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.
15 * @package questionbank
16 * @subpackage questiontypes
18 class question_missingtype_qtype
extends default_questiontype
{
24 function menu_name() {
28 function is_usable_by_random() {
32 function print_question_formulation_and_controls(&$question, &$state, $cmoptions, $options) {
35 $answers = &$question->options
->answers
;
37 $formatoptions = new stdClass
;
38 $formatoptions->noclean
= true;
39 $formatoptions->para
= false;
42 $questiontext = format_text($question->questiontext
,
43 $question->questiontextformat
,
44 $formatoptions, $cmoptions->course
);
45 $image = get_question_image($question);
47 // Print each answer in a separate row if there are any
50 foreach ($answers as $answer) {
52 $a->text
= format_text("$answer->answer", FORMAT_MOODLE
, $formatoptions, $cmoptions->course
);
57 include("$CFG->dirroot/question/type/missingtype/display.html");
60 function grade_responses(&$question, &$state, $cmoptions) {
64 function display_question_editing_page(&$mform, $question, $wizardnow){
66 print_heading(get_string('warningmissingtype', 'quiz'));
72 //// END OF CLASS ////
74 //////////////////////////////////////////////////////////////////////////
75 //// INITIATION - Without this line the question type is not in use... ///
76 //////////////////////////////////////////////////////////////////////////
77 question_register_questiontype(new question_missingtype_qtype());