No HTML editor appears when having more than one essay question

No HTML editor appears when having more than one essay question

by Mohammad Jahama -
Number of replies: 9

Hello,

the quiz I created consists of 2 essay questions. the first one appears with a HTML editor while the second does not (see the image-link below).
Aslo the problem persists when having more than 2 essay questions ( one with a HTML editor while the other two without)

Iam using Moodle 1.81

Any ideas??
Many thanks

http://img297.imageshack.us/my.php?image=quizquizzd7.jpg

Average of ratings: -
In reply to Mohammad Jahama

Re: No HTML editor appears when having more than one essay question

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
See this discussion.
Joseph
In reply to Joseph Rézeau

Re: No HTML editor appears when having more than one essay question

by A. T. Wyatt -
I have a serious problem with lacking the toolbar on any but the first essay question. I teach web design, and my students cannot put any kind of tags in to answer questions without being able to use the preformat (whether selected from the dropdown box or added manually in the code view).

Sometimes, I just can't think of a way for them to answer a question without generating some code on their side!

However, I realize that people were having problems with IE and multiple editors so the fix was to not have the subsequent editors activated. I guess you can't have it both ways. Sigh.

I guess I will just have some paper and pencil tests. But I wanted to at least point out one situation in which it was actually needful to have multiple editors! We tried a lot of ways to get around it, and nothing worked.

atw
In reply to A. T. Wyatt

Re: No HTML editor appears when having more than one essay question

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
ATW - The only way to avoid the pencil and paper then would be to set the quiz up as one question per page which would prevent more than one HTML editor from being on the page. Just figured I would mention this as a possible (while in no way an ideal) workaround. Peace - Anthony
In reply to Anthony Borrow

Re: No HTML editor appears when having more than one essay question

by A. T. Wyatt -
I did think of it! But I thought it might have been confusing since most of the tests present as a single page and there are usually a mix of essay and other types of questions. Maybe I will get more clever asking the questions! smile

atw
In reply to A. T. Wyatt

Re: No HTML editor appears when having more than one essay question

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The current situation is a horrible compromise that probably needs to be revisited one day. Hopefully one day we will actually replace HTML Area with a stable and supported HTML editor.

Anyway, in the mean time, it is easy to tweak the code in question/type/essay.php, method print_question_formuation_and_controls. If you want the HTML editor used for all question, delete the line
 $htmleditorused = true;
near the end of the method.
Average of ratings: Useful (1)
In reply to Tim Hunt

Re: No HTML editor appears when having more than one essay question

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Tim,

Your workaround does work, but wouldn't you agree that it sounds rather counter-intuitive to have to delete (or comment out) a line such as " $htmleditorused = true;" in order to have the HTML editor available for all of the essay questions on the page?

Actually, the whole passage below does not make sense to me (but maybe my "ordinary logic" is not "computer logic"):

 if ($usehtmleditor) {
 use_html_editor($inputname);
 $htmleditorused = true;
 }

Yours puzzled thoughtful,

Joseph

In reply to Tim Hunt

Re: No HTML editor appears when having more than one essay question

by Manuel de la Torre -
Tim,

How can I disable the HTML editor for all essay questions? I am using Moodle 1.8.3+.

Thanks,

Manuel.
In reply to Manuel de la Torre

Re: No HTML editor appears when having more than one essay question

by Stephen Barker -

Dear Manuel,

I have just found your post when looking up about the html editor and briefly looked at the code (moodle/question/type/essay/questiontype.php); to turn off the html editor completely change the line

static $htmleditorused = false ;

to

static $htmleditorused = true ;

then it assumes that it has already been used once.  Probably not the best way to do it but it works (in 1.8 - waiting until the summer holidays to upgrade to 1.9!) and is quick!

Steve