Cannot make line break (enter) in quiz essay type textarea - Moodle 2.0

Cannot make line break (enter) in quiz essay type textarea - Moodle 2.0

by Jack Challenger -
Number of replies: 4

Hi all,

I have a random essay type quiz question, and had to disable TinyMCE, because random essay questions does not work with that yet (see bug MDL-26236 )

But now, when I just use the textarea, its impossible to make a linebreak, when you press enter, nothing happens.

All other textareas work, for example when I use an online assigment, etc...., only the essay type quiz question wont make a linebreak.

Could this be a bug? My moodle installation is pretty fresh (1 week old), so I doubt i could have mucked it up so quickly smile.

Anyway, I'll wait a bit before I file a bug, cos is it is, it would mean that random essay questions are not doable in Moodle 2.

Thanks!!

Average of ratings: -
In reply to Jack Challenger

Re: Cannot make line break (enter) in quiz essay type textarea - Moodle 2.0

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

Oops. enter not working in textareas is another bug (this JavaScript is broken https://github.com/moodle/moodle/blob/master/question/qengine.js).

In reply to Tim Hunt

Re: Cannot make line break (enter) in quiz essay type textarea - Moodle 2.0

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 reported this as MDL-26332. I think the requred fix is https://github.com/timhunt/moodle/commit/bb8f89675c6c205aa4e4064271182c6ec98ff503. Please could you try making that cange, and report whether it works. Thanks.

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

Re: Cannot make line break (enter) in quiz essay type textarea - Moodle 2.0

by Jack Challenger -

Works a charm. Thanks Tim!

Just one thing - you forgot to add a closing bracket here:

e.target.test('input[type=img]') && !e.target.test('textarea')) {

Thanks again!

In reply to Jack Challenger

Re: Cannot make line break (enter) in quiz essay type textarea - Moodle 2.0

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

Thanks, particularly for catching my typo. This fix should now be in next week's weekly build.