ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilExerciseExporter Class Reference

Exporter class for exercise. More...

+ Inheritance diagram for ilExerciseExporter:
+ Collaboration diagram for ilExerciseExporter:

Public Member Functions

 init ()
 Initialisation. More...
 
 getXmlRepresentation ($a_entity, $a_schema_version, $a_id)
 Get xml representation. More...
 
 getValidSchemaVersions ($a_entity)
 Returns schema versions that the component can export to. More...
 
 getXmlExportTailDependencies ($a_entity, $a_target_release, $a_ids)
 Get tail dependencies. More...
 
- Public Member Functions inherited from ilXmlExporter
 __construct ()
 Constructor. More...
 
 setExport (ilExport $a_exp)
 Set export object. More...
 
 getExport ()
 Get export. More...
 
 getXmlRepresentation ($a_entity, $a_schema_version, $a_id)
 Get xml representation. More...
 
 init ()
 
 setExportDirectories ($a_dir_relative, $a_dir_absolute)
 Export directories. More...
 
 getRelativeExportDirectory ()
 Get relative export directory. More...
 
 getAbsoluteExportDirectory ()
 Get absolute export directory. More...
 
 getXmlExportHeadDependencies ($a_entity, $a_target_release, $a_ids)
 Get head dependencies. More...
 
 getXmlExportTailDependencies ($a_entity, $a_target_release, $a_ids)
 Get tail dependencies. More...
 
 getValidSchemaVersions ($a_entity)
 Returns schema versions that the component can export to. More...
 
 determineSchemaVersion ($a_entity, $a_target_release)
 Determine schema version. More...
 

Protected Member Functions

 getActiveAdvMDRecords ($a_id)
 

Private Attributes

 $ds
 

Additional Inherited Members

- Static Public Member Functions inherited from ilXmlExporter
static lookupExportDirectory ($a_obj_type, $a_obj_id, $a_export_type='xml', $a_entity="")
 export directory lookup More...
 
- Protected Attributes inherited from ilXmlExporter
 $dir_relative
 
 $dir_absolute
 
 $exp
 

Detailed Description

Exporter class for exercise.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e

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

Member Function Documentation

◆ getActiveAdvMDRecords()

ilExerciseExporter::getActiveAdvMDRecords (   $a_id)
protected

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

142 {
143 $active = array();
144
145 foreach (ilAdvancedMDRecord::_getActivatedRecordsByObjectType("exc") as $record_obj) {
146 foreach ($record_obj->getAssignedObjectTypes() as $obj_info) {
147 if ($obj_info['obj_type'] == 'exc' && $obj_info['optional'] == 0) {
148 $active[] = $record_obj->getRecordId();
149 }
150 // local activation
151 if (
152 $obj_info['obj_type'] == 'exc' &&
153 $obj_info['optional'] == 1 &&
154 $a_id == $record_obj->getParentObject()
155 ) {
156 $active[] = $record_obj->getRecordId();
157 }
158 }
159 }
160
161 return $active;
162 }
static _getActivatedRecordsByObjectType($a_obj_type, $a_sub_type="", $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 (   $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.

Returns

Reimplemented from ilXmlExporter.

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

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

◆ getXmlExportTailDependencies()

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

Get tail dependencies.

Parameters
stringentity
stringtarget release
arrayids
Returns
array array of array with keys "component", entity", "ids"

Reimplemented from ilXmlExporter.

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

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

References getActiveAdvMDRecords().

+ Here is the call graph for this function:

◆ getXmlRepresentation()

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

Get xml representation.

Parameters
stringentity
stringtarget release
stringid
Returns
string xml string

Reimplemented from ilXmlExporter.

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

33 {
34 $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
35 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
36 }

◆ init()

ilExerciseExporter::init ( )

Initialisation.

Reimplemented from ilXmlExporter.

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

18 {
19 $this->ds = new ilExerciseDataSet();
20 $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
21 $this->ds->setDSPrefix("ds");
22 }
Exercise data set class.

Field Documentation

◆ $ds

ilExerciseExporter::$ds
private

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


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