Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 2.6.3, 2.7
-
Component/s: Questions
-
Testing Instructions:
-
Affected Branches:MOODLE_26_STABLE, MOODLE_27_STABLE
-
Fixed Branches:MOODLE_26_STABLE, MOODLE_27_STABLE
-
Pull from Repository:
-
Pull Master Branch:
-
Pull Master Diff URL:
Description
php docblock for get_num_selected_choices function says:
/**
|
* @param array $response responses, as returned by
|
* {@link question_attempt_step::get_qt_data()}.
|
* @return int the number of choices that were selected. in this response.
|
*/
|
But this is not working as expected because question_attempt_step::get_qt_data can return an array containing other elements than those related to choices, for instance the core qtype_multichoice_multi_question return an array with an '_order' element. So the count of selected answers is wrong by 1.
We need to filter such element discarting those where the name start with an underscore.