Returns a QTI xml representation of the question Returns a QTI xml representation of the question and sets the internal domxml variable with the DOM XML representation of the QTI xml representation public.
40 $ilias = $DIC[
'ilias'];
44 $a_xml_writer->xmlHeader();
45 $a_xml_writer->xmlStartTag(
"questestinterop");
47 "ident" =>
"il_" .
IL_INST_ID .
"_qst_" . $this->
object->getId(),
48 "title" => $this->
object->getTitle(),
49 "maxattempts" => $this->
object->getNrOfTries()
51 $a_xml_writer->xmlStartTag(
"item", $attrs);
53 $a_xml_writer->xmlElement(
"qticomment", null, $this->
object->getComment());
54 $a_xml_writer->xmlStartTag(
"itemmetadata");
55 $a_xml_writer->xmlStartTag(
"qtimetadata");
56 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
57 $a_xml_writer->xmlElement(
"fieldlabel", null,
"ILIAS_VERSION");
58 $a_xml_writer->xmlElement(
"fieldentry", null, $ilias->getSetting(
"ilias_version"));
59 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
60 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
61 $a_xml_writer->xmlElement(
"fieldlabel", null,
"QUESTIONTYPE");
62 $a_xml_writer->xmlElement(
"fieldentry", null, QuestionIdentifiers::NUMERIC_QUESTION_IDENTIFIER);
63 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
64 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
65 $a_xml_writer->xmlElement(
"fieldlabel", null,
"AUTHOR");
66 $a_xml_writer->xmlElement(
"fieldentry", null, $this->
object->getAuthor());
67 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
73 $a_xml_writer->xmlEndTag(
"qtimetadata");
74 $a_xml_writer->xmlEndTag(
"itemmetadata");
78 "label" => $this->
object->getTitle()
80 $a_xml_writer->xmlStartTag(
"presentation", $attrs);
82 $a_xml_writer->xmlStartTag(
"flow");
88 "rcardinality" =>
"Single",
89 "numtype" =>
"Decimal" 91 $a_xml_writer->xmlStartTag(
"response_num", $attrs);
92 $solution = $this->
object->getSuggestedSolution(0);
93 if ($solution !== null) {
98 "fibtype" =>
"Decimal",
99 "maxchars" => $this->
object->getMaxChars()
101 $a_xml_writer->xmlStartTag(
"render_fib", $attrs);
102 $a_xml_writer->xmlEndTag(
"render_fib");
103 $a_xml_writer->xmlEndTag(
"response_num");
104 $a_xml_writer->xmlEndTag(
"flow");
105 $a_xml_writer->xmlEndTag(
"presentation");
108 $a_xml_writer->xmlStartTag(
"resprocessing");
109 $a_xml_writer->xmlStartTag(
"outcomes");
110 $a_xml_writer->xmlStartTag(
"decvar");
111 $a_xml_writer->xmlEndTag(
"decvar");
112 $a_xml_writer->xmlEndTag(
"outcomes");
114 $a_xml_writer->xmlStartTag(
"respcondition");
116 $a_xml_writer->xmlStartTag(
"conditionvar");
120 $a_xml_writer->xmlElement(
"vargte", $attrs, $this->
object->getLowerLimit());
121 $a_xml_writer->xmlElement(
"varlte", $attrs, $this->
object->getUpperLimit());
122 $a_xml_writer->xmlEndTag(
"conditionvar");
127 $a_xml_writer->xmlElement(
"setvar", $attrs, $this->
object->getPoints());
130 "feedbacktype" =>
"Response",
131 "linkrefid" =>
"Correct" 133 $a_xml_writer->xmlElement(
"displayfeedback", $attrs);
134 $a_xml_writer->xmlEndTag(
"respcondition");
136 $feedback_allcorrect = $this->
object->feedbackOBJ->getGenericFeedbackExportPresentation(
140 if (strlen($feedback_allcorrect)) {
144 $a_xml_writer->xmlStartTag(
"respcondition", $attrs);
146 $a_xml_writer->xmlStartTag(
"conditionvar");
150 $a_xml_writer->xmlElement(
"vargte", $attrs, $this->
object->getLowerLimit());
151 $a_xml_writer->xmlElement(
"varlte", $attrs, $this->
object->getUpperLimit());
152 $a_xml_writer->xmlEndTag(
"conditionvar");
155 "feedbacktype" =>
"Response",
156 "linkrefid" =>
"response_allcorrect" 158 $a_xml_writer->xmlElement(
"displayfeedback", $attrs);
159 $a_xml_writer->xmlEndTag(
"respcondition");
162 $feedback_onenotcorrect = $this->
object->feedbackOBJ->getGenericFeedbackExportPresentation(
166 if (strlen($feedback_onenotcorrect)) {
170 $a_xml_writer->xmlStartTag(
"respcondition", $attrs);
172 $a_xml_writer->xmlStartTag(
"conditionvar");
173 $a_xml_writer->xmlStartTag(
"not");
177 $a_xml_writer->xmlElement(
"vargte", $attrs, $this->
object->getLowerLimit());
178 $a_xml_writer->xmlElement(
"varlte", $attrs, $this->
object->getUpperLimit());
179 $a_xml_writer->xmlEndTag(
"not");
180 $a_xml_writer->xmlEndTag(
"conditionvar");
183 "feedbacktype" =>
"Response",
184 "linkrefid" =>
"response_onenotcorrect" 186 $a_xml_writer->xmlElement(
"displayfeedback", $attrs);
187 $a_xml_writer->xmlEndTag(
"respcondition");
190 $a_xml_writer->xmlEndTag(
"resprocessing");
194 "ident" =>
"Correct",
197 $a_xml_writer->xmlStartTag(
"itemfeedback", $attrs);
199 $a_xml_writer->xmlStartTag(
"flow_mat");
200 $a_xml_writer->xmlStartTag(
"material");
201 $a_xml_writer->xmlElement(
"mattext");
202 $a_xml_writer->xmlEndTag(
"material");
203 $a_xml_writer->xmlEndTag(
"flow_mat");
204 $a_xml_writer->xmlEndTag(
"itemfeedback");
205 if (strlen($feedback_allcorrect)) {
207 "ident" =>
"response_allcorrect",
210 $a_xml_writer->xmlStartTag(
"itemfeedback", $attrs);
212 $a_xml_writer->xmlStartTag(
"flow_mat");
214 $a_xml_writer->xmlEndTag(
"flow_mat");
215 $a_xml_writer->xmlEndTag(
"itemfeedback");
217 if (strlen($feedback_onenotcorrect)) {
219 "ident" =>
"response_onenotcorrect",
222 $a_xml_writer->xmlStartTag(
"itemfeedback", $attrs);
224 $a_xml_writer->xmlStartTag(
"flow_mat");
226 $a_xml_writer->xmlEndTag(
"flow_mat");
227 $a_xml_writer->xmlEndTag(
"itemfeedback");
232 $a_xml_writer->xmlEndTag(
"item");
233 $a_xml_writer->xmlEndTag(
"questestinterop");
235 $xml = $a_xml_writer->xmlDumpMem(
false);
236 if (!$a_include_header) {
237 $pos = strpos($xml,
"?>");
238 $xml = substr($xml, $pos + 2);
addSuggestedSolutionLink(ilXmlWriter $writer, assQuestionSuggestedSolution $suggested_solution)
addQTIMaterial(ilXmlWriter $a_xml_writer, string $a_material, bool $close_material_tag=true, bool $add_mobs=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addGeneralMetadata(ilXmlWriter $xmlwriter)
addAdditionalContentEditingModeInformation(ilXmlWriter $a_xml_writer)
adds a qti meta data field for ilias specific information of "additional content editing mode" (xml w...
addSolutionHints(ilXmlWriter $writer)