]> git.mjollnir.org Git - moodle.git/commitdiff
fix for MDL-11063 - thanks to Wen for the patch.
authordanmarsden <danmarsden>
Mon, 22 Oct 2007 21:25:06 +0000 (21:25 +0000)
committerdanmarsden <danmarsden>
Mon, 22 Oct 2007 21:25:06 +0000 (21:25 +0000)
lang/en_utf8/choice.php
mod/choice/view.php

index e8487d124870bc8006e1960a6d07008138f13cff..d9daf7c8dfd33745ad95b20a378124bfd6d4e233 100644 (file)
@@ -17,6 +17,7 @@ $string['choicetext'] = 'Choice text';
 $string['displayhorizontal'] = 'Display horizontally';
 $string['displaymode'] = 'Display Mode';
 $string['displayvertical'] = 'Display vertically';
+$string['expired'] = 'Sorry, this activity closed on $a and is no longer available';
 $string['fillinatleastoneoption'] = 'You need to provide at least two possible answers.';
 $string['full'] = '(Full)';
 $string['havetologin'] = 'You have to log in before you can submit your choice';
index 7c544b6d8d356b12301eed9a845fbf31bf96e6e9..f2da1b3382aaf83d0fee78fd2aff9f47d1abb4d2 100644 (file)
@@ -87,10 +87,17 @@ if ($action == 'delchoice') {
 
 /// Print the form
 
-    if ($choice->timeopen > time() ) {
-        print_simple_box(get_string("notopenyet", "choice", userdate($choice->timeopen)), "center");
-        print_footer($course);
-        exit;
+    $timenow = time();
+    if ($choice->timeclose !=0) {
+        if ($choice->timeopen > $timenow ) {
+            print_simple_box(get_string("notopenyet", "choice", userdate($choice->timeopen)), "center");
+            print_footer($course);
+            exit;
+        } else if ($timenow > $choice->timeclose) {
+            print_simple_box(get_string("expired", "choice", userdate($choice->timeclose)), "center");
+            print_footer($course);
+            exit;
+        }
     }
 
     if ( (!$current or $choice->allowupdate) and