604 $skill_tree = $this->skill_tree_factory->getTreeById($this->
getSkillTreeId());
606 $tree_node_manager = $this->skill_manager->getTreeNodeManager($this->
getSkillTreeId());
614 if ((
int) $a_rec[
"TopNode"] === 1) {
619 $parent = (
int) $a_mapping->
getMapping(
"components/ILIAS/Skill",
"skl_tree", $a_rec[
"Parent"]);
620 $status = (
int) $a_rec[
"Status"];
621 $order = (
int) $a_rec[
"OrderNr"];
623 switch ($a_rec[
"Type"]) {
626 $scat->setTitle($a_rec[
"Title"]);
627 $scat->setDescription($a_rec[
"Description"] ??
"");
628 $scat->setImportId(
"il_" . $source_inst_id .
"_scat_" . $a_rec[
"Child"]);
629 $scat->setSelfEvaluation((
bool) $a_rec[
"SelfEval"]);
630 $scat->setOrderNr($order);
631 $scat->setStatus($status);
633 $tree_node_manager->putIntoTree($scat, $parent);
634 $a_mapping->
addMapping(
"components/ILIAS/Skill",
"skl_tree", $a_rec[
"Child"], (
string) $scat->getId());
639 $skll->setTitle($a_rec[
"Title"]);
640 $skll->setDescription($a_rec[
"Description"] ??
"");
641 $skll->setImportId(
"il_" . $source_inst_id .
"_skll_" . $a_rec[
"Child"]);
642 $skll->setSelfEvaluation((
bool) $a_rec[
"SelfEval"]);
643 $skll->setOrderNr($order);
644 $skll->setStatus($status);
646 $tree_node_manager->putIntoTree($skll, $parent);
647 $a_mapping->
addMapping(
"components/ILIAS/Skill",
"skl_tree", $a_rec[
"Child"], (
string) $skll->getId());
651 $template_id = (
int) $a_mapping->
getMapping(
"components/ILIAS/Skill",
"skl_tree", $a_rec[
"TemplateId"]);
653 if ($template_id > 0) {
655 $sktr->setTitle($a_rec[
"Title"]);
656 $sktr->setDescription($a_rec[
"Description"] ??
"");
657 $sktr->setImportId(
"il_" . $source_inst_id .
"_sktr_" . $a_rec[
"Child"]);
658 $sktr->setSelfEvaluation((
bool) $a_rec[
"SelfEval"]);
659 $sktr->setOrderNr($order);
660 $sktr->setSkillTemplateId($template_id);
661 $sktr->setStatus($status);
663 $tree_node_manager->putIntoTree($sktr, $parent);
664 $a_mapping->
addMapping(
"components/ILIAS/Skill",
"skl_tree", $a_rec[
"Child"], (
string) $sktr->getId());
670 case "skl_templ_subtree":
671 if ((
int) $a_rec[
"TopNode"] === 1) {
675 $parent = (
int) $a_mapping->
getMapping(
"components/ILIAS/Skill",
"skl_tree", $a_rec[
"Parent"]);
676 $order = (
int) $a_rec[
"OrderNr"];
678 switch ($a_rec[
"Type"]) {
681 $sctp->setTitle($a_rec[
"Title"]);
682 $sctp->setDescription($a_rec[
"Description"] ??
"");
683 $sctp->setImportId(
"il_" . $source_inst_id .
"_sctp_" . $a_rec[
"Child"]);
684 $sctp->setOrderNr($order);
686 $tree_node_manager->putIntoTree($sctp, $parent);
687 $a_mapping->
addMapping(
"components/ILIAS/Skill",
"skl_tree", $a_rec[
"Child"], (
string) $sctp->getId());
692 $sktp->setTitle($a_rec[
"Title"]);
693 $sktp->setDescription($a_rec[
"Description"] ??
"");
694 $sktp->setImportId(
"il_" . $source_inst_id .
"_sktp_" . $a_rec[
"Child"]);
695 $sktp->setOrderNr($order);
697 $tree_node_manager->putIntoTree($sktp, $parent);
698 $a_mapping->
addMapping(
"components/ILIAS/Skill",
"skl_tree", $a_rec[
"Child"], (
string) $sktp->getId());
704 $skill_id = (
int) $a_mapping->
getMapping(
"components/ILIAS/Skill",
"skl_tree", $a_rec[
"SkillId"]);
706 if (in_array($type, array(
"skll",
"sktp"))) {
707 if ($type ==
"skll") {
712 $skill->addLevel($a_rec[
"Title"], $a_rec[
"Description"],
"il_" . $source_inst_id .
"_sklv_" . $a_rec[
"LevelId"]);
718 $profile = $this->skill_factory->profile()->profile(
721 $a_rec[
"Description"] ??
"",
724 $new_profile = $this->skill_manager->getProfileManager()->createProfile($profile);
726 $a_mapping->
addMapping(
"components/ILIAS/Skill",
"skl_prof", $a_rec[
"Id"], (
string) $new_profile->getId());
729 case "skl_local_prof":
730 $profile = $this->skill_factory->profile()->profile(
733 $a_rec[
"Description"] ??
"",
736 (
int) $a_rec[
"RefId"]
738 $new_profile = $this->skill_manager->getProfileManager()->createProfile($profile);
740 $a_mapping->
addMapping(
"components/ILIAS/Skill",
"skl_local_prof", $a_rec[
"Id"], (
string) $new_profile->getId());
743 case "skl_prof_level":
744 $profile_id = (
int) $a_mapping->
getMapping(
"components/ILIAS/Skill",
"skl_prof", $a_rec[
"ProfileId"])
745 ? (
int) $a_mapping->
getMapping(
"components/ILIAS/Skill",
"skl_prof", $a_rec[
"ProfileId"])
746 : (
int) $a_mapping->
getMapping(
"components/ILIAS/Skill",
"skl_local_prof", $a_rec[
"ProfileId"]);
747 if ($profile_id > 0) {
750 $level_id = $tref_id = $base_skill = 0;
751 foreach ($level_id_data as $l) {
753 foreach ($skill_data as $s) {
757 $level_id = $l[
"level_id"];
758 $base_skill = $s[
"skill_id"];
759 $tref_id = $s[
"tref_id"];
764 $level = $this->skill_factory->profile()->profileLevel(
769 (
int) $a_rec[
"OrderNr"]
771 $this->skill_manager->getProfileManager()->addSkillLevel($level);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupLevelSkillId(int $a_id)
static getCommonSkillIdForImportId(int $a_source_inst_id, int $a_skill_import_id, int $a_tref_import_id=0)
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
static _lookupType(int $a_obj_id)
int $init_templ_top_order_nr
getMapping(string $a_comp, string $a_entity, string $a_old_id)
getCurrentInstallationId()
static getLevelIdForImportId(int $a_source_inst_id, int $a_level_import_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...