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 @access public.
36 : string
37 {
39 $ilias =
$DIC[
'ilias'];
40
42
43 $a_xml_writer->xmlHeader();
44 $a_xml_writer->xmlStartTag("questestinterop");
45 $attrs = [
46 "ident" =>
"il_" .
IL_INST_ID .
"_qst_" . $this->
object->getId(),
47 "title" => $this->object->getTitle(),
48 "maxattempts" => $this->object->getNrOfTries()
49 ];
50 $a_xml_writer->xmlStartTag("item", $attrs);
51
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");
67
68
71
72 $a_xml_writer->xmlEndTag("qtimetadata");
73 $a_xml_writer->xmlEndTag("itemmetadata");
74
75
76 $attrs = [
77 "label" => $this->object->getTitle()
78 ];
79 $a_xml_writer->xmlStartTag("presentation", $attrs);
80
81 $a_xml_writer->xmlStartTag("flow");
82
84
85 $attrs = [
86 "ident" => "NUM",
87 "rcardinality" => "Single",
88 "numtype" => "Decimal"
89 ];
90 $a_xml_writer->xmlStartTag("response_num", $attrs);
92
93 $attrs = [
94 "fibtype" => "Decimal",
95 "maxchars" => $this->object->getMaxChars()
96 ];
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");
102
103
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");
109
110 $a_xml_writer->xmlStartTag("respcondition");
111
112 $a_xml_writer->xmlStartTag("conditionvar");
113 $attrs = [
114 "respident" => "NUM"
115 ];
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");
119
120 $attrs = [
121 "action" => "Add"
122 ];
123 $a_xml_writer->xmlElement(
"setvar", $attrs, $this->
object->getPoints());
124
125 $attrs = [
126 "feedbacktype" => "Response",
127 "linkrefid" => "Correct"
128 ];
129 $a_xml_writer->xmlElement("displayfeedback", $attrs);
130 $a_xml_writer->xmlEndTag("respcondition");
131
132 $feedback_allcorrect = $this->object->feedbackOBJ->getGenericFeedbackExportPresentation(
134 true
135 );
136 if (strlen($feedback_allcorrect)) {
137 $attrs = [
138 "continue" => "Yes"
139 ];
140 $a_xml_writer->xmlStartTag("respcondition", $attrs);
141
142 $a_xml_writer->xmlStartTag("conditionvar");
143 $attrs = [
144 "respident" => "NUM"
145 ];
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");
149
150 $attrs = [
151 "feedbacktype" => "Response",
152 "linkrefid" => "response_allcorrect"
153 ];
154 $a_xml_writer->xmlElement("displayfeedback", $attrs);
155 $a_xml_writer->xmlEndTag("respcondition");
156 }
157
158 $feedback_onenotcorrect = $this->object->feedbackOBJ->getGenericFeedbackExportPresentation(
160 false
161 );
162 if (strlen($feedback_onenotcorrect)) {
163 $attrs = [
164 "continue" => "Yes"
165 ];
166 $a_xml_writer->xmlStartTag("respcondition", $attrs);
167
168 $a_xml_writer->xmlStartTag("conditionvar");
169 $a_xml_writer->xmlStartTag("not");
170 $attrs = [
171 "respident" => "NUM"
172 ];
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");
177
178 $attrs = [
179 "feedbacktype" => "Response",
180 "linkrefid" => "response_onenotcorrect"
181 ];
182 $a_xml_writer->xmlElement("displayfeedback", $attrs);
183 $a_xml_writer->xmlEndTag("respcondition");
184 }
185
186 $a_xml_writer->xmlEndTag("resprocessing");
187
188
189 $attrs = [
190 "ident" => "Correct",
191 "view" => "All"
192 ];
193 $a_xml_writer->xmlStartTag("itemfeedback", $attrs);
194
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)) {
202 $attrs = [
203 "ident" => "response_allcorrect",
204 "view" => "All"
205 ];
206 $a_xml_writer->xmlStartTag("itemfeedback", $attrs);
207
208 $a_xml_writer->xmlStartTag("flow_mat");
210 $a_xml_writer->xmlEndTag("flow_mat");
211 $a_xml_writer->xmlEndTag("itemfeedback");
212 }
213 if (strlen($feedback_onenotcorrect)) {
214 $attrs = [
215 "ident" => "response_onenotcorrect",
216 "view" => "All"
217 ];
218 $a_xml_writer->xmlStartTag("itemfeedback", $attrs);
219
220 $a_xml_writer->xmlStartTag("flow_mat");
222 $a_xml_writer->xmlEndTag("flow_mat");
223 $a_xml_writer->xmlEndTag("itemfeedback");
224 }
225
226 $a_xml_writer->xmlEndTag("item");
227 $a_xml_writer->xmlEndTag("questestinterop");
228
229 $xml = $a_xml_writer->xmlDumpMem(false);
230 if (!$a_include_header) {
231 $pos = strpos($xml, "?>");
232 $xml = substr($xml, $pos + 2);
233 }
234 return $xml;
235 }
addGeneralMetadata(ilXmlWriter $xmlwriter)
addQTIMaterial(ilXmlWriter $a_xml_writer, string $a_material, bool $close_material_tag=true, bool $add_mobs=true)
addSuggestedSolution(ilXmlWriter $writer)
addAdditionalContentEditingModeInformation(ilXmlWriter $a_xml_writer)
adds a qti meta data field for ilias specific information of "additional content editing mode" (xml w...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...