58 $this->
setId(
'tst_skl_lev_thr_' . $testId);
64 $this->
lng->loadLanguageModule(
'form');
66 $this->
setStyle(
'table',
'fullwidth');
68 $this->
setRowTemplate(
"tpl.tst_skl_thresholds_row.html",
"Modules/Test");
71 #$this->disable('sort'); 82 $this->
lng->txt(
'tst_save_thresholds')
88 $this->
addColumn($this->
lng->txt(
'tst_competence'),
'competence',
'50%');
91 $this->
addColumn($this->
lng->txt(
'tst_num_questions'),
'',
'10%');
92 $this->
addColumn($this->
lng->txt(
'tst_max_comp_points'),
'',
'10%');
95 $this->
addColumn($this->
lng->txt(
'tst_level'),
'',
'10%');
96 $this->
addColumn($this->
lng->txt(
'tst_threshold'),
'',
'10%');
99 public function fillRow(array $a_set): void
101 $skill = $a_set[
'skill'];
102 $levels = $skill->getLevelData();
105 $this->tpl->setCurrentBlock(
'quest_assign_info');
106 $this->tpl->setVariable(
'ROWSPAN', $this->
getRowspan(count($levels)));
107 $this->tpl->setVariable(
'NUM_QUESTIONS', $a_set[
'num_assigns']);
108 $this->tpl->setVariable(
'MAX_COMP_POINTS', $a_set[
'max_points']);
109 $this->tpl->parseCurrentBlock();
112 $this->tpl->setCurrentBlock(
'competence');
113 $this->tpl->setVariable(
'ROWSPAN', $this->
getRowspan(count($levels)));
114 $this->tpl->setVariable(
'COMPETENCE', $a_set[
'competence']);
115 $this->tpl->parseCurrentBlock();
119 $this->tpl->setCurrentBlock(
'tbl_content');
121 for (
$i = 0, $max = count($levels);
$i < $max;
$i++) {
122 $level = $levels[
$i];
124 $this->tpl->setVariable(
'LEVEL', $level[
'title']);
127 $a_set[
'skill_base_id'],
128 $a_set[
'skill_tref_id'],
132 if (
$i < ($max - 1)) {
133 $this->tpl->parseCurrentBlock();
134 $this->tpl->setVariable(
"CSS_ROW", $this->css_row);
135 $this->tpl->setVariable(
"CSS_NO_BORDER",
'ilBorderlessRow');
142 return 'threshold_' . $row[
'skill_base_id'] .
':' . $row[
'skill_tref_id'];
147 if ($numLevels == 0) {
163 if (!in_array(
$id, $idFilter)) {
167 $skill = $data[
'skill'];
168 $levels = $skill->getLevelData();
169 for (
$i = 0, $max = count($levels);
$i < $max;
$i++) {
170 $level = $levels[
$i];
173 $data[
'skill_base_id'],
174 $data[
'skill_tref_id'],
185 $skillKey = $skillBaseId .
':' . $skillTrefId;
187 if (isset($this->input_elements_by_id[$skillKey][$skillLevelId])) {
188 return $this->input_elements_by_id[$skillKey][$skillLevelId];
191 $threshold = $this->skillLevelThresholdList->getThreshold($skillBaseId, $skillTrefId, $skillLevelId);
193 $thresholdValue = $threshold->getThreshold();
195 $thresholdValue =
'';
198 $value =
new ilNumberInputGUI(
'',
'threshold_' . $skillKey .
'_' . $skillLevelId);
199 $value->setValue($thresholdValue);
201 $value->setMinValue(0);
202 $value->setMaxValue(100);
204 if (!isset($this->input_elements_by_id[$skillKey])) {
205 $this->input_elements_by_id[$skillKey] = array();
208 $this->input_elements_by_id[$skillKey][$skillLevelId] = $value;
215 foreach ($rows as
$key => $row) {
217 $row[
'skill']->
getId(),
218 $row[
'skill_tref_id']
areQuestionAssignmentColumnsEnabled()
buildUniqueRecordIdentifier(array $row)
buildThresholdInput($skillBaseId, $skillTrefId, $skillLevelId)
enable(string $a_module_name)
__construct($parentOBJ, $testId, $parentCmd, ilCtrl $ctrl, ilLanguage $lng)
setFormAction(string $a_form_action, bool $a_multipart=false)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
getSkillLevelThresholdList()
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)
setQuestionAssignmentColumnsEnabled(bool $questionAssignmentColumnsEnabled)
setStyle(string $a_element, string $a_style)
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
addHiddenInput(string $a_name, string $a_value)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
array $input_elements_by_id
ilTestSkillLevelThresholdList $skillLevelThresholdList
setSkillLevelThresholdList(ilTestSkillLevelThresholdList $skillLevelThresholdList)
__construct(Container $dic, ilPlugin $plugin)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
disable(string $a_module_name)
const CMD_SAVE_SKILL_THRESHOLDS
bool $questionAssignmentColumnsEnabled
getFormAction(object $a_gui_obj, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
getInputElements(array $idFilter)
completeCompetenceTitles(array $rows)