MDL-20636 Fix @package names in question/behaviour, question/engine and question...
[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 *
32d8935c
TH
22 * @package qtype
23 * @subpackage description
d1b7e03d
TH
24 * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
25 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
7375c542 26 */
516cf3eb 27
d1b7e03d 28require_once($CFG->libdir . '/questionlib.php');
271e6dec 29
d1b7e03d
TH
30/**
31 * The description 'question' type.
32 *
33 * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
34 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
35 */
36class qtype_description extends question_type {
32d8935c 37 public function is_real_question_type() {
f29aeb5a
TH
38 return false;
39 }
40
d1b7e03d 41 public function is_usable_by_random() {
b974f947 42 return false;
43 }
44
d1b7e03d 45 public function can_analyse_responses() {
a2156789 46 return false;
47 }
516cf3eb 48
32d8935c 49 public function save_question($question, $form) {
bfbafdfe 50 // Make very sure that descriptions can'e be created with a grade of
51 // anything other than 0.
d1b7e03d 52 $form->defaultmark = 0;
32d8935c 53 return parent::save_question($question, $form);
516cf3eb 54 }
55
d1b7e03d
TH
56 public function actual_number_of_questions($question) {
57 /// Used for the feature number-of-questions-per-page
58 /// to determine the actual number of questions wrapped
59 /// by this question.
60 /// The question type description is not even a question
61 /// in itself so it will return ZERO!
516cf3eb 62 return 0;
63 }
64
d1b7e03d
TH
65 public function get_random_guess_score($questiondata) {
66 return null;
516cf3eb 67 }
516cf3eb 68}