ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
assQuestionExport Class Reference

Class for question exports. More...

+ Inheritance diagram for assQuestionExport:
+ Collaboration diagram for assQuestionExport:

Public Member Functions

 __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...
 

Data Fields

 $object
 

Protected Member Functions

 addAnswerSpecificFeedback (ilXmlWriter $a_xml_writer, $answers)
 
 addGenericFeedback (ilXmlWriter $a_xml_writer)
 
 addQtiMetaDataField (ilXmlWriter $a_xml_writer, $fieldLabel, $fieldValue)
 adds a qti meta data field with given name and value to the passed xml writer (xml writer must be in context of opened "qtimetadata" tag) More...
 
 addAdditionalContentEditingModeInformation (ilXmlWriter $a_xml_writer)
 adds a qti meta data field for ilias specific information of "additional content editing mode" (xml writer must be in context of opened "qtimetadata" tag) More...
 
 addGeneralMetadata (ilXmlWriter $xmlwriter)
 

Detailed Description

Class for question exports.

exportQuestion is a basis class question exports

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m
Version
$Id$

Definition at line 15 of file class.assQuestionExport.php.

Constructor & Destructor Documentation

◆ __construct()

assQuestionExport::__construct (   $a_object)

assQuestionExport constructor

Parameters
object$a_objectThe question object @access public

Definition at line 32 of file class.assQuestionExport.php.

33 {
34 $this->object = $a_object;
35 }

Member Function Documentation

◆ addAdditionalContentEditingModeInformation()

assQuestionExport::addAdditionalContentEditingModeInformation ( ilXmlWriter  $a_xml_writer)
finalprotected

adds a qti meta data field for ilias specific information of "additional content editing mode" (xml writer must be in context of opened "qtimetadata" tag)

@final @access protected

Parameters
ilXmlWriter$a_xml_writer

Definition at line 197 of file class.assQuestionExport.php.

198 {
199 $this->addQtiMetaDataField(
200 $a_xml_writer,
201 'additional_cont_edit_mode',
202 $this->object->getAdditionalContentEditingMode()
203 );
204 }
addQtiMetaDataField(ilXmlWriter $a_xml_writer, $fieldLabel, $fieldValue)
adds a qti meta data field with given name and value to the passed xml writer (xml writer must be in ...

References addQtiMetaDataField().

Referenced by assClozeTestExport\toXML(), assErrorTextExport\toXML(), assFileUploadExport\toXML(), assFlashQuestionExport\toXML(), assFormulaQuestionExport\toXML(), assImagemapQuestionExport\toXML(), assJavaAppletExport\toXML(), assKprimChoiceExport\toXML(), assLongMenuExport\toXML(), assMatchingQuestionExport\toXML(), assMultipleChoiceExport\toXML(), assNumericExport\toXML(), assOrderingHorizontalExport\toXML(), assOrderingQuestionExport\toXML(), assSingleChoiceExport\toXML(), assTextQuestionExport\toXML(), and assTextSubsetExport\toXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addAnswerSpecificFeedback()

assQuestionExport::addAnswerSpecificFeedback ( ilXmlWriter  $a_xml_writer,
  $answers 
)
protected
Parameters
ilXmlWriter$a_xml_writer

Definition at line 40 of file class.assQuestionExport.php.

41 {
42 foreach ($answers as $index => $answer) {
43 $linkrefid = "response_$index";
44 $attrs = array(
45 "ident" => $linkrefid,
46 "view" => "All"
47 );
48 $a_xml_writer->xmlStartTag("itemfeedback", $attrs);
49 // qti flow_mat
50 $a_xml_writer->xmlStartTag("flow_mat");
51 $fb = $this->object->feedbackOBJ->getSpecificAnswerFeedbackExportPresentation(
52 $this->object->getId(),
53 $index
54 );
55 $this->object->addQTIMaterial($a_xml_writer, $fb);
56 $a_xml_writer->xmlEndTag("flow_mat");
57 $a_xml_writer->xmlEndTag("itemfeedback");
58 }
59 }
xmlEndTag($tag)
Writes an endtag.
xmlStartTag($tag, $attrs=null, $empty=false, $encode=true, $escape=true)
Writes a starttag.
$index
Definition: metadata.php:60

References $index, ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

Referenced by assErrorTextExport\toXML(), assOrderingHorizontalExport\toXML(), and assTextQuestionExport\toXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGeneralMetadata()

◆ addGenericFeedback()

assQuestionExport::addGenericFeedback ( ilXmlWriter  $a_xml_writer)
protected
Parameters
ilXmlWriter$a_xml_writer

Definition at line 64 of file class.assQuestionExport.php.

65 {
66 $this->exportFeedbackOnly($a_xml_writer);
67 }
exportFeedbackOnly($a_xml_writer)

References exportFeedbackOnly().

Referenced by assErrorTextExport\toXML(), assFormulaQuestionExport\toXML(), and assOrderingHorizontalExport\toXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addQtiMetaDataField()

assQuestionExport::addQtiMetaDataField ( ilXmlWriter  $a_xml_writer,
  $fieldLabel,
  $fieldValue 
)
finalprotected

adds a qti meta data field with given name and value to the passed xml writer (xml writer must be in context of opened "qtimetadata" tag)

@final @access protected

Parameters
ilXmlWriter$a_xml_writer
string$fieldLabel
string$fieldValue

Definition at line 181 of file class.assQuestionExport.php.

182 {
183 $a_xml_writer->xmlStartTag("qtimetadatafield");
184 $a_xml_writer->xmlElement("fieldlabel", null, $fieldLabel);
185 $a_xml_writer->xmlElement("fieldentry", null, $fieldValue);
186 $a_xml_writer->xmlEndTag("qtimetadatafield");
187 }
xmlElement($tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)

References ilXmlWriter\xmlElement(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

Referenced by addAdditionalContentEditingModeInformation(), addGeneralMetadata(), assMultipleChoiceExport\toXML(), and assSingleChoiceExport\toXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportFeedbackOnly()

assQuestionExport::exportFeedbackOnly (   $a_xml_writer)

Definition at line 69 of file class.assQuestionExport.php.

70 {
71 $feedback_allcorrect = $this->object->feedbackOBJ->getGenericFeedbackExportPresentation(
72 $this->object->getId(),
73 true
74 );
75 $feedback_onenotcorrect = $this->object->feedbackOBJ->getGenericFeedbackExportPresentation(
76 $this->object->getId(),
77 false
78 );
79 if (strlen($feedback_allcorrect . $feedback_onenotcorrect)) {
80 $a_xml_writer->xmlStartTag("resprocessing");
81 $a_xml_writer->xmlStartTag("outcomes");
82 $a_xml_writer->xmlStartTag("decvar");
83 $a_xml_writer->xmlEndTag("decvar");
84 $a_xml_writer->xmlEndTag("outcomes");
85
86 if (strlen($feedback_allcorrect)) {
87 $attrs = array(
88 "continue" => "Yes"
89 );
90 $a_xml_writer->xmlStartTag("respcondition", $attrs);
91 // qti conditionvar
92 $a_xml_writer->xmlStartTag("conditionvar");
93 $attrs = array(
94 "respident" => "points"
95 );
96 $a_xml_writer->xmlElement("varequal", $attrs, $this->object->getPoints());
97 $a_xml_writer->xmlEndTag("conditionvar");
98 // qti displayfeedback
99 $attrs = array(
100 "feedbacktype" => "Response",
101 "linkrefid" => "response_allcorrect"
102 );
103 $a_xml_writer->xmlElement("displayfeedback", $attrs);
104 $a_xml_writer->xmlEndTag("respcondition");
105 }
106
107 if (strlen($feedback_onenotcorrect)) {
108 $attrs = array(
109 "continue" => "Yes"
110 );
111 $a_xml_writer->xmlStartTag("respcondition", $attrs);
112 // qti conditionvar
113 $a_xml_writer->xmlStartTag("conditionvar");
114 $a_xml_writer->xmlStartTag("not");
115 $attrs = array(
116 "respident" => "points"
117 );
118 $a_xml_writer->xmlElement("varequal", $attrs, $this->object->getPoints());
119 $a_xml_writer->xmlEndTag("not");
120 $a_xml_writer->xmlEndTag("conditionvar");
121 // qti displayfeedback
122 $attrs = array(
123 "feedbacktype" => "Response",
124 "linkrefid" => "response_onenotcorrect"
125 );
126 $a_xml_writer->xmlElement("displayfeedback", $attrs);
127 $a_xml_writer->xmlEndTag("respcondition");
128 }
129 $a_xml_writer->xmlEndTag("resprocessing");
130 }
131
132 if (strlen($feedback_allcorrect)) {
133 $attrs = array(
134 "ident" => "response_allcorrect",
135 "view" => "All"
136 );
137 $a_xml_writer->xmlStartTag("itemfeedback", $attrs);
138 // qti flow_mat
139 $a_xml_writer->xmlStartTag("flow_mat");
140 $this->object->addQTIMaterial($a_xml_writer, $feedback_allcorrect);
141 $a_xml_writer->xmlEndTag("flow_mat");
142 $a_xml_writer->xmlEndTag("itemfeedback");
143 }
144 if (strlen($feedback_onenotcorrect)) {
145 $attrs = array(
146 "ident" => "response_onenotcorrect",
147 "view" => "All"
148 );
149 $a_xml_writer->xmlStartTag("itemfeedback", $attrs);
150 // qti flow_mat
151 $a_xml_writer->xmlStartTag("flow_mat");
152 $this->object->addQTIMaterial($a_xml_writer, $feedback_onenotcorrect);
153 $a_xml_writer->xmlEndTag("flow_mat");
154 $a_xml_writer->xmlEndTag("itemfeedback");
155 }
156 }

Referenced by addGenericFeedback(), assFileUploadExport\toXML(), and assFlashQuestionExport\toXML().

+ Here is the caller graph for this function:

◆ toXML()

assQuestionExport::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.

Returns a QTI xml representation of the question and sets the internal domxml variable with the DOM XML representation of the QTI xml representation

Returns
string The QTI xml representation of the question @access public

Reimplemented in assClozeTestExport, assErrorTextExport, assFileUploadExport, assFlashQuestionExport, assFormulaQuestionExport, assImagemapQuestionExport, assJavaAppletExport, assKprimChoiceExport, assLongMenuExport, assMatchingQuestionExport, assMultipleChoiceExport, assNumericExport, assOrderingHorizontalExport, assOrderingQuestionExport, assSingleChoiceExport, assTextQuestionExport, assTextSubsetExport, and assLongMenuExportQti21.

Definition at line 167 of file class.assQuestionExport.php.

168 {
169 }

Field Documentation

◆ $object

assQuestionExport::$object

Definition at line 24 of file class.assQuestionExport.php.


The documentation for this class was generated from the following file: