19 declare(strict_types=1);
47 private array $defined_order,
48 private array $question_amount
55 $this->taxonomyLabelTranslater = $translater;
83 public function fillRow(array $a_set): void
86 $this->tpl->setCurrentBlock(
'col_selection_checkbox');
88 $this->tpl->parseCurrentBlock();
90 $this->tpl->setCurrentBlock(
'col_actions');
91 $this->tpl->setVariable(
'ACTIONS_HTML', $this->
getActionsHTML($a_set[
'def_id']));
92 $this->tpl->parseCurrentBlock();
94 $this->tpl->setCurrentBlock(
'col_order_checkbox');
99 $this->tpl->parseCurrentBlock();
103 $this->tpl->setCurrentBlock(
'col_order_checkbox');
104 $this->tpl->setVariable(
'ORDER_INPUT_HTML', $a_set[
'sequence_position']);
105 $this->tpl->parseCurrentBlock();
113 $a_set[
'question_amount']
116 $questionAmountHTML = $a_set[
'question_amount'];
119 $this->tpl->setCurrentBlock(
'col_question_amount');
120 $this->tpl->setVariable(
'QUESTION_AMOUNT_INPUT_HTML', $questionAmountHTML);
121 $this->tpl->parseCurrentBlock();
124 $this->tpl->setVariable(
126 $this->buildPossiblyLinkedQuestonPoolTitle(
133 $a_set[
'source_pool_label'],
139 $this->tpl->setVariable(
'TAXONOMY_FILTER', $this->taxonomyLabelTranslater->getTaxonomyFilterLabel($a_set[
'taxonomy_filter'],
'<br />'));
140 $this->tpl->setVariable(
'LIFECYCLE_FILTER', $this->taxonomyLabelTranslater->getLifecycleFilterLabel($a_set[
'lifecycle_filter']));
141 $this->tpl->setVariable(
'TYPE_FILTER', $this->taxonomyLabelTranslater->getTypeFilterLabel($a_set[
'type_filter']));
147 return '<input type="checkbox" value="' . $sourcePoolDefinitionId .
'" name="src_pool_def_ids[]" />';
152 return '<input type="text" size="2" value="' . $defOrderNumber .
'" name="def_order[' . $srcPoolDefId .
']" />';
157 return '<input type="text" size="4" value="' . $questionAmount .
'" name="quest_amount[' . $srcPoolDefId .
']" />';
163 $actions[] = $this->ui_factory->link()->standard($this->
lng->txt(
'edit'), $this->
getEditHref($sourcePoolDefinitionId));
164 $actions[] = $this->ui_factory->link()->standard($this->
lng->txt(
'delete'), $this->
getDeleteHref($sourcePoolDefinitionId));
165 $dropdown = $this->ui_factory->dropdown()->standard($actions);
166 return $this->ui_renderer->render($dropdown);
171 $href = $this->
ctrl->getLinkTarget(
183 $href = $this->
ctrl->getLinkTarget(
195 return ($sequencePosition * 10);
200 if (!$taxonomyTreeId) {
204 return $this->taxonomyLabelTranslater->getTaxonomyTreeLabel($taxonomyTreeId);
209 if (!$taxonomyNodeId) {
213 return $this->taxonomyLabelTranslater->getTaxonomyNodeLabel($taxonomyNodeId);
220 $this->
setTitle($this->
lng->txt(
'tst_src_quest_pool_def_list_table'));
222 $this->
setRowTemplate(
"tpl.il_tst_rnd_quest_set_src_pool_def_row.html",
"Modules/Test");
227 $this->
enable(
'select_all');
241 $this->
setId(self::IDENTIFIER);
257 $this->
addColumn(
'',
'select',
'1%',
true);
258 $this->
addColumn(
'',
'order',
'1%',
true);
263 $this->
addColumn($this->
lng->txt(
"tst_source_question_pool"),
'source_question_pool',
'');
264 $this->
addColumn($this->
lng->txt(
"tst_filter_taxonomy") .
' / ' . $this->
lng->txt(
"tst_filter_tax_node"),
'tst_filter_taxonomy',
'');
265 #$this->addColumn($this->lng->txt("tst_filter_taxonomy"),'tst_filter_taxonomy', ''); 266 #$this->addColumn($this->lng->txt("tst_filter_tax_node"),'tst_filter_tax_node', ''); 267 $this->
addColumn($this->
lng->txt(
"qst_lifecycle"),
'tst_filter_lifecycle',
'');
268 $this->
addColumn($this->
lng->txt(
"tst_filter_question_type"),
'tst_filter_question_type',
'');
271 $this->
addColumn($this->
lng->txt(
"tst_question_amount"),
'tst_question_amount',
'');
275 $this->
addColumn($this->
lng->txt(
"actions"),
'actions',
'');
283 foreach ($sourcePoolDefinitionList as $sourcePoolDefinition) {
288 $set[
'def_id'] = $sourcePoolDefinition->getId();
289 $set[
'sequence_position'] = $sourcePoolDefinition->getSequencePosition();
290 $set[
'source_pool_label'] = $sourcePoolDefinition->getPoolTitle();
292 if ($this->showMappedTaxonomyFilter) {
294 $set[
'taxonomy_filter'] = $sourcePoolDefinition->getMappedTaxonomyFilter();
297 $set[
'taxonomy_filter'] = $sourcePoolDefinition->getOriginalTaxonomyFilter();
299 #$set['filter_taxonomy'] = $sourcePoolDefinition->getMappedFilterTaxId(); 300 #$set['filter_tax_node'] = $sourcePoolDefinition->getMappedFilterTaxNodeId(); 301 $set[
'lifecycle_filter'] = $sourcePoolDefinition->getLifecycleFilter();
302 $set[
'type_filter'] = $sourcePoolDefinition->getTypeFilter();
304 $set[
'question_amount'] = $sourcePoolDefinition->getQuestionAmount();
305 $set[
'ref_id'] = $sourcePoolDefinition->getPoolRefId();
314 foreach ($sourcePoolDefinitionList as $sourcePoolDefinition) {
318 $sourcePoolDefinition->setSequencePosition($orderNumber);
322 $sourcePoolDefinition->setQuestionAmount($questionAmount);
324 $sourcePoolDefinition->setQuestionAmount(null);
331 return array_key_exists($definition->
getId(), $this->defined_order) ? (
int) $this->defined_order[$definition->
getId()] : 0;
336 return array_key_exists($definition->
getId(), $this->question_amount) ? (
int) $this->question_amount[$definition->
getId()] : 0;
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
enable(string $a_module_name)
setFormAction(string $a_form_action, bool $a_multipart=false)
setTaxonomyFilterLabelTranslater(ilTestQuestionFilterLabelTranslater $translater)
getDefinitionOrderInputHTML($srcPoolDefId, $defOrderNumber)
setShowMappedTaxonomyFilter(bool $showMappedTaxonomyFilter)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
getDeleteHref($sourcePoolDefinitionId)
const CMD_SHOW_EDIT_SRC_POOL_DEF_FORM
bool $questionAmountColumnEnabled
getTaxonomyNodeLabel($taxonomyNodeId)
isDefinitionEditModeEnabled()
bool $definitionEditModeEnabled
const CMD_DELETE_SINGLE_SRC_POOL_DEF
setFormName(string $a_name="")
fetchOrderNumberParameter(ilTestRandomQuestionSetSourcePoolDefinition $definition)
__construct(ilTestRandomQuestionSetConfigGUI $parent_obj, string $parent_cmd, private ilAccess $access, private UIFactory $ui_factory, private UIRenderer $ui_renderer, private array $defined_order, private array $question_amount)
setDefinitionEditModeEnabled($definitionEditModeEnabled)
bool $showMappedTaxonomyFilter
setQuestionAmountColumnEnabled(bool $questionAmountColumnEnabled)
getTaxonomyTreeLabel($taxonomyTreeId)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
isQuestionAmountColumnEnabled()
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
const CMD_SAVE_SRC_POOL_DEF_LIST
getOrderNumberForSequencePosition($sequencePosition)
getQuestionAmountInputHTML($srcPoolDefId, $questionAmount)
ilTestQuestionFilterLabelTranslater $taxonomyLabelTranslater
fetchQuestionAmountParameter(ilTestRandomQuestionSetSourcePoolDefinition $definition)
setLimit(int $a_limit=0, int $a_default_limit=0)
getEditHref($sourcePoolDefinitionId)
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)
getActionsHTML($sourcePoolDefinitionId)
getSelectionCheckboxHTML($sourcePoolDefinitionId)
addMultiCommand(string $a_cmd, string $a_text)
const CMD_DELETE_MULTI_SRC_POOL_DEFS
setExternalSegmentation(bool $a_val)
setPrefix(string $a_prefix)