/**
  * Determine max scales and questions
  *
  * @param
  * @return
  */
 function determineMaxScalesAndQuestions()
 {
     include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
     include_once "./Modules/Survey/classes/class.ilSurveySkill.php";
     $ssk = new ilSurveySkill($this->object);
     $this->question_ids = $ssk->getQuestionsForSkill($this->base_skill_id, $this->tref_id);
     $this->scale_sum = $ssk->determineMaxScale($this->base_skill_id, $this->tref_id);
 }
 /**
  * Get skills
  *
  * @param
  * @return
  */
 function getSkills()
 {
     include_once "./Modules/Survey/classes/class.ilSurveySkill.php";
     $sskill = new ilSurveySkill($this->survey);
     $opts = $sskill->getAllAssignedSkillsAsOptions();
     $data = array();
     foreach ($opts as $k => $o) {
         $v = explode(":", $k);
         $question_ids = $sskill->getQuestionsForSkill($v[0], $v[1]);
         $scale_sum = $sskill->determineMaxScale($v[0], $v[1]);
         $data[] = array("title" => $o, "base_skill" => $v[0], "tref_id" => $v[1], "nr_of_q" => count($question_ids), "scale_sum" => $scale_sum);
     }
     $this->setData($data);
 }
 /**
  * Determine max scales and questions
  *
  * @param
  * @return
  */
 function determineMaxScale($a_base_skill, $a_tref_id = 0)
 {
     include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
     include_once "./Modules/Survey/classes/class.ilSurveySkill.php";
     $ssk = new ilSurveySkill($this->survey);
     $question_ids = $ssk->getQuestionsForSkill($a_base_skill, $a_tref_id);
     $scale_sum = 0;
     foreach ($question_ids as $q_id) {
         $q = SurveyQuestion::_instanciateQuestion($q_id);
         if (!is_object($q)) {
             continue;
         }
         $cats = $q->getCategories();
         $max_scale = 0;
         for ($i = 0; $i <= $cats->getCategoryCount(); $i++) {
             $c = $cats->getCategory($i);
             $n = $c->neutral;
             $s = $c->scale;
             if (!$c->neutral) {
                 if ($c->scale > $max_scale) {
                     $max_scale = $c->scale;
                 }
             }
         }
         $scale_sum += $max_scale;
     }
     return $scale_sum;
 }