45 : void {
47 $this->pool_obj->setType('qpl');
48 $this->pool_obj->setTitle('dummy');
49 $this->pool_obj->setDescription('questionpool import');
50 $this->pool_obj->create(true);
51 $this->pool_obj->createReference();
52 $this->pool_obj->putInTree($this->request_data_collector->getRefId());
53 $this->pool_obj->setPermissions($this->request_data_collector->getRefId());
54
55 $a_mapping->
addMapping(
'components/ILIAS/TestQuestionPool',
'qpl', $a_id, (
string) $this->pool_obj->getId());
56
60
62 $qpl_parser->startParsing();
63
64
65 $qpl_new = $this->request_data_collector->string('qpl_new');
66 if ($qpl_new !== '') {
67 $this->pool_obj->setTitle($qpl_new);
68 }
69
70 $this->pool_obj->update();
71 $this->pool_obj->saveToDb();
72
77 $this->pool_obj->getId(),
79 );
80 $qti_parser->startParsing();
81
83 $this->pool_obj,
86 );
87 $page_parser->setQuestionMapping($qti_parser->getImportMapping());
88 $page_parser->startParsing();
89
90 foreach ($qti_parser->getImportMapping() as $k => $v) {
91 $old_question_id = substr($k, strpos($k, 'qst_') + strlen('qst_'));
92 $new_question_id = (string) $v['pool'];
93
95 'components/ILIAS/Taxonomy',
96 'tax_item',
97 "qpl:quest:{$old_question_id}",
98 $new_question_id
99 );
100
102 'components/ILIAS/Taxonomy',
103 'tax_item_obj_id',
104 "qpl:quest:{$old_question_id}",
105 (string) $this->pool_obj->getId()
106 );
107
109 'components/ILIAS/TestQuestionPool',
110 'quest',
111 $old_question_id,
112 $new_question_id
113 );
114 }
115
117
119 'components/ILIAS/MetaData',
120 'md',
121 "{$a_id}:0:qpl",
122 "{$this->pool_obj->getId()}:0:qpl"
123 );
124
125 $this->pool_obj->saveToDb();
126 }
setSession(ImportSession $session)
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Legacy Content Object Parser.
importQuestionSkillAssignments($xmlFile, ilImportMapping $mappingRegistry, $targetParentObjId)
readonly ImportSessionRepository $session