ILIAS  release_8 Revision v8.24
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)
 Get tail dependencies. More...
 
- 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
string $dir_relative = ""
 
string $dir_absolute = ""
 
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 150 of file class.ilExerciseExporter.php.

150 : array
151 {
152 $active = array();
153
154 foreach (ilAdvancedMDRecord::_getActivatedRecordsByObjectType("exc") as $record_obj) {
155 foreach ($record_obj->getAssignedObjectTypes() as $obj_info) {
156 if ($obj_info['obj_type'] == 'exc' && $obj_info['optional'] == 0) {
157 $active[] = $record_obj->getRecordId();
158 }
159 // local activation
160 if (
161 $obj_info['obj_type'] == 'exc' &&
162 $obj_info['optional'] == 1 &&
163 $a_id == $record_obj->getParentObject()
164 ) {
165 $active[] = $record_obj->getRecordId();
166 }
167 }
168 }
169
170 return $active;
171 }
static _getActivatedRecordsByObjectType(string $a_obj_type, string $a_sub_type="", bool $a_only_optional=false)
Get activated records by object type.

References ilAdvancedMDRecord\_getActivatedRecordsByObjectType().

Referenced by getXmlExportTailDependencies().

+ 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.

Reimplemented from ilXmlExporter.

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

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

◆ getXmlExportTailDependencies()

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

Get tail dependencies.

Returns
array array of array with keys "component", entity", "ids"

Reimplemented from ilXmlExporter.

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

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

References $id, and getActiveAdvMDRecords().

+ 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

Reimplemented from ilXmlExporter.

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

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

◆ init()

ilExerciseExporter::init ( )

Reimplemented from ilXmlExporter.

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

28 : void
29 {
30 $this->ds = new ilExerciseDataSet();
31 $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
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: