/** * Start the XML flow. * * This opens the <item> block, with correct attributes. * */ function start_item() { $string = '<assessmentItem xmlns="http://www.imsglobal.org/xsd/imsqti_v2p1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p1 imsqti_v2p1.xsd" identifier="' . $this->questionIdent . '" title="' . htmlspecialchars(formatExerciseQtiTitle($this->question->selectTitle())) . '">' . "\n"; return $string; }
/** * */ public function imsExportResponsesDeclaration($questionIdent) { $this->answerList = $this->getAnswersList(true); $this->gradeList = $this->getGradesList(); $out = ''; $out .= ' <responseDeclaration identifier="hotspot_' . $questionIdent . '" cardinality="ordered" baseType="identifier">' . "\n"; $out .= ' <correctResponse>' . "\n"; if (is_array($this->answerList)) { foreach ($this->answerList as $answerKey => $answer) { $answerKey = $answer['id']; $answer = $answer['answer']; $out .= '<value><![CDATA[' . formatExerciseQtiTitle($answerKey) . ']]></value>'; } } $out .= ' </correctResponse>' . "\n"; $out .= ' </responseDeclaration>' . "\n"; return $out; }