MDL-56131 choice: Set maximum lifetime for lock
authorMichael Aherne <michael.aherne@strath.ac.uk>
Tue, 27 Sep 2016 11:25:06 +0000 (12:25 +0100)
committerAndrew Nicols <andrew@nicols.co.uk>
Mon, 17 Oct 2016 05:50:42 +0000 (13:50 +0800)
mod/choice/lib.php

index 5f9ded4..770077d 100644 (file)
@@ -345,7 +345,7 @@ function choice_user_submit_response($formanswer, $choice, $userid, $course, $cm
         $lockfactory = \core\lock\lock_config::get_lock_factory($locktype);
 
         // Opening the lock.
-        $choicelock = $lockfactory->get_lock($resouce, $timeout);
+        $choicelock = $lockfactory->get_lock($resouce, $timeout, MINSECS);
         if (!$choicelock) {
             print_error('cannotsubmit', 'choice', $continueurl);
         }