|
| toXML ($a_include_header=true, $a_include_binary=true, $a_shuffle=false, $test_output=false, $force_image_references=false) |
|
| __construct ($a_object) |
| assQuestionExport constructor More...
|
|
| exportFeedbackOnly ($a_xml_writer) |
|
| 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. More...
|
|
◆ toXML()
assLongMenuExportQti21::toXML |
( |
|
$a_include_header = true , |
|
|
|
$a_include_binary = true , |
|
|
|
$a_shuffle = false , |
|
|
|
$test_output = false , |
|
|
|
$force_image_references = false |
|
) |
| |
Definition at line 10 of file class.assLongMenuExportQti21.php.
References $i, $index, $key, $xml, array, assLongMenu\GAP_PLACEHOLDER, and object.
14 include_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
19 'xmlns' =>
"http://www.imsglobal.org/xsd/imsqti_v2p1",
20 'xmlns:xsi' =>
'http://www.w3.org/2001/XMLSchema-instance',
21 'xsi:schemaLocation' =>
'http://www.imsglobal.org/xsd/imsqti_v2p1 http://www.imsglobal.org/xsd/qti/qtiv2p1/imsqti_v2p1p1.xsd http://www.w3.org/1998/Math/MathML http://www.w3.org/Math/XMLSchema/mathml2/mathml2.xsd',
22 "identifier" =>
"il_" . IL_INST_ID .
"_qst_" . $this->
object->getId(),
23 "title" => $this->
object->getTitle(),
25 'adaptive' =>
'false',
26 'timeDependent' =>
'false' 28 $xml->xmlStartTag(
"assessmentItem", $attrs,
false,
true,
false);
30 $correct_answers = $this->
object->getCorrectAnswers();
31 $answers = $this->
object->getAnswers();
33 $inlineChoice =
array();
34 foreach ($answers as
$key => $values) {
36 $inlineChoiceString =
'<inlineChoiceInteraction responseIdentifier="LONGMENU_' . $real_id .
'" shuffle="false" required="false">';
38 "identifier" =>
"LONGMENU_" . $real_id,
39 "cardinality" =>
"single",
40 "baseType" =>
"identifier" 42 $xml->xmlStartTag(
"responseDeclaration", $attrs);
43 $xml->xmlStartTag(
"correctResponse");
44 $xml->xmlElement(
"value", null, $correct_answers[
$key][0][0]);
45 $xml->xmlEndTag(
"correctResponse");
47 "defaultValue" =>
"0",
49 "upperBound" => $correct_answers[$key][1]
51 $xml->xmlStartTag(
"mapping", $attrs);
53 foreach ($values as
$index => $value) {
55 if (in_array($value, $correct_answers[$key][0])) {
56 $points = $correct_answers[
$key][1];
60 "mappedValue" => $points
62 $inlineChoiceString .=
'<inlineChoice identifier="' . $value .
'" fixed="false" showHide="show">' . $value .
'</inlineChoice>';
63 $xml->xmlElement(
"mapEntry", $attrs);
65 $xml->xmlEndTag(
"mapping");
66 $xml->xmlEndTag(
"responseDeclaration");
67 $inlineChoiceString .=
'</inlineChoiceInteraction>';
68 $inlineChoice[$real_id] = $inlineChoiceString;
71 "identifier" =>
"SCORE",
72 "cardinality" =>
"single",
75 $xml->xmlStartTag(
"outcomeDeclaration", $attrs);
76 $xml->xmlStartTag(
"defaultValue");
77 $xml->xmlElement(
"value", null, 0);
78 $xml->xmlEndTag(
"defaultValue");
79 $xml->xmlEndTag(
"outcomeDeclaration");
82 "identifier" =>
"MAXSCORE",
83 "cardinality" =>
"single",
86 $xml->xmlStartTag(
"outcomeDeclaration", $attrs);
87 $xml->xmlStartTag(
"defaultValue");
88 $xml->xmlElement(
"value", null, $this->
object->getMaximumPoints());
89 $xml->xmlEndTag(
"defaultValue");
90 $xml->xmlEndTag(
"outcomeDeclaration");
93 "identifier" =>
"FEEDBACKBASIC",
94 "cardinality" =>
"single",
95 "baseType" =>
"identifier",
96 "view" =>
"testConstructor" 99 $xml->xmlStartTag(
"outcomeDeclaration", $attrs);
100 $xml->xmlStartTag(
"defaultValue");
101 $xml->xmlElement(
"value", null,
"TODO IMPLEMENT FEEDBACK");
102 $xml->xmlEndTag(
"defaultValue");
103 $xml->xmlEndTag(
"outcomeDeclaration");
105 $longmenu_text = $this->
object->getLongMenuTextValue();
107 for (
$i = 1;
$i <=
sizeof($answers);
$i++) {
110 $longmenu_text = $this->
object->getQuestion() . $longmenu_text;
111 $xml->xmlStartTag(
"itemBody", $attrs);
112 $xml->xmlElement(
"div", null, $longmenu_text,
true,
false);
113 $xml->xmlEndTag(
"itemBody");
115 $xml->xmlStartTag(
"responseProcessing");
116 foreach ($answers as $key => $values) {
117 $xml->xmlStartTag(
"responseCondition");
118 $xml->xmlStartTag(
"responseIf");
119 $xml->xmlStartTag(
"not");
120 $xml->xmlStartTag(
"isNull");
121 $xml->xmlElement(
"variable",
array(
"identifier" =>
'LONGMENU_' . ($key + 1) ));
122 $xml->xmlEndTag(
"isNull");
123 $xml->xmlEndTag(
"not");
124 $xml->xmlStartTag(
"setOutcomeValue",
array(
"identifier" =>
'SCORE'));
125 $xml->xmlStartTag(
"sum");
126 $xml->xmlElement(
"variable",
array(
"identifier" =>
'SCORE'));
127 $xml->xmlElement(
"mapResponse",
array(
"identifier" =>
'LONGMENU_' . ($key + 1) ));
128 $xml->xmlEndTag(
"sum");
129 $xml->xmlEndTag(
"setOutcomeValue");
130 $xml->xmlStartTag(
"setOutcomeValue",
array(
"identifier" =>
'FEEDBACKBASIC'));
131 $xml->xmlElement(
"value",
array(
'baseType' =>
'identifier'),
"incorrect");
132 $xml->xmlEndTag(
"setOutcomeValue");
133 $xml->xmlEndTag(
"responseIf");
134 $xml->xmlEndTag(
"responseCondition");
136 $xml->xmlEndTag(
"responseProcessing");
137 $xml->xmlEndTag(
"assessmentItem");
139 if (!$a_include_header) {
140 $pos = strpos(
$xml,
"?>");
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
◆ $object
assLongMenuExportQti21::$object |
The documentation for this class was generated from the following file: