From 006358b209926a90397b1afdb9e850635316b58f Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Wed, 10 May 2023 09:01:34 +0200 Subject: [PATCH] MOBILE-4270 h5pp: Users with 0 attempts shouldn't be clickable --- .../mod/h5pactivity/pages/users-attempts/users-attempts.html | 4 ++-- .../mod/h5pactivity/pages/users-attempts/users-attempts.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/addons/mod/h5pactivity/pages/users-attempts/users-attempts.html b/src/addons/mod/h5pactivity/pages/users-attempts/users-attempts.html index 375cb84cc..2610c501e 100644 --- a/src/addons/mod/h5pactivity/pages/users-attempts/users-attempts.html +++ b/src/addons/mod/h5pactivity/pages/users-attempts/users-attempts.html @@ -31,9 +31,9 @@ - + (click)="openUser(user)" [class.hide-detail]="!user.attempts.length" [button]="user.attempts.length > 0"> diff --git a/src/addons/mod/h5pactivity/pages/users-attempts/users-attempts.ts b/src/addons/mod/h5pactivity/pages/users-attempts/users-attempts.ts index b2bb4b57b..5a211d616 100644 --- a/src/addons/mod/h5pactivity/pages/users-attempts/users-attempts.ts +++ b/src/addons/mod/h5pactivity/pages/users-attempts/users-attempts.ts @@ -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}`); }