|
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->dirroot . '/mod/quiz/locallib.php'); 00030 00031 00044 abstract class quiz_access_rule_base { 00046 protected $quiz; 00048 protected $quizobj; 00050 protected $timenow; 00051 00057 public function __construct($quizobj, $timenow) { 00058 $this->quizobj = $quizobj; 00059 $this->quiz = $quizobj->get_quiz(); 00060 $this->timenow = $timenow; 00061 } 00062 00072 public static function make(quiz $quizobj, $timenow, $canignoretimelimits) { 00073 return null; 00074 } 00075 00083 public function prevent_new_attempt($numprevattempts, $lastattempt) { 00084 return false; 00085 } 00086 00093 public function prevent_access() { 00094 return false; 00095 } 00096 00103 public function is_preflight_check_required($attemptid) { 00104 return false; 00105 } 00106 00116 public function add_preflight_check_form_fields(mod_quiz_preflight_check_form $quizform, 00117 MoodleQuickForm $mform, $attemptid) { 00118 // Do nothing by default. 00119 } 00120 00134 public function validate_preflight_check($data, $files, $errors, $attemptid) { 00135 return $errors; 00136 } 00137 00144 public function notify_preflight_check_passed($attemptid) { 00145 // Do nothing by default. 00146 } 00147 00152 public function current_attempt_finished() { 00153 // Do nothing by default. 00154 } 00155 00163 public function description() { 00164 return ''; 00165 } 00166 00177 public function is_finished($numprevattempts, $lastattempt) { 00178 return false; 00179 } 00180 00189 public function time_left($attempt, $timenow) { 00190 return false; 00191 } 00192 00197 public function attempt_must_be_in_popup() { 00198 return false; 00199 } 00200 00205 public function get_popup_options() { 00206 return array(); 00207 } 00208 00216 public function setup_attempt_page($page) { 00217 // Do nothing by default. 00218 } 00219 00229 public function get_superceded_rules() { 00230 return array(); 00231 } 00232 00240 public static function add_settings_form_fields( 00241 mod_quiz_mod_form $quizform, MoodleQuickForm $mform) { 00242 // By default do nothing. 00243 } 00244 00249 public static function get_browser_security_choices() { 00250 return array(); 00251 } 00252 00259 public static function save_settings($quiz) { 00260 // By default do nothing. 00261 } 00262 00283 public static function get_settings_sql($quizid) { 00284 return array('', '', array()); 00285 } 00286 00294 public static function get_extra_settings($quizid) { 00295 return array(); 00296 } 00297 }