MOBILE-4379 assign: Add CTA button if unsupported submission plugins
parent
a4edff16bb
commit
9b43c7171f
|
@ -200,13 +200,21 @@
|
||||||
{{ 'addon.mod_assign.editsubmission' | translate }}
|
{{ 'addon.mod_assign.editsubmission' | translate }}
|
||||||
</ion-button>
|
</ion-button>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ion-item class="core-danger-item ion-text-wrap" *ngIf="(unsupportedEditPlugins
|
<ion-item class="core-danger-item ion-text-wrap"
|
||||||
&& unsupportedEditPlugins.length && !showErrorStatementEdit)|| showErrorStatementEdit">
|
*ngIf="(unsupportedEditPlugins.length && !showErrorStatementEdit)|| showErrorStatementEdit">
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<ng-container
|
<ng-container
|
||||||
*ngIf="unsupportedEditPlugins && unsupportedEditPlugins.length && !showErrorStatementEdit">
|
*ngIf="unsupportedEditPlugins && unsupportedEditPlugins.length && !showErrorStatementEdit">
|
||||||
<p>{{ 'addon.mod_assign.erroreditpluginsnotsupported' | translate }}</p>
|
<p>{{ 'addon.mod_assign.erroreditpluginsnotsupported' | translate }}</p>
|
||||||
<p *ngFor="let name of unsupportedEditPlugins">{{ name }}</p>
|
<ul>
|
||||||
|
<li *ngFor="let name of unsupportedEditPlugins">{{ name }}</li>
|
||||||
|
</ul>
|
||||||
|
<ion-button expand="block" *ngIf="submissionUrl" [href]="submissionUrl" core-link
|
||||||
|
[showBrowserWarning]="false">
|
||||||
|
{{ 'core.openinbrowser' | translate }}
|
||||||
|
<ion-icon name="fas-up-right-from-square" slot="end" aria-hidden="true"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="showErrorStatementEdit">
|
<ng-container *ngIf="showErrorStatementEdit">
|
||||||
<p>{{ 'addon.mod_assign.cannoteditduetostatementsubmission' | translate }}</p>
|
<p>{{ 'addon.mod_assign.cannoteditduetostatementsubmission' | translate }}</p>
|
||||||
|
|
|
@ -127,6 +127,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can
|
||||||
canSaveGrades = false; // Whether the user can save the grades.
|
canSaveGrades = false; // Whether the user can save the grades.
|
||||||
allowAddAttempt = false; // Allow adding a new attempt when grading.
|
allowAddAttempt = false; // Allow adding a new attempt when grading.
|
||||||
gradeUrl?: string; // URL to grade in browser.
|
gradeUrl?: string; // URL to grade in browser.
|
||||||
|
submissionUrl?: string; // URL to add/edit a submission in browser.
|
||||||
isPreviousAttemptEmpty = true; // Whether the previous attempt contains an empty submission.
|
isPreviousAttemptEmpty = true; // Whether the previous attempt contains an empty submission.
|
||||||
showDates = false; // Whether to show some dates.
|
showDates = false; // Whether to show some dates.
|
||||||
timeLimitFinished = false; // Whether there is a time limit and it finished, so the user will submit late.
|
timeLimitFinished = false; // Whether there is a time limit and it finished, so the user will submit late.
|
||||||
|
@ -788,6 +789,12 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can
|
||||||
*/
|
*/
|
||||||
protected async loadUnsupportedPlugins(): Promise<void> {
|
protected async loadUnsupportedPlugins(): Promise<void> {
|
||||||
this.unsupportedEditPlugins = await AddonModAssign.getUnsupportedEditPlugins(this.userSubmission?.plugins || []);
|
this.unsupportedEditPlugins = await AddonModAssign.getUnsupportedEditPlugins(this.userSubmission?.plugins || []);
|
||||||
|
|
||||||
|
if (this.unsupportedEditPlugins && !this.submissionUrl) {
|
||||||
|
const mod = await CoreCourse.getModule(this.moduleId, this.courseId, undefined, true);
|
||||||
|
this.submissionUrl = `${mod.url}&action=editsubmission`;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue