ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestQuestionPoolExporter 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 ilTestQuestionPoolExporter:
+ Collaboration diagram for ilTestQuestionPoolExporter:

Public Member Functions

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

Static Public Member Functions

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

Private Member Functions

 getDependingTaxonomyIds ($poolObjIds)
 

Private Attributes

 $ds
 

Additional Inherited Members

- 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 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 26 of file class.ilTestQuestionPoolExporter.php.

Member Function Documentation

◆ getDependingTaxonomyIds()

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

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

References ilObjTaxonomy\getUsageOfObject().

Referenced by getXmlExportTailDependencies().

106  : array
107  {
108  include_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
109 
110  $taxIds = array();
111 
112  foreach ($poolObjIds as $poolObjId) {
113  foreach (ilObjTaxonomy::getUsageOfObject($poolObjId) as $taxId) {
114  $taxIds[$taxId] = $taxId;
115  }
116  }
117 
118  return $taxIds;
119  }
static getUsageOfObject(int $a_obj_id, bool $a_include_titles=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValidSchemaVersions()

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

Returns
array

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

127  : array
128  {
129  return array(
130  "4.1.0" => array(
131  "namespace" => "http://www.ilias.de/Modules/TestQuestionPool/htlm/4_1",
132  "xsd_file" => "ilias_qpl_4_1.xsd",
133  "uses_dataset" => false,
134  "min" => "4.1.0",
135  "max" => "")
136  );
137  }

◆ getXmlExportTailDependencies()

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

Get tail dependencies.

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

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

References getDependingTaxonomyIds().

81  : array
82  {
83  if ($a_entity == 'qpl') {
84  $deps = array();
85 
86  $taxIds = $this->getDependingTaxonomyIds($a_ids);
87 
88  if (count($taxIds)) {
89  $deps[] = array(
90  'component' => 'Services/Taxonomy',
91  'entity' => 'tax',
92  'ids' => $taxIds
93  );
94  }
95 
96  return $deps;
97  }
98 
99  return parent::getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids);
100  }
+ Here is the call graph for this function:

◆ getXmlRepresentation()

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

Get xml representation.

Parameters
stringentity
stringschema version
stringid
Returns
string xml string

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

References $DIC.

59  : string
60  {
61  include_once './Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
62  $qpl = new ilObjQuestionPool($a_id, false);
63  $qpl->loadFromDb();
64 
65  include_once("./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
66  $qpl_exp = new ilQuestionpoolExport($qpl, 'xml');
67  $qpl_exp->buildExportFile();
68 
69  global $DIC; /* @var ILIAS\DI\Container $DIC */
70  $DIC['ilLog']->write(__METHOD__ . ': Created zip file');
71  return ''; // sagt mjansen
72  }
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ init()

ilTestQuestionPoolExporter::init ( )

Initialisation.

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

33  : void
34  {
35  }

◆ lookupExportDirectory()

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

Overwritten for qpl.

Parameters
string$a_obj_type
int$a_obj_id
string$a_export_type

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

References ilFileUtils\getDataDir().

43  : string
44  {
45  if ($a_export_type == 'xml') {
46  return ilFileUtils::getDataDir() . "/qpl_data" . "/qpl_" . $a_obj_id . "/export_zip";
47  }
48  return ilFileUtils::getDataDir() . "/qpl_data" . "/qpl_" . $a_obj_id . "/export_" . $a_export_type;
49  }
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:

Field Documentation

◆ $ds

ilTestQuestionPoolExporter::$ds
private

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


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