foreach ($data['#']['selectoption'] as $selectoptionxml) {
$question->choices[] = array(
'answer' => $format->getpath($selectoptionxml, array('#', 'text', 0, '#'), '', true),
- 'selectgroup' => $format->getpath($selectoptionxml, array('#', 'group', 0, '#'), 1),
+ 'choicegroup' => $format->getpath($selectoptionxml, array('#', 'group', 0, '#'), 1),
);
}
$ans = $format->import_answer($answerxml);
$question->choices[] = array(
'answer' => $ans->answer,
- 'selectgroup' => $ans->feedback,
+ 'choicegroup' => $ans->feedback,
);
}
}
$expectedq->incorrectfeedback = array('text' => '<p>Your answer is incorrect.</p>', 'format' => FORMAT_MOODLE, 'files' => array());
$expectedq->choices = array(
- array('answer' => 'Alpha', 'selectgroup' => 1),
- array('answer' => 'Beta', 'selectgroup' => 1),
- array('answer' => 'Gamma', 'selectgroup' => 1),
+ array('answer' => 'Alpha', 'choicegroup' => 1),
+ array('answer' => 'Beta', 'choicegroup' => 1),
+ array('answer' => 'Gamma', 'choicegroup' => 1),
);
- $expectedq->hint = array('Try again.', 'These are the first three letters of the Greek alphabet.');
+ $expectedq->hint = array(
+ array('text' => 'Try again.', 'format' => FORMAT_MOODLE, 'files' => array()),
+ array('text' => 'These are the first three letters of the Greek alphabet.', 'format' => FORMAT_MOODLE, 'files' => array()));
$expectedq->hintshownumcorrect = array(true, true);
$expectedq->hintclearwrong = array(false, true);
$this->assert(new CheckSpecifiedFieldsExpectation($expectedq), $q);
+ $this->assertEqual($expectedq->hint, $q->hint);
}
public function test_xml_export() {