Change question to shuffle answers

Change question to shuffle answers

by David Sampson -
Number of replies: 9

Is there an efficient way to edit questions to shuffle answers within a quiz? We have a quiz with 100 MCQs. Instead of editing each question to shuffle answers is there an 'automated' way to set this for all.

Thank you,
David

Average of ratings: -
In reply to David Sampson

Re: Change question to shuffle answers

by Vicki Dunnam -
When you create your quiz, you can choose the "Shurffle Questions" set to yes and even set Shuffle within questions set to yes to shuffle the answers as well. It iw when you create or update your quiz. That is easier than setting each one individually.
In reply to Vicki Dunnam

Ang: Re: Change question to shuffle answers

by Kasper Lauest -

But David would still have to enable the shuffle within questions in each question as it says in MoodleDocs: "If you enable this option, then the parts making up the individual questions will be randomly shuffled each time a student starts an attempt at this quiz, provided the option is also enabled in the question settings."

I feel that it would be a huge improvement to Moodle if there was some way to manipulate several questions (or indeed all questions) in a bank at the same time.

Average of ratings: Useful (1)
In reply to Kasper Lauest

Re: Ang: Re: Change question to shuffle answers

by David Sampson -

Yes, exactly. The novice Moodle teacher/administrator may not have the foresight or knowledge to set each question to shuffle answers when first created. Therefore, a function to allow re-setting questions in a copied quiz to shuffle answers would be nice.

I understand that this may not be possible without more user support for this feature. However, it would be nice to add this as a tip to the Moodle documentation.

Something like:
TIP: It is good practice to set all newly created questions to shuffle answers. While answers will not shuffle within questions unless the quiz is also set to do so, if shuffle answers is not set for each question, a one-by-one manual edit will be required for each question if used in a quiz where answer shuffling is desired.

Thank you all for the feedback.

In reply to David Sampson

Re: Ang: Re: Change question to shuffle answers

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

David > The novice Moodle teacher/administrator may not have the foresight or knowledge to set each question to shuffle answers when first created.

Actually, in Moodle 1.9 latest version, for multiple choice quesitons, the "shuffle the choices" option is checked by default, so it does not take much "foresight or knowledge" to select that option, on the contrary, unchecking the option supposes a deliberate choice from the teacher to have the choices for that particular question be displayed to the student in the order in which they have been created by the teacher. This "unshuffled" possibility is quite useful in such case as:

The cat is...

  1. a flower
  2. an object
  3. an insect
  4. none of the above

Joseph

In reply to Joseph Rézeau

Re: Ang: Re: Change question to shuffle answers

by David Sampson -

Joseph, you are correct. Thank you! I will point this out to the teacher. Appreciate the feedback as always.

David

In reply to Kasper Lauest

Re: Ang: Re: Change question to shuffle answers

by Cristina Berisso -
I will vote in favor of that type of external manipulation also!
In reply to Kasper Lauest

Re: Ang: Re: Change question to shuffle answers

by Timothy Takemoto -

Wow. I am so stupid. I have been using Moodle for years and is only now that I realise that I had to set the option in the question settings too.

Perhaps this feature came in at some point and I did not notice it. Yes. Looking through the database table mdl_multichoice I see that most questions are being shuffled but that more recent ones (probably after the introduction of this feature, some years ago) are shuffleanswers=0.

For my own benefit and in response to Christina and Kasper's destire to be able to manipulate several (or rather ALL) questions at the same time.

So, one way of doing this *GLOBALLY* would be to use the database management tool and use the following SQL

UPDATE mdl_question_multichoice SET shuffleanswers=1

Which I just did, since I am careful when making questions of the type that Joseph enumerates below to use wording such as the following to allow for shuffling.

Which of the following is a mamal
A) Reptile
B) Cod
C) R2D2
D) Not of the other options.

However, you might also set a range usign
UPDATE mdl_question_multichoice SET shuffleanswers=1 WHERE id > abc AND id < xyz

Now I have to find the part of the GIFT import code that is setting shuffleanswers to 0 by default. I guess that this shuffleanswers=1 has become the default somewhere along the way.

No sorry, as David Hunt points out, the default behaviour is settable in  Administration Modules > Activities > Quiz I must have changed my default settings somewhere along the way.

But oops. I do have shuffle within questions set to yes! Some more work needs to be done.

Tim

In reply to Timothy Takemoto

Re: Ang: Re: Change question to shuffle answers

by Dennis Chew -

Hi People,

It's an old thread but I just thought someone might appreciate a useful snippet for setting `shuffleanswers` = 0 in the case of a question with 'none of the above' or 'all of the above' as possibilities.

 

UPDATE `mdl_question_multichoice` `q` 
INNER JOIN  `mdl_question_answers` `a`
ON `q`.`question` = `a`.`question`  
AND `a`.`answer` LIKE '%the above%'
SET `q`.`shuffleanswers` = 0
WHERE `q`.`shuffleanswers` = 1

 

Cheers
Steve B

In reply to Timothy Takemoto

Re: Ang: Re: Change question to shuffle answers

by nicola bresin -

Hi Timothy,

checking the dabase for the 640 questions of my course I found about 10 of them with the field 'shuflleanswers' set to '1'. I thought it was a mistake occured when typing and setting the questions, but when I checked in Moodle, the settings of the 10 questions are not mistaken, the "shuffle the question" check box is empty.... Any idea?

thank you for answer

Niko