Merge branch 'MDL-70041-310' of git://github.com/mihailges/moodle into MOODLE_310_STABLE
[moodle.git] / question / type / missingtype / question.php
CommitLineData
d1b7e03d 1<?php
d1b7e03d
TH
2// This file is part of Moodle - http://moodle.org/
3//
4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16
d1b7e03d
TH
17/**
18 * Defines the 'qtype_missingtype' question definition class.
19 *
7764183a
TH
20 * @package qtype
21 * @subpackage missingtype
22 * @copyright 2009 The Open University
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
d1b7e03d
TH
24 */
25
26
a17b297d
TH
27defined('MOODLE_INTERNAL') || die();
28
97562c4d 29require_once($CFG->dirroot . '/question/type/questionbase.php');
a17b297d 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 41 */
2b7c9bd2
TH
42class qtype_missingtype_question extends question_definition
43 implements question_automatically_gradable {
d1b7e03d
TH
44 public function get_expected_data() {
45 return array();
46 }
47
48 public function get_correct_response() {
49 return array();
50 }
51
52 public function is_complete_response(array $response) {
53 return false;
54 }
55
56 public function is_gradable_response(array $response) {
57 return false;
58 }
59
60 public function get_validation_error(array $response) {
61 return '';
62 }
63
64 public function is_same_response(array $prevresponse, array $newresponse) {
65 return true;
66 }
67
68 public function get_right_answer_summary() {
69 return '';
70 }
71
72 public function summarise_response(array $response) {
73 return null;
74 }
75
5c0654d7
SL
76 public function un_summarise_response(string $response) {
77 return [];
78 }
79
d1b7e03d
TH
80 public function classify_response(array $response) {
81 return array();
82 }
83
1da821bb 84 public function start_attempt(question_attempt_step $step, $variant) {
2b7c9bd2
TH
85 throw new coding_exception('This question is of a type that is not installed ' .
86 'on your system. No processing is possible.');
d1b7e03d
TH
87 }
88
89 public function grade_response(array $response) {
2b7c9bd2
TH
90 throw new coding_exception('This question is of a type that is not installed ' .
91 'on your system. No processing is possible.');
d1b7e03d
TH
92 }
93
94 public function get_hint($hintnumber, question_attempt $qa) {
95 return null;
96 }
97}