General developer forum

For Essay type question need to disable Editor after submiting the question in moodle quiz

 
Picture of shivapooja gouds
For Essay type question need to disable Editor after submiting the question in moodle quiz
 

For Essay type question there is no check if question behaviour is immediate feedback and layout as squential for this i have customised as keeping check and proceed to another but i strucked here need to disable the editor after student check that question.
Need a help on how to disable the editor and my editor is "Tiny Mce".

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: For Essay type question need to disable Editor after submiting the question in moodle quiz
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

When you create an essay question, there is an option for what type of input box to use. Set Response format: plain text.

And, if you want to see the code to create different types of editors, look to see how that option is implemented: https://github.com/moodle/moodle/blob/master/question/type/essay/renderer.php#L221

 
Average of ratings: -
Picture of shivapooja gouds
Re: For Essay type question need to disable Editor after submiting the question in moodle quiz
 

HI Tim,

This is not what am exactly looking for, Actually in quiz settings there is an option "Question Bheaviour". If we choose as an immediate feedback there is no check button  for essay questions. To avoid this we have coustomised such that to display check button for essay type too but where problem is  even after students checks the editor is allowing them to type content. but those shouldn't happens for student once students checks this the content should be the final thing. so i need to disable the editor or readonly position. 

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: For Essay type question need to disable Editor after submiting the question in moodle quiz
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

Essay qustions cannot use 'immediate feedback' because Moodle cannot grade the response. Therefore, whatever behaviour you select in the quiz settings, essay questions will use 'manual graded' behaviour (which is not an option in the UI, but exists behind the scenes.)

https://github.com/moodle/moodle/tree/master/question/behaviour/manualgraded

The way the code-flow works is that when a question is started, the question object is asked "This quiz wants to use X behaviour, please make an instance of the appropriate behaviour for your question type". For essay the logic is this:

https://github.com/moodle/moodle/blob/master/question/type/essay/question.php#L55

Here is another example of the kind of thing that can be done

https://github.com/moodle/moodle/blob/master/question/type/questionbase.php#L736

So, the correct way to implement what you are trying to do is to make a new behaviour "manualgraded_with_check". Then, change the make_behaviour method in the essay question type to use that behaviour, instead of manualgraded, when the preferred behaviour is one like immediate feedback.

(Probably the best way to determine "when the preferred behaviour is one like immediate feedback" is to call question_engine::can_questions_finish_during_the_attempt($preferredbehaviour).)

 
Average of ratings: -