ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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
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 116 of file class.ilTestQuestionPoolExporter.php.

References ilObjTaxonomy\getUsageOfObject().

Referenced by getXmlExportTailDependencies().

116  : array
117  {
118  $taxIds = [];
119 
120  foreach ($poolObjIds as $poolObjId) {
121  foreach (ilObjTaxonomy::getUsageOfObject($poolObjId) as $taxId) {
122  $taxIds[$taxId] = $taxId;
123  }
124  }
125 
126  return $taxIds;
127  }
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 135 of file class.ilTestQuestionPoolExporter.php.

135  : array
136  {
137  return [
138  "4.1.0" => [
139  "namespace" => "http://www.ilias.de/Modules/TestQuestionPool/htlm/4_1",
140  "xsd_file" => "ilias_qpl_4_1.xsd",
141  "uses_dataset" => false,
142  "min" => "4.1.0",
143  "max" => ""]
144  ];
145  }

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

References $id, and getDependingTaxonomyIds().

79  : array
80  {
81  if ($a_entity == 'qpl') {
82  $deps = [];
83 
84  $taxIds = $this->getDependingTaxonomyIds($a_ids);
85 
86  if (count($taxIds)) {
87  $deps[] = [
88  'component' => 'components/ILIAS/Taxonomy',
89  'entity' => 'tax',
90  'ids' => $taxIds
91  ];
92  }
93 
94  $md_ids = [];
95  foreach ($a_ids as $id) {
96  $md_ids[] = $id . ':0:qpl';
97  }
98  if ($md_ids !== []) {
99  $deps[] = [
100  'component' => 'components/ILIAS/MetaData',
101  'entity' => 'md',
102  'ids' => $md_ids
103  ];
104  }
105 
106  return $deps;
107  }
108 
109  return parent::getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids);
110  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ 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  $qpl = new ilObjQuestionPool($a_id, false);
62  $qpl->loadFromDb();
63 
64  $qpl_exp = new ilQuestionpoolExport($qpl, 'xml');
65  $qpl_exp->buildExportFile();
66 
67  global $DIC; /* @var ILIAS\DI\Container $DIC */
68  $DIC['ilLog']->write(__METHOD__ . ': Created zip file');
69  return ''; // sagt mjansen
70  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:22

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