MOBILE-4362 assign: Fix outcome not selected

This is related to MOBILE-3958, it was fixed in scaled but not in outcomes
main
Dani Palou 2023-10-30 15:08:09 +01:00
parent 44f8a8e91f
commit d59b175314
1 changed files with 3 additions and 3 deletions

View File

@ -1089,11 +1089,11 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can
// Only show outcomes with info on it, outcomeid could be null if outcomes are disabled on site.
gradeInfo.outcomes?.forEach((outcome) => {
if (outcome.id == String(grade.outcomeid)) {
outcome.selected = grade.gradeformatted;
// Clean HTML tags, grade can contain an icon.
outcome.selected = CoreTextUtils.cleanTags(grade.gradeformatted || '');
outcome.modified = grade.gradedategraded;
if (outcome.options) {
outcome.selectedId =
CoreGradesHelper.getGradeValueFromLabel(outcome.options, outcome.selected || '');
outcome.selectedId = CoreGradesHelper.getGradeValueFromLabel(outcome.options, outcome.selected);
this.originalGrades.outcomes[outcome.id] = outcome.selectedId;
outcome.itemNumber = grade.itemnumber;
}