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
  • Loading branch information
kkatzen committed May 1, 2015
2 parents 99c2d2e + 0d8a2ad commit 44c4033
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
14 changes: 7 additions & 7 deletions assets/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function updateProblemProgressBar(){

function problemCorrect(user, problem, student, totalStudents){
//check score of a student for a problem
var rsection = $("<td></td>");
var rsection = $("<td>");
var results = {tried: false, correct: false, style: false};
$.post("/submission/read/" + problem.id, {id: problem.id, student: user.username}, function(submissions){
if(submissions.length == 0){
Expand All @@ -155,14 +155,14 @@ function problemCorrect(user, problem, student, totalStudents){
numattempted++;
if(results.correct) {
numfunct++;
rsection.append(problem.value.correct + " / ");
rsection.append(problem.value.correct + "f</td><td>");
} else {
rsection.append(problem.value.correct + " / ");
rsection.append(problem.value.correct + "f</td><td>");
} if(results.style) {
numstyle++;
rsection.append(problem.value.style);
rsection.append(problem.value.style + "s</td>");
} else {
rsection.append(problem.value.style);
rsection.append(problem.value.style + "s</td>");
}
if(results.correct && results.style){
numearned++;
Expand Down Expand Up @@ -395,13 +395,13 @@ function getIndividual(user, refresh) {
var d = new Date(submission.createdAt);

var a = $("<li></li>")
.html("<a href='#submission' data-toggle='pill'>" + d.toLocaleString() + "</a>")
.html("<div class='submission-name-first left'><a href='#submission' data-toggle='pill'>" + d.toLocaleString() + "</a></div>")
.click(function (event) {
event.preventDefault();
getSubmission(submission,user,problem);
});
$("#ISL" + problem.id).append(a);
$("#ISL" + problem.id).append("style: " + submission.value.style + "correct: " + submission.value.correct + "</li>");
$("#ISL" + problem.id).append("<div class='left-submission'>Functionality: " + submission.value.correct + "/" + problem.value.correct + "</div><div class='style-submission left-submission'>Style: " + submission.value.style + "/" + problem.value.style + "</div></li>");
if (parseInt(submission.value.style) > parseInt(earnedStylePoints)){
earnedStylePoints = parseInt(submission.value.style);
totalEarned += parseInt(earnedStylePoints);
Expand Down
10 changes: 10 additions & 0 deletions views/home/admin.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ form > button {
.problem-name-first {
width:35%;
}
.submission-name-first {
width:31.5%;
}
.left-submission {
float:left;
width: 22.5%;
}
.style-submission {
margin-right:23.5%
}
ul {
list-style-type: none;
Expand Down

0 comments on commit 44c4033

Please sign in to comment.