Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ae068eb
)
MDL-58557 mod_choice: only check responses if event is actionable
author
Ryan Wyllie
<ryan@moodle.com>
Thu, 27 Apr 2017 07:00:03 +0000
(07:00 +0000)
committer
Ryan Wyllie
<ryan@moodle.com>
Thu, 27 Apr 2017 07:00:03 +0000
(07:00 +0000)
mod/choice/lib.php
patch
|
blob
|
blame
|
history
diff --git
a/mod/choice/lib.php
b/mod/choice/lib.php
index
c4149a0
..
3d16999
100644
(file)
--- 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;
}
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);
// 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)),
return $factory->create_instance(
get_string('viewchoices', 'choice'),
new \moodle_url('/mod/choice/view.php', array('id' => $cm->id)),