MOBILE-4362 workshop: Remove non-null assertions on index page
parent
bbc107c1e0
commit
f97ea19e9e
|
@ -13,15 +13,15 @@
|
|||
[hasDataToSync]="hasOffline" (completionChanged)="onCompletionChange()">
|
||||
</core-course-module-info>
|
||||
|
||||
<ion-card *ngIf="phases">
|
||||
<ion-card *ngIf="phases && workshop">
|
||||
<ion-item button (click)="viewPhaseInfo()" detail="true">
|
||||
<ion-label>
|
||||
<h2 class="ion-text-wrap">{{ phases[workshop!.phase].title }}</h2>
|
||||
<h2 class="ion-text-wrap">{{ phases[workshop.phase].title }}</h2>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ng-container *ngIf="phases && phases[workshop!.phase] && phases[workshop!.phase].tasks &&
|
||||
phases[workshop!.phase].tasks.length">
|
||||
<ion-item button class="ion-text-wrap" *ngFor="let task of phases[workshop!.phase].tasks"
|
||||
<ng-container *ngIf="phases && phases[workshop.phase] && phases[workshop.phase].tasks &&
|
||||
phases[workshop.phase].tasks.length">
|
||||
<ion-item button class="ion-text-wrap" *ngFor="let task of phases[workshop.phase].tasks"
|
||||
[class.item-dimmed]="task.code == 'submit' && !showSubmit" (click)="runTask(task)" detail="false">
|
||||
<ion-icon slot="start" name="far-circle" *ngIf="task.completed == null"
|
||||
[attr.aria-label]="'addon.mod_workshop.tasktodo' | translate"></ion-icon>
|
||||
|
@ -45,7 +45,7 @@
|
|||
</ion-card>
|
||||
|
||||
<!-- Description (setup phase only) -->
|
||||
<ion-card *ngIf="description && workshop && workshop!.phase == PHASE_SETUP">
|
||||
<ion-card *ngIf="description && workshop && workshop.phase == PHASE_SETUP">
|
||||
<ion-item class="ion-text-wrap">
|
||||
<ion-label>
|
||||
<h3 class="item-heading">{{ 'core.description' | translate }}</h3>
|
||||
|
@ -56,14 +56,14 @@
|
|||
</ion-item>
|
||||
</ion-card>
|
||||
|
||||
<div *ngIf="access && workshop && workshop!.phase >= PHASE_SUBMISSION">
|
||||
<div *ngIf="access && workshop && workshop.phase >= PHASE_SUBMISSION">
|
||||
<!-- CLOSED PHASE -->
|
||||
<ng-container *ngIf="workshop!.phase >= PHASE_CLOSED">
|
||||
<ion-card *ngIf="workshop!.conclusion">
|
||||
<ng-container *ngIf="workshop.phase >= PHASE_CLOSED">
|
||||
<ion-card *ngIf="workshop.conclusion">
|
||||
<ion-item class="ion-text-wrap">
|
||||
<ion-label>
|
||||
<h3 class="item-heading">{{ 'addon.mod_workshop.conclusion' | translate }}</h3>
|
||||
<core-format-text collapsible-item [component]="component" [componentId]="module.id" [text]="workshop!.conclusion"
|
||||
<core-format-text collapsible-item [component]="component" [componentId]="module.id" [text]="workshop.conclusion"
|
||||
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
|
||||
</core-format-text>
|
||||
</ion-label>
|
||||
|
@ -92,11 +92,11 @@
|
|||
</ng-container>
|
||||
|
||||
<!-- SUBMISSION PHASE -->
|
||||
<ion-card *ngIf="workshop!.phase == PHASE_SUBMISSION && workshop!.instructauthors">
|
||||
<ion-card *ngIf="workshop.phase == PHASE_SUBMISSION && workshop.instructauthors">
|
||||
<ion-item class="ion-text-wrap">
|
||||
<ion-label>
|
||||
<h3 class="item-heading">{{ 'addon.mod_workshop.areainstructauthors' | translate }}</h3>
|
||||
<core-format-text collapsible-item [component]="component" [componentId]="module.id" [text]="workshop!.instructauthors"
|
||||
<core-format-text collapsible-item [component]="component" [componentId]="module.id" [text]="workshop.instructauthors"
|
||||
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
|
||||
</core-format-text>
|
||||
</ion-label>
|
||||
|
@ -106,10 +106,10 @@
|
|||
<ion-card *ngIf="canSubmit">
|
||||
<ion-item-divider class="ion-text-wrap">
|
||||
<ion-label>
|
||||
<h3 class="item-heading" *ngIf="workshop!.phase != PHASE_CLOSED || !submission">
|
||||
<h3 class="item-heading" *ngIf="workshop.phase != PHASE_CLOSED || !submission">
|
||||
{{ 'addon.mod_workshop.yoursubmission' | translate }}
|
||||
</h3>
|
||||
<h3 class="item-heading" *ngIf="workshop!.phase == PHASE_CLOSED && submission">
|
||||
<h3 class="item-heading" *ngIf="workshop.phase == PHASE_CLOSED && submission">
|
||||
{{ 'addon.mod_workshop.yoursubmissionwithassessments' | translate }}
|
||||
</h3>
|
||||
</ion-label>
|
||||
|
@ -119,13 +119,13 @@
|
|||
<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"
|
||||
<addon-mod-workshop-submission *ngIf="submission" [submission]="submission" [courseId]="workshop.course" [module]="module"
|
||||
[workshop]="workshop" [access]="access">
|
||||
</addon-mod-workshop-submission>
|
||||
</ion-card>
|
||||
|
||||
|
||||
<ng-container *ngIf="workshop!.phase >= PHASE_CLOSED">
|
||||
<ng-container *ngIf="workshop.phase >= PHASE_CLOSED">
|
||||
<ion-card *ngIf="publishedSubmissions && publishedSubmissions.length">
|
||||
<ion-item-divider class="ion-text-wrap">
|
||||
<ion-label>
|
||||
|
@ -133,7 +133,7 @@
|
|||
</ion-label>
|
||||
</ion-item-divider>
|
||||
<ng-container *ngFor="let submission of publishedSubmissions">
|
||||
<addon-mod-workshop-submission [submission]="submission" [courseId]="workshop!.course" [module]="module"
|
||||
<addon-mod-workshop-submission [submission]="submission" [courseId]="workshop.course" [module]="module"
|
||||
[workshop]="workshop" [access]="access" summary="true" class="core-as-item">
|
||||
</addon-mod-workshop-submission>
|
||||
</ng-container>
|
||||
|
@ -141,14 +141,13 @@
|
|||
</ng-container>
|
||||
|
||||
<!-- ASSESSMENT PHASE -->
|
||||
<ng-container *ngIf="workshop!.phase >= PHASE_ASSESSMENT">
|
||||
<ion-card *ngIf="workshop!.phase == PHASE_ASSESSMENT && workshop!.instructreviewers">
|
||||
<ng-container *ngIf="workshop.phase >= PHASE_ASSESSMENT">
|
||||
<ion-card *ngIf="workshop.phase == PHASE_ASSESSMENT && workshop.instructreviewers">
|
||||
<ion-item class="ion-text-wrap">
|
||||
<ion-label>
|
||||
<h3 class="item-heading">{{ 'addon.mod_workshop.areainstructreviewers' | translate }}</h3>
|
||||
<core-format-text collapsible-item [component]="component" [componentId]="module.id"
|
||||
[text]="workshop!.instructreviewers" contextLevel="module" [contextInstanceId]="module.id"
|
||||
[courseId]="courseId">
|
||||
[text]="workshop.instructreviewers" contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
|
||||
</core-format-text>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
|
@ -167,7 +166,7 @@
|
|||
</ion-item>
|
||||
<ng-container *ngFor="let assessment of (assessments || [])">
|
||||
<addon-mod-workshop-submission [submission]="assessment.submission" [assessment]="assessment"
|
||||
[courseId]="workshop!.course" [module]="module" [workshop]="workshop" [access]="access" summary="true"
|
||||
[courseId]="workshop.course" [module]="module" [workshop]="workshop" [access]="access" summary="true"
|
||||
class="core-as-item">
|
||||
</addon-mod-workshop-submission>
|
||||
</ng-container>
|
||||
|
@ -175,13 +174,13 @@
|
|||
</ng-container>
|
||||
|
||||
<!-- MULTIPLE PHASES SUBMISSION OR GREATER only teachers -->
|
||||
<ion-card *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>
|
||||
<h3 class="item-heading" *ngIf="workshop!.phase == PHASE_SUBMISSION">{{ 'addon.mod_workshop.submissionsreport' |
|
||||
<h3 class="item-heading" *ngIf="workshop.phase == PHASE_SUBMISSION">{{ 'addon.mod_workshop.submissionsreport' |
|
||||
translate }}</h3>
|
||||
<h3 class="item-heading" *ngIf="workshop!.phase > PHASE_SUBMISSION">{{ 'addon.mod_workshop.gradesreport' | translate }}
|
||||
<h3 class="item-heading" *ngIf="workshop.phase > PHASE_SUBMISSION">{{ 'addon.mod_workshop.gradesreport' | translate }}
|
||||
</h3>
|
||||
</ion-label>
|
||||
</ion-item-divider>
|
||||
|
@ -189,7 +188,7 @@
|
|||
</core-group-selector>
|
||||
|
||||
<ng-container *ngFor="let submission of grades">
|
||||
<addon-mod-workshop-submission [submission]="submission" [courseId]="workshop!.course" [module]="module"
|
||||
<addon-mod-workshop-submission [submission]="submission" [courseId]="workshop.course" [module]="module"
|
||||
[workshop]="workshop" [access]="access" summary="true" class="core-as-item">
|
||||
</addon-mod-workshop-submission>
|
||||
</ng-container>
|
||||
|
@ -197,13 +196,13 @@
|
|||
<ion-grid *ngIf="page > 0 || hasNextPage">
|
||||
<ion-row class="ion-align-items-center">
|
||||
<ion-col *ngIf="page > 0">
|
||||
<ion-button expand="block" fill="outline" (click)="gotoSubmissionsPage(page! -1)">
|
||||
<ion-button expand="block" fill="outline" (click)="gotoSubmissionsPage(page -1)">
|
||||
<ion-icon name="fas-chevron-left" slot="start" aria-hidden="true"></ion-icon>
|
||||
{{ 'core.previous' | translate }}
|
||||
</ion-button>
|
||||
</ion-col>
|
||||
<ion-col *ngIf="hasNextPage">
|
||||
<ion-button expand="block" (click)="gotoSubmissionsPage(page! + 1)">
|
||||
<ion-button expand="block" (click)="gotoSubmissionsPage(page + 1)">
|
||||
{{ 'core.next' | translate }}
|
||||
<ion-icon name="fas-chevron-right" slot="end" aria-hidden="true"></ion-icon>
|
||||
</ion-button>
|
||||
|
|
Loading…
Reference in New Issue