4 require_once
'Services/Skill/classes/class.ilBasicSkill.php';
5 require_once
'Modules/Test/classes/class.ilTestSkillLevelThresholdList.php';
6 require_once
'Modules/TestQuestionPool/classes/questions/class.ilAssQuestionAssignedSkillList.php';
152 public function import()
161 $skill = $skillData[
'skill'];
164 'Modules/Test',
'skl_base_id_reverse', $skillData[
'skill_base_id']
168 'Modules/Test',
'skl_tref_id_reverse', $skillData[
'skill_tref_id']
172 $importSkillBaseId, $importSkillTrefId
175 $existingLevels = $skill->getLevelData();
177 if( count($levelThresholds) != count($existingLevels) )
180 $skillData[
'skill_base_id'], $skillData[
'skill_tref_id']
186 for($i = 0, $max = count($existingLevels); $i < $max; $i++)
188 $existingLevelData = $existingLevels[$i];
191 $importLevelThreshold = $levelThresholds[$i];
193 if( $importLevelThreshold->getOrderIndex() != $existingLevelData[
'nr'] )
196 $skillData[
'skill_base_id'], $skillData[
'skill_tref_id']
202 if( !is_numeric($importLevelThreshold->getThreshold()) )
207 $mappedLevelId = $this->
getLevelIdMapping($importLevelThreshold->getImportLevelId());
211 $threshold->setSkillBaseId($skillData[
'skill_base_id']);
212 $threshold->setSkillTrefId($skillData[
'skill_tref_id']);
213 $threshold->setSkillLevelId($mappedLevelId);
214 $threshold->setThreshold($importLevelThreshold->getThreshold());
216 $importedLevelThresholdList->addThreshold($threshold);
220 $importedLevelThresholdList->saveToDb();
239 $mostNewLevelData = current(
$result);
240 return $mostNewLevelData[
'level_id'];
$failedThresholdImportSkillList
static getLevelIdForImportId($a_source_inst_id, $a_level_import_id)
Get level ids for import IDs (newest first)
setImportInstallationId($importInstallationId)
$importedQuestionSkillAssignmentList
getImportedQuestionSkillAssignmentList()
__construct()
ilTestSkillLevelThresholdImporter constructor.
getLevelIdMapping($importLevelId)
setFailedThresholdImportSkillList($failedThresholdImportSkillList)
setImportThresholdList($importThresholdList)
getFailedThresholdImportSkillList()
setImportedQuestionSkillAssignmentList($importedQuestionSkillAssignmentList)
setTargetTestId($targetTestId)
getImportMappingRegistry()
setImportMappingRegistry($importMappingRegistry)
getImportInstallationId()