4require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
99 $this->
setFormAction($this->ctrl->getFormAction($this->questionSetConfigGUI));
101 $this->
setTitle($this->lng->txt(
'tst_rnd_quest_set_cfg_pool_form'));
102 $this->
setId(
'tstRndQuestSetCfgPoolForm');
106 $this->lng->txt(
'save_and_back')
112 $this->lng->txt(
'tst_save_and_create_new_rule')
118 $this->lng->txt(
'cancel')
122 $hiddenDefId->setValue($sourcePool->
getId());
126 $hiddenPoolId->setValue($sourcePool->
getPoolId());
130 $this->lng->txt(
'tst_inp_source_pool_label'),
135 $this->
addItem($nonEditablePoolLabel);
138 if (count($availableTaxonomyIds)) {
140 require_once
'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
143 require_once
'Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php';
144 ilOverlayGUI::initJavaScript();
147 foreach ($availableTaxonomyIds as $taxId) {
149 $taxLabel = sprintf($this->lng->txt(
'tst_inp_source_pool_filter_tax_x'), $taxonomy->getTitle());
155 $this->ctrl->setParameterByClass(
'iltaxselectinputgui',
'src_pool_def_id', $sourcePool->
getId());
156 $this->ctrl->setParameterByClass(
'iltaxselectinputgui',
'quest_pool_id', $sourcePool->
getPoolId());
158 $taxSelect->setRequired(
true);
160 if (isset($filter[$taxId])) {
161 $taxCheckbox->setChecked(
true);
162 $taxSelect->setValue($filter[$taxId]);
164 $taxCheckbox->addSubItem($taxSelect);
168 #$taxRadio = new ilRadioGroupInputGUI(
169 # $this->lng->txt('tst_inp_source_pool_filter_tax'), 'filter_tax'
172 #$taxRadio->setRequired(true);
174 #$taxRadio->addOption(new ilRadioOption(
175 # $this->lng->txt('tst_inp_source_pool_no_tax_filter'), 0
178 #$taxRadio->setValue(0);
180 #require_once 'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
182 #foreach($availableTaxonomyIds as $taxId)
184 # $taxonomy = new ilObjTaxonomy($taxId);
185 # $label = sprintf($this->lng->txt('tst_inp_source_pool_filter_tax_x'), $taxonomy->getTitle());
187 # $taxRadioOption = new ilRadioOption($label, $taxId);
189 # $taxRadio->addOption($taxRadioOption);
191 # $taxSelect = new ilTaxSelectInputGUI($taxId, "filter_tax_$taxId", false);
192 # $taxSelect->setRequired(true);
193 # $taxRadioOption->addSubItem($taxSelect);
195 # if( $taxId == $sourcePool->getOriginalFilterTaxId() )
197 # $taxRadio->setValue( $sourcePool->getOriginalFilterTaxId() );
198 # $taxSelect->setValue( $sourcePool->getOriginalFilterTaxNodeId() );
202 #$this->addItem($taxRadio);
206 $hiddenNoTax->setValue(0);
210 $this->lng->txt(
'tst_inp_source_pool_filter_tax'),
213 $nonEditableNoTax->setValue($this->lng->txt(
'tst_inp_no_available_tax_hint'));
214 $this->
addItem($nonEditableNoTax);
218 $lifecycleCheckbox =
new ilCheckboxInputGUI($this->lng->txt(
'tst_filter_lifecycle_enabled'),
'filter_lifecycle_enabled');
219 $lifecycleCheckbox->setChecked(!empty($lifecycleFilterValues));
220 $lifecycleFilter =
new ilSelectInputGUI($this->lng->txt(
'qst_lifecycle'),
'filter_lifecycle');
221 $lifecycleFilter->setRequired(
true);
222 $lifecycleFilter->setMulti(
true);
224 $lifecycleFilter->setValue($lifecycleFilterValues);
225 $lifecycleCheckbox->addSubItem($lifecycleFilter);
226 $this->
addItem($lifecycleCheckbox);
229 $typeFilterOptions = array();
230 require_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
232 $typeFilterOptions[
$data[
'question_type_id']] = $translation;
235 $typeCheckbox =
new ilCheckboxInputGUI($this->lng->txt(
'tst_filter_question_type_enabled'),
'filter_type_enabled');
236 $typeCheckbox->setChecked(!empty($filterIds));
237 $typeFilter =
new ilSelectInputGUI($this->lng->txt(
'tst_filter_question_type'),
'filter_type');
238 $typeFilter->setRequired(
true);
239 $typeFilter->setMulti(
true);
240 $typeFilter->setOptions($typeFilterOptions);
241 $typeFilter->setValue($filterIds);
242 $typeCheckbox->addSubItem($typeFilter);
246 if ($this->questionSetConfig->isQuestionAmountConfigurationModePerPool()) {
248 $this->lng->txt(
'tst_inp_quest_amount_per_source_pool'),
249 'question_amount_per_pool'
252 $questionAmountPerSourcePool->setRequired(
true);
253 $questionAmountPerSourcePool->allowDecimals(
false);
254 $questionAmountPerSourcePool->setMinValue(0);
255 $questionAmountPerSourcePool->setMinvalueShouldBeGreater(
true);
256 $questionAmountPerSourcePool->setSize(4);
262 $this->
addItem($questionAmountPerSourcePool);
270 foreach ($availableTaxonomyIds as $taxId) {
272 $nodeIds = (array) $this->
getItemByPostVar(
"filter_tax_nodes_$taxId")->getValue();
273 if (!empty($nodeIds)) {
274 foreach ($nodeIds as $nodeId) {
275 $filter[(int) $taxId][] = (
int) $nodeId;
284 # case $this->getItemByPostVar('source_pool_filter_tax') === null:
286 # case !in_array($this->getItemByPostVar('filter_tax')->getValue(), $availableTaxonomyIds):
288 # $sourcePoolDefinition->setOriginalFilterTaxId(null);
289 # $sourcePoolDefinition->setOriginalFilterTaxNodeId(null);
294 # $taxId = $this->getItemByPostVar('filter_tax')->getValue();
296 # $sourcePoolDefinition->setOriginalFilterTaxId( $taxId );
298 # $sourcePoolDefinition->setOriginalFilterTaxNodeId( $this->getItemByPostVar("filter_tax_$taxId")->getValue() );
315 if ($this->questionSetConfig->isQuestionAmountConfigurationModePerPool()) {
An exception for terminatinating execution or to throw for unit testing.
static getDraftInstance()
This class provides processing control methods.
This class represents a non editable value in a property form.
static _getQuestionTypes($all_tags=false, $fixOrder=false, $withDeprecatedTypes=true)
const CMD_SHOW_SRC_POOL_DEF_LIST
setQuestionAmount($questionAmount)
setLifecycleFilter($lifecycleFilter)
setOriginalTaxonomyFilter($filter=array())
set the original taxonomy filter condition
setTypeFilter($typeFilter=array())
getPoolInfoLabel(ilLanguage $lng)
getOriginalTaxonomyFilter()
get the original taxonomy filter conditions
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc