mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
MDL-45686 qtype_multichoice get_num_selected_choices return wrong result
This commit is contained in:
parent
529d4cdbc6
commit
4fb94f7f96
1 changed files with 2 additions and 1 deletions
|
@ -384,7 +384,8 @@ class qtype_multichoice_multi_question extends qtype_multichoice_base {
|
||||||
public function get_num_selected_choices(array $response) {
|
public function get_num_selected_choices(array $response) {
|
||||||
$numselected = 0;
|
$numselected = 0;
|
||||||
foreach ($response as $key => $value) {
|
foreach ($response as $key => $value) {
|
||||||
if (!empty($value)) {
|
// Response keys starting with _ are internal values like _order, so ignore them.
|
||||||
|
if (!empty($value) && $key[0] != '_') {
|
||||||
$numselected += 1;
|
$numselected += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue