Quiz

Will some random questions repeat before all are used?

 
Picture of Oren Bochman
Re: Will some random questions repeat before all are used?
 

Hi, it is possible to have a truely random selection on N out of M questions (given N<= M).

e.g. This can be done by drawing random list size N times and removing the selected item each time.

So getting repeated  question when N<=M should be considered a bug.

 
Average of ratings: -
Picture of C. Satriano
Re: Will some random questions repeat before all are used?
 

I can confirm that there must be a bug, because I got a question repeatead twice with N=2 and M=7.

Infact I had a question category containing 7 questions and asked in my quiz to random exctract 2 questions from that category getting twice the same question.

Is there a method to avoid this? 

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Will some random questions repeat before all are used?
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

I have to say I would need to see very clear evidence to believe there is a bug here. A lot of people rely on this code working, and they do not encounter any problems.

The best way to check is, find one quiz attempt where you think the same question has been selected twice. Review that quiz attempt as teacher/admin, and by every question there will be an 'Edit question'. Check what URL that link goes to, and it will include &id=12345 at the end, where 12345 it the id Moodle users to identify the question.

If there are two questions in the quiz with the same id, then there is really a bug, and so please tell us as many deatails as possible about how that quiz is set up. (Including exactly which Moodle version you are using.)

If the ids are different (and the questions merely look the same) then you made a mistake in setting up your quiz.
 
Average of ratings: -
Picture of C. Satriano
Re: Will some random questions repeat before all are used?
 

You were right: I checked the quiz and the 2 questions had, indeed, different ids.

Thanks you so much for your helpful suggestion!

 
Average of ratings: -