Disabling HTML in quiz responses

Disabling HTML in quiz responses

by Stephanie Jones -
Number of replies: 7

I'm a TA in a Intro to programming course. We are now up to the point where the kids are expected to be able to write some code as answers to quiz questions. However any time they enter the < symbol, Moodle assumes they want to use HTML tags.

So if they write something like "if (i < 5)", all I see as a submitted answer is "if ( i".

Is there a way to disable this?

Average of ratings: -
In reply to Stephanie Jones

Re: Disabling HTML in quiz responses

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Which question type? I assume essay.

The best thing is to just do one question per page, so you get the HTML editor, which correctly escapes <

In reply to Tim Hunt

Re: Disabling HTML in quiz responses

by Stephanie Jones -

Yes, you are correct to assume the essay question type.

Our students have reported that the HTML editor does not show up if they are using Safari. Is there another option that is not "make them use Firefox"?

In reply to Stephanie Jones

Re: Disabling HTML in quiz responses

by ben reynolds -

Not Chrome. It uses the same inferior rendering engine as Safari.

In reply to ben reynolds

Re: Disabling HTML in quiz responses

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Nothing inferior about Webkit these days. The thing that is really inferior is the HTML editor in Moodle up to 1.9. Moodle 2.0 uses TinyMCE, which works in many more browsers. Of course, there are still mobile phone broswers where that does not work.

Basically there is no good way to handle plain text with < symbols on those browsers at the moment. I feel that the essay questiontype is overdue some love. There are lots of minor features like this that would be relatively easy to do if someone just sat down for a week or two to work on it. For example, I would like to add:

  1. Way for the question creator to choose the size of the answer box (MDL-6535)
  2. Let the question creator choose whether the essay question uses the HTML editor or plain text (MDL-10861)
  3. Let the question creator imput some information that is displaid on the manual grading page to help the person doing the grading. (MDL-11080)
  4. (This one is hard, but is on the OU's todo list) Let student's embed images or attach files to essay questions. (MDL-8229)

Once you have done 4, so question answers can have files associated with them, then it opens the way for other cool manually graded question types, like "record some audio" or "paint a picture".

Average of ratings: Useful (2)
In reply to Tim Hunt

Re: Disabling HTML in quiz responses

by Jean-Michel Védrine -

Hello to all,

for 4. wasn't this exactly the goal of the contributed fileresponse questiontype coded a few years ago during GSOC ? I have never used it and maybe it's no more working with current 1.9 Moodle version (it's surely not working with 2.0 !) ?

As I said I have never used it so maybe I didn't understood welll what fileresponse was doing.

In reply to Jean-Michel Védrine

Re: Disabling HTML in quiz responses

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Right, fileresponse sort-of worked in 1.9, except for some of the bits that didn't, like backing up and restoring quiz attempts. It really needs more support in the core of the question system.

Because of the file API changes in Moodle 2.0 it will be really hard to get the file response question type working there. I think it will have to wait until I get the new question engine into Moodle 2.1, then we can enhance the new question engine to handle files in quiz response data, then we can implement the file response question type properly. Except that as was discussed at the time, having it as a separate question type does not really make sense. It works better as an enhancement to the essay type.