Merge pull request #1586 from crazyserver/MOBILE-2589

MOBILE-2589 assignment: Disable locked and overriden grades
main
Juan Leyva 2018-11-09 13:05:01 +01:00 committed by GitHub
commit cb0ce7cb62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 8 deletions

View File

@ -194,6 +194,7 @@
"addon.mod_assign.graded": "assign", "addon.mod_assign.graded": "assign",
"addon.mod_assign.gradedby": "assign", "addon.mod_assign.gradedby": "assign",
"addon.mod_assign.gradedon": "assign", "addon.mod_assign.gradedon": "assign",
"addon.mod_assign.gradelocked": "assign",
"addon.mod_assign.gradenotsynced": "local_moodlemobileapp", "addon.mod_assign.gradenotsynced": "local_moodlemobileapp",
"addon.mod_assign.gradeoutof": "assign", "addon.mod_assign.gradeoutof": "assign",
"addon.mod_assign.gradingstatus": "assign", "addon.mod_assign.gradingstatus": "assign",

View File

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

View File

@ -471,7 +471,8 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy {
addAttempt : false, addAttempt : false,
applyToAll: false, applyToAll: false,
scale: false, scale: false,
lang: false lang: false,
disabled: false
}; };
this.originalGrades = { this.originalGrades = {
@ -823,6 +824,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy {
this.grade.gradebookGrade = parsedGrade || parsedGrade == 0 ? parsedGrade : null; this.grade.gradebookGrade = parsedGrade || parsedGrade == 0 ? parsedGrade : null;
} }
this.grade.disabled = grade.gradeislocked || grade.gradeisoverridden;
this.grade.modified = grade.gradedategraded; this.grade.modified = grade.gradedategraded;
} else if (grade.outcomeid) { } else if (grade.outcomeid) {
@ -839,6 +841,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy {
outcomes.push(outcome); outcomes.push(outcome);
} }
}); });
this.gradeInfo.disabled = grade.gradeislocked || grade.gradeisoverridden;
} }
}); });

View File

@ -37,6 +37,7 @@
"gradedby": "Graded by", "gradedby": "Graded by",
"gradenotsynced": "Grade not synced", "gradenotsynced": "Grade not synced",
"gradedon": "Graded on", "gradedon": "Graded on",
"gradelocked": "This grade is locked or overridden in the gradebook.",
"gradeoutof": "Grade out of {{$a}}", "gradeoutof": "Grade out of {{$a}}",
"gradingstatus": "Grading status", "gradingstatus": "Grading status",
"groupsubmissionsettings": "Group submission settings", "groupsubmissionsettings": "Group submission settings",

View File

@ -194,6 +194,7 @@
"addon.mod_assign.graded": "Graded", "addon.mod_assign.graded": "Graded",
"addon.mod_assign.gradedby": "Graded by", "addon.mod_assign.gradedby": "Graded by",
"addon.mod_assign.gradedon": "Graded on", "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.gradenotsynced": "Grade not synced",
"addon.mod_assign.gradeoutof": "Grade out of {{$a}}", "addon.mod_assign.gradeoutof": "Grade out of {{$a}}",
"addon.mod_assign.gradingstatus": "Grading status", "addon.mod_assign.gradingstatus": "Grading status",