7 /// QUESTION TYPE CLASS //////////////////
10 * Missing question type class
12 * When a question is encountered with a type that is not installed then its
13 * type is changed to 'missingtype'. This questiontype just makes sure that the
14 * necessary information is printed about the question.
16 class question_missingtype_qtype
extends default_questiontype
{
22 function menu_name() {
26 function is_usable_by_random() {
30 function print_question_formulation_and_controls(&$question, &$state, $cmoptions, $options) {
33 $answers = &$question->options
->answers
;
35 $formatoptions = new stdClass
;
36 $formatoptions->noclean
= true;
37 $formatoptions->para
= false;
40 $questiontext = format_text($question->questiontext
,
41 $question->questiontextformat
,
42 $formatoptions, $cmoptions->course
);
43 $image = get_question_image($question, $cmoptions->course
);
45 // Print each answer in a separate row if there are any
48 foreach ($answers as $answer) {
50 $a->text
= format_text("$answer->answer", FORMAT_MOODLE
, $formatoptions, $cmoptions->course
);
55 include("$CFG->dirroot/question/type/missingtype/display.html");
58 function grade_responses(&$question, &$state, $cmoptions) {
62 function display_question_editing_page(&$mform, $question, $wizardnow){
64 print_heading(get_string('warningmissingtype', 'quiz'));
70 //// END OF CLASS ////
72 //////////////////////////////////////////////////////////////////////////
73 //// INITIATION - Without this line the question type is not in use... ///
74 //////////////////////////////////////////////////////////////////////////
75 question_register_questiontype(new question_missingtype_qtype());