Random unique quiz question for each student

Re: Random unique quiz question for each student

by Tim Hunt -
Number of replies: 0
Wužiwarjo-wobraz wo Core developers Wužiwarjo-wobraz wo Documentation writers Wužiwarjo-wobraz wo Particularly helpful Moodlers Wužiwarjo-wobraz wo Peer reviewers Wužiwarjo-wobraz wo Plugin developers

If I have done the calculation right, in the situation you give (25 questions, 5 students) there is a 65% chance that students won't see a repeat for one of the questions, just from randomisation. Even if they do, it will just be two of the students who have the same question as someone else, but they won't know who, so that won't make it very easy for them to cheat. (I assume this is what you are worried about.)

The only way to get what you want would be by altering the code, which is something that should not be done lightly. However, I don't think it would be hard. I have not tested this, but I think you would just need to change this line:

https://github.com/moodle/moodle/blob/cad8adccc796f40ab11b1236cd637e9b987c17c8/mod/quiz/locallib.php#L165

// Usages for this user's previous quiz attempts.
$qubaids = new \mod_quiz\question\qubaids_for_users_attempts(
        $quizobj->get_quizid(), $attempt->userid);

Change it to 

// WARNING: Change to standard Moodle code: All previous usages for this quiz attempts.
$qubaids = new qubaids_for_quiz(
        $quizobj->get_quizid(), false);