MOBILE-4270 h5pp: Users with 0 attempts shouldn't be clickable

main
Dani Palou 2023-05-10 09:01:34 +02:00
parent 5b3244b619
commit 006358b209
2 changed files with 6 additions and 2 deletions

View File

@ -31,9 +31,9 @@
</ion-item>
<!-- List of users. -->
<ion-item class="ion-text-wrap addon-mod_h5pactivity-table-row" *ngFor="let user of users" detail="true" button
<ion-item class="ion-text-wrap addon-mod_h5pactivity-table-row" *ngFor="let user of users" detail="true"
[attr.aria-label]="'addon.mod_h5pactivity.review_user_attempts' | translate:{$a: user.attempts.length}"
(click)="openUser(user)">
(click)="openUser(user)" [class.hide-detail]="!user.attempts.length" [button]="user.attempts.length > 0">
<ion-label>
<ion-row class="ion-align-items-center">

View File

@ -208,6 +208,10 @@ export class AddonModH5PActivityUsersAttemptsPage implements OnInit {
* @param user User to open.
*/
openUser(user: AddonModH5PActivityUserAttemptsFormatted): void {
if (!user.attempts.length) {
return;
}
CoreNavigator.navigate(`../userattempts/${user.userid}`);
}