Implement support for some basic embed options for work sheets via LTI

This commit also fixes an issue with the flash messages being positioned too high and displayed for too long
This commit is contained in:
Sebastian Serth
2018-12-10 16:53:43 +01:00
parent 4fd128b31b
commit a0d8b30ef2
25 changed files with 178 additions and 90 deletions

View File

@ -27,8 +27,11 @@ CodeOceanEditorEvaluation = {
printScoringResult: function (result, index) {
$('#results').show();
var card = $('#dummies').children().first().clone();
this.populateCard(card, result, index);
$('#results ul').first().append(card);
if (card.isPresent()) {
// the card won't be present if @embed_options[::hide_test_results] == true
this.populateCard(card, result, index);
$('#results ul').first().append(card);
}
},
printScoringResults: function (response) {
@ -141,14 +144,19 @@ CodeOceanEditorEvaluation = {
},
printOutput: function (output, colorize, index) {
if (output.stderr === undefined && output.stdout === undefined) {
// Prevent empty element with no text at all
return;
}
var element = this.findOrCreateOutputElement(index);
if (!colorize) {
if (output.stdout != undefined && output.stdout != '') {
if (output.stdout !== undefined && output.stdout !== '') {
//element.append(output.stdout)
element.text(element.text() + output.stdout)
}
if (output.stderr != undefined && output.stderr != '') {
if (output.stderr !== undefined && output.stderr !== '') {
//element.append('StdErr: ' + output.stderr);
element.text('StdErr: ' + element.text() + output.stderr);
}