Affects Version/s: 3.7
Fix Version/s: None
Component/s: HTML Editor (Atto)
In Firefox, you can for example add empty answers to multiple choice questions by following these steps:
- Create a Quiz in some course in Firefox.
- In the Quiz, create a multiple choice question.
- Add some name and description to the question.
- Set choice 1 as 100%.
- Press F12 to open developer console.
- Click on the text field for Choice 1 to focus it.
- Click on something other than the Website, for example the developer console or the desktop to unfocus the text field.
- Click on the text field for Choice 2.
- Type in something.
- Press Ctrl+A and then Backspace to delete the text of the choice.
- Click Save changes and continue editing on the bottom of the page.
- 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.
- Click on Preview on the bottom of the page.
- 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).