MOBILE-3563 workshop: Show submission button if late submission allowed

main
Pau Ferrer Ocaña 2021-05-14 15:53:33 +02:00
parent 84ef10bf23
commit cace67bdcf
5 changed files with 26 additions and 29 deletions

View File

@ -61,7 +61,7 @@
<!-- User can view all submissions (teacher). -->
<ng-container *ngIf="assign && canViewAllSubmissions">
<ion-list class="core-list-align-detail-right with-borders">
<ion-list class="core-list-align-detail-right">
<ion-item class="ion-text-wrap" *ngIf="(groupInfo.separateGroups || groupInfo.visibleGroups)">
<ion-label id="addon-assign-groupslabel">
<ng-container *ngIf="groupInfo.separateGroups">{{'core.groupsseparate' | translate }}</ng-container>

View File

@ -14,7 +14,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!activityComponent?.loaded" (ionRefresh)="activityComponent?.doRefresh($event)">
<ion-refresher slot="fixed" [disabled]="!activityComponent?.loaded" (ionRefresh)="activityComponent?.doRefresh($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

View File

@ -33,7 +33,7 @@
(completionChanged)="onCompletionChange()">
</core-course-module-info>
<ion-card class="with-borders" *ngIf="phases">
<ion-card *ngIf="phases">
<ion-item button (click)="viewPhaseInfo()" detail="true">
<ion-label>
<h2 class="ion-text-wrap">{{ phases[workshop!.phase].title }}</h2>
@ -95,7 +95,7 @@
</ion-item>
</ion-card>
<ion-card class="with-borders" *ngIf="userGrades">
<ion-card *ngIf="userGrades">
<ion-item-divider class="ion-text-wrap">
<ion-label><h2>{{ 'addon.mod_workshop.yourgrades' | translate }}</h2></ion-label>
</ion-item-divider>
@ -128,30 +128,26 @@
</ion-card>
<ion-card *ngIf="canSubmit">
<ion-item-divider class="ion-text-wrap">
<ion-label>
<h2 *ngIf="workshop!.phase != PHASE_CLOSED || !submission">
{{ 'addon.mod_workshop.yoursubmission' | translate }}
</h2>
<h2 *ngIf="workshop!.phase == PHASE_CLOSED && submission">
{{ 'addon.mod_workshop.yoursubmissionwithassessments' | translate }}
</h2>
</ion-label>
</ion-item-divider>
<ion-item class="ion-text-wrap" *ngIf="!submission">
<ion-label>
<h2>{{ 'addon.mod_workshop.yoursubmission' | translate }}</h2>
<p>{{ 'addon.mod_workshop.noyoursubmission' | translate }}</p>
<p *ngIf="!submission">{{ 'addon.mod_workshop.noyoursubmission' | translate }}</p>
</ion-label>
</ion-item>
<addon-mod-workshop-submission *ngIf="submission" [submission]="submission" [courseId]="workshop!.course" [module]="module"
[workshop]="workshop" [access]="access">
</addon-mod-workshop-submission>
<ng-container *ngIf="submission">
<ion-item-divider class="ion-text-wrap">
<ion-label>
<h2 *ngIf="workshop!.phase != PHASE_CLOSED">{{ 'addon.mod_workshop.yoursubmission' | translate }}</h2>
<h2 *ngIf="workshop!.phase == PHASE_CLOSED">
{{ 'addon.mod_workshop.yoursubmissionwithassessments' | translate }}
</h2>
</ion-label>
</ion-item-divider>
<addon-mod-workshop-submission [submission]="submission" [courseId]="workshop!.course" [module]="module"
[workshop]="workshop" [access]="access">
</addon-mod-workshop-submission>
</ng-container>
</ion-card>
<!-- Show only on current phase -->
<ng-container *ngIf="workshop!.phase == PHASE_SUBMISSION">
<!-- Show only on current phase -->
<ion-item class="ion-text-wrap" *ngIf="showSubmit">
<ion-label>
<ion-button expand="block" *ngIf="access.creatingsubmissionallowed && !submission" (click)="gotoSubmit()">
@ -164,10 +160,11 @@
</ion-button>
</ion-label>
</ion-item>
</ng-container>
</ion-card>
<ng-container *ngIf="workshop!.phase >= PHASE_CLOSED">
<ion-card class="with-borders" *ngIf="publishedSubmissions && publishedSubmissions.length">
<ion-card *ngIf="publishedSubmissions && publishedSubmissions.length">
<ion-item-divider class="ion-text-wrap">
<ion-label><h2>{{ 'addon.mod_workshop.publishedsubmissions' | translate }}</h2></ion-label>
</ion-item-divider>
@ -193,7 +190,7 @@
</ion-item>
</ion-card>
<ion-card class="with-borders" *ngIf="canAssess">
<ion-card *ngIf="canAssess">
<ion-item-divider class="ion-text-wrap">
<ion-label><h2>{{ 'addon.mod_workshop.assignedassessments' | translate }}</h2></ion-label>
</ion-item-divider>
@ -210,7 +207,7 @@
</ng-container>
<!-- MULTIPLE PHASES SUBMISSION OR GREATER only teachers -->
<ion-card class="with-borders" *ngIf="access.canviewallsubmissions && workshop!.phase >= PHASE_SUBMISSION &&
<ion-card *ngIf="access.canviewallsubmissions && workshop!.phase >= PHASE_SUBMISSION &&
((grades && grades.length) || (groupInfo && (groupInfo.separateGroups || groupInfo.visibleGroups)))">
<ion-item-divider class="ion-text-wrap">
<ion-label>

View File

@ -434,7 +434,7 @@ export class AddonModWorkshopIndexComponent extends CoreCourseModuleMainActivity
this.phases![AddonModWorkshopPhase.PHASE_SUBMISSION].tasks,
);
this.showSubmit = this.workshop!.phase == AddonModWorkshopPhase.PHASE_SUBMISSION && this.canSubmit &&
this.showSubmit = this.canSubmit &&
((this.access!.creatingsubmissionallowed && !this.submission) ||
(this.access!.modifyingsubmissionallowed && !!this.submission));

View File

@ -13,7 +13,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-refresher slot="fixed" [disabled]="!activityComponent?.loaded" (ionRefresh)="activityComponent?.doRefresh($event)">
<ion-refresher slot="fixed" [disabled]="!activityComponent?.loaded" (ionRefresh)="activityComponent?.doRefresh($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>