ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 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)

protected

Parameters
ilXmlWriter$a_xml_writer

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

References addQtiMetaDataField(), and object.

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

201  {
202  $this->addQtiMetaDataField(
203  $a_xml_writer, 'additional_cont_edit_mode', $this->object->getAdditionalContentEditingMode()
204  );
205  }
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 ...
Create new PHPExcel object
obj_idprivate
+ 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.

References array, object, ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

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

41  {
42  foreach ($answers as $index => $answer)
43  {
44  $linkrefid = "response_$index";
45  $attrs = array(
46  "ident" => $linkrefid,
47  "view" => "All"
48  );
49  $a_xml_writer->xmlStartTag("itemfeedback", $attrs);
50  // qti flow_mat
51  $a_xml_writer->xmlStartTag("flow_mat");
52  $fb = $this->object->feedbackOBJ->getSpecificAnswerFeedbackExportPresentation(
53  $this->object->getId(), $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  }
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
xmlEndTag($tag)
Writes an endtag.
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGeneralMetadata()

assQuestionExport::addGeneralMetadata ( ilXmlWriter  $xmlwriter)
protected
Parameters
ilXmlWriter$xmlwriter

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

References addQtiMetaDataField(), and object.

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

211  {
212  $this->addQtiMetaDataField($xmlwriter, 'externalId', $this->object->getExternalId());
213  }
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 ...
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGenericFeedback()

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

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

References exportFeedbackOnly().

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

65  {
66  $this->exportFeedbackOnly($a_xml_writer);
67  }
exportFeedbackOnly($a_xml_writer)
+ 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)

protected

Parameters
ilXmlWriter$a_xml_writer
string$fieldLabel
string$fieldValue

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

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

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

185  {
186  $a_xml_writer->xmlStartTag("qtimetadatafield");
187  $a_xml_writer->xmlElement("fieldlabel", NULL, $fieldLabel);
188  $a_xml_writer->xmlElement("fieldentry", NULL, $fieldValue);
189  $a_xml_writer->xmlEndTag("qtimetadatafield");
190  }
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
xmlElement($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
Writes a basic element (no children, just textual content)
xmlEndTag($tag)
Writes an endtag.
+ 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.

References array, and object.

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

70  {
71  $feedback_allcorrect = $this->object->feedbackOBJ->getGenericFeedbackExportPresentation(
72  $this->object->getId(), true
73  );
74  $feedback_onenotcorrect = $this->object->feedbackOBJ->getGenericFeedbackExportPresentation(
75  $this->object->getId(), false
76  );
77  if (strlen($feedback_allcorrect . $feedback_onenotcorrect))
78  {
79  $a_xml_writer->xmlStartTag("resprocessing");
80  $a_xml_writer->xmlStartTag("outcomes");
81  $a_xml_writer->xmlStartTag("decvar");
82  $a_xml_writer->xmlEndTag("decvar");
83  $a_xml_writer->xmlEndTag("outcomes");
84 
85  if (strlen($feedback_allcorrect))
86  {
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  {
109  $attrs = array(
110  "continue" => "Yes"
111  );
112  $a_xml_writer->xmlStartTag("respcondition", $attrs);
113  // qti conditionvar
114  $a_xml_writer->xmlStartTag("conditionvar");
115  $a_xml_writer->xmlStartTag("not");
116  $attrs = array(
117  "respident" => "points"
118  );
119  $a_xml_writer->xmlElement("varequal", $attrs, $this->object->getPoints());
120  $a_xml_writer->xmlEndTag("not");
121  $a_xml_writer->xmlEndTag("conditionvar");
122  // qti displayfeedback
123  $attrs = array(
124  "feedbacktype" => "Response",
125  "linkrefid" => "response_onenotcorrect"
126  );
127  $a_xml_writer->xmlElement("displayfeedback", $attrs);
128  $a_xml_writer->xmlEndTag("respcondition");
129  }
130  $a_xml_writer->xmlEndTag("resprocessing");
131  }
132 
133  if (strlen($feedback_allcorrect))
134  {
135  $attrs = array(
136  "ident" => "response_allcorrect",
137  "view" => "All"
138  );
139  $a_xml_writer->xmlStartTag("itemfeedback", $attrs);
140  // qti flow_mat
141  $a_xml_writer->xmlStartTag("flow_mat");
142  $this->object->addQTIMaterial($a_xml_writer, $feedback_allcorrect);
143  $a_xml_writer->xmlEndTag("flow_mat");
144  $a_xml_writer->xmlEndTag("itemfeedback");
145  }
146  if (strlen($feedback_onenotcorrect))
147  {
148  $attrs = array(
149  "ident" => "response_onenotcorrect",
150  "view" => "All"
151  );
152  $a_xml_writer->xmlStartTag("itemfeedback", $attrs);
153  // qti flow_mat
154  $a_xml_writer->xmlStartTag("flow_mat");
155  $this->object->addQTIMaterial($a_xml_writer, $feedback_onenotcorrect);
156  $a_xml_writer->xmlEndTag("flow_mat");
157  $a_xml_writer->xmlEndTag("itemfeedback");
158  }
159  }
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
+ 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 public

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

171  {
172  }

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: