4 include_once
"./Modules/TestQuestionPool/classes/export/qti12/class.assQuestionExport.php";
24 function toXML($a_include_header =
true, $a_include_binary =
true, $a_shuffle =
false, $test_output =
false, $force_image_references =
false)
28 include_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
32 $a_xml_writer->xmlStartTag(
"questestinterop");
34 "ident" =>
"il_".IL_INST_ID.
"_qst_".$this->object->getId(),
35 "title" => $this->
object->getTitle(),
36 "maxattempts" => $this->
object->getNrOfTries()
38 $a_xml_writer->xmlStartTag(
"item", $attrs);
40 $a_xml_writer->xmlElement(
"qticomment", NULL, $this->
object->getComment());
42 $workingtime = $this->
object->getEstimatedWorkingTime();
43 $duration = sprintf(
"P0Y0M0DT%dH%dM%dS", $workingtime[
"h"], $workingtime[
"m"], $workingtime[
"s"]);
44 $a_xml_writer->xmlElement(
"duration", NULL,
$duration);
46 $a_xml_writer->xmlStartTag(
"itemmetadata");
47 $a_xml_writer->xmlStartTag(
"qtimetadata");
48 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
49 $a_xml_writer->xmlElement(
"fieldlabel", NULL,
"ILIAS_VERSION");
50 $a_xml_writer->xmlElement(
"fieldentry", NULL, $ilias->getSetting(
"ilias_version"));
51 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
52 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
53 $a_xml_writer->xmlElement(
"fieldlabel", NULL,
"QUESTIONTYPE");
54 $a_xml_writer->xmlElement(
"fieldentry", NULL, $this->
object->getQuestionType());
55 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
56 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
57 $a_xml_writer->xmlElement(
"fieldlabel", NULL,
"AUTHOR");
58 $a_xml_writer->xmlElement(
"fieldentry", NULL, $this->
object->getAuthor());
59 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
65 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
66 $a_xml_writer->xmlElement(
"fieldlabel", NULL,
"points");
67 $a_xml_writer->xmlElement(
"fieldentry", NULL, $this->
object->getPoints());
68 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
69 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
70 $a_xml_writer->xmlElement(
"fieldlabel", NULL,
"ordertext");
71 $a_xml_writer->xmlElement(
"fieldentry", NULL, $this->
object->getOrderText());
72 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
73 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
74 $a_xml_writer->xmlElement(
"fieldlabel", NULL,
"textsize");
75 $a_xml_writer->xmlElement(
"fieldentry", NULL, $this->
object->getTextSize());
76 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
77 $a_xml_writer->xmlStartTag(
"qtimetadatafield");
78 $a_xml_writer->xmlElement(
"fieldlabel", NULL,
"separator");
79 $a_xml_writer->xmlElement(
"fieldentry", NULL, $this->
object->getSeparator());
80 $a_xml_writer->xmlEndTag(
"qtimetadatafield");
81 $a_xml_writer->xmlEndTag(
"qtimetadata");
82 $a_xml_writer->xmlEndTag(
"itemmetadata");
86 "label" => $this->
object->getTitle()
88 $a_xml_writer->xmlStartTag(
"presentation", $attrs);
90 $a_xml_writer->xmlStartTag(
"flow");
92 $this->
object->addQTIMaterial($a_xml_writer, $this->
object->getQuestion());
94 $a_xml_writer->xmlEndTag(
"flow");
95 $a_xml_writer->xmlEndTag(
"presentation");
101 $a_xml_writer->xmlEndTag(
"item");
102 $a_xml_writer->xmlEndTag(
"questestinterop");
104 $xml = $a_xml_writer->xmlDumpMem(FALSE);
105 if (!$a_include_header)
107 $pos = strpos($xml,
"?>");
108 $xml = substr($xml, $pos + 2);
Class for question exports.
addAnswerSpecificFeedback(ilXmlWriter $a_xml_writer, $answers)
addGeneralMetadata(ilXmlWriter $xmlwriter)
Class for formula question question exports.
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...