Skip to content

Commit

Permalink
MDL-58557 mod_choice: only check responses if event is actionable
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwyllie committed Apr 27, 2017
1 parent ae068eb commit a0499b7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mod/choice/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down

0 comments on commit a0499b7

Please sign in to comment.