Skip to content

Commit f969f99

Browse files
committed
MOBILE-2915 lesson: Fix review after sync if no retakes
1 parent 322d6ad commit f969f99

File tree

1 file changed

+49
-46
lines changed

1 file changed

+49
-46
lines changed

src/addon/mod/lesson/components/index/addon-mod-lesson-index.html

Lines changed: 49 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -51,61 +51,64 @@
5151
</ion-card>
5252

5353
<core-loading [hideUntil]="!showSpinner">
54-
<ion-list *ngIf="lesson && (!preventMessages || !preventMessages.length)">
54+
55+
<ion-list *ngIf="(lesson && (!preventMessages || !preventMessages.length)) || retakeToReview">
5556
<ion-item text-wrap *ngIf="retakeToReview">
5657
<!-- A retake was finished in a synchronization, allow reviewing it. -->
57-
<p>{{ 'addon.mod_lesson.retakefinishedinsync' | translate }}</p>
58+
<p padding-bottom>{{ 'addon.mod_lesson.retakefinishedinsync' | translate }}</p>
5859
<a ion-button block (click)="review()">{{ 'addon.mod_lesson.review' | translate }}</a>
5960
</ion-item>
6061

61-
<ion-item text-wrap *ngIf="leftDuringTimed && !lesson.timelimit && !finishedOffline">
62-
<!-- User left during the session and there is no time limit, ask to continue. -->
63-
<p [innerHTML]="'addon.mod_lesson.youhaveseen' | translate"></p>
64-
<ion-grid>
65-
<ion-row>
66-
<ion-col>
67-
<a ion-button block color="light" (click)="start(false)">{{ 'core.no' | translate }}</a>
68-
</ion-col>
69-
<ion-col>
70-
<a ion-button block (click)="start(true)">{{ 'core.yes' | translate }}</a>
71-
</ion-col>
72-
</ion-row>
73-
</ion-grid>
74-
</ion-item>
62+
<ng-container *ngIf="lesson && (!preventMessages || !preventMessages.length)">
63+
<ion-item text-wrap *ngIf="leftDuringTimed && !lesson.timelimit && !finishedOffline">
64+
<!-- User left during the session and there is no time limit, ask to continue. -->
65+
<p [innerHTML]="'addon.mod_lesson.youhaveseen' | translate"></p>
66+
<ion-grid>
67+
<ion-row>
68+
<ion-col>
69+
<a ion-button block color="light" (click)="start(false)">{{ 'core.no' | translate }}</a>
70+
</ion-col>
71+
<ion-col>
72+
<a ion-button block (click)="start(true)">{{ 'core.yes' | translate }}</a>
73+
</ion-col>
74+
</ion-row>
75+
</ion-grid>
76+
</ion-item>
7577

76-
<ion-item text-wrap *ngIf="leftDuringTimed && lesson.timelimit && lesson.retake && !finishedOffline">
77-
<!-- User left during the session with time limit and retakes allowed, ask to continue. -->
78-
<p [innerHTML]="'addon.mod_lesson.leftduringtimed' | translate"></p>
79-
<a ion-button block icon-end (click)="start(false)">
80-
{{ 'addon.mod_lesson.continue' | translate }}
81-
<ion-icon name="arrow-forward" md="ios-arrow-forward"></ion-icon>
82-
</a>
83-
</ion-item>
78+
<ion-item text-wrap *ngIf="leftDuringTimed && lesson.timelimit && lesson.retake && !finishedOffline">
79+
<!-- User left during the session with time limit and retakes allowed, ask to continue. -->
80+
<p [innerHTML]="'addon.mod_lesson.leftduringtimed' | translate"></p>
81+
<a ion-button block icon-end (click)="start(false)">
82+
{{ 'addon.mod_lesson.continue' | translate }}
83+
<ion-icon name="arrow-forward" md="ios-arrow-forward"></ion-icon>
84+
</a>
85+
</ion-item>
8486

85-
<ion-item text-wrap *ngIf="leftDuringTimed && lesson.timelimit && !lesson.retake">
86-
<!-- User left during the session with time limit and retakes not allowed. This should be handled by preventMessages -->
87-
<p [innerHTML]="'addon.mod_lesson.leftduringtimednoretake' | translate"></p>
88-
</ion-item>
87+
<ion-item text-wrap *ngIf="leftDuringTimed && lesson.timelimit && !lesson.retake">
88+
<!-- User left during the session with time limit and retakes not allowed. This should be handled by preventMessages -->
89+
<p [innerHTML]="'addon.mod_lesson.leftduringtimednoretake' | translate"></p>
90+
</ion-item>
8991

90-
<ion-item text-wrap *ngIf="!leftDuringTimed && !finishedOffline">
91-
<!-- User hasn't left during the session, show a start button. -->
92-
<a ion-button block *ngIf="!canManage" icon-end (click)="start(false)">
93-
{{ 'core.start' | translate }}
94-
<ion-icon name="arrow-forward" md="ios-arrow-forward"></ion-icon>
95-
</a>
96-
<a ion-button block *ngIf="canManage" icon-end (click)="start(false)">
97-
{{ 'addon.mod_lesson.preview' | translate }}
98-
<ion-icon name="search"></ion-icon>
99-
</a>
100-
</ion-item>
92+
<ion-item text-wrap *ngIf="!leftDuringTimed && !finishedOffline">
93+
<!-- User hasn't left during the session, show a start button. -->
94+
<a ion-button block *ngIf="!canManage" icon-end (click)="start(false)">
95+
{{ 'core.start' | translate }}
96+
<ion-icon name="arrow-forward" md="ios-arrow-forward"></ion-icon>
97+
</a>
98+
<a ion-button block *ngIf="canManage" icon-end (click)="start(false)">
99+
{{ 'addon.mod_lesson.preview' | translate }}
100+
<ion-icon name="search"></ion-icon>
101+
</a>
102+
</ion-item>
101103

102-
<ion-item text-wrap *ngIf="finishedOffline">
103-
<!-- There's an attempt finished in offline. Let the user continue, showing the end of lesson. -->
104-
<a ion-button block icon-end (click)="start(true)">
105-
{{ 'addon.mod_lesson.continue' | translate }}
106-
<ion-icon name="arrow-forward" md="ios-arrow-forward"></ion-icon>
107-
</a>
108-
</ion-item>
104+
<ion-item text-wrap *ngIf="finishedOffline">
105+
<!-- There's an attempt finished in offline. Let the user continue, showing the end of lesson. -->
106+
<a ion-button block icon-end (click)="start(true)">
107+
{{ 'addon.mod_lesson.continue' | translate }}
108+
<ion-icon name="arrow-forward" md="ios-arrow-forward"></ion-icon>
109+
</a>
110+
</ion-item>
111+
</ng-container>
109112
</ion-list>
110113
</core-loading>
111114
</ng-template>

0 commit comments

Comments
 (0)