Open lsignac opened 2 months ago
I've got the same issues : my students are unable to reload past submissions :-/.
Same error in JS console.
Using INGInious version v.0.8.7 (upgraded last month).
Instead of changing the loadOldSubmissionInput function
, I preferred to go further in the stacktrace and I used the following fix in tasks.js - function load_input_code
(approx. line 740) to replace the array by its content (input[key] => input[key][0]
) :
function load_input_code(submissionid, key, input)
{
if(key in codeEditors) {
if(key in input)
codeEditors[key].setValue(input[key][0], -1); // BugFix
else
codeEditors[key].setValue("", -1);
}
else {
var field = $("input[name='" + key + "']");
if(key in input)
$(field).val(input[key][0]); //BugFix
else
$(field).val("");
}
}
Seems to be working for now, but I'm not sure about possible side effects. I'd be happy with an official fix :-).
Describe the bug students can not access old submissions, due to a Javascript Error.
INGInious installation details
To Reproduce Steps to reproduce the behavior:
Expected behavior The submission should appear in the codemirror editor.
The Javascript error is raised in codemirror (minified) code :
The line
Bl (codemirror.js:3:106416)
isreturn e.split(/\r\n?|\n/)
e
should contain the submission code. Instead,e
is an Array whose first and only value is the submission code.e
is['def fn():\r\n...']
instead of'def fn():\r\n...'
.Looking in the call stack I looked at
Object.<anonymous> (task.js:685:17)
:Using the chrome debugger, I saw that
data['input']['sub01']
(sub01
is the name of the only subproblem of my task) is an Array. I think it should be a string. I added this linedata['input']['sub01'] = data['input']['sub01'][0];
just beforeload_input(id, data['input']);
Everything works fine !Sure there is a better fix (may be the issue is in the chunks stored in the database...?), and I would like to know if I am the only one facing this issue