From: danmarsden Date: Mon, 22 Oct 2007 21:25:06 +0000 (+0000) Subject: fix for MDL-11063 - thanks to Wen for the patch. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=8c74e3f6766124d8499afa12b07d44b7826d0596;p=moodle.git fix for MDL-11063 - thanks to Wen for the patch. --- diff --git a/lang/en_utf8/choice.php b/lang/en_utf8/choice.php index e8487d1248..d9daf7c8df 100644 --- a/lang/en_utf8/choice.php +++ b/lang/en_utf8/choice.php @@ -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'; diff --git a/mod/choice/view.php b/mod/choice/view.php index 7c544b6d8d..f2da1b3382 100644 --- a/mod/choice/view.php +++ b/mod/choice/view.php @@ -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