From b9f79efcf38365e1386963121ac8866425d874b4 Mon Sep 17 00:00:00 2001 From: dpalou Date: Tue, 18 Sep 2018 15:05:09 +0200 Subject: [PATCH] MOBILE-2588 assign: Show raw grade in input instead of gradebook grade --- .../submission/addon-mod-assign-submission.html | 7 +++++++ src/addon/mod/assign/components/submission/submission.ts | 9 ++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/addon/mod/assign/components/submission/addon-mod-assign-submission.html b/src/addon/mod/assign/components/submission/addon-mod-assign-submission.html index 61c013a05..b146fe5f2 100644 --- a/src/addon/mod/assign/components/submission/addon-mod-assign-submission.html +++ b/src/addon/mod/assign/components/submission/addon-mod-assign-submission.html @@ -173,6 +173,13 @@

{{ outcome.selected }}

+ + +

{{ 'addon.mod_assign.currentgrade' | translate }}

+

{{ grade.gradebookGrade }}

+

-

+
+ diff --git a/src/addon/mod/assign/components/submission/submission.ts b/src/addon/mod/assign/components/submission/submission.ts index 793b5e198..d8047c345 100644 --- a/src/addon/mod/assign/components/submission/submission.ts +++ b/src/addon/mod/assign/components/submission/submission.ts @@ -465,6 +465,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy { this.grade = { method: false, grade: false, + gradebookGrade: false, modified: 0, gradingStatus: false, addAttempt : false, @@ -504,6 +505,8 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy { if (feedback.grade && feedback.grade.grade && !this.grade.grade) { const parsedGrade = parseFloat(feedback.grade.grade); this.grade.grade = parsedGrade || parsedGrade == 0 ? parsedGrade : null; + this.grade.gradebookGrade = this.grade.grade; + this.originalGrades.grade = this.grade.grade; } } else { // If no feedback, always show Submission. @@ -813,14 +816,14 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy { // Not using outcomes or scale, get the numeric grade. if (this.grade.scale) { - this.grade.grade = this.gradesHelper.getGradeValueFromLabel(this.grade.scale, grade.gradeformatted); + this.grade.gradebookGrade = this.gradesHelper.getGradeValueFromLabel( + this.grade.scale, grade.gradeformatted); } else { const parsedGrade = parseFloat(grade.gradeformatted); - this.grade.grade = parsedGrade || parsedGrade == 0 ? parsedGrade : null; + this.grade.gradebookGrade = parsedGrade || parsedGrade == 0 ? parsedGrade : null; } this.grade.modified = grade.gradedategraded; - this.originalGrades.grade = this.grade.grade; } else if (grade.outcomeid) { // Only show outcomes with info on it, outcomeid could be null if outcomes are disabled on site.