]> git.mjollnir.org Git - moodle.git/commitdiff
fix for MDL-7395, adding capaiblity mod/quiz:ignoretimelimits for quiz takers with...
authortoyomoyo <toyomoyo>
Thu, 23 Nov 2006 07:52:54 +0000 (07:52 +0000)
committertoyomoyo <toyomoyo>
Thu, 23 Nov 2006 07:52:54 +0000 (07:52 +0000)
lang/en_utf8/quiz.php
lib/db/upgrade.php
mod/quiz/attempt.php
mod/quiz/db/access.php
mod/quiz/version.php

index b7336bb63d3e6dfce0c240d5ecdc438f61826b1e..818a962e5fb6375529575dd8cd4702700bc27143 100644 (file)
@@ -379,6 +379,7 @@ $string['questiontypesetupoptions'] = 'Setup options for question types:';
 $string['quiz:attempt'] = 'Attempt quizzes';
 $string['quiz:deleteattempts'] = 'Delete quiz attempts';
 $string['quiz:grade'] = 'Grade quizzes manually';
+$string['quiz:ignoretimelimits'] = 'Ignores time limit on quizs';
 $string['quiz:manage'] = 'Manage quizzes';
 $string['quiz:preview'] = 'Preview quizzes';
 $string['quiz:view'] = 'View quiz information';
index c0e34de977588eafa9c0915998ca06e993ddb43e..53062bcb3b17f6d70bb172c983feb43a6652e2cc 100644 (file)
@@ -25,7 +25,7 @@ function xmldb_main_upgrade($oldversion=0) {
 
     if ($oldversion < 2006100401) {
         /// Only for those tracking Moodle 1.7 dev, others will have these dropped in moodle_install_roles()
-        if (!empty($CFG->rolesactive)) {   
+        if (!empty($CFG->rolesactive)) {
             drop_table(new XMLDBTable('user_students'));
             drop_table(new XMLDBTable('user_teachers'));
             drop_table(new XMLDBTable('user_coursecreators'));
index 64ca659e55dba1c5725f9aa421e25f2f312da41e..5ce5199659ad14f70ec9da191176ca617212bb5d 100644 (file)
         $secondsleft = 999999999999;
     }
     // If time limit is set include floating timer.
-    if ($quiz->timelimit > 0) {
+    // MDL-7495, no timer for users with disability
+    
+    if ($quiz->timelimit > 0 && !has_capability('mod/quiz:ignoretimelimits', $context)) {
 
         $timesincestart = time() - $attempt->timestart;
         $timerstartvalue = min($quiz->timelimit*60 - $timesincestart, $secondsleft);
index b3abe03ebd1162c76fc38628edf3aa88d380421f..cba0de1c2fd697bd9e1d564aeabd719a356b9f12 100644 (file)
@@ -93,6 +93,12 @@ $mod_quiz_capabilities = array(
             'coursecreator' => CAP_ALLOW,
             'admin' => CAP_ALLOW
         )
+    ),
+    
+    'mod/quiz:ignoretimelimits' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_MODULE,
+        'legacy' => array()
     )
 );
 
index d1f9bad56c77feb757ddfe931fe6cdf9da720e33..836145a8744de8693954e332f73f4e1c6b8f440c 100644 (file)
@@ -5,7 +5,7 @@
 //  This fragment is called by moodle_needs_upgrading() and /admin/index.php
 ////////////////////////////////////////////////////////////////////////////////
 
-$module->version  = 2006091901;   // The (date) version of this module
+$module->version  = 2006112300;   // The (date) version of this module
 $module->requires = 2006080900;   // Requires this Moodle version
 $module->cron     = 0;            // How often should cron check this module (seconds)?