ILIAS  release_8 Revision v8.24
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(string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping): void
22 {
30 }
31
37 public function finalProcessing(ilImportMapping $a_mapping): void
38 {
39 global $DIC; /* @var ILIAS\DI\Container $DIC */
40
41 $maps = $a_mapping->getMappingsOfEntity("Modules/TestQuestionPool", "qpl");
42
43 foreach ($maps as $old => $new) {
44 if ($old != "new_id" && (int) $old > 0) {
45 $newQstIds = $a_mapping->getMapping("Services/AssessmentQuestion", "qst", $old);
46
47 if ($newQstIds !== false) {
48 $qstIds = explode(":", $newQstIds);
49 foreach ($qstIds as $qId) {
50 $qstInstance = $DIC->question()->getQuestionInstance($qId);
51 $qstInstance->setParentId($new);
52 $qstInstance->save();
53 }
54 }
55
56 $qstMappings = $a_mapping->getMappingsOfEntity('Services/AssessmentQuestion', 'qst');
57
58 foreach ($qstMappings as $oldQstId => $newQstId) {
59 // process all question ids within the consumer component database,
60 // look for the old qst id and map to the new qst id
61 }
62 }
63 }
64 }
65}
finalProcessing(ilImportMapping $a_mapping)
Final processing.
importXmlRepresentation(string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getMapping(string $a_comp, string $a_entity, string $a_old_id)
getMappingsOfEntity(string $a_comp, string $a_entity)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28