MDL-63459 qtype_calculatedmulti: fix incorrect hint object type

This commit is contained in:
Tim Hunt 2018-11-26 12:52:09 +00:00
parent 1e8374c370
commit 614077863b
2 changed files with 8 additions and 4 deletions

View File

@ -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 = '';

View File

@ -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();