File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments