4 include_once
"./Modules/TestQuestionPool/classes/export/qti12/class.assQuestionExport.php";
24 public function toXML($a_include_header =
true, $a_include_binary =
true, $a_shuffle =
false, $test_output =
false, $force_image_references =
false)
27 $ilias = $DIC[
'ilias'];
29 include_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
33 $a_xml_writer->xmlStartTag(
"questestinterop");
35 "ident" =>
"il_" . IL_INST_ID .
"_qst_" . $this->object->getId(),
36 "title" => $this->
object->getTitle(),
37 "maxattempts" => $this->
object->getNrOfTries()
39 $a_xml_writer->xmlStartTag(
"item", $attrs);
41 $a_xml_writer->xmlElement(
"qticomment", null, $this->object->getComment());
43 $workingtime = $this->
object->getEstimatedWorkingTime();
44 $duration = sprintf(
"P0Y0M0DT%dH%dM%dS", $workingtime[
"h"], $workingtime[
"m"], $workingtime[
"s"]);
45 $a_xml_writer->xmlElement(
"duration", null, $duration);
47 $a_xml_writer->xmlStartTag(
"itemmetadata");
48 $a_xml_writer->xmlStartTag(
"qtimetadata");
49 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
50 $a_xml_writer->xmlElement(
"fieldlabel", null,
"ILIAS_VERSION");
51 $a_xml_writer->xmlElement(
"fieldentry", null, $ilias->getSetting(
"ilias_version"));
52 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
53 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
54 $a_xml_writer->xmlElement(
"fieldlabel", null,
"QUESTIONTYPE");
55 $a_xml_writer->xmlElement(
"fieldentry", null, $this->object->getQuestionType());
56 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
57 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
58 $a_xml_writer->xmlElement(
"fieldlabel", null,
"AUTHOR");
59 $a_xml_writer->xmlElement(
"fieldentry", null, $this->object->getAuthor());
60 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
66 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
67 $a_xml_writer->xmlElement(
"fieldlabel", null,
"points");
68 $a_xml_writer->xmlElement(
"fieldentry", null, $this->object->getPoints());
69 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
70 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
71 $a_xml_writer->xmlElement(
"fieldlabel", null,
"maxsize");
72 $a_xml_writer->xmlElement(
"fieldentry", null, $this->object->getMaxSize());
73 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
74 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
75 $a_xml_writer->xmlElement(
"fieldlabel", null,
"allowedextensions");
76 $a_xml_writer->xmlElement(
"fieldentry", null, $this->object->getAllowedExtensions());
77 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
78 $a_xml_writer->xmlEndTag(
"qtimetadata");
79 $a_xml_writer->xmlEndTag(
"itemmetadata");
83 "label" => $this->object->getTitle()
85 $a_xml_writer->xmlStartTag(
"presentation", $attrs);
87 $a_xml_writer->xmlStartTag(
"flow");
89 $this->
object->addQTIMaterial($a_xml_writer, $this->object->getQuestion());
91 $a_xml_writer->xmlEndTag(
"flow");
92 $a_xml_writer->xmlEndTag(
"presentation");
96 $a_xml_writer->xmlEndTag(
"item");
97 $a_xml_writer->xmlEndTag(
"questestinterop");
99 $xml = $a_xml_writer->xmlDumpMem(
false);
100 if (!$a_include_header) {
101 $pos = strpos(
$xml,
"?>");
Class for file upload question exports.
exportFeedbackOnly($a_xml_writer)
Class for question exports.
addGeneralMetadata(ilXmlWriter $xmlwriter)
xmlHeader()
Writes xml header public.
addAdditionalContentEditingModeInformation(ilXmlWriter $a_xml_writer)
adds a qti meta data field for ilias specific information of "additional content editing mode" (xml w...
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.