Skip to content

Commit

Permalink
Merge branch 'userInterface' of github.com:kkatzen/bricks into userIn…
Browse files Browse the repository at this point in the history
…terface

Conflicts:
	views/home/admin.ejs
  • Loading branch information
kkatzen committed Apr 29, 2015
2 parents 9823c08 + dd4ef78 commit fac1592
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 9 deletions.
2 changes: 1 addition & 1 deletion api/models/Submission.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = {
type: 'string'
}
},

// THIS LOOKS LIKE A THING
beforeCreate: function (values, cb) {
//values.message = false;
Problem.findOne(values.problem).exec(function (err, p) {
Expand Down
24 changes: 23 additions & 1 deletion assets/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,9 @@ window.onload = function () {
$("#editProblemError").append(noPointsError);
} else {
console.dir(opts);
//breaks here with "Failed to load resource: the server responded with a status of 500 (Internal Server Error)"
$.post("/problem/update", opts, function (problem) {
console.log("heya");
var updateSuccessMessage = $("<div class='alert alert-success' role='alert'>Problem Updated</div>");
$("#editProblemError").append(updateSuccessMessage);
curProblem = problem;
Expand Down Expand Up @@ -839,4 +841,24 @@ window.onload = function () {

//enable tooltips
$('[data-toggle="tooltip"]').tooltip()
};
};


function populateProgress () {
$.post("/user/read/", {}, function(users){
total = users.length;
users.forEach(function (user) {
$("#visualization").append('<div class="visualize-row" id="visualize-student-' + user.id + '"></div>')
})
});
$.post("/folder/read", null, function (folders) {
folders.forEach(function (folder) {
$.post("/problem/read", {folder: folder.id}, function (problems) {
problems.forEach( function (problem) {

})
});
})
});

}
5 changes: 5 additions & 0 deletions assets/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ function addSubmission(submission) {
var results = { correct: false, style: false };
results.correct = results.correct || (submission.value.correct == curProblem.value.correct);
results.style = results.style || (submission.value.style == curProblem.value.style);
// this gets you the pnut object that was created from the student's code - submission.style
//YO LOOK HERE
//add checks and x's to the submission
if (results.correct) {
$(gradeF).append(correct("8px"));
Expand All @@ -275,6 +277,7 @@ function addSubmission(submission) {
//attach the link to the submission
$("#subs").prepend(link);
}

function resizeWindow(){
/* var window_height = $("#consoleHeader").height();
var window_height2 = $("#codemirror").height();
Expand Down Expand Up @@ -346,6 +349,7 @@ window.onload = function () {
//$("#errors").removeClass("hidden");
$("#console").empty();
$("#console").append(msg);
console.log(msg);
};
$("#test").click(function () {
var code = editor.getValue();
Expand Down Expand Up @@ -375,6 +379,7 @@ window.onload = function () {
addSubmission(submission);
foldersReload();
setErrorMsg(submission.message);
console.log(submission);
});
}
});
Expand Down
28 changes: 21 additions & 7 deletions views/home/admin.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,20 @@ ul {
list-style-type: none;
}
#visualization {
width:100%;
}
.visualize-row {
width:100%;
height:10px;
margin:2px 0;
}
.visualize-square {
width:10px;
height:10px;
float:left;
}
</style>
<script src="lib/codemirror.js"></script>
<script src="../mode/javascript/javascript.js"></script>
Expand All @@ -130,8 +144,7 @@ ul {
</button>
<a class="navbar-brand" href="../">Bricks</a>
<a class="navbar-brand" href="#students" data-toggle="pill">Students</a>
<a class="navbar-brand" href="#admin" data-toggle="pill">Manage</a>
<a class="navbar-brand" href="#progress" data-toggle="pill">Progress</a>
<a class="navbar-brand" href="#admin" data-toggle="pill">Admins</a>
<a class="navbar-brand" href="#help" data-toggle="pill">Help</a>
</div>
<div class="navbar-right">
Expand All @@ -150,7 +163,7 @@ ul {
<!-- SIDE BAR -->
<div id="navigationPanel" class="panel panel-default col-md-3 ">
<button id="sortFolders" type="button" class="btn btn-default">Edit Folders</button>
<button id="sortFolders" type="button" class="btn btn-default" href="#addquestion" data-toggle="pill">Add</button>
<button id="sortFolders" type="button" class="btn btn-default" href="#addquestion" data-toggle="pill">Add Problem</button>
<p>
<div class="panel-group" id="leftSideFolders"></div>
</div>
Expand Down Expand Up @@ -250,8 +263,8 @@ ul {
</div>
<div class="col-md-6">
<label name="editFolder" class="control-label" for="folder">Folder</label>
<select id="eFolderDropdown" class="form-control"> </select>
</div>
<select id="editFolderDropdown" class="form-control"> </select>
</div>
</div>
</div>
<label class="control-label" for="editDescription">Description</label>
Expand Down Expand Up @@ -439,11 +452,12 @@ ul {
</div>
<!-- SUBMISSION SECTION ENDS -->
<!-- PROGRESS SECTION -->
<!-- PROGRESS SECTION
<div class="tab-pane" id="progress">
<h1>Progress</h1>
<div id="visualization"></div>
</div>
<!-- PROGRESS SECTION ENDS -->
PROGRESS SECTION ENDS -->
<!-- ADMIN SECTION -->
<div class="tab-pane" id="admin">
Expand Down

0 comments on commit fac1592

Please sign in to comment.