76 $this->targetParentObjId =
null;
77 $this->importInstallationId =
null;
78 $this->importMappingRegistry =
null;
79 $this->importAssignmentList =
null;
82 $this->skillUsageService = $DIC->skills()->usage();
197 public function import():
void 201 $assignment->getImportSkillBaseId(),
202 $assignment->getImportSkillTrefId()
211 'components/ILIAS/Test',
212 'skl_base_id_reverse',
213 $foundSkillId[
'skill_id'],
214 $assignment->getImportSkillBaseId()
218 'components/ILIAS/Test',
219 'skl_tref_id_reverse',
220 $foundSkillId[
'tref_id'],
221 $assignment->getImportSkillTrefId()
226 foreach ($assignment->getImportSolutionComparisonExpressionList() as $solCompExp) {
228 $importableAssignment->getSolutionComparisonExpressionList()->add($importableSolCompExp);
231 $importableAssignment->saveToDb();
232 $importableAssignment->saveComparisonExpressions();
235 $this->skillUsageService->addUsage($this->
getTargetParentObjId(), $foundSkillId[
'skill_id'], $foundSkillId[
'tref_id']);
245 $importableAssignment->setEvalMode($assignment->
getEvalMode());
246 $importableAssignment->setSkillPoints($assignment->
getSkillPoints());
248 $importableAssignment->setSkillBaseId($foundSkillId[
'skill_id']);
249 $importableAssignment->setSkillTrefId($foundSkillId[
'tref_id']);
259 $importableAssignment->initSolutionComparisonExpressionList();
261 return $importableAssignment;
268 $importableSolCompExp->setOrderIndex($solCompExp->
getOrderIndex());
269 $importableSolCompExp->setExpression($solCompExp->
getExpression());
270 $importableSolCompExp->setPoints($solCompExp->
getPoints());
272 return $importableSolCompExp;
277 if (!is_array($foundSkillData) || !isset($foundSkillData[
'skill_id']) || !$foundSkillData[
'skill_id']) {
287 return [
'skill_id' => $importSkillBaseId,
'tref_id' => $importSkillTrefId ];
296 return current($foundSkillData);
303 return $DIC->settings()->get(
'inst_id', 0);
getImportMappingRegistry()
setImportMappingComponent($importMappingComponent)
buildImportableAssignment(ilAssQuestionSkillAssignmentImport $assignment, $foundSkillId)
getImportInstallationId()
setImportMappingRegistry($importMappingRegistry)
static getCommonSkillIdForImportId(int $a_source_inst_id, int $a_skill_import_id, int $a_tref_import_id=0)
getSuccessImportAssignmentList()
getFailedImportAssignmentList()
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
SkillUsageService $skillUsageService
setSuccessImportAssignmentList($successImportAssignmentList)
$failedImportAssignmentList
setImportInstallationId($importInstallationId)
getImportAssignmentList()
setImportAssignmentList($importAssignmentList)
setTargetParentObjId($targetParentObjId)
isValidSkill($foundSkillData)
getSkillIdMapping($importSkillBaseId, $importSkillTrefId)
$successImportAssignmentList
buildImportableSolutionComparisonExpression(ilAssQuestionSolutionComparisonExpressionImport $solCompExp)
getImportMappingComponent()
__construct()
ilAssQuestionSkillAssignmentImporter constructor.