dirroot/mod/quiz/locallib.php"); /// Ensure that all form variables are initialized if (!isset($form->name)) { $form->name = ""; } if (!isset($form->intro)) { $form->intro = ""; } if (!isset($form->timeopen)) { $form->timeopen = ""; } if (!isset($form->timeclose)) { $form->timeclose = ""; } if (!isset($form->attempts)) { $form->attempts = $CFG->quiz_attempts; } if (!isset($form->attemptonlast)) { $form->attemptonlast = $CFG->quiz_attemptonlast; } if (!isset($form->grademethod)) { $form->grademethod = $CFG->quiz_grademethod; } if (!isset($form->decimalpoints)) { $form->decimalpoints = $CFG->quiz_decimalpoints; } if (!isset($form->review)) { $form->review = $CFG->quiz_review; } if (!isset($form->questionsperpage)) { $form->questionsperpage = $CFG->quiz_questionsperpage; } if (!isset($form->shufflequestions)) { $form->shufflequestions = $CFG->quiz_shufflequestions; } if (!isset($form->shuffleanswers)) { $form->shuffleanswers = $CFG->quiz_shuffleanswers; } if (!isset($form->grade)) { $form->grade = $CFG->quiz_maximumgrade; } if (!isset($form->questions)) { $form->questions = ""; } if (!isset($form->password)) { $form->password = $CFG->quiz_password; } if (!isset($form->subnet)) { $form->subnet = $CFG->quiz_subnet; } if (!isset($form->timelimit)) { $form->timelimit = $CFG->quiz_timelimit; } if (!isset($form->popup)) { $form->popup = $CFG->quiz_popup; } if (!isset($form->optionflags)) { $form->optionflags = $CFG->quiz_optionflags; } if (!isset($form->penaltyscheme)) { $form->penaltyscheme = $CFG->quiz_penaltyscheme; } if (empty($form->timedue)) { $form->timedue = ""; } //enforced time delay between quiz attempts add-on //delay1: time delay between first and second attempt //delay2: time delay between second and additional quiz attempt //enforced delay attempt between quiz if (!isset($form->delay1)) { $form->delay1 = $CFG->quiz_delay1; } if (!isset($form->delay2)) { $form->delay2 = $CFG->quiz_delay2; } $fix = 0; // This will later be set to 1 if some of the variables have been fixed by the admin. // the following are used for drop-down menus $yesnooptions = array(); $yesnooptions[0] = get_string("no"); $yesnooptions[1] = get_string("yes"); $attemptoptions = array(); $attemptoptions[0] = get_string("attemptsunlimited", "quiz"); $attemptoptions[1] = "1 ".strtolower(get_string("attempt", "quiz")); for ($i=2;$i<=6;$i++) { $attemptoptions[$i] = "$i ".strtolower(get_string("attempts", "quiz")); } //enforced time delay between quiz attempts add-on $timedelayoptions = array(); $timedelayoptions[0] = get_string('none'); $timedelayoptions[1800] = get_string('numminutes', '', 30); $timedelayoptions[3600] = get_string('numminutes', '', 60); for($i=2; $i<=23; $i++) { $seconds = $i*3600; $timedelayoptions[$seconds] = get_string('numhours', '', $i); } $timedelayoptions[86400] = get_string('numhours', '', 24); for($i=2; $i<=7; $i++) { $seconds = $i*86400; $timedelayoptions[$seconds] = get_string('numdays', '', $i); } ?>