Open kiratskitizing opened 9 months ago
Thanks for letting me know and for all the detail. That doesn't surprise me greatly, it is probably the javascript security bit that is causing the problem. I will investigate.
Can confirm the problem, when javascript security is activated the words cannot be dragged by students. Moodle 4.1.7 and Gapfill 2.138, OSX, Chrome and Firefox
I have investigated this further and had discussions with the senior developers at Moodle HQ (This should take you to the link in telegram) https://t.me/moodledev/132631
Two of the people who responded were Brett Dalton and also Tim Hunt who is the main architect of the Moodle Quiz module. My interpretation of the responses is that other quiz questions do not use standard HTML drag and drop so the security mode does not interfere. My code uses standard HTML drag and drop capabilities and so is broken by that security mode.
I have spent some time to work around this but without success and I suspect I may never get it to work in that mode with core Moodle. My apologies for not being able to find a solution, but I will leave this ticket open for the moment in the hope of finding a way around this problem.
@marcusgreen ah, what a pity! This is a great question type, and easy to setup. You've done great! I suggest adding admin settings to disable the drag-and-drop option, since many use the "Full screen pop-up with some Javascript Security" setting and Gapfill now might mess things up. It should be made so that all the already existing questions will use the drop-down menu instead when drag/drop has been deactivated.
Yes, there should be some mitigation/warning. I would not have thought of switching to the dropdowns as an option. That is a good idea, I will see if I can think of a way of implementing it. I am currently very focussed on this https://fosstodon.org/@marcusgreen/111643206243001461 until the end of February.
@marcusgreen I understand. Do you know what/where would need to be changed in the database to change all old dragdrop questions to work as dropdown? I have found the table mdl_question_gapfill and tested just changing the value for answerdisplay from dragdrop to dropdown in a test question, but that wasn't enough.
answerdisplay should work, but only for a new attempt at a quiz.
Sorry... I created a dragdrop question and changed the value for answerdisplay from dragdrop to dropdown in table mdl_question_gapfill. Added the question to a new quiz, but the answer options was still dragdrop. So, there's something more that need change.
Describe the bug When a quiz uses the setting: Extra restrictions on attempts / Browser security = Full screen pop-up with some Javascript Security. A student attempting the quiz is not able to drag and drop
To Reproduce Steps to reproduce the behavior:
Expected behavior Student should be able to drag and drop.
Desktop (please complete the following information):