### Eclipse Workspace Patch 1.0 #P CVS Index: mod/choice/view.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/choice/view.php,v retrieving revision 1.110 diff -u -r1.110 view.php --- mod/choice/view.php 4 Apr 2008 02:54:37 -0000 1.110 +++ mod/choice/view.php 4 May 2008 01:31:20 -0000 @@ -92,22 +92,19 @@ } /// Print the form - + $choiceopen = true; $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; + $choiceopen = false; } else if ($timenow > $choice->timeclose) { print_simple_box(get_string("expired", "choice", userdate($choice->timeclose)), "center"); - print_footer($course); - exit; + $choiceopen = false; } } - if ( (!$current or $choice->allowupdate) and - ($choice->timeclose >= time() or $choice->timeclose == 0) and + if ( (!$current or $choice->allowupdate) and $choiceopen and has_capability('mod/choice:choose', $context) ) { // They haven't made their choice yet or updates allowed and choice is open @@ -122,8 +119,6 @@ $choiceformshown = false; } - - if (!$choiceformshown) { $sitecontext = get_context_instance(CONTEXT_SYSTEM); @@ -152,7 +147,6 @@ } // print the results at the bottom of the screen - if ( $choice->showresults == CHOICE_SHOWRESULTS_ALWAYS or ($choice->showresults == CHOICE_SHOWRESULTS_AFTER_ANSWER and $current ) or ($choice->showresults == CHOICE_SHOWRESULTS_AFTER_CLOSE and $choice->timeclose <= time() ) ) { @@ -163,8 +157,5 @@ print_simple_box(get_string('noresultsviewable', 'choice'), 'center'); } - print_footer($course); - - ?>