MDL-14655 fix display of Choice when "show results after closed" is selected. merged from HEAD

This commit is contained in:
danmarsden
2008-08-11 04:22:58 +00:00
parent 3ca11c32d2
commit fec92d9c3e
+4 -6
View File
@@ -92,7 +92,7 @@
}
/// Print the form
$choiceopen = true;
$timenow = time();
if ($choice->timeclose !=0) {
if ($choice->timeopen > $timenow ) {
@@ -101,13 +101,11 @@
exit;
} 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
@@ -155,7 +153,7 @@
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() ) ) {
($choice->showresults == CHOICE_SHOWRESULTS_AFTER_CLOSE and !$choiceopen ) ) {
choice_show_results($choice, $course, $cm, $allresponses); //show table with students responses.