Skip to content
Browse files

Merge branch 'm22_MDL-31856_choice_responses_inconsistently_displayed…

…' of git://github.com/kanikagoyal/moodle into MOODLE_22_STABLE
  • Loading branch information...
2 parents 55878aa + 4941396 commit 4270267ee9795dc20e99fa1f8d946a8093034bc3 @danpoltawski danpoltawski committed Mar 26, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 mod/choice/view.php
View
6 mod/choice/view.php
@@ -100,16 +100,16 @@
echo $OUTPUT->box(format_module_intro('choice', $choice, $cm->id), 'generalbox', 'intro');
}
+ $timenow = time();
$current = false; // Initialise for later
- //if user has already made a selection, and they are not allowed to update it, show their selected answer.
+ //if user has already made a selection, and they are not allowed to update it or if choice is not open, show their selected answer.
if (isloggedin() && ($current = $DB->get_record('choice_answers', array('choiceid' => $choice->id, 'userid' => $USER->id))) &&
- empty($choice->allowupdate) ) {
+ (empty($choice->allowupdate) || ($timenow > $choice->timeclose)) ) {
echo $OUTPUT->box(get_string("yourselection", "choice", userdate($choice->timeopen)).": ".format_string(choice_get_option_text($choice, $current->optionid)), 'generalbox', 'yourselection');
}
/// Print the form
$choiceopen = true;
- $timenow = time();
if ($choice->timeclose !=0) {
if ($choice->timeopen > $timenow ) {
echo $OUTPUT->box(get_string("notopenyet", "choice", userdate($choice->timeopen)), "generalbox notopenyet");

0 comments on commit 4270267

Please sign in to comment.
Something went wrong with that request. Please try again.