From 233e224f041cc1083ad3ac592d022ecb38aba184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 30 Oct 2018 14:04:24 +0100 Subject: [PATCH] MOBILE-2589 assignment: Disable locked and overriden grades --- scripts/langindex.json | 1 + .../submission/addon-mod-assign-submission.html | 16 +++++++++------- .../assign/components/submission/submission.ts | 5 ++++- src/addon/mod/assign/lang/en.json | 1 + src/assets/lang/en.json | 1 + 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/scripts/langindex.json b/scripts/langindex.json index 118e7bc6a..f41cc0741 100644 --- a/scripts/langindex.json +++ b/scripts/langindex.json @@ -193,6 +193,7 @@ "addon.mod_assign.graded": "assign", "addon.mod_assign.gradedby": "assign", "addon.mod_assign.gradedon": "assign", + "addon.mod_assign.gradelocked": "assign", "addon.mod_assign.gradenotsynced": "local_moodlemobileapp", "addon.mod_assign.gradeoutof": "assign", "addon.mod_assign.gradingstatus": "assign", 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 9a169c3c9..2a2030d30 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 @@ -152,22 +152,23 @@ - {{ 'addon.mod_assign.gradeoutof' | translate: {$a: gradeInfo.grade} }} - +

{{ 'addon.mod_assign.gradeoutof' | translate: {$a: gradeInfo.grade} }}

+ +

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

- {{ 'addon.mod_assign.grade' | translate }} - +

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

+ {{grade.label}}
- {{ outcome.name }} - +

{{ outcome.name }}

+ {{grade.label}}

{{ outcome.selected }}

@@ -176,7 +177,8 @@

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

-

{{ grade.gradebookGrade }}

+

{{ grade.gradebookGrade }}

+

{{ grade.scale[grade.gradebookGrade].label }}

-

diff --git a/src/addon/mod/assign/components/submission/submission.ts b/src/addon/mod/assign/components/submission/submission.ts index d8047c345..477546059 100644 --- a/src/addon/mod/assign/components/submission/submission.ts +++ b/src/addon/mod/assign/components/submission/submission.ts @@ -471,7 +471,8 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy { addAttempt : false, applyToAll: false, scale: false, - lang: false + lang: false, + disabled: false }; this.originalGrades = { @@ -823,6 +824,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy { this.grade.gradebookGrade = parsedGrade || parsedGrade == 0 ? parsedGrade : null; } + this.grade.disabled = grade.gradeislocked || grade.gradeisoverridden; this.grade.modified = grade.gradedategraded; } else if (grade.outcomeid) { @@ -839,6 +841,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy { outcomes.push(outcome); } }); + this.gradeInfo.disabled = grade.gradeislocked || grade.gradeisoverridden; } }); diff --git a/src/addon/mod/assign/lang/en.json b/src/addon/mod/assign/lang/en.json index fbbe9f662..e7e2840aa 100644 --- a/src/addon/mod/assign/lang/en.json +++ b/src/addon/mod/assign/lang/en.json @@ -37,6 +37,7 @@ "gradedby": "Graded by", "gradenotsynced": "Grade not synced", "gradedon": "Graded on", + "gradelocked": "This grade is locked or overridden in the gradebook.", "gradeoutof": "Grade out of {{$a}}", "gradingstatus": "Grading status", "groupsubmissionsettings": "Group submission settings", diff --git a/src/assets/lang/en.json b/src/assets/lang/en.json index cfa5bf287..abafd0d71 100644 --- a/src/assets/lang/en.json +++ b/src/assets/lang/en.json @@ -192,6 +192,7 @@ "addon.mod_assign.graded": "Graded", "addon.mod_assign.gradedby": "Graded by", "addon.mod_assign.gradedon": "Graded on", + "addon.mod_assign.gradelocked": "This grade is locked or overridden in the gradebook.", "addon.mod_assign.gradenotsynced": "Grade not synced", "addon.mod_assign.gradeoutof": "Grade out of {{$a}}", "addon.mod_assign.gradingstatus": "Grading status",