ILIAS  release_4-4 Revision
assQuestionExport Class Reference

Class for question exports. More...

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

Public Member Functions

 assQuestionExport (&$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

 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.

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 168 of file class.assQuestionExport.php.

References addQtiMetaDataField().

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

169  {
170  $this->addQtiMetaDataField(
171  $a_xml_writer, 'additional_cont_edit_mode', $this->object->getAdditionalContentEditingMode()
172  );
173  }
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 ...
+ 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 178 of file class.assQuestionExport.php.

References addQtiMetaDataField().

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

179  {
180  $this->addQtiMetaDataField($xmlwriter, 'externalId', $this->object->getExternalId());
181  }
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 ...
+ 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 152 of file class.assQuestionExport.php.

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

Referenced by addAdditionalContentEditingModeInformation(), and addGeneralMetadata().

153  {
154  $a_xml_writer->xmlStartTag("qtimetadatafield");
155  $a_xml_writer->xmlElement("fieldlabel", NULL, $fieldLabel);
156  $a_xml_writer->xmlElement("fieldentry", NULL, $fieldValue);
157  $a_xml_writer->xmlEndTag("qtimetadatafield");
158  }
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:

◆ assQuestionExport()

assQuestionExport::assQuestionExport ( $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  }

◆ exportFeedbackOnly()

assQuestionExport::exportFeedbackOnly (   $a_xml_writer)

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

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

38  {
39  $feedback_allcorrect = $this->object->feedbackOBJ->getGenericFeedbackExportPresentation(
40  $this->object->getId(), true
41  );
42  $feedback_onenotcorrect = $this->object->feedbackOBJ->getGenericFeedbackExportPresentation(
43  $this->object->getId(), false
44  );
45  if (strlen($feedback_allcorrect . $feedback_onenotcorrect))
46  {
47  $a_xml_writer->xmlStartTag("resprocessing");
48  $a_xml_writer->xmlStartTag("outcomes");
49  $a_xml_writer->xmlStartTag("decvar");
50  $a_xml_writer->xmlEndTag("decvar");
51  $a_xml_writer->xmlEndTag("outcomes");
52 
53  if (strlen($feedback_allcorrect))
54  {
55  $attrs = array(
56  "continue" => "Yes"
57  );
58  $a_xml_writer->xmlStartTag("respcondition", $attrs);
59  // qti conditionvar
60  $a_xml_writer->xmlStartTag("conditionvar");
61  $attrs = array(
62  "respident" => "points"
63  );
64  $a_xml_writer->xmlElement("varequal", $attrs, $this->object->getPoints());
65  $a_xml_writer->xmlEndTag("conditionvar");
66  // qti displayfeedback
67  $attrs = array(
68  "feedbacktype" => "Response",
69  "linkrefid" => "response_allcorrect"
70  );
71  $a_xml_writer->xmlElement("displayfeedback", $attrs);
72  $a_xml_writer->xmlEndTag("respcondition");
73  }
74 
75  if (strlen($feedback_onenotcorrect))
76  {
77  $attrs = array(
78  "continue" => "Yes"
79  );
80  $a_xml_writer->xmlStartTag("respcondition", $attrs);
81  // qti conditionvar
82  $a_xml_writer->xmlStartTag("conditionvar");
83  $a_xml_writer->xmlStartTag("not");
84  $attrs = array(
85  "respident" => "points"
86  );
87  $a_xml_writer->xmlElement("varequal", $attrs, $this->object->getPoints());
88  $a_xml_writer->xmlEndTag("not");
89  $a_xml_writer->xmlEndTag("conditionvar");
90  // qti displayfeedback
91  $attrs = array(
92  "feedbacktype" => "Response",
93  "linkrefid" => "response_onenotcorrect"
94  );
95  $a_xml_writer->xmlElement("displayfeedback", $attrs);
96  $a_xml_writer->xmlEndTag("respcondition");
97  }
98  $a_xml_writer->xmlEndTag("resprocessing");
99  }
100 
101  if (strlen($feedback_allcorrect))
102  {
103  $attrs = array(
104  "ident" => "response_allcorrect",
105  "view" => "All"
106  );
107  $a_xml_writer->xmlStartTag("itemfeedback", $attrs);
108  // qti flow_mat
109  $a_xml_writer->xmlStartTag("flow_mat");
110  $this->object->addQTIMaterial($a_xml_writer, $feedback_allcorrect);
111  $a_xml_writer->xmlEndTag("flow_mat");
112  $a_xml_writer->xmlEndTag("itemfeedback");
113  }
114  if (strlen($feedback_onenotcorrect))
115  {
116  $attrs = array(
117  "ident" => "response_onenotcorrect",
118  "view" => "All"
119  );
120  $a_xml_writer->xmlStartTag("itemfeedback", $attrs);
121  // qti flow_mat
122  $a_xml_writer->xmlStartTag("flow_mat");
123  $this->object->addQTIMaterial($a_xml_writer, $feedback_onenotcorrect);
124  $a_xml_writer->xmlEndTag("flow_mat");
125  $a_xml_writer->xmlEndTag("itemfeedback");
126  }
127  }
+ 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 138 of file class.assQuestionExport.php.

139  {
140  }

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: