4 include_once
"./Modules/TestQuestionPool/classes/export/qti12/class.assQuestionExport.php";
22 public function toXML($a_include_header =
true, $a_include_binary =
true, $a_shuffle =
false, $test_output =
false, $force_image_references =
false)
26 include_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
30 $a_xml_writer->xmlStartTag(
"questestinterop");
32 "ident" =>
"il_" . IL_INST_ID .
"_qst_" . $this->
object->getId(),
33 "title" => $this->
object->getTitle(),
34 "maxattempts" => $this->
object->getNrOfTries()
36 $a_xml_writer->xmlStartTag(
"item", $attrs);
38 $a_xml_writer->xmlElement(
"qticomment", null, $this->
object->getComment());
40 $workingtime = $this->
object->getEstimatedWorkingTime();
41 $duration = sprintf(
"P0Y0M0DT%dH%dM%dS", $workingtime[
"h"], $workingtime[
"m"], $workingtime[
"s"]);
42 $a_xml_writer->xmlElement(
"duration", null, $duration);
44 $a_xml_writer->xmlStartTag(
"itemmetadata");
45 $a_xml_writer->xmlStartTag(
"qtimetadata");
46 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
47 $a_xml_writer->xmlElement(
"fieldlabel", null,
"ILIAS_VERSION");
48 $a_xml_writer->xmlElement(
"fieldentry", null, $ilias->getSetting(
"ilias_version"));
49 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
50 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
51 $a_xml_writer->xmlElement(
"fieldlabel", null,
"QUESTIONTYPE");
52 $a_xml_writer->xmlElement(
"fieldentry", null, $this->
object->getQuestionType());
53 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
54 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
55 $a_xml_writer->xmlElement(
"fieldlabel", null,
"AUTHOR");
56 $a_xml_writer->xmlElement(
"fieldentry", null, $this->
object->getAuthor());
57 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
63 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
64 $a_xml_writer->xmlElement(
"fieldlabel", null,
"points_wrong");
65 $a_xml_writer->xmlElement(
"fieldentry", null, $this->
object->getPointsWrong());
66 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
67 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
68 $a_xml_writer->xmlElement(
"fieldlabel", null,
"errortext");
69 $a_xml_writer->xmlElement(
"fieldentry", null, $this->
object->getErrorText());
70 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
71 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
72 $a_xml_writer->xmlElement(
"fieldlabel", null,
"textsize");
73 $a_xml_writer->xmlElement(
"fieldentry", null, $this->
object->getTextSize());
74 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
75 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
76 $a_xml_writer->xmlElement(
"fieldlabel", null,
"errordata");
77 $serialized =
array();
81 $a_xml_writer->xmlElement(
"fieldentry", null, serialize($serialized));
82 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
83 $a_xml_writer->xmlEndTag(
"qtimetadata");
84 $a_xml_writer->xmlEndTag(
"itemmetadata");
88 "label" => $this->
object->getTitle()
90 $a_xml_writer->xmlStartTag(
"presentation", $attrs);
92 $a_xml_writer->xmlStartTag(
"flow");
94 $this->
object->addQTIMaterial($a_xml_writer, $this->
object->getQuestion());
96 $a_xml_writer->xmlEndTag(
"flow");
97 $a_xml_writer->xmlEndTag(
"presentation");
103 $a_xml_writer->xmlEndTag(
"item");
104 $a_xml_writer->xmlEndTag(
"questestinterop");
106 $xml = $a_xml_writer->xmlDumpMem(
false);
107 if (!$a_include_header) {
108 $pos = strpos(
$xml,
"?>");
Class for question exports.
addAnswerSpecificFeedback(ilXmlWriter $a_xml_writer, $answers)
Class for error text question exports.
addGeneralMetadata(ilXmlWriter $xmlwriter)
xmlHeader()
Writes xml header public.
Create styles array
The data for the language used.
addAdditionalContentEditingModeInformation(ilXmlWriter $a_xml_writer)
adds a qti meta data field for ilias specific information of "additional content editing mode" (xml w...
addGenericFeedback(ilXmlWriter $a_xml_writer)
Create new PHPExcel object
obj_idprivate
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 and sets the internal domxml variable with the DOM X...