MOBILE-2915 completion: Display warning for teachers viewing own
parent
2659835d2b
commit
92d6d09b8f
|
@ -145,6 +145,7 @@
|
|||
"addon.coursecompletion.criteriarequiredany": "completion",
|
||||
"addon.coursecompletion.inprogress": "completion",
|
||||
"addon.coursecompletion.manualselfcompletion": "completion",
|
||||
"addon.coursecompletion.nottracked": "completion",
|
||||
"addon.coursecompletion.notyetstarted": "completion",
|
||||
"addon.coursecompletion.pending": "completion",
|
||||
"addon.coursecompletion.required": "moodle",
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<core-loading [hideUntil]="completionLoaded">
|
||||
<ion-card *ngIf="completion">
|
||||
<ion-card *ngIf="completion && tracked">
|
||||
<ion-item text-wrap>
|
||||
<h2>{{ 'addon.coursecompletion.status' | translate }}</h2>
|
||||
<p>{{ completion.statusText | translate }}</p>
|
||||
|
@ -14,7 +14,7 @@
|
|||
<p *ngIf="completion.aggregation === 2">{{ 'addon.coursecompletion.criteriarequiredany' | translate }}</p>
|
||||
</ion-item>
|
||||
</ion-card>
|
||||
<ion-card *ngIf="completion">
|
||||
<ion-card *ngIf="completion && tracked">
|
||||
<ion-item-divider>{{ 'addon.coursecompletion.requiredcriteria' | translate }}</ion-item-divider>
|
||||
<ion-item class="hidden-tablet" text-wrap *ngFor="let criteria of completion.completions">
|
||||
<h2><core-format-text clean="true" [text]="criteria.details.criteria"></core-format-text></h2>
|
||||
|
@ -41,11 +41,16 @@
|
|||
</ion-row>
|
||||
</ion-item>
|
||||
</ion-card>
|
||||
<ion-card *ngIf="showSelfComplete">
|
||||
<ion-card *ngIf="showSelfComplete && tracked">
|
||||
<ion-item-divider>{{ 'addon.coursecompletion.manualselfcompletion' | translate }}</ion-item-divider>
|
||||
<ion-item>
|
||||
<button ion-button block (click)="completeCourse()">{{ 'addon.coursecompletion.completecourse' | translate }}</button>
|
||||
</ion-item>
|
||||
</ion-card>
|
||||
|
||||
<div *ngIf="!tracked" class="core-warning-card" icon-start>
|
||||
<ion-icon name="warning"></ion-icon>
|
||||
{{ 'addon.coursecompletion.nottracked' | translate }}
|
||||
</div>
|
||||
</core-loading>
|
||||
</ion-content>
|
||||
|
|
|
@ -31,6 +31,7 @@ export class AddonCourseCompletionReportComponent implements OnInit {
|
|||
completionLoaded = false;
|
||||
completion: any;
|
||||
showSelfComplete: boolean;
|
||||
tracked = true; // Whether completion is tracked.
|
||||
|
||||
constructor(
|
||||
private sitesProvider: CoreSitesProvider,
|
||||
|
@ -62,8 +63,14 @@ export class AddonCourseCompletionReportComponent implements OnInit {
|
|||
|
||||
this.completion = completion;
|
||||
this.showSelfComplete = this.courseCompletionProvider.canMarkSelfCompleted(this.userId, completion);
|
||||
}).catch((message) => {
|
||||
this.domUtils.showErrorModalDefault(message, 'addon.coursecompletion.couldnotloadreport', true);
|
||||
this.tracked = true;
|
||||
}).catch((error) => {
|
||||
if (error && error.errorcode == 'notenroled') {
|
||||
// Not enrolled error, probably a teacher.
|
||||
this.tracked = false;
|
||||
} else {
|
||||
this.domUtils.showErrorModalDefault(error, 'addon.coursecompletion.couldnotloadreport', true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
"criteriarequiredany": "Any criteria below are required",
|
||||
"inprogress": "In progress",
|
||||
"manualselfcompletion": "Manual self completion",
|
||||
"nottracked": "You are currently not being tracked by completion in this course",
|
||||
"notyetstarted": "Not yet started",
|
||||
"pending": "Pending",
|
||||
"required": "Required",
|
||||
|
|
|
@ -145,6 +145,7 @@
|
|||
"addon.coursecompletion.criteriarequiredany": "Any criteria below are required",
|
||||
"addon.coursecompletion.inprogress": "In progress",
|
||||
"addon.coursecompletion.manualselfcompletion": "Manual self completion",
|
||||
"addon.coursecompletion.nottracked": "You are currently not being tracked by completion in this course",
|
||||
"addon.coursecompletion.notyetstarted": "Not yet started",
|
||||
"addon.coursecompletion.pending": "Pending",
|
||||
"addon.coursecompletion.required": "Required",
|
||||
|
|
Loading…
Reference in New Issue