ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.exQuestionPoolImporter.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
14 {
21  public function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
22  {
30  }
31 
38  public function finalProcessing($a_mapping)
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  }
66 }
finalProcessing($a_mapping)
Final processing.
global $DIC
Definition: goto.php:24
importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
Xml importer class.