From a0499b7fffab705838cc4884eda4d7f14b92f233 Mon Sep 17 00:00:00 2001 From: Ryan Wyllie Date: Thu, 27 Apr 2017 07:00:03 +0000 Subject: [PATCH] MDL-58557 mod_choice: only check responses if event is actionable --- mod/choice/lib.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mod/choice/lib.php b/mod/choice/lib.php index c4149a05f46..3d16999a165 100644 --- a/mod/choice/lib.php +++ b/mod/choice/lib.php @@ -1205,15 +1205,15 @@ function mod_choice_core_calendar_provide_event_action(calendar_event $event, return null; } - if (choice_get_my_response($choice)) { - // There is no action if the user has already submitted their choice. - return null; - } - // The choice is actionable if we don't have a start time or the start time is // in the past. $actionable = (!$choice->timeopen || $choice->timeopen <= $now); + if ($actionable && choice_get_my_response($choice)) { + // There is no action if the user has already submitted their choice. + return null; + } + return $factory->create_instance( get_string('viewchoices', 'choice'), new \moodle_url('/mod/choice/view.php', array('id' => $cm->id)), -- 2.43.0