Pre-populated answer (template) in essay questions
Description
Testing Instructions
Test upgrade
Test that new fields responsetemplate and responsetemplateformat are correctly created in the qtype_essay_options table and that these fields are correctly populated with empty string and 1 for existing essay questions.
Test that existing essay questions continue to work as before and that the answer field is empty when attempt starts.
Test new functionalities
Edit an existing essay question and put some text in the response template field. Verify that for new attempts the text is displayed in the answer field when the attempt is started.
Create a new essay question with some text in the response template field. Verify that the text is displayed in the answer field when the attempt is started.
Try to include some HTML formatting in the response template when creating/editing an essay question selecting HTML Editor as response format and verify the text is correctly displayed during attempt in the answer editor
Verify that the filepicker is not available for the response template when creating/editing an essay question
Test correct behaviour during attempts
Create a quiz with 2 questions (each question on a separate page) : first question is a non essay question and second question is an essay question with some text in the response template.
Attempt the quiz as a student and submit without going to the second page. Verify that on the summary page the question is marked as not yet answered. After clicking on submit all and finish verify that for the student when you review your attempt the answer to the essay question is blank and that the attempt has been automatically graded. Then login as a teacher and verify that the essay question is not marked as needing grading.
Attempt the quiz as a student and go on each page, verify that on page 2 the essay question is correctly displayed with the response template in the answer field, but don't change anything. Verify that on the summary page the essay question is marked as not yet answered. After clicking on submit all and finish verify that for the student when you review your attempt the answer to the essay question is blank and the attempt has been automatically graded. Then login as a teacher and verify that the essay question is not marked as needing grading.
Attempt the quiz as a student and completely change the answer to the essay question. Verify that you new response has been submitted as response to the essay question and that when the student review this attempt it is marked as not yet graded. Then login as a teacher and verify that the attempt is marked as needing manual grading.
Attempt the quiz and modify slightly the text of the template in the answer field of the essay question. Verify that your modification has been saved correctly when you change page and return to the essay question page. Verify that it has also been submitted as answer to the essay question when the attempt is submitted and that when you login as a teacher the attempt is marked as needing manual grading.
Import/Export
Try to import an old (exported before this issue is integrated) Moodle XML file with essay questions. Verify the responsetemplate and responsetemplateformat are correctly populated by empty string and 1 and that no error or warning is displayed during import.
Export a category with some essay questions (both with nothing in responseformat and with some content in responseformat) using Moodle XML format. Verify that the new informations are present in the XML.
Import these questions in another category and verify that responsetemplate is correctly imported and no error or warning is displayed during import.
Backup/Restore
Create a quiz with all questions from a category containing essay questions (both with nothing in responseformat and with some content in responseformat) verify that no information is lost when the backup is restored.
Try to restore an 1.9 course backup with some essay questions and verify that essay questions are correctly restored with empty string as responsetemplate and 1 as responsetemplateformat.
Automated test results
Pre-check results
Workaround
Discovered while testing
has been marked as being related by
Activity
thanks to Tim Hunt for pointing out better location is http://docs.moodle.org/25/en/Essay_question_type
Removing docs_required label as this is documented here http://docs.moodle.org/25/en/Building_Quiz
(thanks, seems we've got it in hand in other issues )
Did you remember to call thankDevelopers() for 'this_weeks_work'? Defaulting to PARAM_SHODDY thanking.
line 1289 of \lib\changes.php: call to debugging()
line 281 of \lib\are.php: call to moodleform->detectMissingThanks()
line 202 of \lib\now.php: call to moodleform->_is_poor_form()
line 73 of \course\upstream.php: call to moodleform->forgetingToThank()
Thanks Mark, Dan and Tim,
You can't guess how happy I am that his is now part of Moodle just in time for 2.5 freeze even if I didn't get Dan's funny message ("Did you remember to call thankDevelopers() for 'this_weeks_work ...") for this one (fortunately I got it for https://moodle.atlassian.net/browse/MDL-38808#icft=MDL-38808).
I have created https://moodle.atlassian.net/browse/MDL-38981#icft=MDL-38981 to take care of the problem with responsetemplateformat value when restoring 1.9 backup.
Details
Details
Priority
Components
Assignee
Reporter
Peer reviewer
Integrator
Fix versions
Tester
Participants
Pull from Repository
Pull Main Diff URL
Pull Main Branch
Clockify
Start / Stop
Clockify

A pre-populated essay question allows teachers to pre-populate the "Answer" area of the essay question (i.e., the html area in which the student types) with arbitrary html. For example, the teacher could insert an empty table that students fill in.
This could be a new feature of the existing Essay question type or an altogether new question type.
There have been numerous requests for special question types (e.g., for accounting) that would be satisfied by this simple feature.