Skip to content

Commit 17417d9

Browse files
committed
fixed curving
1 parent ba51c26 commit 17417d9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

script/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,18 @@ $(function() {
9999
}
100100
},
101101
render: function() {
102-
var curve = 0; // curve uniformly pushes up avg to 87
102+
var curve = 0.0; // curve uniformly pushes up avg to 87
103103
this.submissions.forEach(function(submission) {
104-
curve += submission.score;
105-
}); curve /= this.submissions.length;
104+
curve += parseInt(submission.score);
105+
});
106+
curve /= this.submissions.length;
106107
curve = 87 - curve;
107108

108109
this.$table.empty();
109110
for(var a = 0; a < this.submissions.length; a++) {
110111
var user = this.submissions[a].user;
111112
var score = this.submissions[a].score;
112-
this.$table.append("<tbody id='user" + user.userID + "'><tr><th scope='row'>"+(a+1)+"</th><td><a href='student.php?userID="+user.userID+"'>"+user.firstName+" "+user.lastName+"</a></td><td><a href='school.php?schoolName="+user.schoolName+"'>"+user.schoolName+"</a></td><td><a class='matchDrop' title='"+(score+curve)+"' userID='"+user.userID+"' href='#'>"+score+"</a></td></tr></tbody>");
113+
this.$table.append("<tbody id='user" + user.userID + "'><tr><th scope='row'>"+(a+1)+"</th><td><a href='student.php?userID="+user.userID+"'>"+user.firstName+" "+user.lastName+"</a></td><td><a href='school.php?schoolName="+user.schoolName+"'>"+user.schoolName+"</a></td><td><a class='matchDrop' title='"+(parseInt(score)+curve)+"' userID='"+user.userID+"' href='#'>"+score+"</a></td></tr></tbody>");
113114
}
114115
},
115116
toggleDropdown: function(event) {

0 commit comments

Comments
 (0)