"" Tags in Quiz Content Make Content Disappear

"" Tags in Quiz Content Make Content Disappear

by Bryan Thomson -
Number of replies: 3

Hi all,

I'm busy importing questions into the Quiz Module to be used in my companies LMS program. One of the courses offered follows the Development Route and, predictably, many of the questions i have to now import have alot to do with coding, including html, which uses the <> characters quite often. My problem is this:

It seems that the quiz module recognises the "< >" tags as special characters and exludes them, and all content contained between them, from the output presented on the page when i try to display my questions within a quiz. eg:

My txt file that i import has content such as the following:

This is a question:

1. <This is the first answer.>

2. <This is the second answer.>

3. <This is the third answer.>

4. <This is the fourth answer.> 

The output, when i preview the question after having imported it into my quiz of type aiken format, displays the question, with four selections containing no content. If i remove the <> tags it works fine, but i need these characters for the development tests i'm compiling.

Perfect example of how it works is above in the title of this posting, the <> tags i included aren't displayed.

If anyone has a work-around for this, or an alternative, your input would really be greatly appreciated.

Thank

Bryan =)

Average of ratings: -
In reply to Bryan Thomson

Re: "" Tags in Quiz Content Make Content Disappear

by Itamar Tzadok -
replacing < and > with &lt; and &gt; should do the trick. smile
In reply to Bryan Thomson

Re: "" Tags in Quiz Content Make Content Disappear

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I think this is probably a bug in Aiken format. That is meant to be a simple plain-text format, so we should be automatically escaping HTML special characters in the input.

Of course, if we do that, then it will annoy anyone who was wanting to write HTML questions in Aiken format, but I expect anyone doing sophisticated stuff like that would be using some other format like GIFT in the first place. So I am going to change Aiken (MDL-16056), and I will make sure things are clear in the help files.
In reply to Tim Hunt

Re: "" Tags in Quiz Content Make Content Disappear

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
OK, fixed now (in all branches from 1.6 onwards). It would be really great if people who use Aiken could update to the latest question/format/aiken/format.php and then try importing a range of questions, just to check that I have not broken anything.