Sorry, but you do not currently have permissions to do that (View the entry page of a HotPot activity).

Sorry, but you do not currently have permissions to do that (View the entry page of a HotPot activity).

by Denise Hoyle -
Number of replies: 9

I'm working on a new Moodle build and everything has been going pretty smoothly except that the quizzes I've built in Hot Potatoes only work once, then produce the following error message:

"Sorry, but you do not currently have permissions to do that (View the entry page of a HotPot activity)."

I've checked roles and permissions, all appears fine there and since the quiz works once for each user I think that rules out permissions right?

We've tried testing the course available at Patterns That Fit You Classroom as Admin, as Guest and as Student.  There are four different quizzes in the class, whichever one a user selects first can be completed. Then any other quiz they select, in any of these roles, produces the error.

I was previously having an intermittent bad gateway 502 error which went away when I turned off NGinx caching. That makes me wonder if this could be a caching issue?

Any assistance would be greatly appreciated!!

Attachment moodle_permission_error081221.PNG
Average of ratings: -
In reply to Denise Hoyle

Re: Sorry, but you do not currently have permissions to do that (View the entry page of a HotPot activity).

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hi Denise,
I think this is all about the permissions.

I notice that you have altered the standard permissions to allow "Authenticated users" to view the course page. I wonder what other permissions you changed?

Also, what version of Moodle are you using on this site?
In reply to Gordon Bateson

Re: Sorry, but you do not currently have permissions to do that (View the entry page of a HotPot activity).

by Denise Hoyle -
Hi Gordon! I'm running 3.11.1 and I thought all I did was allow guests to access this course. Other than that I haven't altered any permissions.
In reply to Gordon Bateson

Re: Sorry, but you do not currently have permissions to do that (View the entry page of a HotPot activity).

by Denise Hoyle -

user policies

Everything is still set to default here. Should I be looking somewhere else?

In reply to Gordon Bateson

Re: Sorry, but you do not currently have permissions to do that (View the entry page of a HotPot activity).

by Denise Hoyle -

Gordon's permissions


So sorry to keep posting, just checked your permissions in this course and wanted to share.

In reply to Denise Hoyle

Re: Sorry, but you do not currently have permissions to do that (View the entry page of a HotPot activity).

by Denise Hoyle -
Hello again! I'm still having the same issues - have checked and re-checked all permissions in Moodle admin and server side, they are fine. Here is the error message from the log:

[18-Oct-2021 16:30:07 America/New_York] Default exception handler: Sorry, but you do not currently have permissions to do that (View the entry page of a HotPot activity). Debug:
Error code: nopermissions
* line 870 of /lib/accesslib.php: required_capability_exception thrown
* line 45 of /mod/hotpot/view.php: call to require_capability()

I've uninstalled and reinstalled the plugin. I've re-made and re-imported the quizzes. Any ideas on what to try next would be greatly appreciated!!
In reply to Denise Hoyle

Re: Sorry, but you do not currently have permissions to do that (View the entry page of a HotPot activity).

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Denise,

I reread your earlier message, and you said that you had enabled Guest access to the course. I think this means that anyone who is not enrolled in the course, can still access the course, but they will be viewing it as a guest.

This applies to the Student user you created, and even the Admin user too. Am I right in thinking that neither of those users is actually "enrolled" in the course?

By default, the guest user cannot view HotPot activies. The workaround is to either (1) enrol the Student and Admin users in the course, or (2) change the HotPot permissions to allow guest users to view and attempt the HotPot activity.

Please let me know which workaround you try, and whether or not the behavior chanegs to what you expect.

Best regards,
Gordon

In reply to Gordon Bateson

Re: Sorry, but you do not currently have permissions to do that (View the entry page of a HotPot activity).

by Denise Hoyle -
Yes - I would like for guests to be able to take this course without enrolling. After months of (weekend warrior) working on this issue I've finally located the problem and have fixed it in the code. There are only two HotPot permissions in the Moodle admin:

mod/hotpot:attempt or
mod/hotpot:addinstance

but line 45 of /mod/hotpot/view.php is this

require_capability('mod/hotpot:view', $PAGE->context);

There is NO permission for "view" so I changed it to:

require_capability('mod/hotpot:attempt', $PAGE->context);

and now all is well! Please let me know if there is a better way to do this as I'm aware that future updates to the plugin could break my "fix". Thank you very much for your time and your response!
In reply to Denise Hoyle

Re: Sorry, but you do not currently have permissions to do that (View the entry page of a HotPot activity).

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Denise,
I'm afraid the HotPot module is not installed properly on your Moodle site, because there should be 8 capabilities for the HotPot module, including 'mod/hotpot:view' (see screensnip below of Student permissions within the HotPot activity)

Permissions for student within HotPot activity.

Could you tell me the version of the HotPot module you are using, and where you got it from?

Thanks,
Gordon

In reply to Gordon Bateson

Re: Sorry, but you do not currently have permissions to do that (View the entry page of a HotPot activity).

by Denise Hoyle -
Wow - can't imagine how that has happened. I've uninstalled and reinstalled only to get the same results. I've downloaded the plugin from right here https://moodle.org/plugins/mod_hotpot and am running version 2020-06-05 (44) (2020060544). Is there another version somewhere else that I should try?