3.5.5+ Stop the shuffling of response orders in Matching Questions

3.5.5+ Stop the shuffling of response orders in Matching Questions

by Deb Smith -
Number of replies: 13

That one cannot get the answers in alphabetical order is beyond annoying!  Julian Ridden's suggestion to:


  • You could change the line from shuffle to read 
           asort($choiceorder);

This will sort the responses in alphabetical order.

does not work in 3.5.5+.  Anyone know how to make it work in 3.5.5+?

Average of ratings: -
In reply to Deb Smith

Re: 3.5.5+ Stop the shuffling of response orders in Matching Questions

by Deb Smith -
Julian Ridden posted a fix for this several years ago here https://moodle.org/mod/forum/discuss.php?d=224759#p976196 but that fix doesn't work in 3.5.5+.  Does ANYONE know how to make the drop down lists of matching question answers alphabetical, and preferably alphabetical whether the answers start with upper or lower case letters?  Students are furious that such a simple fix cannot be implemented!
In reply to Deb Smith

Re: 3.5.5+ Stop the shuffling of response orders in Matching Questions

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Deb,

I would suggest you might need to go back and make sure you are changing to asort($choiceorder); in the correct place. Moodle 3.5.5+ (Build: 20190406), today's release, ascending sort works if the change is made to line 67 of the ...yourmoodle/question/type/match/question.php. This also work for the latest Moodle 3.6.3+ in the same exact location.

Average of ratings: Useful (1)
In reply to Deb Smith

Re: 3.5.5+ Stop the shuffling of response orders in Matching Questions

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Deb,

I'm sure the new release works as Al says.

As a workaround, you could have used the Multiple choice (MC) sub-question of the Embedded answer (Cloze) question type and made it work as a Matching question without shuffled answers.

Average of ratings: Useful (1)
In reply to Dominique Bauer

Re: 3.5.5+ Stop the shuffling of response orders in Matching Questions

by Deb Smith -

No, it is still not working.  I cleared my cache and cookies, and still they are not coming up in alphabetical order.  See attached.

Attachment Exam-screenshot.jpg
Attachment Notepad.jpg
In reply to Deb Smith

Re: 3.5.5+ Stop the shuffling of response orders in Matching Questions

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Deb,

I should have investigated more. The problem is that the question type is sorting based on the answer id, and NOT on the answer text. Since I had entered my test answers IN ALPHABETICAL ORDER, I was fooled into thinking it was working. But I just now made a question using your answers and in the order they appear in your picture. Due to that, the asort was listing the answers in the order shown in your picture.

So, there is a 'slightly painful' work around. That is, keep the asort, or comment out the shuffle. Then create your question with the answers in alphabetical order. The question part will be shuffled and the answers will be in alphabetical order.


Average of ratings: Useful (1)
In reply to AL Rachels

Re: 3.5.5+ Stop the shuffling of response orders in Matching Questions

by Deb Smith -

Since I have found that most of today's students can't spell worth a damn, I tend to include terms that are very similar, but often aren't even real terms, as red herrings.  Since there are more answers than questions, this would mean that I have empty questions with wrong answers interspersed.  And sure enough, students always fall for these misspelled words.

Maybe I just need to keep the answer lists short enough to be completely visible within the screen, and hope too many students don't complain!  Having answers in alphabetical order is just always the norm, so I'm not sure why Moodle has never realized that!  It would annoy me if I were the one taking the test, so I can sympathize with students who want to see the answers in alphabetical order!

In reply to Deb Smith

Re: 3.5.5+ Stop the shuffling of response orders in Matching Questions

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I totally agree with the part about their poor spelling which is why I used to use a lot of shortanswer questions where they had to type answers correctly, or get the question wrong.

You could be diabolical evil and provide a picture of an alphabetized list of correct and detractor answers with short answer Cloze questions, or the regular Moodle short answer type question. Making it a picture means they cannot copy and paste, but must type in the correct answer.  big grin
Average of ratings: Useful (1)
In reply to AL Rachels

Re: 3.5.5+ Stop the shuffling of response orders in Matching Questions

by Deb Smith -

I have done that on some exam questions, and predictably, they miss them.

In reply to Deb Smith

Re: 3.5.5+ Stop the shuffling of response orders in Matching Questions

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Deb,

In your screenshot, you have the questions D, E, F, G, H, I, J in alphabetical order, which suggest that your questions are not shuffled.

If you do not need to shuffle your questions, the Multiple-choice Cloze question type is probably more appropriate than the Matching question. In fact, the question in your screenshot looks more like a Multiple-choice Cloze question than a Matching question.

In reply to Dominique Bauer

Re: 3.5.5+ Stop the shuffling of response orders in Matching Questions

by Deb Smith -

The letters actually refer to labels in a graphic, so they are supposed to identify what is labeled A, B, C, and so on.  I have never used Cloze type questions before, and I'm not sure I really want to redo many course questions to make it work.

In reply to Deb Smith

Re: 3.5.5+ Stop the shuffling of response orders in Matching Questions

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

The Multiple choice Cloze question is not difficult. For example, if the answer to A is 'hypothalamus' and the answer to B is 'pituitary gland', etc., you just need the following code in the HTML of the Question text of a Cloze question:

<p>
A {1:MC:%0%adrenal gland
~%0%Fallopian tube
~%0%heart
~%100%hypothalamus
~%0%hypothemus
~%0%ovary
~%0%pancreas
~%0%parathyroid gland
~%0%pineal gland
~%0%pituitary gland
~%0%prostate
~%0%testes
~%0%thalamus
~%0%thymus gland
~%0%thyroid gland
~%0%uterus}
</p>

<p>
B {1:MC:%0%adrenal gland
~%0%Fallopian tube
~%0%heart
~%0%hypothalamus
~%0%hypothemus
~%0%ovary
~%0%pancreas
~%0%parathyroid gland
~%0%pineal gland
~%100%pituitary gland
~%0%prostate
~%0%testes
~%0%thalamus
~%0%thymus gland
~%0%thyroid gland
~%0%uterus}
</p>

That's it! This gives:

QuizForum201904061829.png


You can also consider the "Drag and drop onto image" and the "Drag and drop markers" core questions, which are simple and appropriate for your type of question.

In reply to Dominique Bauer

Re: 3.5.5+ Stop the shuffling of response orders in Matching Questions

by Germán Valero -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

If you use a Cloze question type, you can use the cloze editor for Atto additional plugin.

Write the first question with all the available answers in alphabetical order and then you can easily duplicate and modify this question using the same distractors.

This might be the easiest and fastest way to acheive the desired goal. And there is no need to hack Moodle code.

Average of ratings: Useful (2)
In reply to Germán Valero

Re: 3.5.5+ Stop the shuffling of response orders in Matching Questions

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

I always prefer the "no need to hack Moodle code" option, myself. Would love to see a, built in to the question option, to NOT shuffle the answer list.

Doesn't really matter to me right now, as I have retired from teaching, but my preference is to try and use the formulas type question, whenever possible, due to being able to set random variables so each student gets a personalized question. Plus the formulas type questions works well with the Generico filter which allows for the addition of lots of detailed information that can be toggled into view/hidden as needed.