ILIAS  release_8 Revision v8.24
ilTestRandomQuestionSetConfigGUI Class Reference
+ Collaboration diagram for ilTestRandomQuestionSetConfigGUI:

Public Member Functions

 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'
 
ilCtrlInterface $ctrl
 
ilAccessHandler $access
 
ilTabsGUI $tabs
 
ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 
ilDBInterface $db
 
ilTree $tree
 
ilComponentRepository $component_repository
 
ilObjTest $testOBJ
 
ilObjectDefinition $obj_definition
 

Protected Member Functions

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

Protected Attributes

UIServices $ui
 
ilObjUser $user
 
ilObjectDataCache $obj_cache
 
ilTestRandomQuestionSetConfig $questionSetConfig
 
ilTestRandomQuestionSetSourcePoolDefinitionFactory $sourcePoolDefinitionFactory
 
ilTestRandomQuestionSetSourcePoolDefinitionList $sourcePoolDefinitionList
 
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 ()
 

Private Attributes

InternalRequestService $testrequest
 
ilTestProcessLockerFactory $processLockerFactory
 

Detailed Description

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

Member Function Documentation

◆ buildCreateSourcePoolDefinitionFormGUI()

ilTestRandomQuestionSetConfigGUI::buildCreateSourcePoolDefinitionFormGUI ( )
private

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

625 {
627 $this->ctrl,
628 $this->lng,
629 $this->testOBJ,
630 $this,
631 $this->questionSetConfig
632 );
633
634 $form->setSaveCommand(self::CMD_SAVE_CREATE_SRC_POOL_DEF_FORM);
635 $form->setSaveAndNewCommand(self::CMD_SAVE_AND_NEW_CREATE_SRC_POOL_DEF_FORM);
636
637 return $form;
638 }

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

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

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

◆ buildEditSourcePoolDefinitionFormGUI()

ilTestRandomQuestionSetConfigGUI::buildEditSourcePoolDefinitionFormGUI ( )
private

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

689 {
691 $this->ctrl,
692 $this->lng,
693 $this->testOBJ,
694 $this,
695 $this->questionSetConfig
696 );
697
698 $form->setSaveCommand(self::CMD_SAVE_EDIT_SRC_POOL_DEF_FORM);
699
700 return $form;
701 }

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

Referenced by saveEditSourcePoolDefinitionFormCmd(), and showEditSourcePoolDefinitionFormCmd().

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

◆ buildFormResultMessage()

ilTestRandomQuestionSetConfigGUI::buildFormResultMessage ( )
protected

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

911 : string
912 {
913 $message = '';
914
915 if ($this->testrequest->isset('modified')) {
916 $action = $this->testrequest->raw('modified');
917 if ($action === 'save') {
918 $success_message = $this->ui->factory()->messageBox()->success($this->getGeneralModificationSuccessMessage());
919 } elseif ($action === 'remove') {
920 $success_message = $this->ui->factory()->messageBox()->success($this->lng->txt("tst_msg_source_pool_definitions_deleted"));
921 } elseif ($action === 'sync') {
922 $success_message = $this->ui->factory()->messageBox()->success($this->lng->txt("tst_msg_random_question_set_synced"));
923 }
924 $message .= $this->ui->renderer()->render(
925 $success_message
926 );
927 }
928
929 return $message;
930 }
$message
Definition: xapiexit.php:32

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

Referenced by buildOnScreenMessage().

+ 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 347 of file class.ilTestRandomQuestionSetConfigGUI.php.

348 {
350 $this->ctrl,
351 $this->lng,
352 $this->testOBJ,
353 $this,
354 $this->questionSetConfig
355 );
356
357 //TODO: should frozen config not lead to 'completely disabled' as well?!
358 $form->setEditModeEnabled(!$this->isFrozenConfigRequired());
359
360 if ($disabled) {
361 $form->setEditModeEnabled(false);
362 }
363
364 $form->build();
365
366 if ($disabled) {
367 $form->clearCommandButtons();
368 }
369
370 return $form;
371 }

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

Referenced by saveGeneralConfigFormCmd(), and showGeneralConfigFormCmd().

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

◆ buildNonAvailablePoolsTableGUI()

ilTestRandomQuestionSetConfigGUI::buildNonAvailablePoolsTableGUI ( )
private

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

485 {
487 $this->ctrl,
488 $this->lng,
489 $this,
490 self::CMD_SHOW_SRC_POOL_DEF_LIST
491 );
492
493 $table->build();
494
495 return $table;
496 }

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

Referenced by showSourcePoolDefinitionListCmd().

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

◆ buildOnScreenMessage()

ilTestRandomQuestionSetConfigGUI::buildOnScreenMessage ( )
protected

Definition at line 903 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 266 of file class.ilTestRandomQuestionSetConfigGUI.php.

266 : void
267 {
268 if ($this->sourcePoolDefinitionList->areAllUsedPoolsAvailable()) {
269 $locker = $this->processLockerFactory->retrieveLockerForNamedOperation();
270 $locker->executeNamedOperation(__FUNCTION__, function (): void {
271 $this->stagingPool->rebuild($this->sourcePoolDefinitionList);
272 $this->sourcePoolDefinitionList->saveDefinitions();
273
274 $this->questionSetConfig->loadFromDb();
275 $this->questionSetConfig->setLastQuestionSyncTimestamp(time());
276 $this->questionSetConfig->saveToDb();
277
278 $this->testOBJ->saveCompleteStatus($this->questionSetConfig);
279
280 $this->ctrl->setParameterByClass(self::class, 'modified', 'sync');
281 });
282 }
283
284 $this->ctrl->redirect($this, $this->fetchAfterRebuildQuestionStageCmdParameter());
285 }

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

+ Here is the call graph for this function:

◆ buildSourcePoolDefinitionListTableGUI()

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

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

450 {
452 $this->ctrl,
453 $this->lng,
454 $this,
455 self::CMD_SHOW_SRC_POOL_DEF_LIST
456 );
457
458 if (!$this->isFrozenConfigRequired()) {
459 $table->setDefinitionEditModeEnabled(true);
460 }
461
462 $table->setQuestionAmountColumnEnabled(
463 $this->questionSetConfig->isQuestionAmountConfigurationModePerPool()
464 );
465
466 // fau: taxFilter/typeFilter - show the mapped taxonomy filters if pools are synced
467 $table->setShowMappedTaxonomyFilter(
468 $this->questionSetConfig->getLastQuestionSyncTimestamp() != 0
469 );
470 // fau.
471
472 $translater = new ilTestTaxonomyFilterLabelTranslater($this->db);
473 $translater->loadLabels($this->sourcePoolDefinitionList);
474 $table->setTaxonomyFilterLabelTranslater($translater);
475
476 if ($disabled) {
477 $table->setDefinitionEditModeEnabled(false);
478 }
479 $table->build();
480
481 return $table;
482 }

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

Referenced by saveSourcePoolDefinitionListCmd(), and showSourcePoolDefinitionListCmd().

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

◆ buildSourcePoolDefinitionListToolbarGUI()

ilTestRandomQuestionSetConfigGUI::buildSourcePoolDefinitionListToolbarGUI ( )
private

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

436 {
438 $this->ctrl,
439 $this->lng,
440 $this,
441 $this->questionSetConfig
442 );
443
444 $toolbar->build();
445
446 return $toolbar;
447 }

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

Referenced by showSourcePoolDefinitionListCmd().

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

◆ buildValidationMessage()

ilTestRandomQuestionSetConfigGUI::buildValidationMessage ( )
protected

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

932 : string
933 {
934 if ($this->configStateMessageHandler->isValidationFailed()) {
935 return $this->ui->renderer()->render(
936 $this->ui->factory()->messageBox()->failure($this->configStateMessageHandler->getValidationReportHtml())
937 );
938 }
939
940 if ($this->configStateMessageHandler->hasValidationReports()) {
941 return $this->ui->renderer()->render(
942 $this->ui->factory()->messageBox()->info($this->configStateMessageHandler->getValidationReportHtml())
943 );
944 }
945
946 return $this->configStateMessageHandler->getSyncInfoMessage();
947 }

References ILIAS\Repository\ui().

Referenced by buildOnScreenMessage().

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

◆ deleteMultipleSourcePoolDefinitionsCmd()

ilTestRandomQuestionSetConfigGUI::deleteMultipleSourcePoolDefinitionsCmd ( )
private

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

507 : void
508 {
509 $definitionIds = $this->fetchMultiSourcePoolDefinitionIdsParameter();
510 $this->deleteSourcePoolDefinitions($definitionIds);
511
512 $this->ctrl->setParameterByClass(self::class, 'modified', 'remove');
513 $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
514 }

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

+ Here is the call graph for this function:

◆ deleteSingleSourcePoolDefinitionCmd()

ilTestRandomQuestionSetConfigGUI::deleteSingleSourcePoolDefinitionCmd ( )
private

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

498 : void
499 {
500 $definitionId = $this->fetchSingleSourcePoolDefinitionIdParameter();
501 $this->deleteSourcePoolDefinitions([$definitionId]);
502
503 $this->ctrl->setParameterByClass(self::class, 'modified', 'remove');
504 $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
505 }

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

+ Here is the call graph for this function:

◆ deleteSourcePoolDefinitions()

ilTestRandomQuestionSetConfigGUI::deleteSourcePoolDefinitions (   $definitionIds)
private

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

516 : void
517 {
518 foreach ($definitionIds as $definitionId) {
519 $definition = $this->sourcePoolDefinitionFactory->getSourcePoolDefinitionByDefinitionId($definitionId);
520 $definition->deleteFromDb();
521 }
522
523 $this->sourcePoolDefinitionList->reindexPositions();
524 $this->sourcePoolDefinitionList->saveDefinitions();
525
526 $this->questionSetConfig->loadFromDb();
527 $this->questionSetConfig->setLastQuestionSyncTimestamp(0);
528 $this->questionSetConfig->saveToDb();
529
530 $this->testOBJ->saveCompleteStatus($this->questionSetConfig);
531 }

Referenced by deleteMultipleSourcePoolDefinitionsCmd(), and deleteSingleSourcePoolDefinitionCmd().

+ Here is the caller graph for this function:

◆ deriveNewPoolsCmd()

ilTestRandomQuestionSetConfigGUI::deriveNewPoolsCmd ( )
private

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

820 : void
821 {
822 $poolIds = $this->fetchPoolIdsParameter();
823 $targetRef = $this->fetchTargetRefParameter();
824 if (!$this->access->checkAccess('write', '', $targetRef)) {
825 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_permission"), true);
826 $this->ctrl->setParameterByClass(ilObjTestGUI::class, 'ref_id', $this->testOBJ->getRefId());
827 $this->ctrl->redirectByClass(ilObjTestGUI::class);
828 }
829
830 if (count($poolIds)) {
831 foreach ($poolIds as $poolId) {
832 $lostPool = $this->sourcePoolDefinitionList->getLostPool($poolId);
833
834 $deriver = new ilTestRandomQuestionSetPoolDeriver($this->db, $this->component_repository, $this->testOBJ);
835 $deriver->setSourcePoolDefinitionList($this->sourcePoolDefinitionList);
836 $deriver->setTargetContainerRef($targetRef);
837 $deriver->setOwnerId($this->user->getId());
838 $newPool = $deriver->derive($lostPool);
839
840 $srcPoolDefinition = $this->sourcePoolDefinitionList->getDefinitionBySourcePoolId($newPool->getId());
841 $srcPoolDefinition->setPoolTitle($newPool->getTitle());
842 $srcPoolDefinition->setPoolPath($this->questionSetConfig->getQuestionPoolPathString($newPool->getId()));
843 $srcPoolDefinition->setPoolRefId($this->questionSetConfig->getFirstQuestionPoolRefIdByObjId($newPool->getId()));
844 $srcPoolDefinition->saveToDb();
845
847 $this->testOBJ->getTestId(),
848 $lostPool->getId(),
849 $newPool->getId()
850 );
851 }
852
853 $this->tpl->setOnScreenMessage('success', $this->lng->txt('tst_non_available_pool_newly_derived'), true);
854 }
855
856 $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
857 }

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

+ Here is the call graph for this function:

◆ executeCommand()

ilTestRandomQuestionSetConfigGUI::executeCommand ( )

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

149 : void
150 {
151 if (!$this->access->checkAccess("write", "", $this->testOBJ->getRefId())) {
152 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("cannot_edit_test"), true);
153 $this->ctrl->redirectByClass('ilObjTestGUI', "infoScreen");
154 }
155
157 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("tst_msg_cannot_modify_random_question_set_conf_due_to_part"), true);
158 $this->ctrl->redirect($this);
159 }
160
161 $this->handleTabs();
162
163 $nextClass = $this->ctrl->getNextClass();
164
165 switch ($nextClass) {
166 case 'iltestrandomquestionsetpooldefinitionformgui':
167 $this->questionSetConfig->loadFromDb();
168 $poolId = $this->fetchQuestionPoolIdParameter();
169 $sourcePoolDefinition = $this->getSourcePoolDefinitionByAvailableQuestionPoolId($poolId);
170 $availableTaxonomyIds = ilObjTaxonomy::getUsageOfObject($sourcePoolDefinition->getPoolId());
172 $form->build($sourcePoolDefinition, $availableTaxonomyIds);
173
174 $this->ctrl->forwardCommand($form);
175 break;
176
177 default:
178 $cmd = $this->ctrl->getCmd(self::CMD_SHOW_GENERAL_CONFIG_FORM) . 'Cmd';
179 $this->$cmd();
180 }
181 }
static getUsageOfObject(int $a_obj_id, bool $a_include_titles=false)

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

+ Here is the call graph for this function:

◆ fetchAfterRebuildQuestionStageCmdParameter()

ilTestRandomQuestionSetConfigGUI::fetchAfterRebuildQuestionStageCmdParameter ( )
private

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

288 {
289 if (!$this->testrequest->isset(self::HTTP_PARAM_AFTER_REBUILD_QUESTION_STAGE_CMD)) {
291 }
292
293 if (!strlen($this->testrequest->raw(self::HTTP_PARAM_AFTER_REBUILD_QUESTION_STAGE_CMD))) {
295 }
296
297 return $this->testrequest->raw(self::HTTP_PARAM_AFTER_REBUILD_QUESTION_STAGE_CMD);
298 }

References CMD_SHOW_GENERAL_CONFIG_FORM.

Referenced by buildQuestionStageCmd().

+ Here is the caller graph for this function:

◆ fetchMultiSourcePoolDefinitionIdsParameter()

ilTestRandomQuestionSetConfigGUI::fetchMultiSourcePoolDefinitionIdsParameter ( )
private

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

725 : array
726 {
727 if (!$this->testrequest->isset('src_pool_def_ids') || !is_array($this->testrequest->raw('src_pool_def_ids'))) {
728 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('tst_please_select_source_pool'), true);
729 $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
730 return [];
731 }
732
733 $definitionIds = [];
734
735 foreach ($this->testrequest->raw('src_pool_def_ids') as $definitionId) {
736 $definitionId = (int) $definitionId;
737
738 if (!$definitionId) {
740 }
741
742 $definitionIds[] = $definitionId;
743 }
744
745 return $definitionIds;
746 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

Referenced by deleteMultipleSourcePoolDefinitionsCmd().

+ 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 773 of file class.ilTestRandomQuestionSetConfigGUI.php.

773 : array
774 {
775 $poolIds = [];
776 if ($this->testrequest->isset('derive_pool_ids') && is_array($this->testrequest->raw('derive_pool_ids'))) {
777 $poolIds = [];
778
779 foreach ($this->testrequest->raw('derive_pool_ids') as $poolId) {
780 $poolIds[] = (int) $poolId;
781 }
782 } elseif ($this->testrequest->isset('derive_pool_ids') && preg_match('/^\d+(\:\d+)*$/', $this->testrequest->raw('derive_pool_ids'))) {
783 $poolIds = explode(':', $this->testrequest->raw('derive_pool_ids'));
784 } elseif ($this->testrequest->isset('derive_pool_id') && (int) $this->testrequest->raw('derive_pool_id')) {
785 $poolIds = [(int) $this->testrequest->raw('derive_pool_id')];
786 }
787
788 return $poolIds;
789 }

References ILIAS\Repository\int().

Referenced by deriveNewPoolsCmd(), and selectPoolDerivationTargetCmd().

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

◆ fetchQuestionPoolIdParameter()

ilTestRandomQuestionSetConfigGUI::fetchQuestionPoolIdParameter ( )
private

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

703 : int
704 {
705 if ($this->testrequest->isset('quest_pool_id') && (int) $this->testrequest->raw('quest_pool_id')) {
706 return (int) $this->testrequest->raw('quest_pool_id');
707 }
708
709 if ($this->testrequest->isset('quest_pool_ref') && (int) $this->testrequest->raw('quest_pool_ref')) {
710 return $this->obj_cache->lookupObjId((int) $this->testrequest->raw('quest_pool_ref'));
711 }
712
714 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

+ Here is the caller graph for this function:

◆ fetchSingleSourcePoolDefinitionIdParameter()

ilTestRandomQuestionSetConfigGUI::fetchSingleSourcePoolDefinitionIdParameter ( )
private

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

716 : int
717 {
718 if ($this->testrequest->isset('src_pool_def_id') && (int) $this->testrequest->raw('src_pool_def_id')) {
719 return (int) $this->testrequest->raw('src_pool_def_id');
720 }
721
723 }

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

+ Here is the caller graph for this function:

◆ fetchTargetRefParameter()

ilTestRandomQuestionSetConfigGUI::fetchTargetRefParameter ( )
protected

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

791 : ?int
792 {
793 if ($this->testrequest->isset('target_ref') && (int) $this->testrequest->raw('target_ref')) {
794 return (int) $this->testrequest->raw('target_ref');
795 }
796
797 return null;
798 }

Referenced by deriveNewPoolsCmd().

+ Here is the caller graph for this function:

◆ getGeneralConfigTabLabel()

ilTestRandomQuestionSetConfigGUI::getGeneralConfigTabLabel ( )
Returns
string

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

870 : string
871 {
872 return $this->lng->txt('tst_rnd_quest_cfg_tab_general');
873 }

References ILIAS\Repository\lng().

Referenced by handleTabs().

+ 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 862 of file class.ilTestRandomQuestionSetConfigGUI.php.

862 : string
863 {
864 return $this->lng->txt("tst_msg_random_question_set_config_modified");
865 }

References ILIAS\Repository\lng().

Referenced by buildFormResultMessage().

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

◆ getPoolConfigTabLabel()

ilTestRandomQuestionSetConfigGUI::getPoolConfigTabLabel ( )
Returns
string

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

878 : string
879 {
880 return $this->lng->txt('tst_rnd_quest_cfg_tab_pool');
881 }

References ILIAS\Repository\lng().

Referenced by handleTabs().

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

◆ getSourcePoolDefinitionByAvailableQuestionPoolId()

ilTestRandomQuestionSetConfigGUI::getSourcePoolDefinitionByAvailableQuestionPoolId (   $poolId)
private

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

749 {
750 $availablePools = $this->testOBJ->getAvailableQuestionpools(
751 true,
752 $this->questionSetConfig->arePoolsWithHomogeneousScoredQuestionsRequired(),
753 false,
754 true,
755 true
756 );
757
758 if (isset($availablePools[$poolId])) {
759 $originalPoolData = $availablePools[$poolId];
760
761 $originalPoolData['qpl_path'] = $this->questionSetConfig->getQuestionPoolPathString($poolId);
762 $originalPoolData['qpl_ref_id'] = $this->questionSetConfig->getFirstQuestionPoolRefIdByObjId($poolId);
763
764 return $this->sourcePoolDefinitionFactory->getSourcePoolDefinitionByOriginalPoolData($originalPoolData);
765 }
766
768 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

+ Here is the caller graph for this function:

◆ handleTabs()

ilTestRandomQuestionSetConfigGUI::handleTabs ( )
private

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

227 : void
228 {
229 $this->tabs->activateTab('assQuestions');
230
231 $this->tabs->addSubTab(
232 'tstRandQuestSetGeneralConfig',
234 $this->ctrl->getLinkTarget($this, self::CMD_SHOW_GENERAL_CONFIG_FORM)
235 );
236
237 $this->tabs->addSubTab(
238 'tstRandQuestSetPoolConfig',
239 $this->getPoolConfigTabLabel(),
240 $this->ctrl->getLinkTarget($this, self::CMD_SHOW_SRC_POOL_DEF_LIST)
241 );
242
243 switch ($this->ctrl->getCmd(self::CMD_SHOW_GENERAL_CONFIG_FORM)) {
246
247 $this->tabs->activateSubTab('tstRandQuestSetGeneralConfig');
248 break;
249
258
259 $this->tabs->activateSubTab('tstRandQuestSetPoolConfig');
260 break;
261
262 default: $this->tabs->activateSubTab('nonTab');
263 }
264 }

References CMD_DELETE_MULTI_SRC_POOL_DEFS, CMD_DELETE_SINGLE_SRC_POOL_DEF, CMD_SAVE_CREATE_SRC_POOL_DEF_FORM, CMD_SAVE_EDIT_SRC_POOL_DEF_FORM, CMD_SAVE_GENERAL_CONFIG_FORM, CMD_SAVE_SRC_POOL_DEF_LIST, CMD_SHOW_CREATE_SRC_POOL_DEF_FORM, CMD_SHOW_EDIT_SRC_POOL_DEF_FORM, CMD_SHOW_GENERAL_CONFIG_FORM, CMD_SHOW_SRC_POOL_DEF_LIST, ILIAS\Repository\ctrl(), getGeneralConfigTabLabel(), getPoolConfigTabLabel(), and ILIAS\Repository\tabs().

Referenced by executeCommand().

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

◆ isAvoidManipulationRedirectRequired()

ilTestRandomQuestionSetConfigGUI::isAvoidManipulationRedirectRequired ( )
private

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

183 : bool
184 {
185 if (!$this->isFrozenConfigRequired()) {
186 return false;
187 }
188
189 if (!$this->isManipulationCommand()) {
190 return false;
191 }
192
193 return true;
194 }

References isFrozenConfigRequired(), and isManipulationCommand().

Referenced by executeCommand().

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

◆ isFrozenConfigRequired()

ilTestRandomQuestionSetConfigGUI::isFrozenConfigRequired ( )
private

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

196 : bool
197 {
198 if ($this->testOBJ->participantDataExist()) {
199 return true;
200 }
201
202 if ($this->sourcePoolDefinitionList->hasLostPool()) {
203 return true;
204 }
205
206 return false;
207 }

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

+ Here is the caller graph for this function:

◆ isManipulationCommand()

◆ populateOnScreenMessage()

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

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

953 {
954 $this->ui->mainTemplate()->setCurrentBlock('mess');
955 $this->ui->mainTemplate()->setVariable('MESSAGE', $message);
956 $this->ui->mainTemplate()->parseCurrentBlock();
957 }

References $message, and ILIAS\Repository\ui().

Referenced by showGeneralConfigFormCmd(), and showSourcePoolDefinitionListCmd().

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

◆ preventFormBecauseOfSync()

ilTestRandomQuestionSetConfigGUI::preventFormBecauseOfSync ( )
protected

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

884 : bool
885 {
886 $return = false;
887 $last_sync = $this->questionSetConfig->getLastQuestionSyncTimestamp();
888
889 if ($last_sync !== null && $last_sync !== 0 &&
890 !$this->isFrozenConfigRequired() && $this->questionSetConfig->isQuestionSetBuildable()) {
891 return true;
892 }
893 return false;
894 }

References isFrozenConfigRequired().

Referenced by showGeneralConfigFormCmd(), and showSourcePoolDefinitionListCmd().

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

◆ resetPoolSyncCmd()

ilTestRandomQuestionSetConfigGUI::resetPoolSyncCmd ( )

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

896 : void
897 {
898 $this->questionSetConfig->setLastQuestionSyncTimestamp(0);
899 $this->questionSetConfig->saveToDb();
900 $this->ctrl->redirect($this, self::CMD_SHOW_GENERAL_CONFIG_FORM);
901 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ saveCreateAndNewSourcePoolDefinitionFormCmd()

ilTestRandomQuestionSetConfigGUI::saveCreateAndNewSourcePoolDefinitionFormCmd ( )
private

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

573 : void
574 {
576 }
saveCreateSourcePoolDefinitionFormCmd($redirect_back_to_form=false)

References saveCreateSourcePoolDefinitionFormCmd().

+ 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 581 of file class.ilTestRandomQuestionSetConfigGUI.php.

581 : void
582 {
583 $this->questionSetConfig->loadFromDb();
584
585 $poolId = $this->fetchQuestionPoolIdParameter();
586 $sourcePoolDefinition = $this->getSourcePoolDefinitionByAvailableQuestionPoolId($poolId);
587 $availableTaxonomyIds = ilObjTaxonomy::getUsageOfObject($sourcePoolDefinition->getPoolId());
588
590 $form->build($sourcePoolDefinition, $availableTaxonomyIds);
591
592 $errors = !$form->checkInput(); // ALWAYS CALL BEFORE setValuesByPost()
593 $form->setValuesByPost(); // NEVER CALL THIS BEFORE checkInput()
594
595 if ($errors) {
597 return;
598 }
599
600 $form->applySubmit($sourcePoolDefinition, $availableTaxonomyIds);
601
602 $sourcePoolDefinition->setSequencePosition($this->sourcePoolDefinitionList->getNextPosition());
603 $sourcePoolDefinition->saveToDb();
604 $this->sourcePoolDefinitionList->addDefinition($sourcePoolDefinition);
605
606 $this->sourcePoolDefinitionList->saveDefinitions();
607
608 $this->questionSetConfig->setLastQuestionSyncTimestamp(0);
609 $this->questionSetConfig->saveToDb();
610
611 $this->testOBJ->saveCompleteStatus($this->questionSetConfig);
612
613 if ($redirect_back_to_form) {
614 $this->tpl->setOnScreenMessage('success', $this->lng->txt("tst_msg_random_qsc_modified_add_new_rule"), true);
615 $this->ctrl->setParameter($this, 'src_pool_def_id', $sourcePoolDefinition->getId());
616 $this->ctrl->setParameter($this, 'quest_pool_id', $sourcePoolDefinition->getPoolId());
617 $this->ctrl->redirect($this, self::CMD_SHOW_CREATE_SRC_POOL_DEF_FORM);
618 } else {
619 $this->ctrl->setParameterByClass(self::class, 'modified', 'save');
620 $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
621 }
622 }
showCreateSourcePoolDefinitionFormCmd(ilTestRandomQuestionSetPoolDefinitionFormGUI $form=null)
$errors
Definition: imgupload.php:65

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

Referenced by saveCreateAndNewSourcePoolDefinitionFormCmd().

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

◆ saveEditSourcePoolDefinitionFormCmd()

ilTestRandomQuestionSetConfigGUI::saveEditSourcePoolDefinitionFormCmd ( )
private

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

656 : void
657 {
658 $this->questionSetConfig->loadFromDb();
659
661 $sourcePoolDefinition = $this->sourcePoolDefinitionFactory->getSourcePoolDefinitionByDefinitionId($defId);
662 $availableTaxonomyIds = ilObjTaxonomy::getUsageOfObject($sourcePoolDefinition->getPoolId());
663
665 $form->build($sourcePoolDefinition, $availableTaxonomyIds);
666
667 $errors = !$form->checkInput(); // ALWAYS CALL BEFORE setValuesByPost()
668 $form->setValuesByPost(); // NEVER CALL THIS BEFORE checkInput()
669
670 if ($errors) {
672 return;
673 }
674
675 $form->applySubmit($sourcePoolDefinition, $availableTaxonomyIds);
676
677 $sourcePoolDefinition->saveToDb();
678
679 $this->questionSetConfig->setLastQuestionSyncTimestamp(0);
680 $this->questionSetConfig->saveToDb();
681
682 $this->testOBJ->saveCompleteStatus($this->questionSetConfig);
683
684 $this->ctrl->setParameterByClass(self::class, 'modified', 'save');
685 $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
686 }

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

+ Here is the call graph for this function:

◆ saveGeneralConfigFormCmd()

ilTestRandomQuestionSetConfigGUI::saveGeneralConfigFormCmd ( )
private

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

323 : void
324 {
325 $form = $this->buildGeneralConfigFormGUI();
326
327 $errors = !$form->checkInput(); // ALWAYS CALL BEFORE setValuesByPost()
328 $form->setValuesByPost(); // NEVER CALL THIS BEFORE checkInput()
329
330 if ($errors) {
331 $this->showGeneralConfigFormCmd($form);
332 return;
333 }
334
335 $form->save();
336
337 $this->questionSetConfig->setLastQuestionSyncTimestamp(0);
338 $this->questionSetConfig->saveToDb();
339
340 $this->testOBJ->saveCompleteStatus($this->questionSetConfig);
341
342 $this->ctrl->setParameter($this, 'modified', 'save');
343 $this->ctrl->redirect($this, self::CMD_SHOW_GENERAL_CONFIG_FORM);
344 }
showGeneralConfigFormCmd(ilTestRandomQuestionSetGeneralConfigFormGUI $form=null)

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

+ Here is the call graph for this function:

◆ saveSourcePoolDefinitionListCmd()

ilTestRandomQuestionSetConfigGUI::saveSourcePoolDefinitionListCmd ( )
private

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

410 : void
411 {
412 $this->questionSetConfig->loadFromDb();
413
415
416 $table->applySubmit($this->sourcePoolDefinitionList);
417
418 $this->sourcePoolDefinitionList->reindexPositions();
419 $this->sourcePoolDefinitionList->saveDefinitions();
420
421 // fau: delayCopyRandomQuestions - don't rebuild the staging pool, just clear the sycn timestamp
422 #$this->stagingPool->rebuild( $this->sourcePoolDefinitionList );
423 #$this->sourcePoolDefinitionList->saveDefinitions();
424 #$this->questionSetConfig->setLastQuestionSyncTimestamp(time());
425 $this->questionSetConfig->setLastQuestionSyncTimestamp(0);
426 // fau.
427 $this->questionSetConfig->saveToDb();
428
429 $this->testOBJ->saveCompleteStatus($this->questionSetConfig);
430
431 $this->ctrl->setParameter($this, 'modified', 'save');
432 $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
433 }

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

+ Here is the call graph for this function:

◆ selectPoolDerivationTargetCmd()

ilTestRandomQuestionSetConfigGUI::selectPoolDerivationTargetCmd ( )
private

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

800 : void
801 {
802 $this->ctrl->setParameter($this, 'derive_pool_ids', implode(':', $this->fetchPoolIdsParameter()));
803
804 $explorer = new ilRepositorySelectorExplorerGUI(
805 $this,
806 self::CMD_SELECT_DERIVATION_TARGET,
807 $this,
808 self::CMD_DERIVE_NEW_POOLS,
809 'target_ref'
810 );
811 $explorer->setClickableTypes($this->obj_definition->getExplorerContainerTypes());
812 $explorer->setSelectableTypes([]);
813
814 if (!$explorer->handleCommand()) {
815 $this->tpl->setOnScreenMessage('info', $this->lng->txt('tst_please_select_target_for_pool_derives'));
816 $this->tpl->setContent($this->ctrl->getHTML($explorer));
817 }
818 }
Explorer for selecting repository items.

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

+ Here is the call graph for this function:

◆ showCreateSourcePoolDefinitionFormCmd()

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

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

556 : void
557 {
558 $this->questionSetConfig->loadFromDb();
559
560 $poolId = $this->fetchQuestionPoolIdParameter();
561
562 $sourcePoolDefinition = $this->getSourcePoolDefinitionByAvailableQuestionPoolId($poolId);
563 $availableTaxonomyIds = ilObjTaxonomy::getUsageOfObject($sourcePoolDefinition->getPoolId());
564
565 if ($form === null) {
567 $form->build($sourcePoolDefinition, $availableTaxonomyIds);
568 }
569
570 $this->tpl->setContent($this->ctrl->getHTML($form));
571 }
build(ilTestRandomQuestionSetSourcePoolDefinition $sourcePool, $availableTaxonomyIds)

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

Referenced by saveCreateSourcePoolDefinitionFormCmd().

+ 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 640 of file class.ilTestRandomQuestionSetConfigGUI.php.

640 : void
641 {
642 $this->questionSetConfig->loadFromDb();
643
645 $sourcePoolDefinition = $this->sourcePoolDefinitionFactory->getSourcePoolDefinitionByDefinitionId($defId);
646 $availableTaxonomyIds = ilObjTaxonomy::getUsageOfObject($sourcePoolDefinition->getPoolId());
647
648 if ($form === null) {
650 $form->build($sourcePoolDefinition, $availableTaxonomyIds);
651 }
652
653 $this->tpl->setContent($this->ctrl->getHTML($form));
654 }

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

+ Here is the call graph for this function:

◆ showGeneralConfigFormCmd()

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

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

300 : void
301 {
302 $disabled_form = $this->preventFormBecauseOfSync();
303
304 if ($form === null) {
305 $this->questionSetConfig->loadFromDb();
306 $form = $this->buildGeneralConfigFormGUI($disabled_form);
307 }
308
309 $this->tpl->setContent($this->ctrl->getHTML($form));
310
311 $this->configStateMessageHandler->setContext(
313 );
314
315 $this->configStateMessageHandler->handle();
316
318 if ($message !== '') {
320 }
321 }

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

Referenced by saveGeneralConfigFormCmd().

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

◆ showPoolSelectorExplorerCmd()

ilTestRandomQuestionSetConfigGUI::showPoolSelectorExplorerCmd ( )
protected

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

534 : void
535 {
536 $this->questionSetConfig->loadFromDb();
537
539 $this,
540 self::CMD_SHOW_POOL_SELECTOR_EXPLORER,
541 self::CMD_SHOW_CREATE_SRC_POOL_DEF_FORM
542 );
543
544 $selector->setAvailableQuestionPools(
545 array_keys($this->questionSetConfig->getSelectableQuestionPools())
546 );
547
548 if ($selector->handleCommand()) {
549 return;
550 }
551
552 $this->tpl->setContent($selector->getHTML());
553 }

◆ showSourcePoolDefinitionListCmd()

ilTestRandomQuestionSetConfigGUI::showSourcePoolDefinitionListCmd ( )
private

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

373 : void
374 {
375 $disabled_form = $this->preventFormBecauseOfSync();
376
377 $this->questionSetConfig->loadFromDb();
378
379 $content = '';
380
381 if (!$this->isFrozenConfigRequired() && !$disabled_form) {
382 $toolbar = $this->buildSourcePoolDefinitionListToolbarGUI();
383 $content .= $this->ctrl->getHTML($toolbar);
384 }
385
386 $table = $this->buildSourcePoolDefinitionListTableGUI($disabled_form);
387 $table->init($this->sourcePoolDefinitionList);
388 $content .= $this->ctrl->getHTML($table);
389
390 if (!$this->sourcePoolDefinitionList->areAllUsedPoolsAvailable()) {
391 $table = $this->buildNonAvailablePoolsTableGUI();
392 $table->init($this->sourcePoolDefinitionList);
393 $content .= $this->ctrl->getHTML($table);
394 }
395
396 $this->tpl->setContent($content);
397
398 $this->configStateMessageHandler->setContext(
400 );
401
402 $this->configStateMessageHandler->handle();
403
405 if ($message) {
407 }
408 }

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

Referenced by saveEditSourcePoolDefinitionFormCmd().

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

Field Documentation

◆ $access

ilAccessHandler ilTestRandomQuestionSetConfigGUI::$access

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

◆ $component_repository

ilComponentRepository ilTestRandomQuestionSetConfigGUI::$component_repository

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

◆ $configStateMessageHandler

ilTestRandomQuestionSetConfigStateMessageHandler ilTestRandomQuestionSetConfigGUI::$configStateMessageHandler
protected

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

◆ $ctrl

ilCtrlInterface ilTestRandomQuestionSetConfigGUI::$ctrl

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

◆ $db

ilDBInterface ilTestRandomQuestionSetConfigGUI::$db

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

◆ $lng

ilLanguage ilTestRandomQuestionSetConfigGUI::$lng

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

◆ $obj_cache

ilObjectDataCache ilTestRandomQuestionSetConfigGUI::$obj_cache
protected

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

◆ $obj_definition

ilObjectDefinition ilTestRandomQuestionSetConfigGUI::$obj_definition

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

◆ $processLockerFactory

ilTestProcessLockerFactory ilTestRandomQuestionSetConfigGUI::$processLockerFactory
private

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

◆ $questionSetConfig

ilTestRandomQuestionSetConfig ilTestRandomQuestionSetConfigGUI::$questionSetConfig
protected

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

◆ $sourcePoolDefinitionFactory

ilTestRandomQuestionSetSourcePoolDefinitionFactory ilTestRandomQuestionSetConfigGUI::$sourcePoolDefinitionFactory
protected

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

◆ $sourcePoolDefinitionList

ilTestRandomQuestionSetSourcePoolDefinitionList ilTestRandomQuestionSetConfigGUI::$sourcePoolDefinitionList
protected

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

◆ $stagingPool

ilTestRandomQuestionSetStagingPoolBuilder ilTestRandomQuestionSetConfigGUI::$stagingPool
protected

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

◆ $tabs

ilTabsGUI ilTestRandomQuestionSetConfigGUI::$tabs

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

◆ $testOBJ

ilObjTest ilTestRandomQuestionSetConfigGUI::$testOBJ

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

◆ $testrequest

InternalRequestService ilTestRandomQuestionSetConfigGUI::$testrequest
private

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

◆ $tpl

ilGlobalTemplateInterface ilTestRandomQuestionSetConfigGUI::$tpl

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

◆ $tree

ilTree ilTestRandomQuestionSetConfigGUI::$tree

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

◆ $ui

UIServices ilTestRandomQuestionSetConfigGUI::$ui
protected

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

◆ $user

ilObjUser ilTestRandomQuestionSetConfigGUI::$user
protected

Definition at line 69 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 51 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 46 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by isManipulationCommand().

◆ CMD_SAVE_CREATE_SRC_POOL_DEF_FORM

const ilTestRandomQuestionSetConfigGUI::CMD_SAVE_CREATE_SRC_POOL_DEF_FORM = 'saveCreateSourcePoolDefinitionForm'

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

Referenced by handleTabs(), and isManipulationCommand().

◆ CMD_SAVE_EDIT_SRC_POOL_DEF_FORM

const ilTestRandomQuestionSetConfigGUI::CMD_SAVE_EDIT_SRC_POOL_DEF_FORM = 'saveEditSourcePoolDefinitionForm'

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

Referenced by handleTabs(), and isManipulationCommand().

◆ 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 44 of file class.ilTestRandomQuestionSetConfigGUI.php.

Referenced by handleTabs().

◆ CMD_SHOW_EDIT_SRC_POOL_DEF_FORM

const ilTestRandomQuestionSetConfigGUI::CMD_SHOW_EDIT_SRC_POOL_DEF_FORM = 'showEditSourcePoolDefinitionForm'

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