MOBILE-2589 assignment: Disable locked and overriden grades

main
Pau Ferrer Ocaña 2018-10-30 14:04:24 +01:00
parent f651dc983b
commit 233e224f04
5 changed files with 16 additions and 8 deletions

View File

@ -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",

View File

@ -152,22 +152,23 @@
<!-- Numeric grade. -->
<ion-item text-wrap *ngIf="grade.method == 'simple' && !grade.scale">
<ion-label stacked>{{ 'addon.mod_assign.gradeoutof' | translate: {$a: gradeInfo.grade} }}</ion-label>
<ion-input type="number" [(ngModel)]="grade.grade" min="0" [max]="gradeInfo.grade" [lang]="grade.lang"></ion-input>
<ion-label stacked><h2>{{ 'addon.mod_assign.gradeoutof' | translate: {$a: gradeInfo.grade} }}</h2></ion-label>
<ion-input *ngIf="!grade.disabled" type="number" [(ngModel)]="grade.grade" min="0" [max]="gradeInfo.grade" [lang]="grade.lang"></ion-input>
<p item-content *ngIf="grade.disabled">{{ 'addon.mod_assign.gradelocked' | translate }}</p>
</ion-item>
<!-- Grade using a scale. -->
<ion-item text-wrap *ngIf="grade.method == 'simple' && grade.scale">
<ion-label>{{ 'addon.mod_assign.grade' | translate }}</ion-label>
<ion-select [(ngModel)]="grade.grade" interface="popover">
<ion-label><h2>{{ 'addon.mod_assign.grade' | translate }}</h2></ion-label>
<ion-select [(ngModel)]="grade.grade" interface="popover" [disabled]="grade.disabled">
<ion-option *ngFor="let grade of grade.scale" [value]="grade.value">{{grade.label}}</ion-option>
</ion-select>
</ion-item>
<!-- Outcomes. -->
<ion-item text-wrap *ngFor="let outcome of gradeInfo.outcomes">
<ion-label>{{ outcome.name }}</ion-label>
<ion-select *ngIf="canSaveGrades && outcome.itemNumber" [(ngModel)]="outcome.selectedId" interface="popover">
<ion-label><h2>{{ outcome.name }}</h2></ion-label>
<ion-select *ngIf="canSaveGrades && outcome.itemNumber" [(ngModel)]="outcome.selectedId" interface="popover" [disabled]="gradeInfo.disabled">
<ion-option *ngFor="let grade of outcome.options" [value]="grade.value">{{grade.label}}</ion-option>
</ion-select>
<p item-content *ngIf="!canSaveGrades || !outcome.itemNumber">{{ outcome.selected }}</p>
@ -176,7 +177,8 @@
<!-- Gradebook grade for simple grading. -->
<ion-item text-wrap *ngIf="grade.method == 'simple'">
<h2>{{ 'addon.mod_assign.currentgrade' | translate }}</h2>
<p *ngIf="grade.gradebookGrade !== false && grade.gradebookGrade !== null">{{ grade.gradebookGrade }}</p>
<p *ngIf="grade.gradebookGrade !== false && grade.gradebookGrade !== null && !grade.scale">{{ grade.gradebookGrade }}</p>
<p *ngIf="grade.gradebookGrade !== false && grade.gradebookGrade !== null && grade.scale">{{ grade.scale[grade.gradebookGrade].label }}</p>
<p *ngIf="grade.gradebookGrade === false || grade.gradebookGrade === null">-</p>
</ion-item>

View File

@ -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;
}
});

View File

@ -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",

View File

@ -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",