MDL-38149 core_grade: added a guard for when there are no old grades
This commit is contained in:
@@ -741,9 +741,11 @@ M.gradereport_grader.classes.existingfield = function(ajax, userid, itemid) {
|
||||
this.editfeedback = ajax.showquickfeedback;
|
||||
this.grade = this.report.Y.one('#grade_'+userid+'_'+itemid);
|
||||
|
||||
for(var i = 0; i < this.report.grades.length; i++) {
|
||||
if (this.report.grades[i]['user']==this.userid && this.report.grades[i]['item']==this.itemid) {
|
||||
this.oldgrade = this.report.grades[i]['grade'];
|
||||
if (this.report.grades) {
|
||||
for (var i = 0; i < this.report.grades.length; i++) {
|
||||
if (this.report.grades[i]['user']==this.userid && this.report.grades[i]['item']==this.itemid) {
|
||||
this.oldgrade = this.report.grades[i]['grade'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user