Permalink
Browse files

MDL-12797 - Site-wide quiz default time-limit was not working. The de…

…fault was being used, but the enabled state was not being initialised correctly for the form field.
  • Loading branch information...
tjhunt
tjhunt committed Aug 13, 2008
1 parent 6d139a2 commit 847bb2fd19c10b0679e8e64a7400a48291ba3d67
Showing with 4 additions and 5 deletions.
  1. +4 −5 mod/quiz/mod_form.php
View
@@ -43,6 +43,7 @@ function definition() {
$mform->setAdvanced('timelimitgrp', $CFG->quiz_fix_timelimit);
$mform->setHelpButton('timelimitgrp', array("timelimit", get_string("quiztimer","quiz"), "quiz"));
$mform->setDefault('timelimit', $CFG->quiz_timelimit);
+ $mform->setDefault('timelimitenable', !empty($CFG->quiz_timelimit));
//enforced time delay between quiz attempts add-on
@@ -252,12 +253,10 @@ function data_preprocessing(&$default_values){
}
$key++;
}
-
}
- if (empty($default_values['timelimit'])) {
- $default_values['timelimitenable'] = 0;
- } else {
- $default_values['timelimitenable'] = 1;
+
+ if (isset($default_values['timelimit'])) {
+ $default_values['timelimitenable'] = $default_values['timelimit'] > 0;
}
if (isset($default_values['review'])){

0 comments on commit 847bb2f

Please sign in to comment.