52 $this->testrequest = $DIC->test()->internal()->request();
53 $this->
access = $DIC[
'ilAccess'];
54 $this->ui_factory = $DIC[
'ui.factory'];
55 $this->ui_renderer = $DIC[
'ui.renderer'];
56 $this->definitionEditModeEnabled =
false;
57 $this->questionAmountColumnEnabled =
false;
62 $this->taxonomyLabelTranslater = $translater;
90 public function fillRow(array $a_set): void
93 $this->tpl->setCurrentBlock(
'col_selection_checkbox');
95 $this->tpl->parseCurrentBlock();
97 $this->tpl->setCurrentBlock(
'col_actions');
98 $this->tpl->setVariable(
'ACTIONS_HTML', $this->
getActionsHTML($a_set[
'def_id']));
99 $this->tpl->parseCurrentBlock();
101 $this->tpl->setCurrentBlock(
'col_order_checkbox');
106 $this->tpl->parseCurrentBlock();
110 $this->tpl->setCurrentBlock(
'col_order_checkbox');
111 $this->tpl->setVariable(
'ORDER_INPUT_HTML', $a_set[
'sequence_position']);
112 $this->tpl->parseCurrentBlock();
120 $a_set[
'question_amount']
123 $questionAmountHTML = $a_set[
'question_amount'];
126 $this->tpl->setCurrentBlock(
'col_question_amount');
127 $this->tpl->setVariable(
'QUESTION_AMOUNT_INPUT_HTML', $questionAmountHTML);
128 $this->tpl->parseCurrentBlock();
131 $this->tpl->setVariable(
133 $this->buildPossiblyLinkedQuestonPoolTitle(
140 $a_set[
'source_pool_label'],
146 $this->tpl->setVariable(
'TAXONOMY_FILTER', $this->taxonomyLabelTranslater->getTaxonomyFilterLabel($a_set[
'taxonomy_filter'],
'<br />'));
147 $this->tpl->setVariable(
'LIFECYCLE_FILTER', $this->taxonomyLabelTranslater->getLifecycleFilterLabel($a_set[
'lifecycle_filter']));
148 $this->tpl->setVariable(
'TYPE_FILTER', $this->taxonomyLabelTranslater->getTypeFilterLabel($a_set[
'type_filter']));
154 return '<input type="checkbox" value="' . $sourcePoolDefinitionId .
'" name="src_pool_def_ids[]" />';
159 return '<input type="text" size="2" value="' . $defOrderNumber .
'" name="def_order[' . $srcPoolDefId .
']" />';
164 return '<input type="text" size="4" value="' . $questionAmount .
'" name="quest_amount[' . $srcPoolDefId .
']" />';
169 require_once
'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
173 $selectionList->setId(
'sourcePoolDefinitionActions_' . $sourcePoolDefinitionId);
174 $selectionList->setListTitle($this->
lng->txt(
"actions"));
176 $selectionList->addItem($this->
lng->txt(
'edit'),
'', $this->
getEditHref($sourcePoolDefinitionId));
177 $selectionList->addItem($this->
lng->txt(
'delete'),
'', $this->
getDeleteHref($sourcePoolDefinitionId));
179 return $selectionList->getHTML();
184 $href = $this->
ctrl->getLinkTarget(
196 $href = $this->
ctrl->getLinkTarget(
208 return ($sequencePosition * 10);
213 if (!$taxonomyTreeId) {
217 return $this->taxonomyLabelTranslater->getTaxonomyTreeLabel($taxonomyTreeId);
222 if (!$taxonomyNodeId) {
226 return $this->taxonomyLabelTranslater->getTaxonomyNodeLabel($taxonomyNodeId);
233 $this->
setTitle($this->
lng->txt(
'tst_src_quest_pool_def_list_table'));
235 $this->
setRowTemplate(
"tpl.il_tst_rnd_quest_set_src_pool_def_row.html",
"Modules/Test");
240 $this->
enable(
'select_all');
254 $this->
setId(self::IDENTIFIER);
270 $this->
addColumn(
'',
'select',
'1%',
true);
271 $this->
addColumn(
'',
'order',
'1%',
true);
276 $this->
addColumn($this->
lng->txt(
"tst_source_question_pool"),
'source_question_pool',
'');
277 $this->
addColumn($this->
lng->txt(
"tst_filter_taxonomy") .
' / ' . $this->
lng->txt(
"tst_filter_tax_node"),
'tst_filter_taxonomy',
'');
278 #$this->addColumn($this->lng->txt("tst_filter_taxonomy"),'tst_filter_taxonomy', ''); 279 #$this->addColumn($this->lng->txt("tst_filter_tax_node"),'tst_filter_tax_node', ''); 280 $this->
addColumn($this->
lng->txt(
"qst_lifecycle"),
'tst_filter_lifecycle',
'');
281 $this->
addColumn($this->
lng->txt(
"tst_filter_question_type"),
'tst_filter_question_type',
'');
284 $this->
addColumn($this->
lng->txt(
"tst_question_amount"),
'tst_question_amount',
'');
288 $this->
addColumn($this->
lng->txt(
"actions"),
'actions',
'');
296 foreach ($sourcePoolDefinitionList as $sourcePoolDefinition) {
301 $set[
'def_id'] = $sourcePoolDefinition->getId();
302 $set[
'sequence_position'] = $sourcePoolDefinition->getSequencePosition();
303 $set[
'source_pool_label'] = $sourcePoolDefinition->getPoolTitle();
305 if ($this->showMappedTaxonomyFilter) {
307 $set[
'taxonomy_filter'] = $sourcePoolDefinition->getMappedTaxonomyFilter();
310 $set[
'taxonomy_filter'] = $sourcePoolDefinition->getOriginalTaxonomyFilter();
312 #$set['filter_taxonomy'] = $sourcePoolDefinition->getMappedFilterTaxId(); 313 #$set['filter_tax_node'] = $sourcePoolDefinition->getMappedFilterTaxNodeId(); 314 $set[
'lifecycle_filter'] = $sourcePoolDefinition->getLifecycleFilter();
315 $set[
'type_filter'] = $sourcePoolDefinition->getTypeFilter();
317 $set[
'question_amount'] = $sourcePoolDefinition->getQuestionAmount();
318 $set[
'ref_id'] = $sourcePoolDefinition->getPoolRefId();
327 foreach ($sourcePoolDefinitionList as $sourcePoolDefinition) {
331 $sourcePoolDefinition->setSequencePosition($orderNumber);
335 $sourcePoolDefinition->setQuestionAmount($questionAmount);
337 $sourcePoolDefinition->setQuestionAmount(null);
344 $def_order = $this->testrequest->raw(
'def_order');
345 return array_key_exists($definition->
getId(), $def_order) ? (
int) $def_order[$definition->
getId()] : 0;
350 $quest_amount = $this->testrequest->raw(
'quest_amount');
351 return array_key_exists($definition->
getId(), $quest_amount) ? (
int) $quest_amount[$definition->
getId()] : 0;
__construct(ilCtrl $ctrl, ilLanguage $lng, $parentGUI, $parentCMD)
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)
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)
setTaxonomyFilterLabelTranslater(ilTestTaxonomyFilterLabelTranslater $translater)
ilTestTaxonomyFilterLabelTranslater $taxonomyLabelTranslater
setDefinitionEditModeEnabled($definitionEditModeEnabled)
bool $showMappedTaxonomyFilter
setQuestionAmountColumnEnabled(bool $questionAmountColumnEnabled)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
__construct(Container $dic, ilPlugin $plugin)
ILIAS Test InternalRequestService $testrequest
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)