MOBILE-3320 quiz: Fix invalid parameter after finishing quiz

main
Dani Palou 2021-06-22 13:42:29 +02:00
parent 51c1a7ebbf
commit b87612a577
1 changed files with 3 additions and 1 deletions

View File

@ -647,7 +647,9 @@ export class AddonModQuizIndexComponent extends CoreCourseModuleMainActivityComp
if (data) {
this.gradebookData = {
grade: 'graderaw' in data ? data.graderaw : Number(data.grade),
grade: 'graderaw' in data && data.graderaw !== undefined && data.graderaw !== null ?
data.graderaw :
(data.grade !== undefined && data.grade !== null ? Number(data.grade) : undefined),
feedback: data.feedback,
};
}