-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
2.0.1, 2.0.2, 2.0.3
-
MOODLE_20_STABLE
-
Easy
Hi,
While creating a custom grader report, I found a minor oversight in the M.gradereport_grader.classes.ajax.prototype.submission_outcome() function in grade\report\grader\module.js has a Javascript error in the catch block of the function:
<snip>
message.replace(/[1]/, args.type);
message.replace(/[2]/, M.gradereport_grader.users[args.properties.userid]);
</snip>
The error is only visible when AJAX is enabled for the grader report and the ajax_callbacks.php has an error in it.
The replace method doesn't assign the result its parent object(message in this case) - it needs to be assigned to a variable like:
<snip>
message = message.replace(/[1]/, args.type);
message = message.replace(/[2]/, this.report.users[args.properties.userid]);
</snip>
In addition, M.gradereport_grader.users[] is empty, so we need to use the "this" reference.
I've attached a patch file that resolves the problem as shown above.
Cheers,
Andy
- duplicates
-
MDL-46658 Prepare and integrate grader code from UCLA
-
- Closed
-