Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 847bb2fd19c10b0679e8e64a7400a48291ba3d67 1 parent 6d139a2
tjhunt authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 mod/quiz/mod_form.php
View
9 mod/quiz/mod_form.php
@@ -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'])){
Please sign in to comment.
Something went wrong with that request. Please try again.