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