Moodle 2.8, don't see any mod/quiz:preview permission?

Moodle 2.8, don't see any mod/quiz:preview permission?

by Gareth du Plooy -
Number of replies: 8
As teacher, editing teacher, or manager of a course, we are simply seeing "You need to enrol in this course before you can attempt this quiz" on the main quiz edit page. Screenshots are attached. Looking at the code, it's rendering "echo $output->view_page_notenrolled($course, $quiz, $cm, $context, $viewobj->infomessages);" because "has_capability('mod/quiz:preview', $context);" is false. Looking at the quiz permissions, there is no reference at all to "mod/quiz:preview". How is this possible?
Attachment Screenshot 2015-03-20 16.47.43.jpg
Attachment Screenshot 2015-03-20 16.54.03.jpg
Average of ratings: -
In reply to Gareth du Plooy

Re: Moodle 2.8, don't see any mod/quiz:preview permission?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I guess you are checking the permissions in the Course administration, where it only shows capabilities relevant to that.


Do Quiz administration -> Check permissions.

In reply to Tim Hunt

Re: Moodle 2.8, don't see any mod/quiz:preview permission?

by Gareth du Plooy -

Thanks so much for trying to help me out!


Regarding the permissions, going to Quiz administration -> Check permissions I see the following. Note the side-bar menu, these appear to be the quiz permissions.

I'm still not sure how this teacher is unable to preview the quiz (and therefore be able to add questions manually).


Attachment Screenshot 2015-03-22 14.58.13.jpg
In reply to Gareth du Plooy

Re: Moodle 2.8, don't see any mod/quiz:preview permission?

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Have you actually enrolled the teachers in the course?

In reply to Emma Richardson

Re: Moodle 2.8, don't see any mod/quiz:preview permission?

by Gareth du Plooy -
Hey Emma,


Thanks! Regarding the teacher's enrolment in the course, I've attached screenshots that show her being enrolled as a teacher, and then showing that same teacher user logged in an attempting to view the course.

Does anything jump out as not correctly set?


Thanks again for trying to help out.



Attachment Screenshot 2015-03-22 14.59.04.jpeg
Attachment Screenshot 2015-03-22 15.00.25.jpeg
In reply to Gareth du Plooy

Re: Moodle 2.8, don't see any mod/quiz:preview permission?

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

What happens if you remove the Manager role?  Can she then see the preview?

If you go to System/Users/Permissions/Define Roles - you should then be able to give the teacher and manager the Preview Quiz permission which should fix it.  It looks like neither role has that permission.

In reply to Emma Richardson

Re: Moodle 2.8, don't see any mod/quiz:preview permission?

by Gareth du Plooy -

Hey Emma,


I've gone to the "editingteacher" role, and for the quiz related permissions, there are none available for for mode/quiz:preview.

Also, when I go to the overall Capability overview, you can see when I search for "quiz" preview simply isn't there! I have a feeling I have some missing data here. I may attempt to fix by manually adding items to the database sad. Do you have more quiz related capabilities where when you go to it in your system?


Thanks for your help smile

Attachment Screenshot 2015-03-22 18.45.54.jpg
In reply to Gareth du Plooy

Re: Moodle 2.8, don't see any mod/quiz:preview permission?

by Gareth du Plooy -

Thanks to both Tim and Emma for helping me out here.

The issue was that I was somehow simply missing capabilities in the database. I went directly into the MySQL database and manually added the mod/quiz:preview, mod/quiz:manage, mod/quiz:grade, and mod/quiz:preview capabilities, then assigned those to the teacher role, and now all appears to be working properly. I'm not sure how things got into this state, but we're good now. Thanks!

In reply to Gareth du Plooy

Re: Moodle 2.8, don't see any mod/quiz:preview permission?

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Very strange but glad you got it fixed and thanks for posting the solution.