Moodle Quiz 2.9 Padlock for Questions

Moodle Quiz 2.9 Padlock for Questions

by kathy chilvers -
Number of replies: 12

We have recently upgraded to Moodle 2.9 and I have been trying to create a quiz where the student cannot move on to the next question without getting the first one correct.  They are all straightforward multiple choice questions.

Following the documentation I have set the layout to free and the question behavior to Interactive (and also tried immediate feedback) but the padlock that should allow me to set the questions up as first said above is not appearing.

Any help of ideas of what I might be doing wrong or what could be happening appreciated please.


Kathy

Average of ratings: -
In reply to kathy chilvers

Re: Moodle Quiz 2.9 Padlock for Questions

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Kathy smile How are you? Are you using a standard theme ? Can you try with the Clean theme if not?

In reply to Mary Cooch

Re: Moodle Quiz 2.9 Padlock for Questions

by kathy chilvers -

Hi Mary - I am fine - still around.  Theme was do not force (I think it was set the default to be clean).  Have changed to Clean but still the same.

In reply to kathy chilvers

Re: Moodle Quiz 2.9 Padlock for Questions

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Can you show us a screen-grab of the Edit quiz page?

In reply to Tim Hunt

Re: Moodle Quiz 2.9 Padlock for Questions

by kathy chilvers -

Hi  thanks for your reply - Here are the settings


This is what I see - I was expecting padlock on the right.



In reply to Tim Hunt

Re: Moodle Quiz 2.9 Padlock for Questions

by kathy chilvers -

Screenshots don't appear to be showing so am attaching


Attachment screenshot1.PNG
Attachment screenshot2.PNG
In reply to kathy chilvers

Re: Moodle Quiz 2.9 Padlock for Questions

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

My suspicion (and this is only a guess) is that the padlocks are there, but are invisible because of the particular theme you are using.

My suspicion is aroused by the fact that the pen icon next to the grades 1.00 looks funny, and may be that is not the only thing wrong.

If you are familiar with using developer tools in your web browser (right click and say 'Inspect element') you could try using them to see if the padlocks are there in the HTML.

Alternatively, a simpler test might be to try to create a simple quiz at demo.moodle.org. If it works there, you know the issue is specific to your site. If you can reproduce the problem on demo.moodle.org, then it is much more likely to be a Moodle bug.

In reply to Tim Hunt

Re: Moodle Quiz 2.9 Padlock for Questions

by kathy chilvers -

I have tried different themes and all the same.  Thanks for the idea of trying on the demo..........I did and it worked on there so it must be an issue specific to our site. sad  But at least now I know that I had not been setting the quiz up wrongly so I can stop trying  to put it right that way. 

In reply to Tim Hunt

Re: Moodle Quiz 2.9 Padlock for Questions

by Brian Lee -
I believe there is something wrong with the quizzes on a course page that has been restored from an old Moodle backup file (the course page was built in a Moodle 1.9.11+ site) to a Moodle 2.9+ site. The padlock functionality may not work even after you change the settings of a quiz on a Moodle 2.9+ course page that has been restored from a Moodle 1.9.11+ backup.

After setting "Interactive with multiple tries" and the Navigation Method option to "Free" for the quiz "Online Quiz #2" that came with the course page after being restored, I don't see the padlocks between the questions. After I created the quiz "anotherquiz", added some questions to it and setting "Interactive with multiple tries" and the Navigation option to "Free", I see the padlocks between the questions.

Take a look at the screenshot of "Online Quiz #2" (used Developer for this). You see that there is a span tag with the class "question_dependency_wrapper question_dependency_cannot_depend". Also, take a look at the screenshot of "anotherquiz" (used Developer for this as well). You see that there is a span tag with the class "question_dependency_wrapper".

I believe that this is a bug of some sort, unless Moodle does not support restoring a Moodle 1.9.11+ course page to a Moodle 2.9+ course page, as this can be unreliable and potentially faulty.
Attachment anotherquizeditingquizpadlocksvisible.jpg
Attachment onlinequiz2editingquizpadlocksinvisible.jpg
In reply to Brian Lee

Re: Moodle Quiz 2.9 Padlock for Questions

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Restoring from 1.9.x to 2.x should work. However, the amount that functionality is still used is anyone's guesss. If it is not used much any more, then it may have broken.

The screen grabs you attached are unreadably small.

The logic for what classes are added to that span are not that complicated:

https://github.com/moodle/moodle/blob/MOODLE_29_STABLE/mod/quiz/classes/output/edit_renderer.php#L781

https://github.com/moodle/moodle/blob/MOODLE_29_STABLE/mod/quiz/classes/structure.php#L164

Ah yes! $this->slotsinorder[$slotnumber]->section->shufflequestions. In the restored quiz, you have 'Shuffle quetsions' turned on. You can't depend on the previous question if the order is random.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Moodle Quiz 2.9 Padlock for Questions

by Brian Lee -

Got it! Great catch! Maybe the AJAX or whatever magic happens when you click that "Shuffle" checkbox can be improved, however. Theoretically, it would make more sense to show the padlocks when you uncheck the "Shuffle" checkbox and hide the padlocks when you check it (immediately, in both cases, so you do not have to refresh the page).

Yes, the screenshots that I attached are really small because I had to fit under the 150KB file size limit (or whatever it is). I was using PNG and thought making the size of the screenshots smaller would help. It turns out that JPG would have done the trick without making the size smaller.

Thanks a lot!

In reply to Brian Lee

Re: Moodle Quiz 2.9 Padlock for Questions

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Oh yes. If the Ajax update of the page does not show/hide the padlocks correctly then that is a bug. Please can you report it in the Tracker.