MDL-20636 Fix 30 TODOs
[moodle.git] / question / type / missingtype / question.php
CommitLineData
d1b7e03d
TH
1<?php
2
3// This file is part of Moodle - http://moodle.org/
4//
5// Moodle is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// Moodle is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
17
d1b7e03d
TH
18/**
19 * Defines the 'qtype_missingtype' question definition class.
20 *
7764183a
TH
21 * @package qtype
22 * @subpackage missingtype
23 * @copyright 2009 The Open University
24 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
d1b7e03d
TH
25 */
26
27
a17b297d
TH
28defined('MOODLE_INTERNAL') || die();
29
30
d1b7e03d
TH
31/**
32 * This question definition class is used when the actual question type of this
33 * question cannot be found.
34 *
35 * Why does this this class implement question_automatically_gradable? I am not
36 * sure at the moment. Perhaps it is important for it to work with as many
37 * behaviours as possible.
38 *
7764183a
TH
39 * @copyright 2009 The Open University
40 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
d1b7e03d
TH
41 */
42class qtype_missingtype_question extends question_definition implements question_automatically_gradable {
43 public function get_expected_data() {
44 return array();
45 }
46
47 public function get_correct_response() {
48 return array();
49 }
50
51 public function is_complete_response(array $response) {
52 return false;
53 }
54
55 public function is_gradable_response(array $response) {
56 return false;
57 }
58
59 public function get_validation_error(array $response) {
60 return '';
61 }
62
63 public function is_same_response(array $prevresponse, array $newresponse) {
64 return true;
65 }
66
67 public function get_right_answer_summary() {
68 return '';
69 }
70
71 public function summarise_response(array $response) {
72 return null;
73 }
74
75 public function classify_response(array $response) {
76 return array();
77 }
78
79 public function init_first_step(question_attempt_step $step) {
80 }
81
82 public function grade_response(array $response) {
88f0eb15 83 throw new coding_exception('This question is of a type that is not installed on your system. No processing is possible.');
d1b7e03d
TH
84 }
85
86 public function get_hint($hintnumber, question_attempt $qa) {
87 return null;
88 }
89}