MDL-77328 qtype_caclulatedsimple: Use qtype_calculated_answer

The question answers for question type plugins extending
\qtype_calculated now have the type
\qtype_calculated\qtype_calculated_answer. So the answers for
make_calculatedsimple_question_sum() should be changed accordingly.
This commit is contained in:
Jun Pataleta 2023-07-19 12:07:52 +08:00 committed by Ilya Tregubov
parent 6ec75e40e0
commit 9119d4513f
No known key found for this signature in database
GPG key ID: 0F58186F748E55C1

View file

@ -54,10 +54,10 @@ class qtype_calculatedsimple_test_helper extends question_test_helper {
$q->generalfeedback = 'Generalfeedback: {={a} + {b}} is the right answer.';
$q->answers = array(
13 => new qtype_numerical_answer(13, '{a} + {b}', 1.0, 'Very good.', FORMAT_HTML, 0),
14 => new qtype_numerical_answer(14, '{a} - {b}', 0.0, 'Add. not subtract!.',
13 => new \qtype_calculated\qtype_calculated_answer(13, '{a} + {b}', 1.0, 'Very good.', FORMAT_HTML, 0),
14 => new \qtype_calculated\qtype_calculated_answer(14, '{a} - {b}', 0.0, 'Add. not subtract!.',
FORMAT_HTML, 0),
17 => new qtype_numerical_answer(17, '*', 0.0, 'Completely wrong.', FORMAT_HTML, 0),
17 => new \qtype_calculated\qtype_calculated_answer(17, '*', 0.0, 'Completely wrong.', FORMAT_HTML, 0),
);
foreach ($q->answers as $answer) {
$answer->correctanswerlength = 2;