using HTML in quiz

using HTML in quiz

by Linda Dimitrov -
Number of replies: 13
I want to use a Moodle quiz to test my kids on some XHTML and CSS but I can’t find a place to change settings so that I can use plain text – the default is HTML format and can’t be changed (or at least I can’t find where to change it – I’ve checked activity settings, etc).

And I want the kids to be able to answer using code so their answers would also be in plain text. I experimented with it today with a class and I can’t read any of the code in their answers.

Thanks for any help you can provide.

Average of ratings: -
In reply to Linda Dimitrov

Re: using HTML in quiz

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Well you could go to site admin>appearance>html editor and untick/uncheck html editor -however that would change it for all of the site. As for you you can paste code into a text page (add a resource>compose a text page). Would it be any good if you got the pupils to click on code view in the html editor and just paste their code into there? Ot does that mess it up?
In reply to Linda Dimitrov

Re: using HTML in quiz

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'm afraid that is not currently possible. It should be, but it isn't. Sorry.
In reply to Linda Dimitrov

Re: using HTML in quiz

by Eoin Campbell -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
If you use the Opera browser to create/edit the questions, then Moodle displays all the form fields as plain text rather than rich-text fields.
So you could use your standard browser for normal work, but switch to Opera when you want to create or edit quiz questions.

Even with Opera, in all fields, you still have to escape the HTML start-tag opening delimiter (left angle bracket) using < though, which is a bit of a pain.

Your class could answer the questions using Opera too, but would also have to remember to escape the markup, but it sort of defeats the purpose to force them to do this, I imagine.

At the risk of repeating myself ad nauseam, I tested out my Word to Moodle XML converter (cf. www.moodle2word.net), and found that it does a nice job of retaining directly entered markup, because it wraps all the content of the Moodle Question XML <text> elements inside CDATA sections as part of the conversion process. So all HTML markup appears in Moodle exactly as you typed it in Word.

e.g. <text><![CDATA[<b>Bold</b>]]></text>
In reply to Eoin Campbell

Re: using HTML in quiz

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Eoin,
Sorry, but I do not understand how you would use the following:
e.g. <text><![CDATA[<b>Bold</b>]]></text>
Can you show us a concrete example of a question using this?
TIA
Jospeh
In reply to Joseph Rézeau

Re: using HTML in quiz

by Eoin Campbell -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Whoops, I think i should have typed
<text><![CDATA[&lt;b>Bold&lt;/b>]]></text>

Attached is a Moodle Question XML file which might demonstrate it more clearly.
In reply to Eoin Campbell

Re: using HTML in quiz

by Eoin Campbell -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Attached is the Word file I used to create the XML file, if you're interested. It's much less error-prone to write markup directly, than try and remember how much entity escaping to do in a form field.
In reply to Eoin Campbell

Re: using HTML in quiz

by Eoin Campbell -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
On further investigation, it seems to me that the Moodle Question XML import facility ignores the
<![CDATA[ section directive, so in fact, all HTML markup must be escaped using character entities, regardless of whether you enter it directly in a text field, or import if via XML.

So my XML file doesn't fully work - the Matching question contains unescaped markup for list elements, which is not handled properly on import.
In reply to Eoin Campbell

Re: using HTML in quiz

by Donna Hrynkiw -

> Even with Opera, in all fields, you still have to escape the HTML start-tag opening delimiter (left angle bracket) using &lt; though, which is a bit of a pain.

Thank-you Eoin, for including this tidbit of information in your reply. I have a faculty member tearing their hair out over matching and multiple-choice answers that become truncated whenever they included a left angle-bracket.

I would have expected the Moodle quiz editor to have taken left angle-bracket into account and deal with them appropriately.

In reply to Linda Dimitrov

Re: using HTML in quiz

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Linda,
Unfortunately you did not say which question type you want to use. Since you mention "I want the kids to be able to answer using code..." I expect you want to use short answer questions. Using current Moodle version 1.9 I find that it is quite possible to enter HTML code, so I do not understand your problem; could you please re-state your case? Thanks,
Joseph

Attachment image00.jpg
In reply to Joseph Rézeau

Re: using HTML in quiz

by Linda Dimitrov -
Hi Joseph,
Thanks for this. I was using the essay type question because I want to see what the student writes - to understand where problems might be, etc. Using the short answer option might work but I'd really like to find a way to get in and see what the student wrote if there was a mistake. Any suggestions on that?
Thanks again,
Linda
In reply to Linda Dimitrov

Re: using HTML in quiz

by Praveena K -

Even I am facing the same problem. When we give html tags as answer to questions, it doesnt display in internet explorer & mozilla.Please help me for a solution.