public function getHTML()
 {
     $gui = new ilPersonalSkillsGUI();
     $gui->setGapAnalysisActualStatusModePerObject($this->testOBJ->getId(), $this->lng->txt('tst_test_result'));
     $gui->setProfileId($this->getSelectedSkillProfile());
     $html = $gui->getGapAnalysisHTML($this->getUsrId(), $this->getAvailableSkills());
     return $html;
 }
 public function getHTML()
 {
     $gui = new ilPersonalSkillsGUI();
     $gui->setGapAnalysisActualStatusModePerObject($this->getTestId(), $this->lng->txt('tst_test_result'));
     // this is not required, we have no self evals in the test context,
     // getReachedSkillLevel is a "test evaluation"
     //$gui->setGapAnalysisSelfEvalLevels($this->getReachedSkillLevels());
     $gui->setProfileId($this->getSelectedSkillProfile());
     $html = $gui->getGapAnalysisHTML($this->getUsrId(), $this->getAvailableSkills());
     return $html;
 }
 /**
  * Competence Evaluation
  *
  * @param
  * @return
  */
 function competenceEval()
 {
     global $ilUser, $lng, $ilCtrl, $ilToolbar, $tpl, $ilTabs;
     $survey = $this->object;
     $ilTabs->activateSubtab("svy_eval_competences");
     $ilTabs->activateTab("svy_results");
     $ilToolbar->setFormAction($this->ctrl->getFormAction($this, "competenceEval"));
     if ($this->object->get360Mode()) {
         $appr_id = $this->getAppraiseeId();
         $this->addApprSelectionToToolbar();
     }
     if ($appr_id == 0) {
         return;
     }
     // evaluation modes
     $eval_modes = array();
     // get all competences of survey
     include_once "./Modules/Survey/classes/class.ilSurveySkill.php";
     $sskill = new ilSurveySkill($survey);
     $opts = $sskill->getAllAssignedSkillsAsOptions();
     $skills = array();
     foreach ($opts as $id => $o) {
         $idarr = explode(":", $id);
         $skills[$id] = array("id" => $id, "title" => $o, "profiles" => array(), "base_skill" => $idarr[0], "tref_id" => $idarr[1]);
     }
     //var_dump($opts);
     // get matching user competence profiles
     // -> add gap analysis to profile
     include_once "./Services/Skill/classes/class.ilSkillProfile.php";
     $profiles = ilSkillProfile::getProfilesOfUser($appr_id);
     foreach ($profiles as $p) {
         $prof = new ilSkillProfile($p["id"]);
         $prof_levels = $prof->getSkillLevels();
         foreach ($prof_levels as $pl) {
             if (isset($skills[$pl["base_skill_id"] . ":" . $pl["tref_id"]])) {
                 $skills[$pl["base_skill_id"] . ":" . $pl["tref_id"]]["profiles"][] = $p["id"];
                 $eval_modes["gap_" . $p["id"]] = $lng->txt("svy_gap_analysis") . ": " . $prof->getTitle();
             }
         }
     }
     //var_dump($skills);
     //var_dump($eval_modes);
     // if one competence does not match any profiles
     // -> add "competences of survey" alternative
     reset($skills);
     foreach ($skills as $sk) {
         if (count($sk["profiles"]) == 0) {
             $eval_modes["skills_of_survey"] = $lng->txt("svy_all_survey_competences");
         }
     }
     // final determination of current evaluation mode
     $comp_eval_mode = $_GET["comp_eval_mode"];
     if ($_POST["comp_eval_mode"] != "") {
         $comp_eval_mode = $_POST["comp_eval_mode"];
     }
     if (!isset($eval_modes[$comp_eval_mode])) {
         reset($eval_modes);
         $comp_eval_mode = key($eval_modes);
         $ilCtrl->setParameter($this, "comp_eval_mode", $comp_eval_mode);
     }
     $ilCtrl->saveParameter($this, "comp_eval_mode");
     include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
     $mode_sel = new ilSelectInputGUI($lng->txt("svy_analysis"), "comp_eval_mode");
     $mode_sel->setOptions($eval_modes);
     $mode_sel->setValue($comp_eval_mode);
     $ilToolbar->addInputItem($mode_sel, true);
     $ilToolbar->addFormButton($lng->txt("select"), "competenceEval");
     if (substr($comp_eval_mode, 0, 4) == "gap_") {
         // gap analysis
         $profile_id = (int) substr($comp_eval_mode, 4);
         include_once "./Services/Skill/classes/class.ilPersonalSkillsGUI.php";
         $pskills_gui = new ilPersonalSkillsGUI();
         $pskills_gui->setProfileId($profile_id);
         $pskills_gui->setGapAnalysisActualStatusModePerObject($survey->getId(), $lng->txt("survey_360_raters"));
         if ($survey->getFinishedIdForAppraiseeIdAndRaterId($appr_id, $appr_id) > 0) {
             $sskill = new ilSurveySkill($survey);
             $self_levels = array();
             foreach ($sskill->determineSkillLevelsForAppraisee($appr_id, true) as $sl) {
                 $self_levels[$sl["base_skill_id"]][$sl["tref_id"]] = $sl["new_level_id"];
             }
             $pskills_gui->setGapAnalysisSelfEvalLevels($self_levels);
         }
         $html = $pskills_gui->getGapAnalysisHTML($appr_id);
         $tpl->setContent($html);
     } else {
         include_once "./Services/Skill/classes/class.ilPersonalSkillsGUI.php";
         $pskills_gui = new ilPersonalSkillsGUI();
         $pskills_gui->setGapAnalysisActualStatusModePerObject($survey->getId(), $lng->txt("survey_360_raters"));
         if ($survey->getFinishedIdForAppraiseeIdAndRaterId($appr_id, $appr_id) > 0) {
             $sskill = new ilSurveySkill($survey);
             $self_levels = array();
             foreach ($sskill->determineSkillLevelsForAppraisee($appr_id, true) as $sl) {
                 $self_levels[$sl["base_skill_id"]][$sl["tref_id"]] = $sl["new_level_id"];
             }
             $pskills_gui->setGapAnalysisSelfEvalLevels($self_levels);
         }
         $sk = array();
         foreach ($skills as $skill) {
             $sk[] = array("base_skill_id" => (int) $skill["base_skill"], "tref_id" => (int) $skill["tref_id"]);
         }
         $html = $pskills_gui->getGapAnalysisHTML($appr_id, $sk);
         $tpl->setContent($html);
     }
 }
 protected function renderSkills($a_user_id, $a_skills_id)
 {
     include_once "Services/Skill/classes/class.ilPersonalSkillsGUI.php";
     $gui = new ilPersonalSkillsGUI();
     if ($this->getOutputMode() == "offline") {
         $gui->setOfflineMode("./files/");
     }
     $html = $gui->getSkillHTML($a_skills_id, $a_user_id);
     if ($this->getOutputMode() == "offline") {
         $js = $gui->getTooltipsJs();
         if (sizeof($js)) {
             $this->js_onload_code = array_merge($this->js_onload_code, $js);
         }
     }
     return $html;
 }