35 public function toXML($a_include_header =
true, $a_include_binary =
true, $a_shuffle =
false, $test_output =
false, $force_image_references =
false): string
38 $ilias = $DIC[
'ilias'];
42 $a_xml_writer->xmlHeader();
43 $a_xml_writer->xmlStartTag(
"questestinterop");
45 "ident" =>
"il_" .
IL_INST_ID .
"_qst_" . $this->
object->getId(),
46 "title" => $this->
object->getTitle(),
47 "maxattempts" => $this->
object->getNrOfTries()
49 $a_xml_writer->xmlStartTag(
"item", $attrs);
51 $a_xml_writer->xmlElement(
"qticomment",
null, $this->
object->getComment());
52 $a_xml_writer->xmlStartTag(
"itemmetadata");
53 $a_xml_writer->xmlStartTag(
"qtimetadata");
54 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
55 $a_xml_writer->xmlElement(
"fieldlabel",
null,
"ILIAS_VERSION");
56 $a_xml_writer->xmlElement(
"fieldentry",
null, $ilias->getSetting(
"ilias_version"));
57 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
58 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
59 $a_xml_writer->xmlElement(
"fieldlabel",
null,
"QUESTIONTYPE");
60 $a_xml_writer->xmlElement(
"fieldentry",
null, $this->
object->getQuestionType());
61 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
62 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
63 $a_xml_writer->xmlElement(
"fieldlabel",
null,
"AUTHOR");
64 $a_xml_writer->xmlElement(
"fieldentry",
null, $this->
object->getAuthor());
65 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
71 $a_xml_writer->xmlEndTag(
"qtimetadata");
72 $a_xml_writer->xmlEndTag(
"itemmetadata");
76 "label" => $this->
object->getTitle()
78 $a_xml_writer->xmlStartTag(
"presentation", $attrs);
80 $a_xml_writer->xmlStartTag(
"flow");
86 "rcardinality" =>
"Single",
87 "numtype" =>
"Decimal" 89 $a_xml_writer->xmlStartTag(
"response_num", $attrs);
93 "fibtype" =>
"Decimal",
94 "maxchars" => $this->
object->getMaxChars()
96 $a_xml_writer->xmlStartTag(
"render_fib", $attrs);
97 $a_xml_writer->xmlEndTag(
"render_fib");
98 $a_xml_writer->xmlEndTag(
"response_num");
99 $a_xml_writer->xmlEndTag(
"flow");
100 $a_xml_writer->xmlEndTag(
"presentation");
103 $a_xml_writer->xmlStartTag(
"resprocessing");
104 $a_xml_writer->xmlStartTag(
"outcomes");
105 $a_xml_writer->xmlStartTag(
"decvar");
106 $a_xml_writer->xmlEndTag(
"decvar");
107 $a_xml_writer->xmlEndTag(
"outcomes");
109 $a_xml_writer->xmlStartTag(
"respcondition");
111 $a_xml_writer->xmlStartTag(
"conditionvar");
115 $a_xml_writer->xmlElement(
"vargte", $attrs, $this->
object->getLowerLimit());
116 $a_xml_writer->xmlElement(
"varlte", $attrs, $this->
object->getUpperLimit());
117 $a_xml_writer->xmlEndTag(
"conditionvar");
122 $a_xml_writer->xmlElement(
"setvar", $attrs, $this->
object->getPoints());
125 "feedbacktype" =>
"Response",
126 "linkrefid" =>
"Correct" 128 $a_xml_writer->xmlElement(
"displayfeedback", $attrs);
129 $a_xml_writer->xmlEndTag(
"respcondition");
131 $feedback_allcorrect = $this->
object->feedbackOBJ->getGenericFeedbackExportPresentation(
135 if (strlen($feedback_allcorrect)) {
139 $a_xml_writer->xmlStartTag(
"respcondition", $attrs);
141 $a_xml_writer->xmlStartTag(
"conditionvar");
145 $a_xml_writer->xmlElement(
"vargte", $attrs, $this->
object->getLowerLimit());
146 $a_xml_writer->xmlElement(
"varlte", $attrs, $this->
object->getUpperLimit());
147 $a_xml_writer->xmlEndTag(
"conditionvar");
150 "feedbacktype" =>
"Response",
151 "linkrefid" =>
"response_allcorrect" 153 $a_xml_writer->xmlElement(
"displayfeedback", $attrs);
154 $a_xml_writer->xmlEndTag(
"respcondition");
157 $feedback_onenotcorrect = $this->
object->feedbackOBJ->getGenericFeedbackExportPresentation(
161 if (strlen($feedback_onenotcorrect)) {
165 $a_xml_writer->xmlStartTag(
"respcondition", $attrs);
167 $a_xml_writer->xmlStartTag(
"conditionvar");
168 $a_xml_writer->xmlStartTag(
"not");
172 $a_xml_writer->xmlElement(
"vargte", $attrs, $this->
object->getLowerLimit());
173 $a_xml_writer->xmlElement(
"varlte", $attrs, $this->
object->getUpperLimit());
174 $a_xml_writer->xmlEndTag(
"not");
175 $a_xml_writer->xmlEndTag(
"conditionvar");
178 "feedbacktype" =>
"Response",
179 "linkrefid" =>
"response_onenotcorrect" 181 $a_xml_writer->xmlElement(
"displayfeedback", $attrs);
182 $a_xml_writer->xmlEndTag(
"respcondition");
185 $a_xml_writer->xmlEndTag(
"resprocessing");
189 "ident" =>
"Correct",
192 $a_xml_writer->xmlStartTag(
"itemfeedback", $attrs);
194 $a_xml_writer->xmlStartTag(
"flow_mat");
195 $a_xml_writer->xmlStartTag(
"material");
196 $a_xml_writer->xmlElement(
"mattext");
197 $a_xml_writer->xmlEndTag(
"material");
198 $a_xml_writer->xmlEndTag(
"flow_mat");
199 $a_xml_writer->xmlEndTag(
"itemfeedback");
200 if (strlen($feedback_allcorrect)) {
202 "ident" =>
"response_allcorrect",
205 $a_xml_writer->xmlStartTag(
"itemfeedback", $attrs);
207 $a_xml_writer->xmlStartTag(
"flow_mat");
209 $a_xml_writer->xmlEndTag(
"flow_mat");
210 $a_xml_writer->xmlEndTag(
"itemfeedback");
212 if (strlen($feedback_onenotcorrect)) {
214 "ident" =>
"response_onenotcorrect",
217 $a_xml_writer->xmlStartTag(
"itemfeedback", $attrs);
219 $a_xml_writer->xmlStartTag(
"flow_mat");
221 $a_xml_writer->xmlEndTag(
"flow_mat");
222 $a_xml_writer->xmlEndTag(
"itemfeedback");
227 $a_xml_writer->xmlEndTag(
"item");
228 $a_xml_writer->xmlEndTag(
"questestinterop");
230 $xml = $a_xml_writer->xmlDumpMem(
false);
231 if (!$a_include_header) {
232 $pos = strpos($xml,
"?>");
233 $xml = substr($xml, $pos + 2);
addQTIMaterial(ilXmlWriter $a_xml_writer, string $a_material, bool $close_material_tag=true, bool $add_mobs=true)
Class for question exports.
addGeneralMetadata(ilXmlWriter $xmlwriter)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
toXML($a_include_header=true, $a_include_binary=true, $a_shuffle=false, $test_output=false, $force_image_references=false)
Returns a QTI xml representation of the question Returns a QTI xml representation of the question and...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addAdditionalContentEditingModeInformation(ilXmlWriter $a_xml_writer)
adds a qti meta data field for ilias specific information of "additional content editing mode" (xml w...
addSuggestedSolution(ilXmlWriter $writer)
addSolutionHints(ilXmlWriter $writer)