Skip to content

Commit

Permalink
MDL-63459 qtype_calculatedmulti: fix incorrect hint object type
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed Nov 26, 2018
1 parent 1e8374c commit 6140778
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions question/type/calculatedmulti/questiontype.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ public function make_answer($answer) {
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 = '';
Expand Down
8 changes: 4 additions & 4 deletions question/type/calculatedmulti/tests/walkthrough_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public function test_interactive_single_response() {
$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();
Expand Down Expand Up @@ -108,8 +108,8 @@ public function test_interactive_multi_response() {
$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();
Expand Down

0 comments on commit 6140778

Please sign in to comment.