marcusgreen / moodle-qtype_gapfill

Fill in the blanks question type with very easy to learn syntax
6 stars 20 forks source link

an extra "if!supportLists" choice #95

Closed synnac closed 1 year ago

synnac commented 2 years ago

In the choices list provided, sometimes there appears an extra "if !supportLists" and "Endif"choice. How can I fix the issue? Thank you!

1665203602065

marcusgreen commented 2 years ago

I don't know why you are seeing ifSupportsList. My guess is that you have some javascript injecting that, but that is just a guess. If you could export your question to xml and attach it to a message I will look at it. Alternatively if you give me access to the site where this is happening I will take a look at this. One other option is that I can give you access to a site where you can re-create the question to see what happens. I have done a search through the source code of the question type and it does not contain the string ifSupportLists.

synnac commented 2 years ago

I don't know why you are seeing ifSupportsList. My guess is that you have some javascript injecting that, but that is just a guess. If you could export your question to xml and attach it to a message I will look at it. Alternatively if you give me access to the site where this is happening I will take a look at this. One other option is that I can give you access to a site where you can re-create the question to see what happens. I have done a search through the source code of the question type and it does not contain the string ifSupportLists.

I think I've figured our what happened. When I copy question text with auto numbering from Microsoft Word into the editor, the text will contain some html codes with square brackets, which then will be treated by Gapfill plugin as choices. I think if there isn't a method to clear these codes, then we will have to avoid copying autonumbered texts from Word.

The following is an example.

image

marcusgreen commented 2 years ago

Ahh yes, I have thought about trying to detect unexpected html in gaps/distractors in the past, I will give it more thought. Thank you for getting back to me. Perhaps I should strip all comments, as I cannot see any benefits from html comments when rendering a question type.

synnac commented 2 years ago

Ahh yes, I have thought about trying to detect unexpected html in gaps/distractors in the past, I will give it more thought. Thank you for getting back to me. Perhaps I should strip all comments, as I cannot see any benefits from html comments when rendering a question type.

Thank you Marcus, you are the best!

marcusgreen commented 1 year ago

I am closing this issue now as it was addressed in release 2.136 as recorded in the changelog. https://github.com/marcusgreen/moodle-qtype_gapfill/blob/master/changelog.md Many thanks for your contribution, it will removed an issue that would almost certainly have been a problem for some users.