|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 // This file is part of Moodle - http://moodle.org/ 00003 // 00004 // Moodle is free software: you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation, either version 3 of the License, or 00007 // (at your option) any later version. 00008 // 00009 // Moodle is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 00016 00027 defined('MOODLE_INTERNAL') || die(); 00028 00029 require_once($CFG->libdir . '/questionlib.php'); 00030 00031 00038 class qtype_description extends question_type { 00039 public function is_real_question_type() { 00040 return false; 00041 } 00042 00043 public function is_usable_by_random() { 00044 return false; 00045 } 00046 00047 public function can_analyse_responses() { 00048 return false; 00049 } 00050 00051 public function save_question($question, $form) { 00052 // Make very sure that descriptions can'e be created with a grade of 00053 // anything other than 0. 00054 $form->defaultmark = 0; 00055 return parent::save_question($question, $form); 00056 } 00057 00058 public function actual_number_of_questions($question) { 00064 return 0; 00065 } 00066 00067 public function get_random_guess_score($questiondata) { 00068 return null; 00069 } 00070 }