ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
assOrderingHorizontalExport 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 assOrderingHorizontalExport:
+ Collaboration diagram for assOrderingHorizontalExport:

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 and sets the internal domxml variable with the DOM XML representation of the QTI xml representation public. 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
 
const ITEM_SOLUTIONHINT = 'solutionhint'
 
- 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)
 
 addSolutionHints (ilXmlWriter $writer)
 
 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 formula question question exports

assOrderingHorizontalExport is a class for single choice 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 27 of file class.assOrderingHorizontalExport.php.

Member Function Documentation

◆ toXML()

assOrderingHorizontalExport::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 and sets the internal domxml variable with the DOM XML representation of the QTI xml representation public.

Definition at line 34 of file class.assOrderingHorizontalExport.php.

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

34  : string
35  {
36  global $DIC;
37  $ilias = $DIC['ilias'];
38 
39  $a_xml_writer = new ilXmlWriter();
40  // set xml header
41  $a_xml_writer->xmlHeader();
42  $a_xml_writer->xmlStartTag("questestinterop");
43  $attrs = [
44  "ident" => "il_" . IL_INST_ID . "_qst_" . $this->object->getId(),
45  "title" => $this->object->getTitle(),
46  "maxattempts" => $this->object->getNrOfTries()
47  ];
48  $a_xml_writer->xmlStartTag("item", $attrs);
49  // add question description
50  $a_xml_writer->xmlElement("qticomment", null, $this->object->getComment());
51  $a_xml_writer->xmlStartTag("itemmetadata");
52  $a_xml_writer->xmlStartTag("qtimetadata");
53  $a_xml_writer->xmlStartTag("qtimetadatafield");
54  $a_xml_writer->xmlElement("fieldlabel", null, "ILIAS_VERSION");
55  $a_xml_writer->xmlElement("fieldentry", null, $ilias->getSetting("ilias_version"));
56  $a_xml_writer->xmlEndTag("qtimetadatafield");
57  $a_xml_writer->xmlStartTag("qtimetadatafield");
58  $a_xml_writer->xmlElement("fieldlabel", null, "QUESTIONTYPE");
59  $a_xml_writer->xmlElement("fieldentry", null, $this->object->getQuestionType());
60  $a_xml_writer->xmlEndTag("qtimetadatafield");
61  $a_xml_writer->xmlStartTag("qtimetadatafield");
62  $a_xml_writer->xmlElement("fieldlabel", null, "AUTHOR");
63  $a_xml_writer->xmlElement("fieldentry", null, $this->object->getAuthor());
64  $a_xml_writer->xmlEndTag("qtimetadatafield");
65 
66  // additional content editing information
67  $this->addAdditionalContentEditingModeInformation($a_xml_writer);
68  $this->addGeneralMetadata($a_xml_writer);
69 
70  $a_xml_writer->xmlStartTag("qtimetadatafield");
71  $a_xml_writer->xmlElement("fieldlabel", null, "points");
72  $a_xml_writer->xmlElement("fieldentry", null, $this->object->getPoints());
73  $a_xml_writer->xmlEndTag("qtimetadatafield");
74  $a_xml_writer->xmlStartTag("qtimetadatafield");
75  $a_xml_writer->xmlElement("fieldlabel", null, "ordertext");
76  $a_xml_writer->xmlElement("fieldentry", null, $this->object->getOrderText());
77  $a_xml_writer->xmlEndTag("qtimetadatafield");
78  $a_xml_writer->xmlStartTag("qtimetadatafield");
79  $a_xml_writer->xmlElement("fieldlabel", null, "textsize");
80  $a_xml_writer->xmlElement("fieldentry", null, $this->object->getTextSize());
81  $a_xml_writer->xmlEndTag("qtimetadatafield");
82  $a_xml_writer->xmlStartTag("qtimetadatafield");
83  $a_xml_writer->xmlElement("fieldlabel", null, "separator");
84  $a_xml_writer->xmlElement("fieldentry", null, $this->object->getSeparator());
85  $a_xml_writer->xmlEndTag("qtimetadatafield");
86  $a_xml_writer->xmlEndTag("qtimetadata");
87  $a_xml_writer->xmlEndTag("itemmetadata");
88 
89  // PART I: qti presentation
90  $attrs = [
91  "label" => $this->object->getTitle()
92  ];
93  $a_xml_writer->xmlStartTag("presentation", $attrs);
94  // add flow to presentation
95  $a_xml_writer->xmlStartTag("flow");
96  // add material with question text to presentation
97  $this->addQTIMaterial($a_xml_writer, $this->object->getQuestion());
98  // add answers to presentation
99  $a_xml_writer->xmlEndTag("flow");
100  $a_xml_writer = $this->addSuggestedSolution($a_xml_writer);
101  $a_xml_writer->xmlEndTag("presentation");
102 
103  $this->addGenericFeedback($a_xml_writer);
104 
105  $a_xml_writer = $this->addSolutionHints($a_xml_writer);
106 
107  $a_xml_writer->xmlEndTag("item");
108  $a_xml_writer->xmlEndTag("questestinterop");
109 
110  $xml = $a_xml_writer->xmlDumpMem(false);
111  if (!$a_include_header) {
112  $pos = strpos($xml, "?>");
113  $xml = substr($xml, $pos + 2);
114  }
115  return $xml;
116  }
const IL_INST_ID
Definition: constants.php:40
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:22
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)
addSolutionHints(ilXmlWriter $writer)
addGenericFeedback(ilXmlWriter $a_xml_writer)
+ Here is the call graph for this function:

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