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

Public Member Functions

 init ()
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, string $a_id)
 Get xml representation. More...
 
 getValidSchemaVersions (string $a_entity)
 Returns schema versions that the component can export to. More...
 
 getXmlExportTailDependencies (string $a_entity, string $a_target_release, array $a_ids)
 
- Public Member Functions inherited from ilXmlExporter
 __construct ()
 
 setExport (ilExport $a_exp)
 
 getExport ()
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, string $a_id)
 
 init ()
 
 setExportDirectories (string $a_dir_relative, string $a_dir_absolute)
 
 getRelativeExportDirectory ()
 
 getAbsoluteExportDirectory ()
 
 getXmlExportHeadDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Get head dependencies. More...
 
 getXmlExportTailDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Get tail dependencies. More...
 
 getValidSchemaVersions (string $a_entity)
 Returns schema versions that the component can export to. More...
 
 determineSchemaVersion (string $a_entity, string $a_target_release)
 

Protected Member Functions

 getActiveAdvMDRecords ($a_id)
 

Private Attributes

ilExerciseDataSet $ds
 

Additional Inherited Members

- Static Public Member Functions inherited from ilXmlExporter
static lookupExportDirectory (string $a_obj_type, int $a_obj_id, string $a_export_type='xml', string $a_entity="")
 
- Protected Attributes inherited from ilXmlExporter
ilExport $exp
 

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 Exporter class for exercise

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Member Function Documentation

◆ getActiveAdvMDRecords()

ilExerciseExporter::getActiveAdvMDRecords (   $a_id)
protected
Returns
int[]

Definition at line 156 of file class.ilExerciseExporter.php.

References ilAdvancedMDRecord\_getActivatedRecordsByObjectType().

Referenced by getXmlExportTailDependencies().

156  : array
157  {
158  $active = array();
159 
160  foreach (ilAdvancedMDRecord::_getActivatedRecordsByObjectType("exc") as $record_obj) {
161  foreach ($record_obj->getAssignedObjectTypes() as $obj_info) {
162  if ($obj_info['obj_type'] == 'exc' && $obj_info['optional'] == 0) {
163  $active[] = $record_obj->getRecordId();
164  }
165  // local activation
166  if (
167  $obj_info['obj_type'] == 'exc' &&
168  $obj_info['optional'] == 1 &&
169  $a_id == $record_obj->getParentObject()
170  ) {
171  $active[] = $record_obj->getRecordId();
172  }
173  }
174  }
175 
176  return $active;
177  }
static _getActivatedRecordsByObjectType(string $a_obj_type, string $a_sub_type="", bool $a_only_optional=false)
Get activated records by object type.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValidSchemaVersions()

ilExerciseExporter::getValidSchemaVersions ( string  $a_entity)

Returns schema versions that the component can export to.

ILIAS chooses the first one, that has min/max constraints which fit to the target release. Please put the newest on top.

Definition at line 53 of file class.ilExerciseExporter.php.

53  : array
54  {
55  return array(
56  "9.0" => array(
57  "namespace" => "https://www.ilias.de/Modules/Exercise/exc/9",
58  "xsd_file" => "ilias_exc_9.xsd",
59  "uses_dataset" => true,
60  "min" => "9.0",
61  "max" => "9.99"),
62  "4.1.0" => array(
63  "namespace" => "https://www.ilias.de/Modules/Exercise/exc/4_1",
64  "xsd_file" => "ilias_exc_4_1.xsd",
65  "uses_dataset" => true,
66  "min" => "4.1.0",
67  "max" => "4.3.99"),
68  "4.4.0" => array(
69  "namespace" => "https://www.ilias.de/Modules/Exercise/exc/4_4",
70  "xsd_file" => "ilias_exc_4_4.xsd",
71  "uses_dataset" => true,
72  "min" => "4.4.0",
73  "max" => "4.4.99"),
74  "5.0.0" => array(
75  "namespace" => "https://www.ilias.de/Modules/Exercise/exc/5_0",
76  "xsd_file" => "ilias_exc_5_0.xsd",
77  "uses_dataset" => true,
78  "min" => "5.0.0",
79  "max" => "5.0.99"),
80  "5.1.0" => array(
81  "namespace" => "https://www.ilias.de/Modules/Exercise/exc/5_1",
82  "xsd_file" => "ilias_exc_5_1.xsd",
83  "uses_dataset" => true,
84  "min" => "5.1.0",
85  "max" => "5.1.99"),
86  "5.2.0" => array(
87  "namespace" => "https://www.ilias.de/Modules/Exercise/exc/5_2",
88  "xsd_file" => "ilias_exc_5_2.xsd",
89  "uses_dataset" => true,
90  "min" => "5.2.0",
91  "max" => "5.2.99"),
92  "5.3.0" => array(
93  "namespace" => "https://www.ilias.de/Modules/Exercise/exc/5_3",
94  "xsd_file" => "ilias_exc_5_3.xsd",
95  "uses_dataset" => true,
96  "min" => "5.3.0",
97  "max" => "")
98  );
99  }

◆ getXmlExportTailDependencies()

ilExerciseExporter::getXmlExportTailDependencies ( string  $a_entity,
string  $a_target_release,
array  $a_ids 
)

Definition at line 101 of file class.ilExerciseExporter.php.

References $id, and getActiveAdvMDRecords().

101  : array
102  {
103  $deps = [];
104 
105  if ($a_entity == "exc") {
106  // service settings
107  $deps[] = array(
108  "component" => "components/ILIAS/ILIASObject",
109  "entity" => "common",
110  "ids" => $a_ids
111  );
112 
113  $advmd_ids = array();
114  foreach ($a_ids as $id) {
115  $rec_ids = $this->getActiveAdvMDRecords($id);
116  foreach ($rec_ids as $rec_id) {
117  $advmd_ids[] = $id . ":" . $rec_id;
118  }
119  }
120 
121  if ($advmd_ids !== []) {
122  $deps[] = array(
123  "component" => "components/ILIAS/AdvancedMetaData",
124  "entity" => "advmd",
125  "ids" => $advmd_ids
126  );
127  }
128 
129  $md_ids = array();
130  foreach ($a_ids as $exc_id) {
131  $md_ids[] = $exc_id . ":0:exc";
132  }
133  if ($md_ids !== []) {
134  $deps[] =
135  array(
136  "component" => "components/ILIAS/MetaData",
137  "entity" => "md",
138  "ids" => $md_ids
139  );
140  }
141 
142  // service settings
143  $deps[] = array(
144  "component" => "components/ILIAS/ILIASObject",
145  "entity" => "service_settings",
146  "ids" => $a_ids
147  );
148  }
149 
150  return $deps;
151  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ getXmlRepresentation()

ilExerciseExporter::getXmlRepresentation ( string  $a_entity,
string  $a_schema_version,
string  $a_id 
)

Get xml representation.

Parameters
stringentity
stringtarget release
stringid
Returns
string xml string

Definition at line 42 of file class.ilExerciseExporter.php.

42  : string
43  {
44  $this->ds->initByExporter($this);
45  return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, [$a_id], "", true, true);
46  }

◆ init()

ilExerciseExporter::init ( )

Definition at line 28 of file class.ilExerciseExporter.php.

28  : void
29  {
30  $this->ds = new ilExerciseDataSet();
31  $this->ds->initByExporter($this);
32  $this->ds->setDSPrefix("ds");
33  }
Exercise data set class.

Field Documentation

◆ $ds

ilExerciseDataSet ilExerciseExporter::$ds
private

Definition at line 26 of file class.ilExerciseExporter.php.


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