function qformat_qti2::get_correct_answers in Quiz 6.5
Same name and namespace in other branches
- 6.6 includes/moodle/question/format/qti2/format.php \qformat_qti2::get_correct_answers()
gets the answers whose grade fraction > 0
Parameters
array $answers:
Return value
array (0-indexed) containing the answers whose grade fraction > 0
1 call to qformat_qti2::get_correct_answers()
- qformat_qti2::writequestion in includes/
moodle/ question/ format/ qti2/ format.php - Creates the export text for a question
File
- includes/
moodle/ question/ format/ qti2/ format.php, line 663
Class
Code
function get_correct_answers($answers) {
$correctanswers = array();
foreach ($answers as $answer) {
if ($answer['fraction'] > 0) {
$correctanswers[] = $answer;
}
}
return $correctanswers;
}