MDL-63459 qtype_calculatedmulti: fix incorrect hint object type

This commit is contained in:
Tim Hunt
2018-12-03 14:25:41 +08:00
committed by Jake Dallimore
parent be27fc0fe3
commit ac0b8201a9
2 changed files with 8 additions and 4 deletions
@@ -215,6 +215,10 @@ class qtype_calculatedmulti extends qtype_calculated {
return parent::make_answer($answer);
}
protected function make_hint($hint) {
return question_hint_with_parts::load_from_record($hint);
}
public function comment_header($question) {
$strheader = '';
$delimiter = '';
@@ -44,8 +44,8 @@ class qtype_calculatedmulti_walkthrough_test extends qbehaviour_walkthrough_test
$q = test_question_maker::make_question('calculatedmulti', 'singleresponse');
$q->shuffleanswers = false;
$q->hints = array(
new question_hint(1, 'This is the first hint.', FORMAT_HTML),
new question_hint(2, 'This is the second hint.', FORMAT_HTML),
new question_hint_with_parts(1, 'This is the first hint.', FORMAT_HTML, true, false),
new question_hint_with_parts(2, 'This is the second hint.', FORMAT_HTML, true, false),
);
$this->start_attempt_at_question($q, 'interactive', 3, 2);
$values = $q->vs->get_values();
@@ -108,8 +108,8 @@ class qtype_calculatedmulti_walkthrough_test extends qbehaviour_walkthrough_test
$q = test_question_maker::make_question('calculatedmulti', 'multiresponse');
$q->shuffleanswers = false;
$q->hints = array(
new question_hint(1, 'This is the first hint.', FORMAT_HTML),
new question_hint(2, 'This is the second hint.', FORMAT_HTML),
new question_hint_with_parts(1, 'This is the first hint.', FORMAT_HTML, true, false),
new question_hint_with_parts(2, 'This is the second hint.', FORMAT_HTML, true, false),
);
$this->start_attempt_at_question($q, 'interactive', 3, 2);
$values = $q->vs->get_values();