Can someone give me some pointers on what code to modify to unrandomize the order of questions within the multiple choice questions in a Lesson?
Thank you so much in advance.
Re: Modifying Lesson code to not randomize multi-choice answers
case LESSON_MULTICHOICE :
$i = 0;
//shuffle($answers);
foreach ($answers as $answer) {...
Re: Modifying Lesson code to not randomize multi-choice answers
I tried exactly this, as suggested, using 1.9.9+ on windows and it made no difference at all but then I realised this says multi-choice. What do I alter to make the same change for multiple choice questions (one of three answers only is correct)? Or is multichoice the same thing?
Brian
Re: Modifying Lesson code to not randomize multi-choice answers
Brian,
Just tried the hack I had suggested on a 1.9.9 version of Moodle and it works as advertised. In the user interface this question type is called "Multiple choice", but in the php files it's referred to as LESSON_MULTICHOICE.
The "recipe" I gave has not changed:
in file mod/lesson/view.php, simply comment out line 612:
case LESSON_MULTICHOICE :
$i = 0;
//shuffle($answers);
foreach ($answers as $answer) {...
Joseph
Re: Modifying Lesson code to not randomize multi-choice answers
Hello Ellyn Kao,
Did my answer of Wednesday, 16 December 2009 help you at all with your randomize problem?
In these forums, many of us "Moodle helpers" like to help users with their problems, but we also like to have some feedback and know that the time spent looking for a solution was time well-spent.
Providing feedback when you have been helped is not only gratifying for the "helpers", it also encourages them to continue their work.
All the best,
Joseph
Re: Modifying Lesson code to not randomize multi-choice answers
I apologize for not seeing your answer. I had disabled email notification since I was on vacation
It looks like it might be exactly what I need. I'll log in to the code files later and see if I can do as you instructed.
Many many thanks for providing detailed technical instructions. This may save a lot of headache for us.
Ellen
Re: Modifying Lesson code to not randomize multi-choice answers
Please keep us posted when you get my hack to work.
ATB
Joseph
Re: Modifying Lesson code to not randomize multi-choice answers
I went in to the lesson/view.php file as you had instructed and commented out the one line. Voila! It worked exactly as needed.
Many thanks for sharing your expertise on this matter. I had seen the same question asked by others before, but no specific fixes.
Ellen
Re: Modifying Lesson code to not randomize multi-choice answers
I'm glad it worked for you,
ATB
Joseph
Re: Modifying Lesson code to not randomize multi-choice answers
Funnily enough I did this mod the other day as well (do note that there are a few similar lines of code for different types of question - you can comment them out if you like as well).
Anyway, I have a note to try 2.0 when on general release and if that does not have a lesson setting to turn on and off randomising answers, We will add that mod as a setting as well.
We would do it as a global switch (i.e. either the lesson shuffles or it does not) for all types of question that are in it.
All the best
Ed
Re: Modifying Lesson code to not randomize multi-choice answers
Could you please enter a bug report in the tracker asking for this new feature to be added to forthcoming moodle 2.0 version?
thanks
Joseph
Re: Modifying Lesson code to not randomize multi-choice answers
Thanks for suggesting it Joseph, I missed it the first time round.
Ed