fix points rounding in results view, clear results view on new scoring attempt.
This commit is contained in:
@ -351,7 +351,7 @@ configureEditors: function () {
|
|||||||
},
|
},
|
||||||
|
|
||||||
isBrowserSupported: function () {
|
isBrowserSupported: function () {
|
||||||
// websockets is used for run, score and test
|
// websockets are used for run, score and test
|
||||||
return Modernizr.websockets;
|
return Modernizr.websockets;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -361,7 +361,7 @@ configureEditors: function () {
|
|||||||
panel.find('.panel-title .number').text(index + 1);
|
panel.find('.panel-title .number').text(index + 1);
|
||||||
panel.find('.row .col-sm-9').eq(0).find('.number').eq(0).text(result.passed);
|
panel.find('.row .col-sm-9').eq(0).find('.number').eq(0).text(result.passed);
|
||||||
panel.find('.row .col-sm-9').eq(0).find('.number').eq(1).text(result.count);
|
panel.find('.row .col-sm-9').eq(0).find('.number').eq(1).text(result.count);
|
||||||
panel.find('.row .col-sm-9').eq(1).find('.number').eq(0).text((result.score * result.weight).toFixed(2));
|
panel.find('.row .col-sm-9').eq(1).find('.number').eq(0).text(parseFloat((result.score * result.weight).toFixed(2)));
|
||||||
panel.find('.row .col-sm-9').eq(1).find('.number').eq(1).text(result.weight);
|
panel.find('.row .col-sm-9').eq(1).find('.number').eq(1).text(result.weight);
|
||||||
panel.find('.row .col-sm-9').eq(2).text(result.message);
|
panel.find('.row .col-sm-9').eq(2).text(result.message);
|
||||||
if (result.error_messages) panel.find('.row .col-sm-9').eq(3).text(result.error_messages.join(', '));
|
if (result.error_messages) panel.find('.row .col-sm-9').eq(3).text(result.error_messages.join(', '));
|
||||||
|
@ -6,6 +6,7 @@ CodeOceanEditorEvaluation = {
|
|||||||
*/
|
*/
|
||||||
scoreCode: function (event) {
|
scoreCode: function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.clearScoringOutput();
|
||||||
this.createSubmission('#assess', null, function (response) {
|
this.createSubmission('#assess', null, function (response) {
|
||||||
this.showSpinner($('#assess'));
|
this.showSpinner($('#assess'));
|
||||||
$('#score_div').removeClass('hidden');
|
$('#score_div').removeClass('hidden');
|
||||||
@ -139,6 +140,14 @@ CodeOceanEditorEvaluation = {
|
|||||||
$('#output pre').remove();
|
$('#output pre').remove();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
clearScoringOutput: function() {
|
||||||
|
$('#results ul').first().html('');
|
||||||
|
$('.test-count .number').html(0);
|
||||||
|
$('#score').data('score', 0);
|
||||||
|
this.renderScore();
|
||||||
|
this.clearOutput();
|
||||||
|
},
|
||||||
|
|
||||||
printOutput: function (output, colorize, index) {
|
printOutput: function (output, colorize, index) {
|
||||||
var element = this.findOrCreateOutputElement(index);
|
var element = this.findOrCreateOutputElement(index);
|
||||||
if (!colorize) {
|
if (!colorize) {
|
||||||
|
Reference in New Issue
Block a user