ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilTestRandomQuestionSetConfigGUI Class Reference
+ Collaboration diagram for ilTestRandomQuestionSetConfigGUI:

Public Member Functions

 __construct (private ilObjTest $test_obj, private ilCtrl $ctrl, private ilObjUser $user, private ilAccessHandler $access, private UIFactory $ui_factory, private UIRenderer $ui_renderer, private ilTabsGUI $tabs, private ilLanguage $lng, private ilLogger $log, private ilGlobalTemplateInterface $tpl, private ilDBInterface $db, private ilTree $tree, private ilComponentRepository $component_repository, private ilObjectDefinition $obj_definition, private ilObjectDataCache $obj_cache, private ilTestProcessLockerFactory $processLockerFactory, private InternalRequestService $testrequest, private QuestionInfoService $questioninfo)
 
 executeCommand ()
 
 getGeneralConfigTabLabel ()
 
 getPoolConfigTabLabel ()
 
 resetPoolSyncCmd ()
 

Data Fields

const CMD_SHOW_GENERAL_CONFIG_FORM = 'showGeneralConfigForm'
 
const CMD_SAVE_GENERAL_CONFIG_FORM = 'saveGeneralConfigForm'
 
const CMD_SHOW_SRC_POOL_DEF_LIST = 'showSourcePoolDefinitionList'
 
const CMD_SAVE_SRC_POOL_DEF_LIST = 'saveSourcePoolDefinitionList'
 
const CMD_DELETE_SINGLE_SRC_POOL_DEF = 'deleteSingleSourcePoolDefinition'
 
const CMD_DELETE_MULTI_SRC_POOL_DEFS = 'deleteMultipleSourcePoolDefinitions'
 
const CMD_SHOW_POOL_SELECTOR_EXPLORER = 'showPoolSelectorExplorer'
 
const CMD_SHOW_CREATE_SRC_POOL_DEF_FORM = 'showCreateSourcePoolDefinitionForm'
 
const CMD_SAVE_CREATE_SRC_POOL_DEF_FORM = 'saveCreateSourcePoolDefinitionForm'
 
const CMD_SAVE_AND_NEW_CREATE_SRC_POOL_DEF_FORM = 'saveCreateAndNewSourcePoolDefinitionForm'
 
const CMD_SHOW_EDIT_SRC_POOL_DEF_FORM = 'showEditSourcePoolDefinitionForm'
 
const CMD_SAVE_EDIT_SRC_POOL_DEF_FORM = 'saveEditSourcePoolDefinitionForm'
 
const CMD_BUILD_QUESTION_STAGE = 'buildQuestionStage'
 
const CMD_SELECT_DERIVATION_TARGET = 'selectPoolDerivationTarget'
 
const CMD_DERIVE_NEW_POOLS = 'deriveNewPools'
 
const CMD_RESET_POOLSYNC = 'resetPoolSync'
 
const HTTP_PARAM_AFTER_REBUILD_QUESTION_STAGE_CMD = 'afterRebuildQuestionStageCmd'
 

Protected Member Functions

 showPoolSelectorExplorerCmd ()
 
 fetchPoolIdsParameter ()
 
 fetchTargetRefParameter ()
 
 preventFormBecauseOfSync ()
 
 buildOnScreenMessage ()
 
 buildFormResultMessage ()
 
 buildValidationMessage ()
 
 populateOnScreenMessage ($message)
 

Protected Attributes

ilTestRandomQuestionSetConfig $question_set_config
 
ilTestRandomQuestionSetSourcePoolDefinitionFactory $source_pool_definition_factory
 
ilTestRandomQuestionSetSourcePoolDefinitionList $source_pool_definition_list
 
ilTestRandomQuestionSetStagingPoolBuilder $stagingPool
 
ilTestRandomQuestionSetConfigStateMessageHandler $configStateMessageHandler
 

Private Member Functions

 isAvoidManipulationRedirectRequired ()
 
 isFrozenConfigRequired ()
 
 isManipulationCommand ()
 
 handleTabs ()
 
 buildQuestionStageCmd ()
 
 fetchAfterRebuildQuestionStageCmdParameter ()
 
 showGeneralConfigFormCmd (ilTestRandomQuestionSetGeneralConfigFormGUI $form=null)
 
 saveGeneralConfigFormCmd ()
 
 buildGeneralConfigFormGUI (bool $disabled=false)
 
 showSourcePoolDefinitionListCmd ()
 
 saveSourcePoolDefinitionListCmd ()
 
 buildSourcePoolDefinitionListToolbarGUI ()
 
 buildSourcePoolDefinitionListTableGUI (bool $disabled=false)
 
 buildNonAvailablePoolsTableGUI ()
 
 deleteSingleSourcePoolDefinitionCmd ()
 
 deleteMultipleSourcePoolDefinitionsCmd ()
 
 deleteSourcePoolDefinitions ($definitionIds)
 
 showCreateSourcePoolDefinitionFormCmd (ilTestRandomQuestionSetPoolDefinitionFormGUI $form=null)
 
 saveCreateAndNewSourcePoolDefinitionFormCmd ()
 
 saveCreateSourcePoolDefinitionFormCmd ($redirect_back_to_form=false)
 
 buildCreateSourcePoolDefinitionFormGUI ()
 
 showEditSourcePoolDefinitionFormCmd (ilTestRandomQuestionSetPoolDefinitionFormGUI $form=null)
 
 saveEditSourcePoolDefinitionFormCmd ()
 
 buildEditSourcePoolDefinitionFormGUI ()
 
 fetchQuestionPoolIdParameter ()
 
 fetchSingleSourcePoolDefinitionIdParameter ()
 
 fetchMultiSourcePoolDefinitionIdsParameter ()
 
 getSourcePoolDefinitionByAvailableQuestionPoolId ($poolId)
 
 selectPoolDerivationTargetCmd ()
 
 deriveNewPoolsCmd ()
 
 getGeneralModificationSuccessMessage ()
 

Detailed Description

Definition at line 39 of file class.ilTestRandomQuestionSetConfigGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestRandomQuestionSetConfigGUI::__construct ( private ilObjTest  $test_obj,
private ilCtrl  $ctrl,
private ilObjUser  $user,
private ilAccessHandler  $access,
private UIFactory  $ui_factory,
private UIRenderer  $ui_renderer,
private ilTabsGUI  $tabs,
private ilLanguage  $lng,
private ilLogger  $log,
private ilGlobalTemplateInterface  $tpl,
private ilDBInterface  $db,
private ilTree  $tree,
private ilComponentRepository  $component_repository,
private ilObjectDefinition  $obj_definition,
private ilObjectDataCache  $obj_cache,
private ilTestProcessLockerFactory  $processLockerFactory,
private InternalRequestService  $testrequest,
private QuestionInfoService  $questioninfo 
)

Definition at line 66 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

85  {
86  $this->question_set_config = new ilTestRandomQuestionSetConfig(
87  $this->tree,
88  $this->db,
89  $this->lng,
90  $this->log,
91  $this->component_repository,
92  $this->test_obj,
93  $this->questioninfo
94  );
95  $this->question_set_config->loadFromDb();
96 
97  $this->source_pool_definition_factory = new ilTestRandomQuestionSetSourcePoolDefinitionFactory(
98  $this->db,
99  $this->test_obj
100  );
101 
102  $this->source_pool_definition_list = new ilTestRandomQuestionSetSourcePoolDefinitionList(
103  $this->db,
104  $this->test_obj,
105  $this->source_pool_definition_factory
106  );
107 
108  $this->source_pool_definition_list->loadDefinitions();
109 
110  $this->stagingPool = new ilTestRandomQuestionSetStagingPoolBuilder(
111  $this->db,
112  $this->log,
113  $this->test_obj
114  );
115 
116  $this->configStateMessageHandler = new ilTestRandomQuestionSetConfigStateMessageHandler(
117  $this->lng,
118  $this->ui_factory,
119  $this->ui_renderer,
120  $this->ctrl
121  );
122 
123  $this->configStateMessageHandler->setTargetGUI($this);
124  $this->configStateMessageHandler->setQuestionSetConfig($this->question_set_config);
125  $this->configStateMessageHandler->setParticipantDataExists($this->test_obj->participantDataExist());
126  $this->configStateMessageHandler->setLostPools($this->source_pool_definition_list->getLostPools());
127  $this->processLockerFactory = $processLockerFactory;
128  }
+ Here is the call graph for this function:

Member Function Documentation

◆ buildCreateSourcePoolDefinitionFormGUI()

ilTestRandomQuestionSetConfigGUI::buildCreateSourcePoolDefinitionFormGUI ( )
private

Definition at line 603 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by executeCommand(), saveCreateSourcePoolDefinitionFormCmd(), and showCreateSourcePoolDefinitionFormCmd().

604  {
606  $this->ctrl,
607  $this->lng,
608  $this->test_obj,
609  $this,
610  $this->question_set_config
611  );
612 
613  $form->setSaveCommand(self::CMD_SAVE_CREATE_SRC_POOL_DEF_FORM);
614  $form->setSaveAndNewCommand(self::CMD_SAVE_AND_NEW_CREATE_SRC_POOL_DEF_FORM);
615 
616  return $form;
617  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildEditSourcePoolDefinitionFormGUI()

ilTestRandomQuestionSetConfigGUI::buildEditSourcePoolDefinitionFormGUI ( )
private

Definition at line 667 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by saveEditSourcePoolDefinitionFormCmd(), and showEditSourcePoolDefinitionFormCmd().

668  {
670  $this->ctrl,
671  $this->lng,
672  $this->test_obj,
673  $this,
674  $this->question_set_config
675  );
676 
677  $form->setSaveCommand(self::CMD_SAVE_EDIT_SRC_POOL_DEF_FORM);
678 
679  return $form;
680  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildFormResultMessage()

ilTestRandomQuestionSetConfigGUI::buildFormResultMessage ( )
protected

Definition at line 893 of file class.ilTestRandomQuestionSetConfigGUI.php.

References $message, getGeneralModificationSuccessMessage(), and ILIAS\Repository\lng().

Referenced by buildOnScreenMessage().

893  : string
894  {
895  $message = '';
896 
897  if ($this->testrequest->isset('modified')) {
898  $action = $this->testrequest->raw('modified');
899  if ($action === 'save') {
900  $success_message = $this->ui_factory->messageBox()->success($this->getGeneralModificationSuccessMessage());
901  } elseif ($action === 'remove') {
902  $success_message = $this->ui_factory->messageBox()->success($this->lng->txt("tst_msg_source_pool_definitions_deleted"));
903  } elseif ($action === 'sync') {
904  $success_message = $this->ui_factory->messageBox()->success($this->lng->txt("tst_msg_random_question_set_synced"));
905  }
906  $message .= $this->ui_renderer->render(
907  $success_message
908  );
909  }
910 
911  return $message;
912  }
$message
Definition: xapiexit.php:32
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildGeneralConfigFormGUI()

ilTestRandomQuestionSetConfigGUI::buildGeneralConfigFormGUI ( bool  $disabled = false)
private

Definition at line 328 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\ctrl(), isFrozenConfigRequired(), and ILIAS\Repository\lng().

Referenced by saveGeneralConfigFormCmd(), and showGeneralConfigFormCmd().

329  {
331  $this->ctrl,
332  $this->lng,
333  $this->test_obj,
334  $this,
335  $this->question_set_config
336  );
337 
338  //TODO: should frozen config not lead to 'completely disabled' as well?!
339  $form->setEditModeEnabled(!$this->isFrozenConfigRequired());
340 
341  if ($disabled) {
342  $form->setEditModeEnabled(false);
343  }
344 
345  $form->build();
346 
347  if ($disabled) {
348  $form->clearCommandButtons();
349  }
350 
351  return $form;
352  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildNonAvailablePoolsTableGUI()

ilTestRandomQuestionSetConfigGUI::buildNonAvailablePoolsTableGUI ( )
private

Definition at line 462 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by showSourcePoolDefinitionListCmd().

463  {
465  $this->ctrl,
466  $this->lng,
467  $this,
468  self::CMD_SHOW_SRC_POOL_DEF_LIST
469  );
470 
471  $table->build();
472 
473  return $table;
474  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildOnScreenMessage()

ilTestRandomQuestionSetConfigGUI::buildOnScreenMessage ( )
protected

Definition at line 885 of file class.ilTestRandomQuestionSetConfigGUI.php.

References $message, buildFormResultMessage(), and buildValidationMessage().

Referenced by showGeneralConfigFormCmd(), and showSourcePoolDefinitionListCmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildQuestionStageCmd()

ilTestRandomQuestionSetConfigGUI::buildQuestionStageCmd ( )
private

Definition at line 247 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\ctrl(), and fetchAfterRebuildQuestionStageCmdParameter().

247  : void
248  {
249  if ($this->source_pool_definition_list->areAllUsedPoolsAvailable()) {
250  $locker = $this->processLockerFactory->retrieveLockerForNamedOperation();
251  $locker->executeNamedOperation(__FUNCTION__, function (): void {
252  $this->stagingPool->rebuild($this->source_pool_definition_list);
253  $this->source_pool_definition_list->saveDefinitions();
254 
255  $this->question_set_config->loadFromDb();
256  $this->question_set_config->setLastQuestionSyncTimestamp(time());
257  $this->question_set_config->saveToDb();
258 
259  $this->test_obj->saveCompleteStatus($this->question_set_config);
260 
261  $this->ctrl->setParameterByClass(self::class, 'modified', 'sync');
262  });
263  }
264 
265  $this->ctrl->redirect($this, $this->fetchAfterRebuildQuestionStageCmdParameter());
266  }
+ Here is the call graph for this function:

◆ buildSourcePoolDefinitionListTableGUI()

ilTestRandomQuestionSetConfigGUI::buildSourcePoolDefinitionListTableGUI ( bool  $disabled = false)
private

Definition at line 426 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\access(), isFrozenConfigRequired(), ILIAS\Repository\lng(), and ilTestRandomQuestionSetSourcePoolDefinitionListTableGUI\setDefinitionEditModeEnabled().

Referenced by saveSourcePoolDefinitionListCmd(), and showSourcePoolDefinitionListCmd().

427  {
429  $this,
430  self::CMD_SHOW_SRC_POOL_DEF_LIST,
431  $this->access,
432  $this->ui_factory,
433  $this->ui_renderer,
434  $this->testrequest->raw('def_order') ?? [],
435  $this->testrequest->raw('quest_amount') ?? []
436  );
437 
438  if (!$this->isFrozenConfigRequired()) {
439  $table->setDefinitionEditModeEnabled(true);
440  }
441 
442  $table->setQuestionAmountColumnEnabled(
443  $this->question_set_config->isQuestionAmountConfigurationModePerPool()
444  );
445 
446  $table->setShowMappedTaxonomyFilter(
447  $this->question_set_config->getLastQuestionSyncTimestamp() != 0
448  );
449 
450  $translater = new ilTestQuestionFilterLabelTranslater($this->db, $this->lng);
451  $translater->loadLabels($this->source_pool_definition_list);
452  $table->setTaxonomyFilterLabelTranslater($translater);
453 
454  if ($disabled) {
455  $table->setDefinitionEditModeEnabled(false);
456  }
457  $table->build();
458 
459  return $table;
460  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildSourcePoolDefinitionListToolbarGUI()

ilTestRandomQuestionSetConfigGUI::buildSourcePoolDefinitionListToolbarGUI ( )
private

Definition at line 412 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by showSourcePoolDefinitionListCmd().

413  {
415  $this->ctrl,
416  $this->lng,
417  $this,
418  $this->question_set_config
419  );
420 
421  $toolbar->build();
422 
423  return $toolbar;
424  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildValidationMessage()

ilTestRandomQuestionSetConfigGUI::buildValidationMessage ( )
protected

Definition at line 914 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by buildOnScreenMessage().

914  : string
915  {
916  if ($this->configStateMessageHandler->isValidationFailed()) {
917  return $this->ui_renderer->render(
918  $this->ui_factory->messageBox()->failure($this->configStateMessageHandler->getValidationReportHtml())
919  );
920  }
921 
922  if ($this->configStateMessageHandler->hasValidationReports()) {
923  return $this->ui_renderer->render(
924  $this->ui_factory->messageBox()->info($this->configStateMessageHandler->getValidationReportHtml())
925  );
926  }
927 
928  return $this->configStateMessageHandler->getSyncInfoMessage();
929  }
+ Here is the caller graph for this function:

◆ deleteMultipleSourcePoolDefinitionsCmd()

ilTestRandomQuestionSetConfigGUI::deleteMultipleSourcePoolDefinitionsCmd ( )
private

Definition at line 485 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\ctrl(), deleteSourcePoolDefinitions(), and fetchMultiSourcePoolDefinitionIdsParameter().

485  : void
486  {
487  $definitionIds = $this->fetchMultiSourcePoolDefinitionIdsParameter();
488  $this->deleteSourcePoolDefinitions($definitionIds);
489 
490  $this->ctrl->setParameterByClass(self::class, 'modified', 'remove');
491  $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
492  }
+ Here is the call graph for this function:

◆ deleteSingleSourcePoolDefinitionCmd()

ilTestRandomQuestionSetConfigGUI::deleteSingleSourcePoolDefinitionCmd ( )
private

Definition at line 476 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\ctrl(), deleteSourcePoolDefinitions(), and fetchSingleSourcePoolDefinitionIdParameter().

476  : void
477  {
478  $definitionId = $this->fetchSingleSourcePoolDefinitionIdParameter();
479  $this->deleteSourcePoolDefinitions([$definitionId]);
480 
481  $this->ctrl->setParameterByClass(self::class, 'modified', 'remove');
482  $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
483  }
+ Here is the call graph for this function:

◆ deleteSourcePoolDefinitions()

ilTestRandomQuestionSetConfigGUI::deleteSourcePoolDefinitions (   $definitionIds)
private

Definition at line 494 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by deleteMultipleSourcePoolDefinitionsCmd(), and deleteSingleSourcePoolDefinitionCmd().

494  : void
495  {
496  foreach ($definitionIds as $definitionId) {
497  $definition = $this->source_pool_definition_factory->getSourcePoolDefinitionByDefinitionId($definitionId);
498  $definition->deleteFromDb();
499  }
500 
501  $this->source_pool_definition_list->reindexPositions();
502  $this->source_pool_definition_list->saveDefinitions();
503 
504  $this->question_set_config->loadFromDb();
505  $this->question_set_config->setLastQuestionSyncTimestamp(0);
506  $this->question_set_config->saveToDb();
507 
508  $this->test_obj->saveCompleteStatus($this->question_set_config);
509  }
+ Here is the caller graph for this function:

◆ deriveNewPoolsCmd()

ilTestRandomQuestionSetConfigGUI::deriveNewPoolsCmd ( )
private

Definition at line 802 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\access(), ILIAS\Repository\ctrl(), fetchPoolIdsParameter(), fetchTargetRefParameter(), ILIAS\Repository\lng(), ilTestRandomQuestionSetStagingPoolQuestionList\updateSourceQuestionPoolId(), and ILIAS\Repository\user().

802  : void
803  {
804  $pool_ids = $this->fetchPoolIdsParameter();
805  $target_ref = $this->fetchTargetRefParameter();
806  if (!$this->access->checkAccess('write', '', $target_ref)) {
807  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_permission"), true);
808  $this->ctrl->setParameterByClass(ilObjTestGUI::class, 'ref_id', $this->test_obj->getRefId());
809  $this->ctrl->redirectByClass(ilObjTestGUI::class);
810  }
811 
812  if ($pool_ids !== []) {
813  foreach ($pool_ids as $pool_id) {
814  $lost_pool = $this->source_pool_definition_list->getLostPool($pool_id);
815 
816  $deriver = new ilTestRandomQuestionSetPoolDeriver($this->db, $this->component_repository, $this->test_obj);
817  $deriver->setSourcePoolDefinitionList($this->source_pool_definition_list);
818  $deriver->setTargetContainerRef($target_ref);
819  $deriver->setOwnerId($this->user->getId());
820  $new_pool = $deriver->derive($lost_pool);
821 
822  $srcPoolDefinition = $this->source_pool_definition_list->getDefinitionBySourcePoolId($new_pool->getId());
823  $srcPoolDefinition->setPoolTitle($new_pool->getTitle());
824  $srcPoolDefinition->setPoolPath($this->question_set_config->getQuestionPoolPathString($new_pool->getId()));
825  $srcPoolDefinition->setPoolRefId($this->question_set_config->getFirstQuestionPoolRefIdByObjId($new_pool->getId()));
826  $srcPoolDefinition->saveToDb();
827 
829  $this->test_obj->getTestId(),
830  $lost_pool->getId(),
831  $new_pool->getId()
832  );
833  }
834 
835  $this->tpl->setOnScreenMessage('success', $this->lng->txt('tst_non_available_pool_newly_derived'), true);
836  }
837 
838  $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
839  }
+ Here is the call graph for this function:

◆ executeCommand()

ilTestRandomQuestionSetConfigGUI::executeCommand ( )

Definition at line 130 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\access(), buildCreateSourcePoolDefinitionFormGUI(), ILIAS\Repository\ctrl(), fetchQuestionPoolIdParameter(), getSourcePoolDefinitionByAvailableQuestionPoolId(), ilObjTaxonomy\getUsageOfObject(), handleTabs(), isAvoidManipulationRedirectRequired(), and ILIAS\Repository\lng().

130  : void
131  {
132  if (!$this->access->checkAccess("write", "", $this->test_obj->getRefId())) {
133  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("cannot_edit_test"), true);
134  $this->ctrl->redirectByClass('ilObjTestGUI', "infoScreen");
135  }
136 
138  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("tst_msg_cannot_modify_random_question_set_conf_due_to_part"), true);
139  $this->ctrl->redirect($this);
140  }
141 
142  $this->handleTabs();
143 
144  $nextClass = $this->ctrl->getNextClass();
145 
146  switch ($nextClass) {
147  case 'iltestrandomquestionsetpooldefinitionformgui':
148  $this->question_set_config->loadFromDb();
149  $poolId = $this->fetchQuestionPoolIdParameter();
150  $sourcePoolDefinition = $this->getSourcePoolDefinitionByAvailableQuestionPoolId($poolId);
151  $availableTaxonomyIds = ilObjTaxonomy::getUsageOfObject($sourcePoolDefinition->getPoolId());
153  $form->build($sourcePoolDefinition, $availableTaxonomyIds);
154 
155  $this->ctrl->forwardCommand($form);
156  break;
157 
158  default:
159  $cmd = $this->ctrl->getCmd(self::CMD_SHOW_GENERAL_CONFIG_FORM) . 'Cmd';
160  $this->$cmd();
161  }
162  }
static getUsageOfObject(int $a_obj_id, bool $a_include_titles=false)
+ Here is the call graph for this function:

◆ fetchAfterRebuildQuestionStageCmdParameter()

ilTestRandomQuestionSetConfigGUI::fetchAfterRebuildQuestionStageCmdParameter ( )
private

Definition at line 268 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by buildQuestionStageCmd().

269  {
270  if (!$this->testrequest->isset(self::HTTP_PARAM_AFTER_REBUILD_QUESTION_STAGE_CMD)) {
271  return self::CMD_SHOW_GENERAL_CONFIG_FORM;
272  }
273 
274  if (!strlen($this->testrequest->raw(self::HTTP_PARAM_AFTER_REBUILD_QUESTION_STAGE_CMD))) {
275  return self::CMD_SHOW_GENERAL_CONFIG_FORM;
276  }
277 
278  return $this->testrequest->raw(self::HTTP_PARAM_AFTER_REBUILD_QUESTION_STAGE_CMD);
279  }
+ Here is the caller graph for this function:

◆ fetchMultiSourcePoolDefinitionIdsParameter()

ilTestRandomQuestionSetConfigGUI::fetchMultiSourcePoolDefinitionIdsParameter ( )
private

Definition at line 704 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\int(), and ILIAS\Repository\lng().

Referenced by deleteMultipleSourcePoolDefinitionsCmd().

704  : array
705  {
706  if (!$this->testrequest->isset('src_pool_def_ids') || !is_array($this->testrequest->raw('src_pool_def_ids'))) {
707  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('tst_please_select_source_pool'), true);
708  $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
709  return [];
710  }
711 
712  $definitionIds = [];
713 
714  foreach ($this->testrequest->raw('src_pool_def_ids') as $definitionId) {
715  $definitionId = (int) $definitionId;
716 
717  if (!$definitionId) {
719  }
720 
721  $definitionIds[] = $definitionId;
722  }
723 
724  return $definitionIds;
725  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchPoolIdsParameter()

ilTestRandomQuestionSetConfigGUI::fetchPoolIdsParameter ( )
protected
Returns
int[]

Definition at line 752 of file class.ilTestRandomQuestionSetConfigGUI.php.

References $id, and ILIAS\Repository\int().

Referenced by deriveNewPoolsCmd(), and selectPoolDerivationTargetCmd().

752  : array
753  {
754  $pool_ids = [];
755  if ($this->testrequest->isset('derive_pool_ids') && is_array($this->testrequest->raw('derive_pool_ids'))) {
756  $pool_ids = [];
757 
758  foreach ($this->testrequest->raw('derive_pool_ids') as $pool_id) {
759  $pool_ids[] = (int) $pool_id;
760  }
761  } elseif ($this->testrequest->isset('derive_pool_ids') && preg_match('/^\d+(\:\d+)*$/', $this->testrequest->raw('derive_pool_ids'))) {
762  $pool_ids = array_map(
763  fn(int $id) => (int) $id,
764  explode(':', $this->testrequest->raw('derive_pool_ids'))
765  );
766  } elseif ($this->testrequest->isset('derive_pool_id') && (int) $this->testrequest->raw('derive_pool_id')) {
767  $pool_ids = [(int) $this->testrequest->raw('derive_pool_id')];
768  }
769 
770  return $pool_ids;
771  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchQuestionPoolIdParameter()

ilTestRandomQuestionSetConfigGUI::fetchQuestionPoolIdParameter ( )
private

Definition at line 682 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\int().

Referenced by executeCommand(), saveCreateSourcePoolDefinitionFormCmd(), and showCreateSourcePoolDefinitionFormCmd().

682  : int
683  {
684  if ($this->testrequest->isset('quest_pool_id') && (int) $this->testrequest->raw('quest_pool_id')) {
685  return (int) $this->testrequest->raw('quest_pool_id');
686  }
687 
688  if ($this->testrequest->isset('quest_pool_ref') && (int) $this->testrequest->raw('quest_pool_ref')) {
689  return $this->obj_cache->lookupObjId((int) $this->testrequest->raw('quest_pool_ref'));
690  }
691 
693  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchSingleSourcePoolDefinitionIdParameter()

ilTestRandomQuestionSetConfigGUI::fetchSingleSourcePoolDefinitionIdParameter ( )
private

Definition at line 695 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\int().

Referenced by deleteSingleSourcePoolDefinitionCmd(), saveEditSourcePoolDefinitionFormCmd(), and showEditSourcePoolDefinitionFormCmd().

695  : int
696  {
697  if ($this->testrequest->isset('src_pool_def_id') && (int) $this->testrequest->raw('src_pool_def_id')) {
698  return (int) $this->testrequest->raw('src_pool_def_id');
699  }
700 
702  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchTargetRefParameter()

ilTestRandomQuestionSetConfigGUI::fetchTargetRefParameter ( )
protected

Definition at line 773 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\int().

Referenced by deriveNewPoolsCmd().

773  : ?int
774  {
775  if ($this->testrequest->isset('target_ref') && (int) $this->testrequest->raw('target_ref')) {
776  return (int) $this->testrequest->raw('target_ref');
777  }
778 
779  return null;
780  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGeneralConfigTabLabel()

ilTestRandomQuestionSetConfigGUI::getGeneralConfigTabLabel ( )
Returns
string

Definition at line 852 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\lng().

Referenced by handleTabs().

852  : string
853  {
854  return $this->lng->txt('tst_rnd_quest_cfg_tab_general');
855  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGeneralModificationSuccessMessage()

ilTestRandomQuestionSetConfigGUI::getGeneralModificationSuccessMessage ( )
private
Returns
string

Definition at line 844 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\lng().

Referenced by buildFormResultMessage().

844  : string
845  {
846  return $this->lng->txt("tst_msg_random_question_set_config_modified");
847  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPoolConfigTabLabel()

ilTestRandomQuestionSetConfigGUI::getPoolConfigTabLabel ( )
Returns
string

Definition at line 860 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\lng().

Referenced by handleTabs().

860  : string
861  {
862  return $this->lng->txt('tst_rnd_quest_cfg_tab_pool');
863  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSourcePoolDefinitionByAvailableQuestionPoolId()

ilTestRandomQuestionSetConfigGUI::getSourcePoolDefinitionByAvailableQuestionPoolId (   $poolId)
private

Definition at line 727 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by executeCommand(), saveCreateSourcePoolDefinitionFormCmd(), and showCreateSourcePoolDefinitionFormCmd().

728  {
729  $availablePools = $this->test_obj->getAvailableQuestionpools(
730  true,
731  $this->question_set_config->arePoolsWithHomogeneousScoredQuestionsRequired(),
732  false,
733  true,
734  true
735  );
736 
737  if (isset($availablePools[$poolId])) {
738  $originalPoolData = $availablePools[$poolId];
739 
740  $originalPoolData['qpl_path'] = $this->question_set_config->getQuestionPoolPathString($poolId);
741  $originalPoolData['qpl_ref_id'] = $this->question_set_config->getFirstQuestionPoolRefIdByObjId($poolId);
742 
743  return $this->source_pool_definition_factory->getSourcePoolDefinitionByOriginalPoolData($originalPoolData);
744  }
745 
747  }
+ Here is the caller graph for this function:

◆ handleTabs()

ilTestRandomQuestionSetConfigGUI::handleTabs ( )
private

Definition at line 208 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\ctrl(), getGeneralConfigTabLabel(), getPoolConfigTabLabel(), and ILIAS\Repository\tabs().

Referenced by executeCommand().

208  : void
209  {
210  $this->tabs->activateTab('assQuestions');
211 
212  $this->tabs->addSubTab(
213  'tstRandQuestSetGeneralConfig',
214  $this->getGeneralConfigTabLabel(),
215  $this->ctrl->getLinkTarget($this, self::CMD_SHOW_GENERAL_CONFIG_FORM)
216  );
217 
218  $this->tabs->addSubTab(
219  'tstRandQuestSetPoolConfig',
220  $this->getPoolConfigTabLabel(),
221  $this->ctrl->getLinkTarget($this, self::CMD_SHOW_SRC_POOL_DEF_LIST)
222  );
223 
224  switch ($this->ctrl->getCmd(self::CMD_SHOW_GENERAL_CONFIG_FORM)) {
225  case self::CMD_SHOW_GENERAL_CONFIG_FORM:
226  case self::CMD_SAVE_GENERAL_CONFIG_FORM:
227 
228  $this->tabs->activateSubTab('tstRandQuestSetGeneralConfig');
229  break;
230 
231  case self::CMD_SHOW_SRC_POOL_DEF_LIST:
232  case self::CMD_SAVE_SRC_POOL_DEF_LIST:
233  case self::CMD_DELETE_SINGLE_SRC_POOL_DEF:
234  case self::CMD_DELETE_MULTI_SRC_POOL_DEFS:
235  case self::CMD_SHOW_CREATE_SRC_POOL_DEF_FORM:
236  case self::CMD_SAVE_CREATE_SRC_POOL_DEF_FORM:
237  case self::CMD_SHOW_EDIT_SRC_POOL_DEF_FORM:
238  case self::CMD_SAVE_EDIT_SRC_POOL_DEF_FORM:
239 
240  $this->tabs->activateSubTab('tstRandQuestSetPoolConfig');
241  break;
242 
243  default: $this->tabs->activateSubTab('nonTab');
244  }
245  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAvoidManipulationRedirectRequired()

ilTestRandomQuestionSetConfigGUI::isAvoidManipulationRedirectRequired ( )
private

Definition at line 164 of file class.ilTestRandomQuestionSetConfigGUI.php.

References isFrozenConfigRequired(), and isManipulationCommand().

Referenced by executeCommand().

164  : bool
165  {
166  if (!$this->isFrozenConfigRequired()) {
167  return false;
168  }
169 
170  if (!$this->isManipulationCommand()) {
171  return false;
172  }
173 
174  return true;
175  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isFrozenConfigRequired()

ilTestRandomQuestionSetConfigGUI::isFrozenConfigRequired ( )
private

Definition at line 177 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by buildGeneralConfigFormGUI(), buildSourcePoolDefinitionListTableGUI(), isAvoidManipulationRedirectRequired(), preventFormBecauseOfSync(), and showSourcePoolDefinitionListCmd().

177  : bool
178  {
179  if ($this->test_obj->participantDataExist()) {
180  return true;
181  }
182 
183  if ($this->source_pool_definition_list->hasLostPool()) {
184  return true;
185  }
186 
187  return false;
188  }
+ Here is the caller graph for this function:

◆ isManipulationCommand()

ilTestRandomQuestionSetConfigGUI::isManipulationCommand ( )
private

Definition at line 190 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\ctrl().

Referenced by isAvoidManipulationRedirectRequired().

190  : bool
191  {
192  switch ($this->ctrl->getCmd(self::CMD_SHOW_GENERAL_CONFIG_FORM)) {
193  case self::CMD_SAVE_GENERAL_CONFIG_FORM:
194  case self::CMD_SAVE_SRC_POOL_DEF_LIST:
195  case self::CMD_DELETE_SINGLE_SRC_POOL_DEF:
196  case self::CMD_DELETE_MULTI_SRC_POOL_DEFS:
197  case self::CMD_SAVE_CREATE_SRC_POOL_DEF_FORM:
198  case self::CMD_SAVE_EDIT_SRC_POOL_DEF_FORM:
199  case self::CMD_SAVE_AND_NEW_CREATE_SRC_POOL_DEF_FORM:
200  case self::CMD_BUILD_QUESTION_STAGE:
201 
202  return true;
203  }
204 
205  return false;
206  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateOnScreenMessage()

ilTestRandomQuestionSetConfigGUI::populateOnScreenMessage (   $message)
protected
Parameters
$message

Definition at line 934 of file class.ilTestRandomQuestionSetConfigGUI.php.

References $message.

Referenced by showGeneralConfigFormCmd(), and showSourcePoolDefinitionListCmd().

935  {
936  $this->tpl->setCurrentBlock('mess');
937  $this->tpl->setVariable('MESSAGE', $message);
938  $this->tpl->parseCurrentBlock();
939  }
$message
Definition: xapiexit.php:32
+ Here is the caller graph for this function:

◆ preventFormBecauseOfSync()

ilTestRandomQuestionSetConfigGUI::preventFormBecauseOfSync ( )
protected

Definition at line 866 of file class.ilTestRandomQuestionSetConfigGUI.php.

References isFrozenConfigRequired().

Referenced by showGeneralConfigFormCmd(), and showSourcePoolDefinitionListCmd().

866  : bool
867  {
868  $return = false;
869  $last_sync = $this->question_set_config->getLastQuestionSyncTimestamp();
870 
871  if ($last_sync !== null && $last_sync !== 0 &&
872  !$this->isFrozenConfigRequired() && $this->question_set_config->isQuestionSetBuildable()) {
873  return true;
874  }
875  return false;
876  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetPoolSyncCmd()

ilTestRandomQuestionSetConfigGUI::resetPoolSyncCmd ( )

Definition at line 878 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\ctrl().

878  : void
879  {
880  $this->question_set_config->setLastQuestionSyncTimestamp(0);
881  $this->question_set_config->saveToDb();
882  $this->ctrl->redirect($this, self::CMD_SHOW_GENERAL_CONFIG_FORM);
883  }
+ Here is the call graph for this function:

◆ saveCreateAndNewSourcePoolDefinitionFormCmd()

ilTestRandomQuestionSetConfigGUI::saveCreateAndNewSourcePoolDefinitionFormCmd ( )
private

Definition at line 552 of file class.ilTestRandomQuestionSetConfigGUI.php.

References saveCreateSourcePoolDefinitionFormCmd().

552  : void
553  {
555  }
saveCreateSourcePoolDefinitionFormCmd($redirect_back_to_form=false)
+ Here is the call graph for this function:

◆ saveCreateSourcePoolDefinitionFormCmd()

ilTestRandomQuestionSetConfigGUI::saveCreateSourcePoolDefinitionFormCmd (   $redirect_back_to_form = false)
private
Parameters
bool$redirect_back_to_form

Definition at line 560 of file class.ilTestRandomQuestionSetConfigGUI.php.

References buildCreateSourcePoolDefinitionFormGUI(), ILIAS\Repository\ctrl(), fetchQuestionPoolIdParameter(), getSourcePoolDefinitionByAvailableQuestionPoolId(), ilObjTaxonomy\getUsageOfObject(), ILIAS\Repository\lng(), and showCreateSourcePoolDefinitionFormCmd().

Referenced by saveCreateAndNewSourcePoolDefinitionFormCmd().

560  : void
561  {
562  $this->question_set_config->loadFromDb();
563 
564  $poolId = $this->fetchQuestionPoolIdParameter();
565  $sourcePoolDefinition = $this->getSourcePoolDefinitionByAvailableQuestionPoolId($poolId);
566  $availableTaxonomyIds = ilObjTaxonomy::getUsageOfObject($sourcePoolDefinition->getPoolId());
567 
569  $form->build($sourcePoolDefinition, $availableTaxonomyIds);
570 
571  $errors = !$form->checkInput(); // ALWAYS CALL BEFORE setValuesByPost()
572  $form->setValuesByPost(); // NEVER CALL THIS BEFORE checkInput()
573 
574  if ($errors) {
576  return;
577  }
578 
579  $form->applySubmit($sourcePoolDefinition, $availableTaxonomyIds);
580 
581  $sourcePoolDefinition->setSequencePosition($this->source_pool_definition_list->getNextPosition());
582  $sourcePoolDefinition->saveToDb();
583  $this->source_pool_definition_list->addDefinition($sourcePoolDefinition);
584 
585  $this->source_pool_definition_list->saveDefinitions();
586 
587  $this->question_set_config->setLastQuestionSyncTimestamp(0);
588  $this->question_set_config->saveToDb();
589 
590  $this->test_obj->saveCompleteStatus($this->question_set_config);
591 
592  if ($redirect_back_to_form) {
593  $this->tpl->setOnScreenMessage('success', $this->lng->txt("tst_msg_random_qsc_modified_add_new_rule"), true);
594  $this->ctrl->setParameter($this, 'src_pool_def_id', $sourcePoolDefinition->getId());
595  $this->ctrl->setParameter($this, 'quest_pool_id', $sourcePoolDefinition->getPoolId());
596  $this->ctrl->redirect($this, self::CMD_SHOW_CREATE_SRC_POOL_DEF_FORM);
597  } else {
598  $this->ctrl->setParameterByClass(self::class, 'modified', 'save');
599  $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
600  }
601  }
static getUsageOfObject(int $a_obj_id, bool $a_include_titles=false)
showCreateSourcePoolDefinitionFormCmd(ilTestRandomQuestionSetPoolDefinitionFormGUI $form=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveEditSourcePoolDefinitionFormCmd()

ilTestRandomQuestionSetConfigGUI::saveEditSourcePoolDefinitionFormCmd ( )
private

Definition at line 635 of file class.ilTestRandomQuestionSetConfigGUI.php.

References buildEditSourcePoolDefinitionFormGUI(), ILIAS\Repository\ctrl(), fetchSingleSourcePoolDefinitionIdParameter(), ilObjTaxonomy\getUsageOfObject(), and showSourcePoolDefinitionListCmd().

635  : void
636  {
637  $this->question_set_config->loadFromDb();
638 
640  $sourcePoolDefinition = $this->source_pool_definition_factory->getSourcePoolDefinitionByDefinitionId($defId);
641  $availableTaxonomyIds = ilObjTaxonomy::getUsageOfObject($sourcePoolDefinition->getPoolId());
642 
643  $form = $this->buildEditSourcePoolDefinitionFormGUI();
644  $form->build($sourcePoolDefinition, $availableTaxonomyIds);
645 
646  $errors = !$form->checkInput(); // ALWAYS CALL BEFORE setValuesByPost()
647  $form->setValuesByPost(); // NEVER CALL THIS BEFORE checkInput()
648 
649  if ($errors) {
651  return;
652  }
653 
654  $form->applySubmit($sourcePoolDefinition, $availableTaxonomyIds);
655 
656  $sourcePoolDefinition->saveToDb();
657 
658  $this->question_set_config->setLastQuestionSyncTimestamp(0);
659  $this->question_set_config->saveToDb();
660 
661  $this->test_obj->saveCompleteStatus($this->question_set_config);
662 
663  $this->ctrl->setParameterByClass(self::class, 'modified', 'save');
664  $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
665  }
static getUsageOfObject(int $a_obj_id, bool $a_include_titles=false)
+ Here is the call graph for this function:

◆ saveGeneralConfigFormCmd()

ilTestRandomQuestionSetConfigGUI::saveGeneralConfigFormCmd ( )
private

Definition at line 304 of file class.ilTestRandomQuestionSetConfigGUI.php.

References buildGeneralConfigFormGUI(), ILIAS\Repository\ctrl(), and showGeneralConfigFormCmd().

304  : void
305  {
306  $form = $this->buildGeneralConfigFormGUI();
307 
308  $errors = !$form->checkInput(); // ALWAYS CALL BEFORE setValuesByPost()
309  $form->setValuesByPost(); // NEVER CALL THIS BEFORE checkInput()
310 
311  if ($errors) {
312  $this->showGeneralConfigFormCmd($form);
313  return;
314  }
315 
316  $form->save();
317 
318  $this->question_set_config->setLastQuestionSyncTimestamp(0);
319  $this->question_set_config->saveToDb();
320 
321  $this->test_obj->saveCompleteStatus($this->question_set_config);
322 
323  $this->ctrl->setParameter($this, 'modified', 'save');
324  $this->ctrl->redirect($this, self::CMD_SHOW_GENERAL_CONFIG_FORM);
325  }
showGeneralConfigFormCmd(ilTestRandomQuestionSetGeneralConfigFormGUI $form=null)
+ Here is the call graph for this function:

◆ saveSourcePoolDefinitionListCmd()

ilTestRandomQuestionSetConfigGUI::saveSourcePoolDefinitionListCmd ( )
private

Definition at line 391 of file class.ilTestRandomQuestionSetConfigGUI.php.

References buildSourcePoolDefinitionListTableGUI(), and ILIAS\Repository\ctrl().

391  : void
392  {
393  $this->question_set_config->loadFromDb();
394 
395  $table = $this->buildSourcePoolDefinitionListTableGUI();
396 
397  $table->applySubmit($this->source_pool_definition_list);
398 
399  $this->source_pool_definition_list->reindexPositions();
400  $this->source_pool_definition_list->saveDefinitions();
401 
402  $this->question_set_config->setLastQuestionSyncTimestamp(0);
403  // fau.
404  $this->question_set_config->saveToDb();
405 
406  $this->test_obj->saveCompleteStatus($this->question_set_config);
407 
408  $this->ctrl->setParameter($this, 'modified', 'save');
409  $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
410  }
+ Here is the call graph for this function:

◆ selectPoolDerivationTargetCmd()

ilTestRandomQuestionSetConfigGUI::selectPoolDerivationTargetCmd ( )
private

Definition at line 782 of file class.ilTestRandomQuestionSetConfigGUI.php.

References ILIAS\Repository\ctrl(), fetchPoolIdsParameter(), and ILIAS\Repository\lng().

782  : void
783  {
784  $this->ctrl->setParameter($this, 'derive_pool_ids', implode(':', $this->fetchPoolIdsParameter()));
785 
786  $explorer = new ilRepositorySelectorExplorerGUI(
787  $this,
788  self::CMD_SELECT_DERIVATION_TARGET,
789  $this,
790  self::CMD_DERIVE_NEW_POOLS,
791  'target_ref'
792  );
793  $explorer->setClickableTypes($this->obj_definition->getExplorerContainerTypes());
794  $explorer->setSelectableTypes([]);
795 
796  if (!$explorer->handleCommand()) {
797  $this->tpl->setOnScreenMessage('info', $this->lng->txt('tst_please_select_target_for_pool_derives'));
798  $this->tpl->setContent($this->ctrl->getHTML($explorer));
799  }
800  }
Explorer for selecting repository items.
+ Here is the call graph for this function:

◆ showCreateSourcePoolDefinitionFormCmd()

ilTestRandomQuestionSetConfigGUI::showCreateSourcePoolDefinitionFormCmd ( ilTestRandomQuestionSetPoolDefinitionFormGUI  $form = null)
private

Definition at line 535 of file class.ilTestRandomQuestionSetConfigGUI.php.

References buildCreateSourcePoolDefinitionFormGUI(), ILIAS\Repository\ctrl(), fetchQuestionPoolIdParameter(), getSourcePoolDefinitionByAvailableQuestionPoolId(), and ilObjTaxonomy\getUsageOfObject().

Referenced by saveCreateSourcePoolDefinitionFormCmd().

535  : void
536  {
537  $this->question_set_config->loadFromDb();
538 
539  $poolId = $this->fetchQuestionPoolIdParameter();
540 
541  $sourcePoolDefinition = $this->getSourcePoolDefinitionByAvailableQuestionPoolId($poolId);
542  $availableTaxonomyIds = ilObjTaxonomy::getUsageOfObject($sourcePoolDefinition->getPoolId());
543 
544  if ($form === null) {
546  $form->build($sourcePoolDefinition, $availableTaxonomyIds);
547  }
548 
549  $this->tpl->setContent($this->ctrl->getHTML($form));
550  }
build(ilTestRandomQuestionSetSourcePoolDefinition $sourcePool, $availableTaxonomyIds)
static getUsageOfObject(int $a_obj_id, bool $a_include_titles=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showEditSourcePoolDefinitionFormCmd()

ilTestRandomQuestionSetConfigGUI::showEditSourcePoolDefinitionFormCmd ( ilTestRandomQuestionSetPoolDefinitionFormGUI  $form = null)
private

Definition at line 619 of file class.ilTestRandomQuestionSetConfigGUI.php.

References buildEditSourcePoolDefinitionFormGUI(), ILIAS\Repository\ctrl(), fetchSingleSourcePoolDefinitionIdParameter(), and ilObjTaxonomy\getUsageOfObject().

619  : void
620  {
621  $this->question_set_config->loadFromDb();
622 
624  $sourcePoolDefinition = $this->source_pool_definition_factory->getSourcePoolDefinitionByDefinitionId($defId);
625  $availableTaxonomyIds = ilObjTaxonomy::getUsageOfObject($sourcePoolDefinition->getPoolId());
626 
627  if ($form === null) {
628  $form = $this->buildEditSourcePoolDefinitionFormGUI();
629  $form->build($sourcePoolDefinition, $availableTaxonomyIds);
630  }
631 
632  $this->tpl->setContent($this->ctrl->getHTML($form));
633  }
build(ilTestRandomQuestionSetSourcePoolDefinition $sourcePool, $availableTaxonomyIds)
static getUsageOfObject(int $a_obj_id, bool $a_include_titles=false)
+ Here is the call graph for this function:

◆ showGeneralConfigFormCmd()

ilTestRandomQuestionSetConfigGUI::showGeneralConfigFormCmd ( ilTestRandomQuestionSetGeneralConfigFormGUI  $form = null)
private

Definition at line 281 of file class.ilTestRandomQuestionSetConfigGUI.php.

References $message, buildGeneralConfigFormGUI(), buildOnScreenMessage(), ilTestRandomQuestionSetConfigStateMessageHandler\CONTEXT_GENERAL_CONFIG, ILIAS\Repository\ctrl(), populateOnScreenMessage(), and preventFormBecauseOfSync().

Referenced by saveGeneralConfigFormCmd().

281  : void
282  {
283  $disabled_form = $this->preventFormBecauseOfSync();
284 
285  if ($form === null) {
286  $this->question_set_config->loadFromDb();
287  $form = $this->buildGeneralConfigFormGUI($disabled_form);
288  }
289 
290  $this->tpl->setContent($this->ctrl->getHTML($form));
291 
292  $this->configStateMessageHandler->setContext(
294  );
295 
296  $this->configStateMessageHandler->handle();
297 
298  $message = $this->buildOnScreenMessage();
299  if ($message !== '') {
301  }
302  }
$message
Definition: xapiexit.php:32
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showPoolSelectorExplorerCmd()

ilTestRandomQuestionSetConfigGUI::showPoolSelectorExplorerCmd ( )
protected

Definition at line 512 of file class.ilTestRandomQuestionSetConfigGUI.php.

512  : void
513  {
514  $this->question_set_config->loadFromDb();
515 
516  $selector = new ilTestQuestionPoolSelectorExplorer(
517  $this,
518  self::CMD_SHOW_POOL_SELECTOR_EXPLORER,
519  self::CMD_SHOW_CREATE_SRC_POOL_DEF_FORM,
520  $this->obj_cache
521  );
522 
523  $selector->setAvailableQuestionPools(
524  array_keys($this->question_set_config->getSelectableQuestionPools())
525  );
526 
527  if ($selector->handleCommand()) {
528  return;
529  }
530 
531  $this->tpl->setContent($selector->getHTML());
532  }

◆ showSourcePoolDefinitionListCmd()

ilTestRandomQuestionSetConfigGUI::showSourcePoolDefinitionListCmd ( )
private

Definition at line 354 of file class.ilTestRandomQuestionSetConfigGUI.php.

References $message, buildNonAvailablePoolsTableGUI(), buildOnScreenMessage(), buildSourcePoolDefinitionListTableGUI(), buildSourcePoolDefinitionListToolbarGUI(), ilTestRandomQuestionSetConfigStateMessageHandler\CONTEXT_POOL_SELECTION, ILIAS\Repository\ctrl(), isFrozenConfigRequired(), populateOnScreenMessage(), and preventFormBecauseOfSync().

Referenced by saveEditSourcePoolDefinitionFormCmd().

354  : void
355  {
356  $disabled_form = $this->preventFormBecauseOfSync();
357 
358  $this->question_set_config->loadFromDb();
359 
360  $content = '';
361 
362  if (!$this->isFrozenConfigRequired() && !$disabled_form) {
363  $toolbar = $this->buildSourcePoolDefinitionListToolbarGUI();
364  $content .= $this->ctrl->getHTML($toolbar);
365  }
366 
367  $table = $this->buildSourcePoolDefinitionListTableGUI($disabled_form);
368  $table->init($this->source_pool_definition_list);
369  $content .= $this->ctrl->getHTML($table);
370 
371  if (!$this->source_pool_definition_list->areAllUsedPoolsAvailable()) {
372  $table = $this->buildNonAvailablePoolsTableGUI();
373  $table->init($this->source_pool_definition_list);
374  $content .= $this->ctrl->getHTML($table);
375  }
376 
377  $this->tpl->setContent($content);
378 
379  $this->configStateMessageHandler->setContext(
381  );
382 
383  $this->configStateMessageHandler->handle();
384 
385  $message = $this->buildOnScreenMessage();
386  if ($message) {
388  }
389  }
$message
Definition: xapiexit.php:32
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $configStateMessageHandler

ilTestRandomQuestionSetConfigStateMessageHandler ilTestRandomQuestionSetConfigGUI::$configStateMessageHandler
protected

Definition at line 64 of file class.ilTestRandomQuestionSetConfigGUI.php.

◆ $question_set_config

ilTestRandomQuestionSetConfig ilTestRandomQuestionSetConfigGUI::$question_set_config
protected

Definition at line 60 of file class.ilTestRandomQuestionSetConfigGUI.php.

◆ $source_pool_definition_factory

ilTestRandomQuestionSetSourcePoolDefinitionFactory ilTestRandomQuestionSetConfigGUI::$source_pool_definition_factory
protected

Definition at line 61 of file class.ilTestRandomQuestionSetConfigGUI.php.

◆ $source_pool_definition_list

ilTestRandomQuestionSetSourcePoolDefinitionList ilTestRandomQuestionSetConfigGUI::$source_pool_definition_list
protected

Definition at line 62 of file class.ilTestRandomQuestionSetConfigGUI.php.

◆ $stagingPool

ilTestRandomQuestionSetStagingPoolBuilder ilTestRandomQuestionSetConfigGUI::$stagingPool
protected

Definition at line 63 of file class.ilTestRandomQuestionSetConfigGUI.php.

◆ CMD_BUILD_QUESTION_STAGE

const ilTestRandomQuestionSetConfigGUI::CMD_BUILD_QUESTION_STAGE = 'buildQuestionStage'

◆ CMD_DELETE_MULTI_SRC_POOL_DEFS

const ilTestRandomQuestionSetConfigGUI::CMD_DELETE_MULTI_SRC_POOL_DEFS = 'deleteMultipleSourcePoolDefinitions'

◆ CMD_DELETE_SINGLE_SRC_POOL_DEF

const ilTestRandomQuestionSetConfigGUI::CMD_DELETE_SINGLE_SRC_POOL_DEF = 'deleteSingleSourcePoolDefinition'

◆ CMD_DERIVE_NEW_POOLS

const ilTestRandomQuestionSetConfigGUI::CMD_DERIVE_NEW_POOLS = 'deriveNewPools'

Definition at line 55 of file class.ilTestRandomQuestionSetConfigGUI.php.

◆ CMD_RESET_POOLSYNC

const ilTestRandomQuestionSetConfigGUI::CMD_RESET_POOLSYNC = 'resetPoolSync'

◆ CMD_SAVE_AND_NEW_CREATE_SRC_POOL_DEF_FORM

const ilTestRandomQuestionSetConfigGUI::CMD_SAVE_AND_NEW_CREATE_SRC_POOL_DEF_FORM = 'saveCreateAndNewSourcePoolDefinitionForm'

Definition at line 50 of file class.ilTestRandomQuestionSetConfigGUI.php.

◆ CMD_SAVE_CREATE_SRC_POOL_DEF_FORM

const ilTestRandomQuestionSetConfigGUI::CMD_SAVE_CREATE_SRC_POOL_DEF_FORM = 'saveCreateSourcePoolDefinitionForm'

Definition at line 49 of file class.ilTestRandomQuestionSetConfigGUI.php.

◆ CMD_SAVE_EDIT_SRC_POOL_DEF_FORM

const ilTestRandomQuestionSetConfigGUI::CMD_SAVE_EDIT_SRC_POOL_DEF_FORM = 'saveEditSourcePoolDefinitionForm'

Definition at line 52 of file class.ilTestRandomQuestionSetConfigGUI.php.

◆ CMD_SAVE_GENERAL_CONFIG_FORM

const ilTestRandomQuestionSetConfigGUI::CMD_SAVE_GENERAL_CONFIG_FORM = 'saveGeneralConfigForm'

◆ CMD_SAVE_SRC_POOL_DEF_LIST

const ilTestRandomQuestionSetConfigGUI::CMD_SAVE_SRC_POOL_DEF_LIST = 'saveSourcePoolDefinitionList'

◆ CMD_SELECT_DERIVATION_TARGET

const ilTestRandomQuestionSetConfigGUI::CMD_SELECT_DERIVATION_TARGET = 'selectPoolDerivationTarget'

◆ CMD_SHOW_CREATE_SRC_POOL_DEF_FORM

const ilTestRandomQuestionSetConfigGUI::CMD_SHOW_CREATE_SRC_POOL_DEF_FORM = 'showCreateSourcePoolDefinitionForm'

Definition at line 48 of file class.ilTestRandomQuestionSetConfigGUI.php.

◆ CMD_SHOW_EDIT_SRC_POOL_DEF_FORM

const ilTestRandomQuestionSetConfigGUI::CMD_SHOW_EDIT_SRC_POOL_DEF_FORM = 'showEditSourcePoolDefinitionForm'

◆ CMD_SHOW_GENERAL_CONFIG_FORM

const ilTestRandomQuestionSetConfigGUI::CMD_SHOW_GENERAL_CONFIG_FORM = 'showGeneralConfigForm'

◆ CMD_SHOW_POOL_SELECTOR_EXPLORER

const ilTestRandomQuestionSetConfigGUI::CMD_SHOW_POOL_SELECTOR_EXPLORER = 'showPoolSelectorExplorer'

◆ CMD_SHOW_SRC_POOL_DEF_LIST

◆ HTTP_PARAM_AFTER_REBUILD_QUESTION_STAGE_CMD

const ilTestRandomQuestionSetConfigGUI::HTTP_PARAM_AFTER_REBUILD_QUESTION_STAGE_CMD = 'afterRebuildQuestionStageCmd'

The documentation for this class was generated from the following file: