56 $this->questionAssignmentColumnsEnabled =
false;
77 $cmd = $this->ctrl->getCmd(
'show') .
'Cmd';
106 private function saveSkillThresholdsCmd()
108 require_once
'Modules/Test/classes/class.ilTestSkillLevelThreshold.php';
110 if(strtolower(
$_SERVER[
'REQUEST_METHOD']) ==
'post')
113 $assignmentList->loadFromDb();
118 $elements = $table->getInputElements();
119 foreach($elements as $elm)
121 if(!$elm->checkInput())
126 $elm->setValueByArray(
$_POST);
135 $threshold =
array();
136 foreach(
$_POST as $key => $value)
139 if(preg_match(
'/^threshold_(\d+?):(\d+?)_(\d+?)$/', $key, $matches) && is_array($matches))
141 $threshold[$matches[1] .
':' . $matches[2]][$matches[3]] = $value;
146 $skillLevelThresholds =
array();
148 foreach($assignmentList->getUniqueAssignedSkills() as
$data)
150 $skill =
$data[
'skill'];
151 $skillKey =
$data[
'skill_base_id'] .
':' .
$data[
'skill_tref_id'];
152 $levels = $skill->getLevelData();
154 $thresholds_by_level =
array();
156 foreach($levels as $level)
158 if(isset($threshold[$skillKey]) && isset($threshold[$skillKey][$level[
'id']]))
162 $skillLevelThreshold->setTestId($this->
getTestId());
163 $skillLevelThreshold->setSkillBaseId(
$data[
'skill_base_id']);
164 $skillLevelThreshold->setSkillTrefId(
$data[
'skill_tref_id']);
165 $skillLevelThreshold->setSkillLevelId($level[
'id']);
167 $skillLevelThreshold->setThreshold($threshold[$skillKey][$level[
'id']]);
168 $skillLevelThresholds[] = $skillLevelThreshold;
169 $thresholds_by_level[] = $threshold[$skillKey][$level[
'id']];
173 $sorted_thresholds_by_level = $thresholds_by_level = array_values($thresholds_by_level);
174 sort($sorted_thresholds_by_level);
176 $sorted_thresholds_by_level != $thresholds_by_level ||
177 count($thresholds_by_level) != count(array_unique($thresholds_by_level))
185 foreach($skillLevelThresholds as $skillLevelThreshold)
187 $skillLevelThreshold->saveToDb();
193 $this->ctrl->redirect($this, self::CMD_SHOW_SKILL_THRESHOLDS);
206 $this->tpl->setContent($this->ctrl->getHTML($table));
217 $skillLevelThresholdList->loadFromDb();
218 $table->setSkillLevelThresholdList($skillLevelThresholdList);
221 $assignmentList->loadFromDb();
223 $table->setData($table->completeCompetenceTitles(
224 $assignmentList->getUniqueAssignedSkills()
231 require_once
'Modules/Test/classes/tables/class.ilTestSkillLevelThresholdsTableGUI.php';
234 $table->initColumns();
241 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentList.php';
245 return $assignmentList;
250 require_once
'Modules/Test/classes/class.ilTestSkillLevelThresholdList.php';
252 $thresholdList->setTestId($this->
getTestId());
254 return $thresholdList;
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
This class provides processing control methods.
$questionAssignmentColumnsEnabled
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
areQuestionAssignmentColumnsEnabled()
setQuestionContainerId($questionContainerId)
buildSkillQuestionAssignmentList()
showSkillThresholdsCmd(ilTestSkillLevelThresholdsTableGUI $table=null)
special template class to simplify handling of ITX/PEAR
setQuestionAssignmentColumnsEnabled($questionAssignmentColumnsEnabled)
const CMD_SHOW_SKILL_THRESHOLDS
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
buildSkillLevelThresholdList()
__construct(ilCtrl $ctrl, ilTemplate $tpl, ilLanguage $lng, ilDBInterface $db, $testId)
const CMD_SAVE_SKILL_THRESHOLDS