MDL-78621 mod_choice: verify limited responses before showing "full".

This commit is contained in:
Paul Holden 2023-12-04 22:28:42 +00:00
parent 591cdd8211
commit 7d3eff209c
No known key found for this signature in database
GPG key ID: A81A96D6045F6164

View file

@ -186,7 +186,10 @@ class mod_choice_renderer extends plugin_renderer_base {
} else if ($optionid > 0) { } else if ($optionid > 0) {
$headertitle = format_string($choices->options[$optionid]->text); $headertitle = format_string($choices->options[$optionid]->text);
if (!empty($choices->options[$optionid]->user) && count($choices->options[$optionid]->user) > 0) { if (!empty($choices->options[$optionid]->user) && count($choices->options[$optionid]->user) > 0) {
if ((count($choices->options[$optionid]->user)) == ($choices->options[$optionid]->maxanswer)) { if (
$choices->limitanswers &&
(count($choices->options[$optionid]->user) == $choices->options[$optionid]->maxanswer)
) {
$headertitle .= ' ' . get_string('full', 'choice'); $headertitle .= ' ' . get_string('full', 'choice');
} }
} }