diff --git a/mod/quiz/mod.html b/mod/quiz/mod.html index 21d6992bf43..9b19f92b86a 100644 --- a/mod/quiz/mod.html +++ b/mod/quiz/mod.html @@ -3,7 +3,8 @@ dirroot/mod/quiz/locallib.php"); -/// Ensure that all form variables are initialized + + // Set any form variables that have not been initialized to their default value. if (!isset($form->name)) { $form->name = ""; } @@ -67,10 +68,9 @@ if (empty($form->timedue)) { $form->timedue = ""; } - //enforced time delay between quiz attempts add-on + //enforced time delay between quiz attempts //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; } @@ -78,14 +78,9 @@ $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(get_string("no"), get_string("yes")); - // 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")); @@ -185,212 +180,18 @@ -quiz_fix_timelimit) { ?> - - : - - timelimit) echo 'checked="checked"' ?> /> - - - - - - +quiz_fix_questionsperpage) { ?> - - : - - questionsperpage, ''); - helpbutton('questionsperpage', get_string('questionsperpage', 'quiz'), 'quiz'); - ?> - - - + print_standard_coursemodule_settings($form); -quiz_fix_shufflequestions) { ?> - - : - - shufflequestions", ""); - helpbutton("shufflequestions", get_string("shufflequestions","quiz"), "quiz"); - ?> - - - - -quiz_fix_shuffleanswers) { ?> - - : - - shuffleanswers", ""); - helpbutton("shufflewithin", get_string("shufflewithin","quiz"), "quiz"); - ?> - - - - -quiz_fix_attempts) { ?> - - : - - attempts", ""); - helpbutton("attempts", get_string("attemptsallowed","quiz"), "quiz"); - ?> - - - - -quiz_fix_attemptonlast) { ?> - - : - - attemptonlast", ""); - helpbutton("repeatattempts", - get_string("eachattemptbuildsonthelast", "quiz"), - "quiz"); - ?> - - - - -quiz_fix_grademethod) { ?> - - : - - grademethod", ""); - helpbutton("grademethod", get_string("grademethod","quiz"), "quiz"); - ?> - - - - -quiz_fix_adaptive) { ?> - - : - - optionflags & QUESTION_ADAPTIVE) ? 1 : 0, ""); - helpbutton("adaptive", get_string("adaptive","quiz"), "quiz"); - ?> - - - - -quiz_fix_penaltyscheme) { ?> - - : - - penaltyscheme", ""); - helpbutton("penaltyscheme", get_string("penaltyscheme","quiz"), "quiz"); - ?> - - - - -quiz_fix_decimalpoints) { ?> - - : - - decimalpoints", ""); - helpbutton("decimalpoints", get_string("decimaldigits","quiz"), "quiz"); - ?> - - - - -quiz_fix_review) { - echo ''; - include($CFG->dirroot . '/mod/quiz/reviewoptions.html'); - echo ''; -} else $fix=1 ?> - -quiz_fix_popup) { ?> - - : - - popup", ""); - helpbutton("popup", get_string("popup","quiz"), "quiz"); - ?> - - - - -quiz_fix_delay1) { ?> - - : - - delay1", ""); - helpbutton("timedelay1", get_string("delay1","quiz"), "quiz"); - ?> - - - - -quiz_fix_delay2) { ?> - - : - - delay2", ""); - helpbutton("timedelay2", get_string("delay2","quiz"), "quiz"); - ?> - - - - -quiz_fix_password) { ?> - - : - - - - - - - -quiz_fix_subnet) { ?> - - : - - - - - - - - - - - - - + if ($fix) { + // Some options were fixed by the admin. Show them, but hidden behind an Advanced button. +?> : - -
- -quiz_fix_timelimit) { ?> - - - - - - -quiz_fix_questionsperpage) { ?> - - - - - - -quiz_fix_shufflequestions) { ?> - - - - - - -quiz_fix_shuffleanswers) { ?> - - - - - - -quiz_fix_attempts) { ?> - - - - - -quiz_fix_attemptonlast) { ?> - - - - - -quiz_fix_grademethod) { ?> - - - - - - -quiz_fix_adaptive) { $fix = 1; ?> - - - - - - -quiz_fix_penaltyscheme) { $fix = 1; ?> - - - - - - -quiz_fix_decimalpoints) { ?> - - - - - - -quiz_fix_review) { - echo ''; - include($CFG->dirroot . '/mod/quiz/reviewoptions.html'); - echo ''; -} ?> - -quiz_fix_delay1) { ?> - - - - - - -quiz_fix_delay2) { ?> - - - - - - -quiz_fix_popup) { ?> - - - - - - -quiz_fix_password) { ?> - - - - - - -quiz_fix_subnet) { ?> - - - - - - - - +
: - timelimit) echo 'checked="checked"' ?> /> - - - -
: - questionsperpage, ''); - helpbutton('questionsperpage', get_string('questionsperpage'), 'quiz'); - ?> -
: - shufflequestions", ""); - helpbutton("shufflequestions", get_string("shufflequestions","quiz"), "quiz"); - ?> -
: - shuffleanswers", ""); - helpbutton("shufflewithin", get_string("shufflewithin","quiz"), "quiz"); - ?> -
: - attempts", ""); - helpbutton("attempts", get_string("attemptsallowed","quiz"), "quiz"); - ?> -
: - attemptonlast", ""); - helpbutton("repeatattempts", - get_string("eachattemptbuildsonthelast", "quiz"), - "quiz"); - ?> -
: - grademethod", ""); - helpbutton("grademethod", get_string("grademethod","quiz"), "quiz"); - ?> -
: - optionflags & QUESTION_ADAPTIVE) ? 1 : 0, ""); - helpbutton("adaptive", get_string("adaptive","quiz"), "quiz"); - ?> -
: - penaltyscheme", ""); - helpbutton("penaltyscheme", get_string("penaltyscheme","quiz"), "quiz"); - ?> -
: - decimalpoints", ""); - helpbutton("decimalpoints", get_string("decimaldigits","quiz"), "quiz"); - ?> -
: - delay1", ""); - helpbutton("timedelay1", get_string("delay1","quiz"), "quiz"); - ?> -
: - delay2", ""); - helpbutton("timedelay2", get_string("delay2","quiz"), "quiz"); - ?> -
: - popup", ""); - helpbutton("popup", get_string("popup","quiz"), "quiz"); - ?> -
: - - -
: - - -
- @@ -664,16 +267,236 @@ wwwroot/mod/quiz/edit.php?quizid=$form->instance") ?>" /> " /> -" /> +" /> -" /> +" /> + + + +quiz_fix_timelimit == $showfixed) { ?> + + : + + timelimit) echo 'checked="checked"' ?> /> + + + + + + + +quiz_fix_questionsperpage == $showfixed) { ?> + + : + + questionsperpage, ''); + helpbutton('questionsperpage', get_string('questionsperpage', 'quiz'), 'quiz'); + ?> + + + + +quiz_fix_shufflequestions == $showfixed) { ?> + + : + + shufflequestions", ""); + helpbutton("shufflequestions", get_string("shufflequestions","quiz"), "quiz"); + ?> + + + + +quiz_fix_shuffleanswers == $showfixed) { ?> + + : + + shuffleanswers", ""); + helpbutton("shufflewithin", get_string("shufflewithin","quiz"), "quiz"); + ?> + + + + +quiz_fix_attempts == $showfixed) { ?> + + : + + attempts", ""); + helpbutton("attempts", get_string("attemptsallowed","quiz"), "quiz"); + ?> + + + + +quiz_fix_attemptonlast == $showfixed) { ?> + + : + + attemptonlast", ""); + helpbutton("repeatattempts", + get_string("eachattemptbuildsonthelast", "quiz"), + "quiz"); + ?> + + + + +quiz_fix_grademethod == $showfixed) { ?> + + : + + grademethod", ""); + helpbutton("grademethod", get_string("grademethod","quiz"), "quiz"); + ?> + + + + +quiz_fix_adaptive == $showfixed) { ?> + + : + + optionflags & QUESTION_ADAPTIVE) ? 1 : 0, ""); + helpbutton("adaptive", get_string("adaptive","quiz"), "quiz"); + ?> + + + + +quiz_fix_penaltyscheme == $showfixed) { ?> + + : + + penaltyscheme", ""); + helpbutton("penaltyscheme", get_string("penaltyscheme","quiz"), "quiz"); + ?> + + + + +quiz_fix_decimalpoints == $showfixed) { ?> + + : + + decimalpoints", ""); + helpbutton("decimalpoints", get_string("decimaldigits","quiz"), "quiz"); + ?> + + + + +quiz_fix_review == $showfixed) { + echo ''; + include($CFG->dirroot . '/mod/quiz/reviewoptions.html'); + echo ''; + $output = true; +} ?> + +quiz_fix_popup == $showfixed) { ?> + + : + + popup", ""); + helpbutton("popup", get_string("popup","quiz"), "quiz"); + ?> + + + + +quiz_fix_delay1 == $showfixed) { ?> + + : + + delay1", ""); + helpbutton("timedelay1", get_string("delay1","quiz"), "quiz"); + ?> + + + + +quiz_fix_delay2 == $showfixed) { ?> + + : + + delay2", ""); + helpbutton("timedelay2", get_string("delay2","quiz"), "quiz"); + ?> + + + + +quiz_fix_password == $showfixed) { ?> + + : + + + + + + + +quiz_fix_subnet == $showfixed) { ?> + + : + + + + + + +