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

Quiz essay question image response lost when HTML Editor is set

XMLWordPrintable

    • MOODLE_401_STABLE, MOODLE_403_STABLE

      Hello,

      I have detected that when configuring an essay question, with this configuration:

      • Response format: HTML Editor.
      • Require text: Require the student to enter text.
      • Allow attachments: No.

      this can lead to uncontrolled errors and confusion for the end user.

      There are two different behaviours depending on the editor used to respond:

      1. Student responds with Atto
      When pasting an image from the clipboard, with Ctrl+V (a screenshot for example), the send attempt button is blocked and does not allow to send or advance. If you wait for auto-save and close the window, then when you review the attempt with the teacher, you will see that the image has been deleted and the rest of the text content is left.

      When you paste the screenshot, the following error appears in devtools: "Uncaught TypeError: Cannot read properties of undefined (reading 'savepath')".

      2. Student responds with Tiny
      With tiny, when pasting the screenshot, it does not block end or advance buttons, it does not give an error in devtools and when sending it can be checked again and the screenshot is still visible. Finally, when it is finally sent and it is reviewed from the teacher's side, you can see that the screenshot has been deleted. The rest of the possible text content prevails.

      This happens in both 4.3.2 (Build: 20231222) and 4.1.8 (Build: 20231222).

       

      Testing instrucctions:
      1. Create quiz.
      2. Add an essay question and configure it with:
          - Response format: HTML Editor.
          - Require text: Require the student to enter text.
          - Allow attachments: No.
      3. Login with student and set the preferred editor from student profile preferences: try atto and repeat with tiny.
      4. With student go to the quiz, write some text and paste an image with Ctrl+V.
      4.1 If you are using atto: an error should occur in devtools and quiz submit buttons should be blocked: wait for autosave time (until you see the autosave call in devtools).
      4.2 If you are using tiny: send, review attempt and verify that the image is still embedded. Finally send the quiz.
      5. Enter with teacher to check the attempt: in both cases the image will have been deleted and only the text is preserved. 

      Expected result: since it allows the image to be pasted, it should be preserved. If the idea is that this is not possible, you should avoid it somehow, to avoid this confusion.
      Actual result: with atto, JS error occurs when pasting the image, the submit buttons are blocked and when saving the attempt, the image is deleted. With tiny, no errors but saving the attempt deletes the image, despite displaying it in the pre-submission review.

       

      Thank you,

      Regards

            Unassigned Unassigned
            jmabreu Miguel_
            Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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