MDL-20636 Add all the new styles to the base theme.
[moodle.git] / question / type / description / questiontype.php
CommitLineData
aeb15530 1<?php
516cf3eb 2
d1b7e03d
TH
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
516cf3eb 18
1976496e 19/**
d1b7e03d 20 * Question type class for the description 'question' type.
b974f947 21 *
d1b7e03d
TH
22 * @package qtype_description
23 * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
24 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
7375c542 25 */
516cf3eb 26
d1b7e03d 27require_once($CFG->libdir . '/questionlib.php');
271e6dec 28
d1b7e03d
TH
29/**
30 * The description 'question' type.
31 *
32 * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
33 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
34 */
35class qtype_description extends question_type {
f29aeb5a
TH
36 function is_real_question_type() {
37 return false;
38 }
39
d1b7e03d 40 public function is_usable_by_random() {
b974f947 41 return false;
42 }
43
d1b7e03d 44 public function can_analyse_responses() {
a2156789 45 return false;
46 }
516cf3eb 47
d1b7e03d 48 public function save_question($question, $form, $course) {
bfbafdfe 49 // Make very sure that descriptions can'e be created with a grade of
50 // anything other than 0.
d1b7e03d
TH
51 $form->defaultmark = 0;
52 return parent::save_question($question, $form, $course);
bfbafdfe 53 }
54
d1b7e03d
TH
55 public function get_question_options(&$question) {
56 // No options to be restored for this question type
516cf3eb 57 return true;
58 }
59
d1b7e03d
TH
60 public function save_question_options($question) {
61 /// No options to be saved for this question type:
516cf3eb 62 return true;
63 }
64
d1b7e03d
TH
65 public function actual_number_of_questions($question) {
66 /// Used for the feature number-of-questions-per-page
67 /// to determine the actual number of questions wrapped
68 /// by this question.
69 /// The question type description is not even a question
70 /// in itself so it will return ZERO!
516cf3eb 71 return 0;
72 }
73
d1b7e03d
TH
74 public function get_random_guess_score($questiondata) {
75 return null;
516cf3eb 76 }
516cf3eb 77}