In a default Moodle installation the Attempt quizzes (mod/quiz:attempt) permission is 'NOT SET' for the Manager role. For the Student role that permission is set to 'ALLOW'. What happens if a person has both the Student AND the Manager role in a course and that person attempts a quiz? Will their quiz attempt be recorded and written to the Gradebook?
Thanks.There is no problem allowing mod/quiz:attempt for multiple roles.
What you must never do is have both mod/quiz:attempt and mod/quiz:preview for the same user in the same quiz. So if you allow :attempt, then you must also deny :preview.
Thank you Tim, but what is confusing me is that the mod/quiz:attempt permission is 'NOT SET' for the Manager role, but for the Student role that permission is set to 'ALLOW' (those are the defaults - I have not changed the role permissions). With those settings, what happens when somebody who has BOTH the Student AND Manager role in a course attempts a quiz in that course? Does Moodle save their quiz result as a "real attempt" and does it write the grade to the gradebook?
Re: Quiz attempts for the Moodle Manager role
Ok, I just had another look at those two roles:
In the default Moodle Manager role
mod/quiz:preview is set to ALLOW and
mod/quiz:attempt is NOT SET.
In the default Moodle Student role
mod/quiz:preview is NOT SET and
mod/quiz:attempt is set to ALLOW.
So, if a person has both the Manager AND the Student role in a course and they attempt a quiz in that course what happens to their quiz attempt? Is it saved as a real quiz attempt or as a quiz preview?
(The settings above are the defaut settings in Moodle 2.1 - we have not changed any permissions for those roles.)
Re: Quiz attempts for the Moodle Manager role
This depends on your version of Moodle. In older versions, they would have both capabilities. Now, it appears that if they have the preview role, this, I think(!), overrides the attempt role.
Emma is incorrect.
In the situiation you give, that user would end up with both capabilities, which is bad.
The reason I say it is bad is that when a user has both capabilities, then mod/quiz:preview takes precedence. There is no way to attempt the quiz. Any attempt you make will be a preview, and the system can delete previews at any time.
Sorry, that is what I meant - not well said.
Maybe the quiz was never this way, but I know that in the past, I could have admin and student role and be able to submit assignments and, I thought, take a quiz as well but maybe my memory is going! I used to really like the way it worked in the past because I would make a Moodle playground course and make my teachers students and teachers and they could see both sides of an assignment - submitting and marking.
This has never worked for the quiz. The assignment uses different logic.
The main workaround people have been using for this situation (despite my long insistence that keeping learner ids and instructor/manager ids separate is really better practice when it can be done) is to disable that preview capability by having the manager use the "switch role to" function to trip the student role if they have to post scores for their own learning. No role over-ride necessary; no digging through permissions and role overlaps.
They just have to remember to do that "switch role to" student step or their score will post as a preview not as an attempt. It should work that way in 2.1, if I remember right, and still does in Moodle 3.0, which I just tested again to be sure nothing had changed since I tried this last. Hope that helps. Unfortunately, once an attempt posts as a preview there is nothing that will convert it to a "real" attempt, so it is crucial to do it right the first time.
I managed to change the quiz preview to a real and graded attempt by:
- Removing the Manager role for the student in the course - the student certainly doesn't need it. Nobody will admit to adding it!
- Changing the mdl_quiz_attempts.preview value in the Moodle database for the attempt from 1 to 0.
- Regrading the quiz attempt.
The attempt now shows in the quiz attempts list and the grade was written to the gradebook.
On Monday morning I'll give everyone a lecture about not giving any students the STUDENT AND MANAGER roles in a course.
Thanks everyone...