]> git.mjollnir.org Git - moodle.git/commitdiff
print_timer_selector function added for QuizTimer
authorjulmis <julmis>
Wed, 2 Jun 2004 18:00:12 +0000 (18:00 +0000)
committerjulmis <julmis>
Wed, 2 Jun 2004 18:00:12 +0000 (18:00 +0000)
lib/weblib.php

index f2ae1ec1463f04833f149c59cec6b8ab2f86535b..27849216dc46587f66c4e540ddb6040eb1aac42d 100644 (file)
@@ -1929,6 +1929,21 @@ function print_time_selector($hour, $minute, $currenttime=0, $step=5) {
     choose_from_menu($minutes, $minute, $currentdate['minutes'], "");
 }
 
+function print_timer_selector($timelimit = 0) {
+/// Prints time limit value selector
+/// to add or edit quiz's time limit
+
+    global $CFG;
+
+    // Max timelimit is sessiontimeout - 10 minutes.
+    $maxvalue = ($CFG->sessiontimeout / 60) - 10;
+
+    for ($i=0; $i<=$maxvalue; $i++) {
+        $minutes[$i] = sprintf("%02d",$i);
+    }
+    choose_from_menu($minutes, "timelimit", $timelimit,"");
+}
+
 function print_grade_menu($courseid, $name, $current, $includenograde=true) {
 /// Prints a grade menu (as part of an existing form) with help
 /// Showing all possible numerical grades and scales