I asked my students to type Java code in response to an AP style free response question. I used an Essay question on a Quiz for this. They repeatedly told me that much of their code was disappearing when they saved it.
Upon further investigation, I discovered that Moodle reads the "<" and ">" signs, and everything in between, as HTML tags. The problem only occurs when the HTML editor is turned off. It was my understanding that Moodle accepted only plain text at that point. Apparently, it still processes HTML tags.
As an example, a student who typed:
if(bob < 10)
if(sue > 10)
blah;
would end up with:
if(bob 10)
blah;
Turning the HTML editor on is a poor solution, since it is only used for the first of a series of Essay questions presented on the same page. Splitting the free response question onto multiple pages is not ideal.
Is there any way to force Moodle to treat input as plain text? Are there any alternative work arounds for this issue?
Brandon
Moodle reads Java code in Essay format questions as HTML tags
by Brandon Horn -
Number of replies: 3
In reply to Brandon Horn
Re: Moodle reads Java code in Essay format questions as HTML tags
by Martin Dougiamas -
Aren't you seeing a format menu under the textarea when the editor is switched off? The correct option in there is the "Plain text format" which won't do any reformatting. If this menu is not there then it may be a bug.
In reply to Martin Dougiamas
Re: Moodle reads Java code in Essay format questions as HTML tags
by Tim Hunt -
I think it may be a known bug that no-one has had time to fix. Search in the tracker.
In reply to Martin Dougiamas
Re: Moodle reads Java code in Essay format questions as HTML tags
by Brandon Horn -
Missing Format Menu
With the HTML editor off, no format menu is displayed anywhere that I've observed in the Quiz module. As mentioned, there's an unresolved issue related to the inconsistent display of the format menu.
http://tracker.moodle.org/browse/MDL-478
Quiz module inconsistently handles text with the HTML Editor off
When I enter the problematic text as an Introduction to a Quiz (with the HTML Editor off), it is interpreted and displayed correctly. When students enter the same text in response to an Essay question (with the HTML Editor off), it is interpreted incorrectly.
Brandon
With the HTML editor off, no format menu is displayed anywhere that I've observed in the Quiz module. As mentioned, there's an unresolved issue related to the inconsistent display of the format menu.
http://tracker.moodle.org/browse/MDL-478
Quiz module inconsistently handles text with the HTML Editor off
When I enter the problematic text as an Introduction to a Quiz (with the HTML Editor off), it is interpreted and displayed correctly. When students enter the same text in response to an Essay question (with the HTML Editor off), it is interpreted incorrectly.
Brandon