various formslib work including bug fixes for MDL-8039 id attribute collision between...
[moodle.git] / question / type / essay / edit_essay_form.php
CommitLineData
271ffe3f 1<?php
2/**
3 * Defines the editing form for the essay question type.
4 *
5 * @copyright &copy; 2007 Jamie Pratt
6 * @author Jamie Pratt me@jamiep.org
7 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
8 * @package questions
9 */
10
11/**
12 * essay editing form definition.
13 */
14class question_edit_essay_form extends question_edit_form {
15 /**
16 * Add question-type specific form fields.
17 *
18 * @param MoodleQuickForm $mform the form being built.
19 */
20 function definition_inner(&$mform) {
21 $mform->addElement('htmleditor', 'feedback', print_string("feedback", "quiz"));
22 $mform->setType('feedback', PARAM_RAW);
23
24 $mform->addElement('hidden', 'fraction', 0);
25 }
26
27 function set_defaults($question) {
28 if (isset($question->options)){
29 $question->feedback = $question->options->answer->feedback;
30 }
31 parent::set_defaults($question);
32 }
33
34 function qtype() {
35 return 'essay';
36 }
37
38
39}
40?>