19 declare(strict_types=1);
78 $this->
setTitle($this->
lng->txt(
'tst_rnd_quest_set_cfg_pool_form'));
79 $this->
setId(
'tstRndQuestSetCfgPoolForm');
83 $this->
lng->txt(
'save_and_back')
89 $this->
lng->txt(
'tst_save_and_create_new_rule')
95 $this->
lng->txt(
'cancel')
99 $hiddenDefId->setValue((
string) $sourcePool->
getId());
103 $hiddenPoolId->setValue((
string) $sourcePool->
getPoolId());
107 $this->
lng->txt(
'tst_inp_source_pool_label'),
112 $this->
addItem($nonEditablePoolLabel);
115 if ($available_taxonomy_ids !== []) {
117 foreach ($available_taxonomy_ids as $tax_id) {
119 $taxLabel = sprintf($this->
lng->txt(
'tst_inp_source_pool_filter_tax_x'), $taxonomy->getTitle());
125 $this->
ctrl->setParameterByClass(
'iltaxselectinputgui',
'src_pool_def_id', $sourcePool->
getId());
126 $this->
ctrl->setParameterByClass(
'iltaxselectinputgui',
'quest_pool_id', $sourcePool->
getPoolId());
128 $taxSelect->setRequired(
true);
130 if (isset($filter[$tax_id])) {
131 $taxCheckbox->setChecked(
true);
132 $taxSelect->setValue($filter[$tax_id]);
134 $taxCheckbox->addSubItem($taxSelect);
140 $hiddenNoTax->setValue(
'0');
144 $this->
lng->txt(
'tst_inp_source_pool_filter_tax'),
147 $nonEditableNoTax->setValue($this->
lng->txt(
'tst_inp_no_available_tax_hint'));
148 $this->
addItem($nonEditableNoTax);
152 $lifecycleCheckbox =
new ilCheckboxInputGUI($this->
lng->txt(
'tst_filter_lifecycle_enabled'),
'filter_lifecycle_enabled');
153 $lifecycleCheckbox->setChecked(!empty($lifecycleFilterValues));
154 $lifecycleFilter =
new ilSelectInputGUI($this->
lng->txt(
'qst_lifecycle'),
'filter_lifecycle');
156 $lifecycleFilter->setMulti(
true);
158 $lifecycleFilter->setValue($lifecycleFilterValues);
159 $lifecycleCheckbox->addSubItem($lifecycleFilter);
160 $this->
addItem($lifecycleCheckbox);
163 $typeFilterOptions = [];
165 $typeFilterOptions[
$data[
'question_type_id']] = $translation;
168 $typeCheckbox =
new ilCheckboxInputGUI($this->
lng->txt(
'tst_filter_question_type_enabled'),
'filter_type_enabled');
169 $typeCheckbox->setChecked(!empty($filterIds));
170 $typeFilter =
new ilSelectInputGUI($this->
lng->txt(
'tst_filter_question_type'),
'filter_type');
172 $typeFilter->setMulti(
true);
173 $typeFilter->setOptions($typeFilterOptions);
174 $typeFilter->setValue($filterIds);
175 $typeCheckbox->addSubItem($typeFilter);
179 if ($this->questionSetConfig->isQuestionAmountConfigurationModePerPool()) {
181 $this->
lng->txt(
'tst_inp_quest_amount_per_source_pool'),
182 'question_amount_per_pool' 186 $questionAmountPerSourcePool->allowDecimals(
false);
187 $questionAmountPerSourcePool->setMinValue(0);
188 $questionAmountPerSourcePool->setMinvalueShouldBeGreater(
true);
189 $questionAmountPerSourcePool->setSize(4);
192 $questionAmountPerSourcePool->setValue(
197 $this->
addItem($questionAmountPerSourcePool);
203 $available_taxonomy_ids
207 $taxonomy_filter = [];
208 foreach ($available_taxonomy_ids as $tax_id) {
210 $node_ids = (array) $this->
getItemByPostVar(
"filter_tax_nodes_{$tax_id}")->getValue();
211 if (!empty($node_ids)) {
212 foreach ($node_ids as $node_id) {
213 $taxonomy_filter[(
int) $tax_id][] = (
int) $node_id;
226 $life_cycle_filter = [];
228 $life_cycle_filter = $this->
getItemByPostVar(
'filter_lifecycle')->getMultiValues();
234 if ($this->questionSetConfig->isQuestionAmountConfigurationModePerPool()) {
235 $question_amount = $this->
getItemByPostVar(
'question_amount_per_pool')->getValue();
237 $log_array[AdditionalInformationGenerator::KEY_QUESTION_AMOUNT_PER_POOL] = $question_amount;
241 AdditionalInformationGenerator::KEY_SOURCE_POOL => $source_pool_definition->
getPoolId(),
242 AdditionalInformationGenerator::KEY_SOURCE_TAXONOMY_FILTER => $taxonomy_filter,
243 AdditionalInformationGenerator::KEY_SOURCE_TYPE_FILTER => $type_filter,
244 AdditionalInformationGenerator::KEY_SOURCE_LIFECYCLE_FILTER => $life_cycle_filter
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setOriginalTaxonomyFilter(array $filter=[])
getPoolInfoLabel(ilLanguage $lng)
setQuestionAmount(?int $question_amount)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
const CMD_SHOW_SRC_POOL_DEF_LIST
__construct(Container $dic, ilPlugin $plugin)
setTypeFilter(array $type_filter=[])
setLifecycleFilter(array $lifecycle_filter)
static getDraftInstance()
static _getQuestionTypes($all_tags=false, $fixOrder=false, $withDeprecatedTypes=true)
getOriginalTaxonomyFilter()