ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilTestRandomQuestionSetConfigGUI Class Reference
+ Collaboration diagram for ilTestRandomQuestionSetConfigGUI:

Public Member Functions

 __construct (private readonly ilObjTest $test_obj, private readonly ilCtrl $ctrl, private readonly ilObjUser $user, private readonly ilAccessHandler $access, private readonly UIFactory $ui_factory, private readonly UIRenderer $ui_renderer, private readonly DataFactory $data_factory, private readonly TabsManager $tabs_manager, private readonly ilLanguage $lng, private readonly TestLogger $logger, private readonly ilGlobalTemplateInterface $tpl, private readonly ilDBInterface $db, private readonly ilTree $tree, private readonly ilComponentRepository $component_repository, private readonly ilObjectDefinition $obj_definition, private readonly ilObjectDataCache $obj_cache, private ilTestProcessLockerFactory $processLockerFactory, private readonly RequestDataCollector $testrequest, private readonly TitleColumnsBuilder $title_builder, private readonly GeneralQuestionPropertiesRepository $questionrepository)
 
 executeCommand ()
 
 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_SRC_POOL_DEF = 'deleteSourcePoolDefinition'
 
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 ()
 
 activateTabs ()
 
 buildQuestionStageCmd ()
 
 fetchAfterRebuildQuestionStageCmdParameter ()
 
 showGeneralConfigFormCmd (ilTestRandomQuestionSetGeneralConfigFormGUI $form=null)
 
 saveGeneralConfigFormCmd ()
 
 buildGeneralConfigFormGUI (bool $disabled=false)
 
 showSourcePoolDefinitionListCmd ()
 
 saveSourcePoolDefinitionListCmd ()
 
 buildSourcePoolDefinitionListToolbarGUI ()
 
 buildSourcePoolDefinitionListTableGUI (bool $disabled=false)
 
 deleteSourcePoolDefinitionCmd ()
 
 showCreateSourcePoolDefinitionFormCmd (ilTestRandomQuestionSetPoolDefinitionFormGUI $form=null)
 
 saveCreateAndNewSourcePoolDefinitionFormCmd ()
 
 saveCreateSourcePoolDefinitionFormCmd ($redirect_back_to_form=false)
 
 buildCreateSourcePoolDefinitionFormGUI ()
 
 showEditSourcePoolDefinitionFormCmd (ilTestRandomQuestionSetPoolDefinitionFormGUI $form=null)
 
 saveEditSourcePoolDefinitionFormCmd ()
 
 buildEditSourcePoolDefinitionFormGUI ()
 
 fetchQuestionPoolIdParameter ()
 
 fetchMultiSourcePoolDefinitionIdsParameter ()
 
 fetchSingleSourcePoolDefinitionIdParameter ()
 
 getSourcePoolDefinitionByAvailableQuestionPoolId ($pool_id)
 
 selectPoolDerivationTargetCmd ()
 
 deriveNewPoolsCmd ()
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilTestRandomQuestionSetConfigGUI::__construct ( private readonly ilObjTest  $test_obj,
private readonly ilCtrl  $ctrl,
private readonly ilObjUser  $user,
private readonly ilAccessHandler  $access,
private readonly UIFactory  $ui_factory,
private readonly UIRenderer  $ui_renderer,
private readonly DataFactory  $data_factory,
private readonly TabsManager  $tabs_manager,
private readonly ilLanguage  $lng,
private readonly TestLogger  $logger,
private readonly ilGlobalTemplateInterface  $tpl,
private readonly ilDBInterface  $db,
private readonly ilTree  $tree,
private readonly ilComponentRepository  $component_repository,
private readonly ilObjectDefinition  $obj_definition,
private readonly ilObjectDataCache  $obj_cache,
private ilTestProcessLockerFactory  $processLockerFactory,
private readonly RequestDataCollector  $testrequest,
private readonly TitleColumnsBuilder  $title_builder,
private readonly GeneralQuestionPropertiesRepository  $questionrepository 
)

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

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

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

Member Function Documentation

◆ activateTabs()

ilTestRandomQuestionSetConfigGUI::activateTabs ( )
private

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

References ILIAS\Repository\ctrl().

Referenced by executeCommand().

217  : void
218  {
219  $this->tabs_manager->activateTab('assQuestions');
220 
221  switch ($this->ctrl->getCmd(self::CMD_SHOW_GENERAL_CONFIG_FORM)) {
222  case self::CMD_SHOW_GENERAL_CONFIG_FORM:
223  case self::CMD_SAVE_GENERAL_CONFIG_FORM:
224  $this->tabs_manager->activateSubTab('tstRandQuestSetGeneralConfig');
225  break;
226 
227  case self::CMD_SHOW_SRC_POOL_DEF_LIST:
228  case self::CMD_SAVE_SRC_POOL_DEF_LIST:
229  case self::CMD_DELETE_SRC_POOL_DEF:
230  case self::CMD_SHOW_CREATE_SRC_POOL_DEF_FORM:
231  case self::CMD_SAVE_CREATE_SRC_POOL_DEF_FORM:
232  case self::CMD_SHOW_EDIT_SRC_POOL_DEF_FORM:
233  case self::CMD_SAVE_EDIT_SRC_POOL_DEF_FORM:
234  $this->tabs_manager->activateSubTab('tstRandQuestSetPoolConfig');
235  break;
236  }
237  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildCreateSourcePoolDefinitionFormGUI()

ilTestRandomQuestionSetConfigGUI::buildCreateSourcePoolDefinitionFormGUI ( )
private

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

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

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

582  {
584  $this->ctrl,
585  $this->lng,
586  $this->test_obj,
587  $this,
588  $this->question_set_config
589  );
590 
591  $form->setSaveCommand(self::CMD_SAVE_CREATE_SRC_POOL_DEF_FORM);
592  $form->setSaveAndNewCommand(self::CMD_SAVE_AND_NEW_CREATE_SRC_POOL_DEF_FORM);
593 
594  return $form;
595  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildEditSourcePoolDefinitionFormGUI()

ilTestRandomQuestionSetConfigGUI::buildEditSourcePoolDefinitionFormGUI ( )
private

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

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

Referenced by saveEditSourcePoolDefinitionFormCmd(), and showEditSourcePoolDefinitionFormCmd().

658  {
660  $this->ctrl,
661  $this->lng,
662  $this->test_obj,
663  $this,
664  $this->question_set_config
665  );
666 
667  $form->setSaveCommand(self::CMD_SAVE_EDIT_SRC_POOL_DEF_FORM);
668 
669  return $form;
670  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildFormResultMessage()

ilTestRandomQuestionSetConfigGUI::buildFormResultMessage ( )
protected

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

References ILIAS\Repository\lng().

Referenced by buildOnScreenMessage().

867  : string
868  {
869  $message = '';
870 
871  if ($this->testrequest->isset('modified')) {
872  $action = $this->testrequest->raw('modified');
873  if ($action === 'save') {
874  $success_message = $this->ui_factory->messageBox()->success($this->lng->txt('tst_msg_random_question_set_config_modified'));
875  } elseif ($action === 'remove') {
876  $success_message = $this->ui_factory->messageBox()->success($this->lng->txt('tst_msg_source_pool_definitions_deleted'));
877  } elseif ($action === 'sync') {
878  $success_message = $this->ui_factory->messageBox()->success($this->lng->txt('tst_msg_random_question_set_synced'));
879  }
880  $message .= $this->ui_renderer->render(
881  $success_message
882  );
883  }
884 
885  return $message;
886  }
+ 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 341 of file class.ilTestRandomQuestionSetConfigGUI.php.

References isFrozenConfigRequired().

Referenced by saveGeneralConfigFormCmd(), and showGeneralConfigFormCmd().

342  {
344  $this,
345  $this->question_set_config
346  );
347 
348  //TODO: should frozen config not lead to 'completely disabled' as well?!
349  $form->setEditModeEnabled(!$this->isFrozenConfigRequired());
350 
351  if ($disabled) {
352  $form->setEditModeEnabled(false);
353  }
354 
355  $form->build();
356 
357  if ($disabled) {
358  $form->clearCommandButtons();
359  }
360 
361  return $form;
362  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildOnScreenMessage()

ilTestRandomQuestionSetConfigGUI::buildOnScreenMessage ( )
protected

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

References buildFormResultMessage(), and buildValidationMessage().

Referenced by showGeneralConfigFormCmd(), and showSourcePoolDefinitionListCmd().

859  : string
860  {
861  $message = $this->buildFormResultMessage();
862  $message .= $this->buildValidationMessage();
863 
864  return $message;
865  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildQuestionStageCmd()

ilTestRandomQuestionSetConfigGUI::buildQuestionStageCmd ( )
private

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

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

239  : void
240  {
241  if ($this->source_pool_definition_list->areAllUsedPoolsAvailable()) {
242  $locker = $this->processLockerFactory->retrieveLockerForNamedOperation();
243  $locker->executeNamedOperation(__FUNCTION__, function (): void {
244  $this->stagingPool->rebuild($this->source_pool_definition_list);
245  $this->source_pool_definition_list->saveDefinitions();
246 
247  $this->question_set_config->loadFromDb();
248  $this->question_set_config->setLastQuestionSyncTimestamp(time());
249  $this->question_set_config->saveToDb();
250 
251  $this->test_obj->saveCompleteStatus($this->question_set_config);
252 
253  $this->ctrl->setParameterByClass(self::class, 'modified', 'sync');
254  });
255  if ($this->logger->isLoggingEnabled()) {
256  $this->logger->logTestAdministrationInteraction(
257  $this->logger->getInteractionFactory()->buildTestAdministrationInteraction(
258  $this->test_obj->getRefId(),
259  $this->user->getId(),
260  TestAdministrationInteractionTypes::QUESTIONS_SYNCHRONISED,
261  []
262  )
263  );
264  }
265  }
266 
267  $this->ctrl->redirect($this, $this->fetchAfterRebuildQuestionStageCmdParameter());
268  }
+ Here is the call graph for this function:

◆ buildSourcePoolDefinitionListTableGUI()

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

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

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

Referenced by saveSourcePoolDefinitionListCmd(), and showSourcePoolDefinitionListCmd().

440  {
441  $translator = new ilTestQuestionFilterLabelTranslator($this->db, $this->lng);
442  $translator->loadLabels($this->source_pool_definition_list);
443 
445  $this->ctrl,
446  $this->lng,
447  $this->ui_factory,
448  $this->data_factory,
449  $this->testrequest->getRequest(),
450  $this->title_builder,
451  $translator,
453  !$this->isFrozenConfigRequired() && !$disabled,
454  $this->question_set_config->isQuestionAmountConfigurationModePerPool()
455  );
456  }
ilTestRandomQuestionSetSourcePoolDefinitionList $source_pool_definition_list
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildSourcePoolDefinitionListToolbarGUI()

ilTestRandomQuestionSetConfigGUI::buildSourcePoolDefinitionListToolbarGUI ( )
private

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

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

Referenced by showSourcePoolDefinitionListCmd().

426  {
428  $this->ctrl,
429  $this->lng,
430  $this,
431  $this->question_set_config
432  );
433 
434  $toolbar->build();
435 
436  return $toolbar;
437  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildValidationMessage()

ilTestRandomQuestionSetConfigGUI::buildValidationMessage ( )
protected

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

Referenced by buildOnScreenMessage().

888  : string
889  {
890  if ($this->configStateMessageHandler->isValidationFailed()) {
891  return $this->ui_renderer->render(
892  $this->ui_factory->messageBox()->failure($this->configStateMessageHandler->getValidationReportHtml())
893  );
894  }
895 
896  if ($this->configStateMessageHandler->hasValidationReports()) {
897  return $this->ui_renderer->render(
898  $this->ui_factory->messageBox()->info($this->configStateMessageHandler->getValidationReportHtml())
899  );
900  }
901 
902  return $this->configStateMessageHandler->getSyncInfoMessage();
903  }
+ Here is the caller graph for this function:

◆ deleteSourcePoolDefinitionCmd()

ilTestRandomQuestionSetConfigGUI::deleteSourcePoolDefinitionCmd ( )
private

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

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

458  : void
459  {
460  $definition_ids = $this->fetchMultiSourcePoolDefinitionIdsParameter();
461  foreach ($definition_ids as $definition_id) {
462  $definition = $this->source_pool_definition_factory->getSourcePoolDefinitionByDefinitionId($definition_id);
463  $definition->deleteFromDb();
464  }
465 
466  $this->source_pool_definition_list->reindexPositions();
467  $this->source_pool_definition_list->saveDefinitions();
468 
469  $this->question_set_config->loadFromDb();
470  $this->question_set_config->setLastQuestionSyncTimestamp(0);
471  $this->question_set_config->saveToDb();
472 
473  $this->test_obj->saveCompleteStatus($this->question_set_config);
474 
475  $this->ctrl->setParameterByClass(self::class, 'modified', 'remove');
476  $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
477  }
+ Here is the call graph for this function:

◆ deriveNewPoolsCmd()

ilTestRandomQuestionSetConfigGUI::deriveNewPoolsCmd ( )
private

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

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

789  : void
790  {
791  $pool_ids = $this->fetchPoolIdsParameter();
792  $target_ref = $this->fetchTargetRefParameter();
793  if (!$this->access->checkAccess('write', '', $target_ref)) {
794  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_permission"), true);
795  $this->ctrl->setParameterByClass(ilObjTestGUI::class, 'ref_id', $this->test_obj->getRefId());
796  $this->ctrl->redirectByClass(ilObjTestGUI::class);
797  }
798 
799  if ($pool_ids !== []) {
800  foreach ($pool_ids as $pool_id) {
801  $lost_pool = $this->source_pool_definition_list->getLostPool($pool_id);
802 
803  $deriver = new ilTestRandomQuestionSetPoolDeriver(
804  $this->db,
805  $this->component_repository,
806  $this->test_obj,
807  $this->source_pool_definition_list,
808  $this->user->getId(),
809  $target_ref
810  );
811  $new_pool = $deriver->derive($lost_pool);
812 
813  $srcPoolDefinition = $this->source_pool_definition_list->getDefinitionBySourcePoolId($new_pool->getId());
814  $srcPoolDefinition->setPoolTitle($new_pool->getTitle());
815  $srcPoolDefinition->setPoolPath($this->question_set_config->getQuestionPoolPathString($new_pool->getId()));
816  $srcPoolDefinition->setPoolRefId($this->question_set_config->getFirstQuestionPoolRefIdByObjId($new_pool->getId()));
817  $srcPoolDefinition->saveToDb();
818 
820  $this->test_obj->getTestId(),
821  $lost_pool->getId(),
822  $new_pool->getId()
823  );
824  }
825 
826  $this->tpl->setOnScreenMessage('success', $this->lng->txt('tst_non_available_pool_newly_derived'), true);
827  }
828 
829  $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
830  }
derive(ilTestRandomQuestionSetNonAvailablePool $non_available_pool)
static updateSourceQuestionPoolId(int $test_id, int $old_pool_id, int $new_pool_id)
+ Here is the call graph for this function:

◆ executeCommand()

ilTestRandomQuestionSetConfigGUI::executeCommand ( )

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

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

137  : void
138  {
139  if (!$this->access->checkAccess("write", "", $this->test_obj->getRefId())) {
140  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("cannot_edit_test"), true);
141  $this->ctrl->redirectByClass([ilRepositoryGUI::class, ilObjTestGUI::class, ilInfoScreenGUI::class]);
142  }
143 
145  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("tst_msg_cannot_modify_random_question_set_conf_due_to_part"), true);
146  $this->ctrl->redirect($this);
147  }
148 
149  $this->tabs_manager->getQuestionsSubTabs();
150  $this->activateTabs();
151  $next_class = $this->ctrl->getNextClass();
152 
153  switch ($next_class) {
154  case 'iltestrandomquestionsetpooldefinitionformgui':
155  $this->question_set_config->loadFromDb();
156  $pool_id = $this->fetchQuestionPoolIdParameter();
157  $source_pool_definition = $this->getSourcePoolDefinitionByAvailableQuestionPoolId($pool_id);
158  $available_taxonomy_ids = ilObjTaxonomy::getUsageOfObject($source_pool_definition->getPoolId());
160  $form->build($source_pool_definition, $available_taxonomy_ids);
161 
162  $this->ctrl->forwardCommand($form);
163  break;
164 
165  default:
166  $cmd = $this->ctrl->getCmd(self::CMD_SHOW_GENERAL_CONFIG_FORM) . 'Cmd';
167  $this->$cmd();
168  }
169  }
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 270 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by buildQuestionStageCmd().

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

◆ fetchMultiSourcePoolDefinitionIdsParameter()

ilTestRandomQuestionSetConfigGUI::fetchMultiSourcePoolDefinitionIdsParameter ( )
private

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

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

Referenced by deleteSourcePoolDefinitionCmd(), and fetchSingleSourcePoolDefinitionIdParameter().

685  : array
686  {
687  if (!$this->testrequest->isset('src_pool_def_id')) {
688  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('tst_please_select_source_pool'), true);
689  $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
690  return [];
691  }
692 
693  $definition_ids = is_array($this->testrequest->raw('src_pool_def_id'))
694  ? array_map('intval', $this->testrequest->raw('src_pool_def_id'))
695  : [(int) $this->testrequest->raw('src_pool_def_id')];
696 
697  foreach ($definition_ids as $definition_id) {
698  if ($definition_id === 0) {
700  }
701  }
702  return $definition_ids;
703  }
+ 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 740 of file class.ilTestRandomQuestionSetConfigGUI.php.

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

Referenced by deriveNewPoolsCmd(), and selectPoolDerivationTargetCmd().

740  : array
741  {
742  $pool_ids = [];
743  if ($this->testrequest->isset('derive_pool_ids') && is_array($this->testrequest->raw('derive_pool_ids'))) {
744  $pool_ids = [];
745 
746  foreach ($this->testrequest->raw('derive_pool_ids') as $pool_id) {
747  $pool_ids[] = (int) $pool_id;
748  }
749  } elseif ($this->testrequest->isset('derive_pool_ids') && preg_match('/^\d+(\:\d+)*$/', $this->testrequest->raw('derive_pool_ids'))) {
750  $pool_ids = array_map(
751  fn(int $id) => (int) $id,
752  explode(':', $this->testrequest->raw('derive_pool_ids'))
753  );
754  } elseif ($this->testrequest->isset('derive_pool_id') && (int) $this->testrequest->raw('derive_pool_id')) {
755  $pool_ids = [(int) $this->testrequest->raw('derive_pool_id')];
756  }
757 
758  return $pool_ids;
759  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchQuestionPoolIdParameter()

ilTestRandomQuestionSetConfigGUI::fetchQuestionPoolIdParameter ( )
private

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

References ILIAS\Repository\int().

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

672  : int
673  {
674  if ($this->testrequest->isset('quest_pool_id') && (int) $this->testrequest->raw('quest_pool_id')) {
675  return (int) $this->testrequest->raw('quest_pool_id');
676  }
677 
678  if ($this->testrequest->isset('quest_pool_ref') && (int) $this->testrequest->raw('quest_pool_ref')) {
679  return $this->obj_cache->lookupObjId((int) $this->testrequest->raw('quest_pool_ref'));
680  }
681 
683  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchSingleSourcePoolDefinitionIdParameter()

ilTestRandomQuestionSetConfigGUI::fetchSingleSourcePoolDefinitionIdParameter ( )
private

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

References fetchMultiSourcePoolDefinitionIdsParameter().

Referenced by saveEditSourcePoolDefinitionFormCmd(), and showEditSourcePoolDefinitionFormCmd().

705  : int
706  {
707  //even a single id can be an array (set by table actions) or a single value (set by form actions)
708  $definition_ids = $this->fetchMultiSourcePoolDefinitionIdsParameter();
709  if (count($definition_ids) !== 1) {
711  }
712  return $definition_ids[0];
713  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchTargetRefParameter()

ilTestRandomQuestionSetConfigGUI::fetchTargetRefParameter ( )
protected

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

References ILIAS\Repository\int().

Referenced by deriveNewPoolsCmd().

761  : ?int
762  {
763  if ($this->testrequest->isset('target_ref') && (int) $this->testrequest->raw('target_ref')) {
764  return (int) $this->testrequest->raw('target_ref');
765  }
766  return null;
767  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSourcePoolDefinitionByAvailableQuestionPoolId()

ilTestRandomQuestionSetConfigGUI::getSourcePoolDefinitionByAvailableQuestionPoolId (   $pool_id)
private

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

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

716  {
717  $availablePools = $this->test_obj->getAvailableQuestionpools(
718  true,
719  $this->question_set_config->arePoolsWithHomogeneousScoredQuestionsRequired(),
720  false,
721  true,
722  true
723  );
724 
725  if (isset($availablePools[$pool_id])) {
726  $originalPoolData = $availablePools[$pool_id];
727 
728  $originalPoolData['qpl_path'] = $this->question_set_config->getQuestionPoolPathString($pool_id);
729  $originalPoolData['qpl_ref_id'] = $this->question_set_config->getFirstQuestionPoolRefIdByObjId($pool_id);
730 
731  return $this->source_pool_definition_factory->getSourcePoolDefinitionByOriginalPoolData($originalPoolData);
732  }
733 
735  }
+ Here is the caller graph for this function:

◆ isAvoidManipulationRedirectRequired()

ilTestRandomQuestionSetConfigGUI::isAvoidManipulationRedirectRequired ( )
private

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

References isFrozenConfigRequired(), and isManipulationCommand().

Referenced by executeCommand().

171  : bool
172  {
173  if (!$this->isFrozenConfigRequired()) {
174  return false;
175  }
176 
177  if (!$this->isManipulationCommand()) {
178  return false;
179  }
180 
181  return true;
182  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isFrozenConfigRequired()

ilTestRandomQuestionSetConfigGUI::isFrozenConfigRequired ( )
private

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

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

184  : bool
185  {
186  if ($this->test_obj->participantDataExist()) {
187  return true;
188  }
189 
190  if ($this->source_pool_definition_list->hasLostPool()) {
191  return true;
192  }
193 
194  return false;
195  }
+ Here is the caller graph for this function:

◆ isManipulationCommand()

ilTestRandomQuestionSetConfigGUI::isManipulationCommand ( )
private

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

References ILIAS\Repository\ctrl().

Referenced by isAvoidManipulationRedirectRequired().

197  : bool
198  {
199  if (in_array(
200  $this->ctrl->getCmd(self::CMD_SHOW_GENERAL_CONFIG_FORM),
201  [
202  self::CMD_SAVE_GENERAL_CONFIG_FORM,
203  self::CMD_SAVE_SRC_POOL_DEF_LIST,
204  self::CMD_DELETE_SRC_POOL_DEF,
205  self::CMD_SAVE_CREATE_SRC_POOL_DEF_FORM,
206  self::CMD_SAVE_EDIT_SRC_POOL_DEF_FORM,
207  self::CMD_SAVE_AND_NEW_CREATE_SRC_POOL_DEF_FORM,
208  self::CMD_BUILD_QUESTION_STAGE
209  ]
210  )) {
211  return true;
212  }
213 
214  return false;
215  }
+ 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 908 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by showGeneralConfigFormCmd(), and showSourcePoolDefinitionListCmd().

909  {
910  $this->tpl->setCurrentBlock('mess');
911  $this->tpl->setVariable('MESSAGE', $message);
912  $this->tpl->parseCurrentBlock();
913  }
+ Here is the caller graph for this function:

◆ preventFormBecauseOfSync()

ilTestRandomQuestionSetConfigGUI::preventFormBecauseOfSync ( )
protected

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

References isFrozenConfigRequired().

Referenced by showGeneralConfigFormCmd(), and showSourcePoolDefinitionListCmd().

832  : bool
833  {
834  $last_sync = $this->question_set_config->getLastQuestionSyncTimestamp();
835  if ($last_sync !== null && $last_sync !== 0 &&
836  !$this->isFrozenConfigRequired() && $this->question_set_config->isQuestionSetBuildable()) {
837  return true;
838  }
839  return false;
840  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetPoolSyncCmd()

ilTestRandomQuestionSetConfigGUI::resetPoolSyncCmd ( )

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

References ILIAS\Repository\ctrl(), ILIAS\Repository\logger(), and ILIAS\Repository\user().

842  : void
843  {
844  $this->question_set_config->setLastQuestionSyncTimestamp(0);
845  $this->question_set_config->saveToDb();
846  if ($this->logger->isLoggingEnabled()) {
847  $this->logger->logTestAdministrationInteraction(
848  $this->logger->getInteractionFactory()->buildTestAdministrationInteraction(
849  $this->test_obj->getRefId(),
850  $this->user->getId(),
851  TestAdministrationInteractionTypes::QUESTIONS_SYNCHRONISATION_RESET,
852  []
853  )
854  );
855  }
856  $this->ctrl->redirect($this, self::CMD_SHOW_GENERAL_CONFIG_FORM);
857  }
+ Here is the call graph for this function:

◆ saveCreateAndNewSourcePoolDefinitionFormCmd()

ilTestRandomQuestionSetConfigGUI::saveCreateAndNewSourcePoolDefinitionFormCmd ( )
private

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

References saveCreateSourcePoolDefinitionFormCmd().

518  : void
519  {
521  }
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 526 of file class.ilTestRandomQuestionSetConfigGUI.php.

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

Referenced by saveCreateAndNewSourcePoolDefinitionFormCmd().

526  : void
527  {
528  $this->question_set_config->loadFromDb();
529 
530  $pool_id = $this->fetchQuestionPoolIdParameter();
531  $source_pool_definition = $this->getSourcePoolDefinitionByAvailableQuestionPoolId($pool_id);
532  $available_taxonomy_ids = ilObjTaxonomy::getUsageOfObject($source_pool_definition->getPoolId());
533 
535  $form->build($source_pool_definition, $available_taxonomy_ids);
536 
537  $errors = !$form->checkInput(); // ALWAYS CALL BEFORE setValuesByPost()
538  $form->setValuesByPost(); // NEVER CALL THIS BEFORE checkInput()
539 
540  if ($errors) {
542  return;
543  }
544 
545  $log_array = $form->applySubmit($source_pool_definition, $available_taxonomy_ids);
546 
547  $source_pool_definition->setSequencePosition($this->source_pool_definition_list->getNextPosition());
548  $source_pool_definition->saveToDb();
549  $this->source_pool_definition_list->addDefinition($source_pool_definition);
550 
551  $this->source_pool_definition_list->saveDefinitions();
552 
553  $this->question_set_config->setLastQuestionSyncTimestamp(0);
554  $this->question_set_config->saveToDb();
555 
556  $this->test_obj->saveCompleteStatus($this->question_set_config);
557 
558  if ($this->logger->isLoggingEnabled()) {
559  $this->logger->logTestAdministrationInteraction(
560  $this->logger->getInteractionFactory()->buildTestAdministrationInteraction(
561  $this->test_obj->getRefId(),
562  $this->user->getId(),
563  TestAdministrationInteractionTypes::QUESTION_SELECTION_CRITERIA_MODIFIED,
564  $log_array
565  )
566  );
567  }
568 
569  if ($redirect_back_to_form) {
570  $this->tpl->setOnScreenMessage('success', $this->lng->txt("tst_msg_random_qsc_modified_add_new_rule"), true);
571  $this->ctrl->setParameter($this, 'src_pool_def_id', $source_pool_definition->getId());
572  $this->ctrl->setParameter($this, 'quest_pool_id', $source_pool_definition->getPoolId());
573  $this->ctrl->redirect($this, self::CMD_SHOW_CREATE_SRC_POOL_DEF_FORM);
574  return;
575  }
576 
577  $this->ctrl->setParameterByClass(self::class, 'modified', 'save');
578  $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
579  }
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 613 of file class.ilTestRandomQuestionSetConfigGUI.php.

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

613  : void
614  {
615  $this->question_set_config->loadFromDb();
616 
617  $source_pool_definition = $this->source_pool_definition_factory->getSourcePoolDefinitionByDefinitionId(
619  );
620  $available_taxonomy_ids = ilObjTaxonomy::getUsageOfObject($source_pool_definition->getPoolId());
621 
622  $form = $this->buildEditSourcePoolDefinitionFormGUI();
623  $form->build($source_pool_definition, $available_taxonomy_ids);
624 
625  $errors = !$form->checkInput(); // ALWAYS CALL BEFORE setValuesByPost()
626  $form->setValuesByPost(); // NEVER CALL THIS BEFORE checkInput()
627 
628  if ($errors) {
630  return;
631  }
632 
633  $log_array = $form->applySubmit($source_pool_definition, $available_taxonomy_ids);
634 
635  $source_pool_definition->saveToDb();
636 
637  $this->question_set_config->setLastQuestionSyncTimestamp(0);
638  $this->question_set_config->saveToDb();
639 
640  $this->test_obj->saveCompleteStatus($this->question_set_config);
641 
642  if ($this->logger->isLoggingEnabled()) {
643  $this->logger->logTestAdministrationInteraction(
644  $this->logger->getInteractionFactory()->buildTestAdministrationInteraction(
645  $this->test_obj->getRefId(),
646  $this->user->getId(),
647  TestAdministrationInteractionTypes::QUESTIONS_SYNCHRONISATION_RESET,
648  $log_array
649  )
650  );
651  }
652 
653  $this->ctrl->setParameterByClass(self::class, 'modified', 'save');
654  $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
655  }
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 306 of file class.ilTestRandomQuestionSetConfigGUI.php.

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

306  : void
307  {
308  $form = $this->buildGeneralConfigFormGUI();
309 
310  $errors = !$form->checkInput(); // ALWAYS CALL BEFORE setValuesByPost()
311  $form->setValuesByPost(); // NEVER CALL THIS BEFORE checkInput()
312 
313  if ($errors) {
314  $this->showGeneralConfigFormCmd($form);
315  return;
316  }
317 
318  $log_array = $form->save($this->logger->getAdditionalInformationGenerator());
319 
320  $this->question_set_config->setLastQuestionSyncTimestamp(0);
321  $this->question_set_config->saveToDb();
322 
323  if ($this->logger->isLoggingEnabled()) {
324  $this->logger->logTestAdministrationInteraction(
325  $this->logger->getInteractionFactory()->buildTestAdministrationInteraction(
326  $this->test_obj->getRefId(),
327  $this->user->getId(),
328  TestAdministrationInteractionTypes::QUESTION_SELECTION_CRITERIA_MODIFIED,
329  $log_array
330  )
331  );
332  }
333 
334  $this->test_obj->saveCompleteStatus($this->question_set_config);
335 
336  $this->ctrl->setParameter($this, 'modified', 'save');
337  $this->ctrl->redirect($this, self::CMD_SHOW_GENERAL_CONFIG_FORM);
338  }
showGeneralConfigFormCmd(ilTestRandomQuestionSetGeneralConfigFormGUI $form=null)
+ Here is the call graph for this function:

◆ saveSourcePoolDefinitionListCmd()

ilTestRandomQuestionSetConfigGUI::saveSourcePoolDefinitionListCmd ( )
private

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

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

406  : void
407  {
408  $this->question_set_config->loadFromDb();
409 
410  $table = $this->buildSourcePoolDefinitionListTableGUI();
411  $table->applySubmit($this->testrequest);
412 
413  $this->source_pool_definition_list->reindexPositions();
414  $this->source_pool_definition_list->saveDefinitions();
415 
416  $this->question_set_config->setLastQuestionSyncTimestamp(0);
417  $this->question_set_config->saveToDb();
418 
419  $this->test_obj->saveCompleteStatus($this->question_set_config);
420 
421  $this->ctrl->setParameter($this, 'modified', 'save');
422  $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
423  }
+ Here is the call graph for this function:

◆ selectPoolDerivationTargetCmd()

ilTestRandomQuestionSetConfigGUI::selectPoolDerivationTargetCmd ( )
private

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

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

769  : void
770  {
771  $this->ctrl->setParameter($this, 'derive_pool_ids', implode(':', $this->fetchPoolIdsParameter()));
772 
773  $explorer = new ilRepositorySelectorExplorerGUI(
774  $this,
775  self::CMD_SELECT_DERIVATION_TARGET,
776  $this,
777  self::CMD_DERIVE_NEW_POOLS,
778  'target_ref'
779  );
780  $explorer->setClickableTypes($this->obj_definition->getExplorerContainerTypes());
781  $explorer->setSelectableTypes([]);
782 
783  if (!$explorer->handleCommand()) {
784  $this->tpl->setOnScreenMessage('info', $this->lng->txt('tst_please_select_target_for_pool_derives'));
785  $this->tpl->setContent($this->ctrl->getHTML($explorer));
786  }
787  }
+ Here is the call graph for this function:

◆ showCreateSourcePoolDefinitionFormCmd()

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

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

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

Referenced by saveCreateSourcePoolDefinitionFormCmd().

501  : void
502  {
503  $this->question_set_config->loadFromDb();
504 
505  $pool_id = $this->fetchQuestionPoolIdParameter();
506 
507  $source_pool_definition = $this->getSourcePoolDefinitionByAvailableQuestionPoolId($pool_id);
508  $available_taxonomy_ids = ilObjTaxonomy::getUsageOfObject($source_pool_definition->getPoolId());
509 
510  if ($form === null) {
512  $form->build($source_pool_definition, $available_taxonomy_ids);
513  }
514 
515  $this->tpl->setContent($this->ctrl->getHTML($form));
516  }
static getUsageOfObject(int $a_obj_id, bool $a_include_titles=false)
build(ilTestRandomQuestionSetSourcePoolDefinition $sourcePool, $available_taxonomy_ids)
+ 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 597 of file class.ilTestRandomQuestionSetConfigGUI.php.

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

597  : void
598  {
599  $this->question_set_config->loadFromDb();
600 
602  $source_pool_definition = $this->source_pool_definition_factory->getSourcePoolDefinitionByDefinitionId($defId);
603  $available_taxonomy_ids = ilObjTaxonomy::getUsageOfObject($source_pool_definition->getPoolId());
604 
605  if ($form === null) {
606  $form = $this->buildEditSourcePoolDefinitionFormGUI();
607  $form->build($source_pool_definition, $available_taxonomy_ids);
608  }
609 
610  $this->tpl->setContent($this->ctrl->getHTML($form));
611  }
static getUsageOfObject(int $a_obj_id, bool $a_include_titles=false)
build(ilTestRandomQuestionSetSourcePoolDefinition $sourcePool, $available_taxonomy_ids)
+ Here is the call graph for this function:

◆ showGeneralConfigFormCmd()

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

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

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

Referenced by saveGeneralConfigFormCmd().

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

◆ showPoolSelectorExplorerCmd()

ilTestRandomQuestionSetConfigGUI::showPoolSelectorExplorerCmd ( )
protected

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

479  : void
480  {
481  $this->question_set_config->loadFromDb();
482 
483  $selector = new ilTestQuestionPoolSelectorExplorer(
484  $this,
485  self::CMD_SHOW_POOL_SELECTOR_EXPLORER,
486  self::CMD_SHOW_CREATE_SRC_POOL_DEF_FORM,
487  $this->obj_cache
488  );
489 
490  $selector->setAvailableQuestionPools(
491  array_keys($this->question_set_config->getSelectableQuestionPools())
492  );
493 
494  if ($selector->handleCommand()) {
495  return;
496  }
497 
498  $this->tpl->setContent($selector->getHTML(true));
499  }

◆ showSourcePoolDefinitionListCmd()

ilTestRandomQuestionSetConfigGUI::showSourcePoolDefinitionListCmd ( )
private

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

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

Referenced by saveEditSourcePoolDefinitionFormCmd().

364  : void
365  {
366  $disabled_form = $this->preventFormBecauseOfSync();
367 
368  $this->question_set_config->loadFromDb();
369 
370  $content = '';
371 
372  if (!$this->isFrozenConfigRequired() && !$disabled_form) {
373  $toolbar = $this->buildSourcePoolDefinitionListToolbarGUI();
374  $content .= $this->ctrl->getHTML($toolbar);
375  }
376 
377  $table = $this->buildSourcePoolDefinitionListTableGUI($disabled_form);
378  $content .= $this->ui_renderer->render($table->getComponent());
379 
380  if (!$this->source_pool_definition_list->areAllUsedPoolsAvailable()) {
382  $this->ctrl,
383  $this->lng,
384  $this->ui_factory,
385  $this->data_factory,
386  $this->testrequest->getRequest(),
388  );
389  $content .= $this->ui_renderer->render($table->getComponent());
390  }
391 
392  $this->tpl->setContent($content);
393 
394  $this->configStateMessageHandler->setContext(
396  );
397 
398  $this->configStateMessageHandler->handle();
399 
400  $message = $this->buildOnScreenMessage();
401  if ($message) {
402  $this->populateOnScreenMessage($message);
403  }
404  }
ilTestRandomQuestionSetSourcePoolDefinitionList $source_pool_definition_list
+ 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 69 of file class.ilTestRandomQuestionSetConfigGUI.php.

◆ $question_set_config

ilTestRandomQuestionSetConfig ilTestRandomQuestionSetConfigGUI::$question_set_config
protected

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

◆ $source_pool_definition_factory

ilTestRandomQuestionSetSourcePoolDefinitionFactory ilTestRandomQuestionSetConfigGUI::$source_pool_definition_factory
protected

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

◆ $source_pool_definition_list

ilTestRandomQuestionSetSourcePoolDefinitionList ilTestRandomQuestionSetConfigGUI::$source_pool_definition_list
protected

◆ $stagingPool

ilTestRandomQuestionSetStagingPoolBuilder ilTestRandomQuestionSetConfigGUI::$stagingPool
protected

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

◆ CMD_BUILD_QUESTION_STAGE

const ilTestRandomQuestionSetConfigGUI::CMD_BUILD_QUESTION_STAGE = 'buildQuestionStage'

◆ CMD_DELETE_SRC_POOL_DEF

const ilTestRandomQuestionSetConfigGUI::CMD_DELETE_SRC_POOL_DEF = 'deleteSourcePoolDefinition'

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

◆ CMD_DERIVE_NEW_POOLS

const ilTestRandomQuestionSetConfigGUI::CMD_DERIVE_NEW_POOLS = 'deriveNewPools'

Definition at line 60 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 55 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 54 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 57 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'

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

◆ CMD_SELECT_DERIVATION_TARGET

const ilTestRandomQuestionSetConfigGUI::CMD_SELECT_DERIVATION_TARGET = 'selectPoolDerivationTarget'

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

◆ CMD_SHOW_CREATE_SRC_POOL_DEF_FORM

const ilTestRandomQuestionSetConfigGUI::CMD_SHOW_CREATE_SRC_POOL_DEF_FORM = 'showCreateSourcePoolDefinitionForm'

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

◆ CMD_SHOW_EDIT_SRC_POOL_DEF_FORM

const ilTestRandomQuestionSetConfigGUI::CMD_SHOW_EDIT_SRC_POOL_DEF_FORM = 'showEditSourcePoolDefinitionForm'

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

◆ CMD_SHOW_GENERAL_CONFIG_FORM

◆ 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: