ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
assFileUploadExport Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for assFileUploadExport:
+ Collaboration diagram for assFileUploadExport:

Public Member Functions

 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. More...
 
- Public Member Functions inherited from assQuestionExport
 __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 Returns a QTI xml representation of the question and sets the internal domxml variable with the DOM XML representation of the QTI xml representation. More...
 
 addQTIMaterial (ilXmlWriter $a_xml_writer, string $a_material, bool $close_material_tag=true, bool $add_mobs=true)
 

Additional Inherited Members

- Data Fields inherited from assQuestionExport
 $object
 
- Protected Member Functions inherited from assQuestionExport
 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)
 
 addSuggestedSolution (ilXmlWriter $writer)
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class for file upload 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 26 of file class.assFileUploadExport.php.

Member Function Documentation

◆ toXML()

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

Definition at line 33 of file class.assFileUploadExport.php.

References $DIC, assQuestionExport\addAdditionalContentEditingModeInformation(), assQuestionExport\addGeneralMetadata(), assQuestionExport\addQTIMaterial(), assQuestionExport\addSuggestedSolution(), assQuestionExport\exportFeedbackOnly(), IL_INST_ID, null, and ILIAS\Repository\object().

33  : string
34  {
35  global $DIC;
36  $ilias = $DIC['ilias'];
37 
38  $a_xml_writer = new ilXmlWriter();
39  // set xml header
40  $a_xml_writer->xmlHeader();
41  $a_xml_writer->xmlStartTag("questestinterop");
42  $attrs = [
43  "ident" => "il_" . IL_INST_ID . "_qst_" . $this->object->getId(),
44  "title" => $this->object->getTitle(),
45  "maxattempts" => $this->object->getNrOfTries()
46  ];
47  $a_xml_writer->xmlStartTag("item", $attrs);
48  // add question description
49  $a_xml_writer->xmlElement("qticomment", null, $this->object->getComment());
50  $a_xml_writer->xmlStartTag("itemmetadata");
51  $a_xml_writer->xmlStartTag("qtimetadata");
52  $a_xml_writer->xmlStartTag("qtimetadatafield");
53  $a_xml_writer->xmlElement("fieldlabel", null, "ILIAS_VERSION");
54  $a_xml_writer->xmlElement("fieldentry", null, $ilias->getSetting("ilias_version"));
55  $a_xml_writer->xmlEndTag("qtimetadatafield");
56  $a_xml_writer->xmlStartTag("qtimetadatafield");
57  $a_xml_writer->xmlElement("fieldlabel", null, "QUESTIONTYPE");
58  $a_xml_writer->xmlElement("fieldentry", null, $this->object->getQuestionType());
59  $a_xml_writer->xmlEndTag("qtimetadatafield");
60  $a_xml_writer->xmlStartTag("qtimetadatafield");
61  $a_xml_writer->xmlElement("fieldlabel", null, "AUTHOR");
62  $a_xml_writer->xmlElement("fieldentry", null, $this->object->getAuthor());
63  $a_xml_writer->xmlEndTag("qtimetadatafield");
64 
65  // additional content editing information
66  $this->addAdditionalContentEditingModeInformation($a_xml_writer);
67  $this->addGeneralMetadata($a_xml_writer);
68 
69  $a_xml_writer->xmlStartTag("qtimetadatafield");
70  $a_xml_writer->xmlElement("fieldlabel", null, "points");
71  $a_xml_writer->xmlElement("fieldentry", null, $this->object->getPoints());
72  $a_xml_writer->xmlEndTag("qtimetadatafield");
73  $a_xml_writer->xmlStartTag("qtimetadatafield");
74  $a_xml_writer->xmlElement("fieldlabel", null, "maxsize");
75  $a_xml_writer->xmlElement("fieldentry", null, $this->object->getMaxSize());
76  $a_xml_writer->xmlEndTag("qtimetadatafield");
77  $a_xml_writer->xmlStartTag("qtimetadatafield");
78  $a_xml_writer->xmlElement("fieldlabel", null, "allowedextensions");
79  $a_xml_writer->xmlElement("fieldentry", null, $this->object->getAllowedExtensions());
80  $a_xml_writer->xmlEndTag("qtimetadatafield");
81  $a_xml_writer->xmlEndTag("qtimetadata");
82  $a_xml_writer->xmlEndTag("itemmetadata");
83 
84  // PART I: qti presentation
85  $attrs = [
86  "label" => $this->object->getTitle()
87  ];
88  $a_xml_writer->xmlStartTag("presentation", $attrs);
89  // add flow to presentation
90  $a_xml_writer->xmlStartTag("flow");
91  // add material with question text to presentation
92  $this->addQTIMaterial($a_xml_writer, $this->object->getQuestion());
93  // add answers to presentation
94  $a_xml_writer->xmlEndTag("flow");
95  $a_xml_writer = $this->addSuggestedSolution($a_xml_writer);
96  $a_xml_writer->xmlEndTag("presentation");
97 
98  $this->exportFeedbackOnly($a_xml_writer);
99 
100  $a_xml_writer->xmlEndTag("item");
101  $a_xml_writer->xmlEndTag("questestinterop");
102 
103  $xml = $a_xml_writer->xmlDumpMem(false);
104  if (!$a_include_header) {
105  $pos = strpos($xml, "?>");
106  $xml = substr($xml, $pos + 2);
107  }
108  return $xml;
109  }
const IL_INST_ID
Definition: constants.php:40
exportFeedbackOnly($a_xml_writer)
addQTIMaterial(ilXmlWriter $a_xml_writer, string $a_material, bool $close_material_tag=true, bool $add_mobs=true)
addGeneralMetadata(ilXmlWriter $xmlwriter)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:26
addAdditionalContentEditingModeInformation(ilXmlWriter $a_xml_writer)
adds a qti meta data field for ilias specific information of "additional content editing mode" (xml w...
addSuggestedSolution(ilXmlWriter $writer)
+ Here is the call graph for this function:

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