ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilTestQuestionPoolExporter Class Reference

Used for container export with tests. More...

+ Inheritance diagram for ilTestQuestionPoolExporter:
+ Collaboration diagram for ilTestQuestionPoolExporter:

Public Member Functions

 init ()
 Initialisation. More...
 
 getXmlRepresentation ($a_entity, $a_schema_version, $a_id)
 Get xml representation. 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...
 
- 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...
 

Static Public Member Functions

static lookupExportDirectory ($a_obj_type, $a_obj_id, $a_export_type='xml', $a_entity="")
 Overwritten for qpl. More...
 
- 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...
 

Private Member Functions

 getDependingTaxonomyIds ($poolObjIds)
 

Private Attributes

 $ds
 

Additional Inherited Members

- Protected Attributes inherited from ilXmlExporter
 $dir_relative
 
 $dir_absolute
 
 $exp
 

Detailed Description

Used for container export with tests.

Author
Helmut Schottmüller ilias.nosp@m.@aur.nosp@m.ealis.nosp@m..de
Version
$Id$

Definition at line 13 of file class.ilTestQuestionPoolExporter.php.

Member Function Documentation

◆ getDependingTaxonomyIds()

ilTestQuestionPoolExporter::getDependingTaxonomyIds (   $poolObjIds)
private
Parameters
array$testObjIds
Returns
array $taxIds

Definition at line 93 of file class.ilTestQuestionPoolExporter.php.

References array, and ilObjTaxonomy\getUsageOfObject().

Referenced by getXmlExportTailDependencies().

94  {
95  include_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
96 
97  $taxIds = array();
98 
99  foreach ($poolObjIds as $poolObjId) {
100  foreach (ilObjTaxonomy::getUsageOfObject($poolObjId) as $taxId) {
101  $taxIds[$taxId] = $taxId;
102  }
103  }
104 
105  return $taxIds;
106  }
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValidSchemaVersions()

ilTestQuestionPoolExporter::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

Definition at line 115 of file class.ilTestQuestionPoolExporter.php.

References array.

116  {
117  return array(
118  "4.1.0" => array(
119  "namespace" => "http://www.ilias.de/Modules/TestQuestionPool/htlm/4_1",
120  "xsd_file" => "ilias_qpl_4_1.xsd",
121  "uses_dataset" => false,
122  "min" => "4.1.0",
123  "max" => "")
124  );
125  }
Create styles array
The data for the language used.

◆ getXmlExportTailDependencies()

ilTestQuestionPoolExporter::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"

Definition at line 68 of file class.ilTestQuestionPoolExporter.php.

References array, and getDependingTaxonomyIds().

69  {
70  if ($a_entity == 'qpl') {
71  $deps = array();
72 
73  $taxIds = $this->getDependingTaxonomyIds($a_ids);
74 
75  if (count($taxIds)) {
76  $deps[] = array(
77  'component' => 'Services/Taxonomy',
78  'entity' => 'tax',
79  'ids' => $taxIds
80  );
81  }
82 
83  return $deps;
84  }
85 
86  return parent::getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids);
87  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getXmlRepresentation()

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

Get xml representation.

Parameters
stringentity
stringschema version
stringid
Returns
string xml string

Definition at line 47 of file class.ilTestQuestionPoolExporter.php.

References $GLOBALS.

48  {
49  include_once './Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
50  $qpl = new ilObjQuestionPool($a_id, false);
51  $qpl->loadFromDb();
52 
53  include_once("./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
54  $qpl_exp = new ilQuestionpoolExport($qpl, 'xml');
55  $zip = $qpl_exp->buildExportFile();
56 
57  $GLOBALS['ilLog']->write(__METHOD__ . ': Created zip file ' . $zip);
58  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Export class for questionpools.

◆ init()

ilTestQuestionPoolExporter::init ( )

Initialisation.

Definition at line 20 of file class.ilTestQuestionPoolExporter.php.

21  {
22  }

◆ lookupExportDirectory()

static ilTestQuestionPoolExporter::lookupExportDirectory (   $a_obj_type,
  $a_obj_id,
  $a_export_type = 'xml',
  $a_entity = "" 
)
static

Overwritten for qpl.

Parameters
string$a_obj_type
int$a_obj_id
string$a_export_type

Definition at line 30 of file class.ilTestQuestionPoolExporter.php.

References ilUtil\getDataDir().

31  {
32  if ($a_export_type == 'xml') {
33  return ilUtil::getDataDir() . "/qpl_data" . "/qpl_" . $a_obj_id . "/export_zip";
34  }
35  return ilUtil::getDataDir() . "/qpl_data" . "/qpl_" . $a_obj_id . "/export_" . $a_export_type;
36  }
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:

Field Documentation

◆ $ds

ilTestQuestionPoolExporter::$ds
private

Definition at line 15 of file class.ilTestQuestionPoolExporter.php.


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