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

Atto: Add empty answers to multichoice question in Firefox



    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.7
    • Fix Version/s: None
    • Component/s: HTML Editor (Atto)
    • Labels:
    • Affected Branches:


      In Firefox, you can for example add empty answers to multiple choice questions by following these steps:

      1. Create a Quiz in some course in Firefox.
      2. In the Quiz, create a multiple choice question.
      3. Add some name and description to the question.
      4. Set choice 1 as 100%.
      5. Press F12 to open developer console.
      6. Click on the text field for Choice 1 to focus it.
      7. Click on something other than the Website, for example the developer console or the desktop to unfocus the text field.
      8. Click on the text field for Choice 2.
      9. Type in something.
      10. Press Ctrl+A and then Backspace to delete the text of the choice.
      11. Click Save changes and continue editing on the bottom of the page.
      12. You would expect that the page shows the error "Grade set, but the Answer is blank" for the first, and "This type of question requires at least 2 choices" for the second choice, but it doesn't.
      13. Click on Preview on the bottom of the page.
      14. You can see two choices with no text. (Which should not be possible, because emtpy answers should be deleted).

      These are two different ways of creating empty answers. This seems to be a general problem with Atto. Tested with Firefox 66.0.3. In Chrome, this does not seem to work.

      When you are typing in the text field, <p><br></p> is inserted automatically. When you click on somewhere else in the web page to unfocus the text field, and the text field has no content, the <p><br></p> is removed. If you click on somewhere outside the web page, Firefox will also unfocus the text field, but the <p><br></p> will not be deleted.

      When you type something into the text field, select all with Ctrl+A and then delete that, the <p> and </p> will also be deleted with the text and <br> will remain in the text field, which won't be deleted when you unfocus the text field (both when you click inside or outside the web page).




            justusdieckmann Justus Dieckmann
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            3 Vote for this issue
            3 Start watching this issue