ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
exQuestionPoolImporter Class Reference
+ Inheritance diagram for exQuestionPoolImporter:
+ Collaboration diagram for exQuestionPoolImporter:

Public Member Functions

 importXmlRepresentation ($a_entity, $a_id, $a_xml, $a_mapping)
 
 finalProcessing ($a_mapping)
 Final processing. More...
 
- Public Member Functions inherited from ilXmlImporter
 __construct ()
 Constructor. More...
 
 setImport ($a_val)
 Set import. More...
 
 getImport ()
 Get import. More...
 
 init ()
 Init. More...
 
 setInstallId ($a_val)
 Set installation id. More...
 
 getInstallId ()
 Get installation id. More...
 
 setInstallUrl ($a_val)
 Set installation url. More...
 
 getInstallUrl ()
 Get installation url. More...
 
 setSchemaVersion ($a_val)
 Set schema version. More...
 
 getSchemaVersion ()
 Get schema version. More...
 
 setImportDirectory ($a_val)
 Set import directory. More...
 
 getImportDirectory ()
 Get import directory. More...
 
 setSkipEntities ($a_val)
 Set skip entities. More...
 
 getSkipEntities ()
 Get skip entities. More...
 
 exportedFromSameInstallation ()
 Is exporting and importing installation identical? More...
 
 importXmlRepresentation ($a_entity, $a_id, $a_xml, $a_mapping)
 Import xml representation. More...
 
 finalProcessing ($a_mapping)
 Final processing. More...
 
 afterContainerImportProcessing (ilImportMapping $mapping)
 Called after all container objects have been implemented. More...
 

Additional Inherited Members

- Protected Attributes inherited from ilXmlImporter
 $skip_entities = array()
 
 $imp
 

Detailed Description

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

Member Function Documentation

◆ finalProcessing()

exQuestionPoolImporter::finalProcessing (   $a_mapping)

Final processing.

Parameters
ilImportMapping$a_mapping
Returns

Definition at line 38 of file class.exQuestionPoolImporter.php.

References $DIC.

39  {
40  global $DIC; /* @var ILIAS\DI\Container $DIC */
41 
42  $maps = $a_mapping->getMappingsOfEntity("Modules/TestQuestionPool", "qpl");
43 
44  foreach ($maps as $old => $new) {
45  if ($old != "new_id" && (int) $old > 0) {
46  $newQstIds = $a_mapping->getMapping("Services/AssessmentQuestion", "qst", $old);
47 
48  if ($newQstIds !== false) {
49  $qstIds = explode(":", $newQstIds);
50  foreach ($qstIds as $qId) {
51  $qstInstance = $DIC->question()->getQuestionInstance($qId);
52  $qstInstance->setParentId($new);
53  $qstInstance->save();
54  }
55  }
56 
57  $qstMappings = $a_mapping->getMappingsOfEntity('Services/AssessmentQuestion', 'qst');
58 
59  foreach ($qstMappings as $oldQstId => $newQstId) {
60  // process all question ids within the consumer component database,
61  // look for the old qst id and map to the new qst id
62  }
63  }
64  }
65  }
$DIC
Definition: xapitoken.php:46

◆ importXmlRepresentation()

exQuestionPoolImporter::importXmlRepresentation (   $a_entity,
  $a_id,
  $a_xml,
  $a_mapping 
)
Parameters
string$a_entity
int$a_id
string$a_xml
array$a_mapping

here consumers can regularly process their own import stuff.

although the assessment questions are imported by declared tail depencies, any consumer component can import any overall qti xml file, that was added to the export by the consumer itself.

Definition at line 21 of file class.exQuestionPoolImporter.php.

22  {
30  }

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