36 public function toXML($a_include_header =
true, $a_include_binary =
true, $a_shuffle =
false, $test_output =
false, $force_image_references =
false): string
39 $ilias = $DIC[
'ilias'];
43 $a_xml_writer->xmlHeader();
44 $a_xml_writer->xmlStartTag(
"questestinterop");
46 "ident" =>
"il_" .
IL_INST_ID .
"_qst_" . $this->
object->getId(),
47 "title" => $this->
object->getTitle(),
48 "maxattempts" => $this->
object->getNrOfTries()
50 $a_xml_writer->xmlStartTag(
"item", $attrs);
52 $a_xml_writer->xmlElement(
"qticomment",
null, $this->
object->getComment());
53 $a_xml_writer->xmlStartTag(
"itemmetadata");
54 $a_xml_writer->xmlStartTag(
"qtimetadata");
55 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
56 $a_xml_writer->xmlElement(
"fieldlabel",
null,
"ILIAS_VERSION");
57 $a_xml_writer->xmlElement(
"fieldentry",
null, $ilias->getSetting(
"ilias_version"));
58 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
59 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
60 $a_xml_writer->xmlElement(
"fieldlabel",
null,
"QUESTIONTYPE");
61 $a_xml_writer->xmlElement(
"fieldentry",
null, $this->
object->getQuestionType());
62 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
63 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
64 $a_xml_writer->xmlElement(
"fieldlabel",
null,
"AUTHOR");
65 $a_xml_writer->xmlElement(
"fieldentry",
null, $this->
object->getAuthor());
66 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
72 $a_xml_writer->xmlEndTag(
"qtimetadata");
73 $a_xml_writer->xmlEndTag(
"itemmetadata");
77 "label" => $this->
object->getTitle()
79 $a_xml_writer->xmlStartTag(
"presentation", $attrs);
81 $a_xml_writer->xmlStartTag(
"flow");
87 "rcardinality" =>
"Single",
88 "numtype" =>
"Decimal" 90 $a_xml_writer->xmlStartTag(
"response_num", $attrs);
94 "fibtype" =>
"Decimal",
95 "maxchars" => $this->
object->getMaxChars()
97 $a_xml_writer->xmlStartTag(
"render_fib", $attrs);
98 $a_xml_writer->xmlEndTag(
"render_fib");
99 $a_xml_writer->xmlEndTag(
"response_num");
100 $a_xml_writer->xmlEndTag(
"flow");
101 $a_xml_writer->xmlEndTag(
"presentation");
104 $a_xml_writer->xmlStartTag(
"resprocessing");
105 $a_xml_writer->xmlStartTag(
"outcomes");
106 $a_xml_writer->xmlStartTag(
"decvar");
107 $a_xml_writer->xmlEndTag(
"decvar");
108 $a_xml_writer->xmlEndTag(
"outcomes");
110 $a_xml_writer->xmlStartTag(
"respcondition");
112 $a_xml_writer->xmlStartTag(
"conditionvar");
116 $a_xml_writer->xmlElement(
"vargte", $attrs, $this->
object->getLowerLimit());
117 $a_xml_writer->xmlElement(
"varlte", $attrs, $this->
object->getUpperLimit());
118 $a_xml_writer->xmlEndTag(
"conditionvar");
123 $a_xml_writer->xmlElement(
"setvar", $attrs, $this->
object->getPoints());
126 "feedbacktype" =>
"Response",
127 "linkrefid" =>
"Correct" 129 $a_xml_writer->xmlElement(
"displayfeedback", $attrs);
130 $a_xml_writer->xmlEndTag(
"respcondition");
132 $feedback_allcorrect = $this->
object->feedbackOBJ->getGenericFeedbackExportPresentation(
136 if (strlen($feedback_allcorrect)) {
140 $a_xml_writer->xmlStartTag(
"respcondition", $attrs);
142 $a_xml_writer->xmlStartTag(
"conditionvar");
146 $a_xml_writer->xmlElement(
"vargte", $attrs, $this->
object->getLowerLimit());
147 $a_xml_writer->xmlElement(
"varlte", $attrs, $this->
object->getUpperLimit());
148 $a_xml_writer->xmlEndTag(
"conditionvar");
151 "feedbacktype" =>
"Response",
152 "linkrefid" =>
"response_allcorrect" 154 $a_xml_writer->xmlElement(
"displayfeedback", $attrs);
155 $a_xml_writer->xmlEndTag(
"respcondition");
158 $feedback_onenotcorrect = $this->
object->feedbackOBJ->getGenericFeedbackExportPresentation(
162 if (strlen($feedback_onenotcorrect)) {
166 $a_xml_writer->xmlStartTag(
"respcondition", $attrs);
168 $a_xml_writer->xmlStartTag(
"conditionvar");
169 $a_xml_writer->xmlStartTag(
"not");
173 $a_xml_writer->xmlElement(
"vargte", $attrs, $this->
object->getLowerLimit());
174 $a_xml_writer->xmlElement(
"varlte", $attrs, $this->
object->getUpperLimit());
175 $a_xml_writer->xmlEndTag(
"not");
176 $a_xml_writer->xmlEndTag(
"conditionvar");
179 "feedbacktype" =>
"Response",
180 "linkrefid" =>
"response_onenotcorrect" 182 $a_xml_writer->xmlElement(
"displayfeedback", $attrs);
183 $a_xml_writer->xmlEndTag(
"respcondition");
186 $a_xml_writer->xmlEndTag(
"resprocessing");
190 "ident" =>
"Correct",
193 $a_xml_writer->xmlStartTag(
"itemfeedback", $attrs);
195 $a_xml_writer->xmlStartTag(
"flow_mat");
196 $a_xml_writer->xmlStartTag(
"material");
197 $a_xml_writer->xmlElement(
"mattext");
198 $a_xml_writer->xmlEndTag(
"material");
199 $a_xml_writer->xmlEndTag(
"flow_mat");
200 $a_xml_writer->xmlEndTag(
"itemfeedback");
201 if (strlen($feedback_allcorrect)) {
203 "ident" =>
"response_allcorrect",
206 $a_xml_writer->xmlStartTag(
"itemfeedback", $attrs);
208 $a_xml_writer->xmlStartTag(
"flow_mat");
210 $a_xml_writer->xmlEndTag(
"flow_mat");
211 $a_xml_writer->xmlEndTag(
"itemfeedback");
213 if (strlen($feedback_onenotcorrect)) {
215 "ident" =>
"response_onenotcorrect",
218 $a_xml_writer->xmlStartTag(
"itemfeedback", $attrs);
220 $a_xml_writer->xmlStartTag(
"flow_mat");
222 $a_xml_writer->xmlEndTag(
"flow_mat");
223 $a_xml_writer->xmlEndTag(
"itemfeedback");
226 $a_xml_writer->xmlEndTag(
"item");
227 $a_xml_writer->xmlEndTag(
"questestinterop");
229 $xml = $a_xml_writer->xmlDumpMem(
false);
230 if (!$a_include_header) {
231 $pos = strpos($xml,
"?>");
232 $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)