Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-75978

Drag-drop into text questions: it is possible to get the questions into a broken state (on mobile Safari)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.0.7, 4.1.2
    • 3.11.10, 4.0.4
    • Questions
    • MOODLE_311_STABLE, MOODLE_400_STABLE
    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MDL-75978-401
    • MDL-75978-master
    • Hide

      Note, this issue is not a complete fix. It just solves the most serious breakage. It you see odd behaviour while testing, please check MDL-76946 before reporting new issues.

      1. Download the export question file questions-L192-22J-q5v3-20221028-0925 (1).xml.
      2. As admin/teacker, import it (Moodle XML format) into the question bank of any course.
      3. Create a quiz and add this question.
      4. Using Safari on an iPhone to attempt the quiz. (We tested with iPhone 14 pro, iPhone 13, iPhone 13 promax.)
      5. (If you can, have the JavaScript console of your developer tools open, so you can see any error messages.)
      6. Try to drag and drop answers into all the different areas. (As you drag, it is expected that you will see that some drag zones jump from the end of one line to the start of the next. This is the unwanted behaviour that was causing the bug we have fixed. We have not yet fixed that jumping around. See MDL-76946. What we have done is to ensure that jumping around does not break the question.)
      7. (If you were able to access it, Verify no error messages are reported in the JavaScript consold.)
      8. Verify that the question never gets into a broken state, where some or all of the draggble items stop resoponding when you try to move them.

      The problem is intermittent, so you should try this testing many times to see if you can trigger it. (It might be a good idea to first try with last week's Moodle build, to see if you can reproduce the bug yourself, before testing the fix.).

      Show
      Note, this issue is not a complete fix. It just solves the most serious breakage. It you see odd behaviour while testing, please check MDL-76946 before reporting new issues. Download the export question file questions-L192-22J-q5v3-20221028-0925 (1).xml . As admin/teacker, import it (Moodle XML format) into the question bank of any course. Create a quiz and add this question. Using Safari on an iPhone to attempt the quiz. (We tested with iPhone 14 pro, iPhone 13, iPhone 13 promax.) (If you can, have the JavaScript console of your developer tools open, so you can see any error messages.) Try to drag and drop answers into all the different areas. (As you drag, it is expected that you will see that some drag zones jump from the end of one line to the start of the next. This is the unwanted behaviour that was causing the bug we have fixed. We have not yet fixed that jumping around. See MDL-76946 . What we have done is to ensure that jumping around does not break the question.) (If you were able to access it, Verify no error messages are reported in the JavaScript consold.) Verify that the question never gets into a broken state, where some or all of the draggble items stop resoponding when you try to move them. The problem is intermittent, so you should try this testing many times to see if you can trigger it. (It might be a good idea to first try with last week's Moodle build, to see if you can reproduce the bug yourself, before testing the fix.).

      This issue seems to affect drag-drop into text questions. It is very intermittent, and seemed to be happening on Mobile Safari. We are not sure if this can be reproduced on other browser/device combinations.

      The symptom is that after answering part of the question (e.g. questions-L192-22J-q5v3-20221028-0925 (1).xml), the student could then no longer move any of the drag items, and so could not complete the question. (This was reported to us by more than one student in assessed tests). When I went to review their attempt, there was an error in the JavaScript console:

      Uncaught TypeError: classes is undefined
          getClassnameNumericSuffix https://HIDDEN/lib/requirejs.php/1663235109/core/first.js:1979
          getGroup https://HIDDEN/lib/requirejs.php/1663235109/core/first.js:1979
          getDragClone https://HIDDEN/lib/requirejs.php/1663235109/core/first.js:1979
          positionDrags https://HIDDEN/lib/requirejs.php/1663235109/core/first.js:1979
          jQuery 2
          positionDrags https://HIDDEN/lib/requirejs.php/1663235109/core/first.js:1979
          DragDropToTextQuestion https://HIDDEN/lib/requirejs.php/1663235109/core/first.js:1979
          init https://HIDDEN/lib/requirejs.php/1663235109/core/first.js:1979
          <anonymous> https://HIDDEN/mod/quiz/review.php?attempt=5603746:1189
          execCb https://HIDDEN/lib/javascript.php/1663235109/lib/requirejs/require.min.js:5
          check https://HIDDEN/lib/javascript.php/1663235109/lib/requirejs/require.min.js:5
          enable https://HIDDEN/lib/javascript.php/1663235109/lib/requirejs/require.min.js:5
          init https://HIDDEN/lib/javascript.php/1663235109/lib/requirejs/require.min.js:5
          o https://HIDDEN/lib/javascript.php/1663235109/lib/requirejs/require.min.js:5
      first.js:1979:11117
      

      That it turn was caused by two different drop zones both thinking that they contained the same (single use) drag item, that is, when the question was displayed, the hidden inputs were:

      ...
      <input type="hidden" id="q7083725_6_p4" class="placeinput place4 group1" name="q7083725:6_p4" value="3">
      <input type="hidden" id="q7083725_6_p5" class="placeinput place5 group1" name="q7083725:6_p5" value="6">
      <input type="hidden" id="q7083725_6_p6" class="placeinput place6 group1" name="q7083725:6_p6" value="6">
      <input type="hidden" id="q7083725_6_p7" class="placeinput place7 group2" name="q7083725:6_p7" value="7">
      ...
      

      Note the two with value="6" - that was a choice that could only be used once. The question is, how did it get like that? I could not work it out, but I was able to reproduce it, but only on an iphone, so it might be touch-screen only, or that might be a read-herring.

      This seems related to the fact that, on an iphone, in some cases the drop zones were jumping from line to line (because the line-wrap was changing) whenever you started or stopped a drag. That seems to be what causes this.

        1. Evidence_MDL-75978_picture_2.jpg
          Evidence_MDL-75978_picture_2.jpg
          309 kB
        2. Evidence_MDL75978_video.mp4
          1.71 MB
        3. Figure.png
          Figure.png
          37 kB
        4. image-2022-11-24-15-38-21-560.png
          image-2022-11-24-15-38-21-560.png
          187 kB
        5. image-2022-11-24-15-41-32-993.png
          image-2022-11-24-15-41-32-993.png
          309 kB
        6. image-2022-12-09-14-36-00-900.png
          image-2022-12-09-14-36-00-900.png
          15 kB
        7. image-2022-12-09-14-36-40-271.png
          image-2022-12-09-14-36-40-271.png
          13 kB
        8. image-2022-12-09-14-51-19-485.png
          image-2022-12-09-14-51-19-485.png
          63 kB
        9. image-2022-12-09-14-52-47-239.png
          image-2022-12-09-14-52-47-239.png
          118 kB
        10. image-2022-12-09-14-53-21-344.png
          image-2022-12-09-14-53-21-344.png
          61 kB
        11. questions-L192-22J-q5v3-20221028-0925 (1).xml
          5 kB
        12. RPReplay_Final1674010456.MP4
          3.75 MB
        13. RPReplay_Final1674010486.MP4
          3.54 MB
        14. RPReplay_Final1675043580.MP4
          36.28 MB

            vuvanhieu143 Hieu Vu
            timhunt Tim Hunt
            Tim Hunt Tim Hunt
            Andrew Lyons Andrew Lyons
            Huong Nguyen Huong Nguyen
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours, 55 minutes
                5h 55m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.