ILIAS  release_7 Revision v7.30-3-g800a261c036
ilTestRandomQuestionSetConfigGUI Class Reference
+ Collaboration diagram for ilTestRandomQuestionSetConfigGUI:

Public Member Functions

 __construct (ilCtrl $ctrl, ilAccessHandler $access, ilTabsGUI $tabs, ilLanguage $lng, ilGlobalTemplateInterface $tpl, ilDBInterface $db, ilTree $tree, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ, ilTestProcessLockerFactory $processLockerFactory)
 
 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'
 
 $ctrl = null
 
 $access = null
 
 $tabs = null
 
 $lng = null
 
 $tpl = null
 
 $db = null
 
 $tree = null
 
 $pluginAdmin = null
 
 $objDefinition = null
 
 $testOBJ = null
 

Protected Member Functions

 showPoolSelectorExplorerCmd ()
 
 fetchPoolIdsParameter ()
 
 fetchTargetRefParameter ()
 
 preventFormBecauseOfSync ()
 

Protected Attributes

 $questionSetConfig = null
 
 $sourcePoolDefinitionFactory = null
 
 $sourcePoolDefinitionList = null
 
 $stagingPool = null
 
 $configStateMessageHandler
 
 $dic
 

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

 $processLockerFactory
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilTestRandomQuestionSetConfigGUI::__construct ( ilCtrl  $ctrl,
ilAccessHandler  $access,
ilTabsGUI  $tabs,
ilLanguage  $lng,
ilGlobalTemplateInterface  $tpl,
ilDBInterface  $db,
ilTree  $tree,
ilPluginAdmin  $pluginAdmin,
ilObjTest  $testOBJ,
ilTestProcessLockerFactory  $processLockerFactory 
)

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

142 {
143 $this->ctrl = $ctrl;
144 $this->access = $access;
145 $this->tabs = $tabs;
146 $this->lng = $lng;
147 $this->tpl = $tpl;
148 $this->db = $db;
149 $this->tree = $tree;
150 $this->pluginAdmin = $pluginAdmin;
151 $this->testOBJ = $testOBJ;
152
153 global $DIC;
154 $this->dic = $DIC;
155 $this->objDefinition = $this->dic['objDefinition'];
156
157 $this->questionSetConfig = new ilTestRandomQuestionSetConfig(
158 $this->tree,
159 $this->db,
160 $this->pluginAdmin,
161 $this->testOBJ
162 );
163 $this->questionSetConfig->loadFromDb();
164
165 $this->sourcePoolDefinitionFactory = new ilTestRandomQuestionSetSourcePoolDefinitionFactory(
166 $this->db,
167 $this->testOBJ
168 );
169
170 $this->sourcePoolDefinitionList = new ilTestRandomQuestionSetSourcePoolDefinitionList(
171 $this->db,
172 $this->testOBJ,
173 $this->sourcePoolDefinitionFactory
174 );
175
176 $this->sourcePoolDefinitionList->loadDefinitions();
177
178 $this->stagingPool = new ilTestRandomQuestionSetStagingPoolBuilder(
179 $this->db,
180 $this->testOBJ
181 );
182
183 $this->configStateMessageHandler = new ilTestRandomQuestionSetConfigStateMessageHandler(
184 $this->lng,
185 $this->ctrl
186 );
187
188 $this->configStateMessageHandler->setTargetGUI($this);
189 $this->configStateMessageHandler->setQuestionSetConfig($this->questionSetConfig);
190 $this->configStateMessageHandler->setParticipantDataExists($this->testOBJ->participantDataExist());
191 $this->configStateMessageHandler->setLostPools($this->sourcePoolDefinitionList->getLostPools());
192 $this->processLockerFactory = $processLockerFactory;
193 }
global $DIC
Definition: goto.php:24

References $access, $ctrl, $db, $DIC, $lng, $pluginAdmin, $processLockerFactory, $tabs, $testOBJ, $tpl, and $tree.

Member Function Documentation

◆ buildCreateSourcePoolDefinitionFormGUI()

ilTestRandomQuestionSetConfigGUI::buildCreateSourcePoolDefinitionFormGUI ( )
private

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

704 {
705 require_once 'Modules/Test/classes/forms/class.ilTestRandomQuestionSetPoolDefinitionFormGUI.php';
706
708 $this->ctrl,
709 $this->lng,
710 $this->testOBJ,
711 $this,
712 $this->questionSetConfig
713 );
714
715 $form->setSaveCommand(self::CMD_SAVE_CREATE_SRC_POOL_DEF_FORM);
716 $form->setSaveAndNewCommand(self::CMD_SAVE_AND_NEW_CREATE_SRC_POOL_DEF_FORM);
717
718 return $form;
719 }

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

+ Here is the caller graph for this function:

◆ buildEditSourcePoolDefinitionFormGUI()

ilTestRandomQuestionSetConfigGUI::buildEditSourcePoolDefinitionFormGUI ( )
private

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

769 {
770 require_once 'Modules/Test/classes/forms/class.ilTestRandomQuestionSetPoolDefinitionFormGUI.php';
771
773 $this->ctrl,
774 $this->lng,
775 $this->testOBJ,
776 $this,
777 $this->questionSetConfig
778 );
779
780 $form->setSaveCommand(self::CMD_SAVE_EDIT_SRC_POOL_DEF_FORM);
781
782 return $form;
783 }

Referenced by saveEditSourcePoolDefinitionFormCmd(), and showEditSourcePoolDefinitionFormCmd().

+ Here is the caller graph for this function:

◆ buildGeneralConfigFormGUI()

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

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

405 {
406 require_once 'Modules/Test/classes/forms/class.ilTestRandomQuestionSetGeneralConfigFormGUI.php';
407
409 $this->ctrl,
410 $this->lng,
411 $this->testOBJ,
412 $this,
413 $this->questionSetConfig
414 );
415
416 //TODO: should frozen config not lead to 'completely disabled' as well?!
417 $form->setEditModeEnabled(!$this->isFrozenConfigRequired());
418
419 if ($disabled) {
420 $form->setEditModeEnabled(false);
421 }
422
423 $form->build();
424
425 if ($disabled) {
426 $form->clearCommandButtons();
427 }
428
429 return $form;
430 }

References isFrozenConfigRequired().

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

562 {
563 require_once 'Modules/Test/classes/tables/class.ilTestRandomQuestionSetNonAvailablePoolsTableGUI.php';
564
566 $this->ctrl,
567 $this->lng,
568 $this,
569 self::CMD_SHOW_SRC_POOL_DEF_LIST
570 );
571
572 $table->build();
573
574 return $table;
575 }

Referenced by showSourcePoolDefinitionListCmd().

+ Here is the caller graph for this function:

◆ buildQuestionStageCmd()

ilTestRandomQuestionSetConfigGUI::buildQuestionStageCmd ( )
private

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

314 : void
315 {
316 if ($this->sourcePoolDefinitionList->areAllUsedPoolsAvailable()) {
317 $locker = $this->processLockerFactory->retrieveLockerForNamedOperation();
318 $locker->executeNamedOperation(__FUNCTION__, function () : void {
319 $this->stagingPool->rebuild($this->sourcePoolDefinitionList);
320 $this->sourcePoolDefinitionList->saveDefinitions();
321
322 $this->questionSetConfig->loadFromDb();
323 $this->questionSetConfig->setLastQuestionSyncTimestamp(time());
324 $this->questionSetConfig->saveToDb();
325
326 $this->testOBJ->saveCompleteStatus($this->questionSetConfig);
327
328 ilUtil::sendSuccess($this->lng->txt("tst_msg_random_question_set_synced"), true);
329 });
330 }
331
332 $this->ctrl->redirect($this, $this->fetchAfterRebuildQuestionStageCmdParameter());
333 }

References fetchAfterRebuildQuestionStageCmdParameter().

+ Here is the call graph for this function:

◆ buildSourcePoolDefinitionListTableGUI()

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

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

524 {
525 require_once 'Modules/Test/classes/tables/class.ilTestRandomQuestionSetSourcePoolDefinitionListTableGUI.php';
526
528 $this->ctrl,
529 $this->lng,
530 $this,
531 self::CMD_SHOW_SRC_POOL_DEF_LIST
532 );
533
534 if (!$this->isFrozenConfigRequired()) {
535 $table->setDefinitionEditModeEnabled(true);
536 }
537
538 $table->setQuestionAmountColumnEnabled(
539 $this->questionSetConfig->isQuestionAmountConfigurationModePerPool()
540 );
541
542 // fau: taxFilter/typeFilter - show the mapped taxonomy filters if pools are synced
543 $table->setShowMappedTaxonomyFilter(
544 $this->questionSetConfig->getLastQuestionSyncTimestamp() != 0
545 );
546 // fau.
547
548 require_once 'Modules/Test/classes/class.ilTestTaxonomyFilterLabelTranslater.php';
549 $translater = new ilTestTaxonomyFilterLabelTranslater($this->db);
550 $translater->loadLabels($this->sourcePoolDefinitionList);
551 $table->setTaxonomyFilterLabelTranslater($translater);
552
553 if ($disabled) {
554 $table->setDefinitionEditModeEnabled(false);
555 }
556 $table->build();
557
558 return $table;
559 }

References isFrozenConfigRequired().

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

508 {
509 require_once 'Modules/Test/classes/toolbars/class.ilTestRandomQuestionSetSourcePoolDefinitionListToolbarGUI.php';
510
512 $this->ctrl,
513 $this->lng,
514 $this,
515 $this->questionSetConfig
516 );
517
518 $toolbar->build();
519
520 return $toolbar;
521 }

Referenced by showSourcePoolDefinitionListCmd().

+ Here is the caller graph for this function:

◆ deleteMultipleSourcePoolDefinitionsCmd()

ilTestRandomQuestionSetConfigGUI::deleteMultipleSourcePoolDefinitionsCmd ( )
private

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

587 {
588 $definitionIds = $this->fetchMultiSourcePoolDefinitionIdsParameter();
589 $this->deleteSourcePoolDefinitions($definitionIds);
590
591 ilUtil::sendSuccess($this->lng->txt("tst_msg_source_pool_definitions_deleted"), true);
592 $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
593 }

References deleteSourcePoolDefinitions(), and fetchMultiSourcePoolDefinitionIdsParameter().

+ Here is the call graph for this function:

◆ deleteSingleSourcePoolDefinitionCmd()

ilTestRandomQuestionSetConfigGUI::deleteSingleSourcePoolDefinitionCmd ( )
private

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

578 {
579 $definitionId = $this->fetchSingleSourcePoolDefinitionIdParameter();
580 $this->deleteSourcePoolDefinitions(array($definitionId));
581
582 ilUtil::sendSuccess($this->lng->txt("tst_msg_source_pool_definitions_deleted"), true);
583 $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
584 }

References deleteSourcePoolDefinitions(), and fetchSingleSourcePoolDefinitionIdParameter().

+ Here is the call graph for this function:

◆ deleteSourcePoolDefinitions()

ilTestRandomQuestionSetConfigGUI::deleteSourcePoolDefinitions (   $definitionIds)
private

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

596 {
597 foreach ($definitionIds as $definitionId) {
598 $definition = $this->sourcePoolDefinitionFactory->getSourcePoolDefinitionByDefinitionId($definitionId);
599 $definition->deleteFromDb();
600 }
601
602 $this->sourcePoolDefinitionList->reindexPositions();
603 $this->sourcePoolDefinitionList->saveDefinitions();
604
605 $this->questionSetConfig->loadFromDb();
606 $this->questionSetConfig->setLastQuestionSyncTimestamp(0);
607 $this->questionSetConfig->saveToDb();
608
609 $this->testOBJ->saveCompleteStatus($this->questionSetConfig);
610 }

Referenced by deleteMultipleSourcePoolDefinitionsCmd(), and deleteSingleSourcePoolDefinitionCmd().

+ Here is the caller graph for this function:

◆ deriveNewPoolsCmd()

ilTestRandomQuestionSetConfigGUI::deriveNewPoolsCmd ( )
private

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

913 {
914 $poolIds = $this->fetchPoolIdsParameter();
915 $targetRef = $this->fetchTargetRefParameter();
916
917 if (!$this->access->checkAccess('write', '', $targetRef)) {
918 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_permission"), true);
919 $this->ctrl->setParameterByClass(ilObjTestGUI::class, 'ref_id', $this->testOBJ->getRefId());
920 $this->ctrl->redirectByClass(ilObjTestGUI::class);
921 }
922
923 if (count($poolIds)) {
924 require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetPoolDeriver.php';
925
926 foreach ($poolIds as $poolId) {
927 $lostPool = $this->sourcePoolDefinitionList->getLostPool($poolId);
928
929 $deriver = new ilTestRandomQuestionSetPoolDeriver($this->db, $this->pluginAdmin, $this->testOBJ);
930 $deriver->setSourcePoolDefinitionList($this->sourcePoolDefinitionList);
931 $deriver->setTargetContainerRef($targetRef);
932 $deriver->setOwnerId($this->dic['ilUser']->getId());
933 $newPool = $deriver->derive($lostPool);
934
935 $srcPoolDefinition = $this->sourcePoolDefinitionList->getDefinitionBySourcePoolId($newPool->getId());
936 $srcPoolDefinition->setPoolTitle($newPool->getTitle());
937 $srcPoolDefinition->setPoolPath($this->questionSetConfig->getQuestionPoolPathString($newPool->getId()));
938 $srcPoolDefinition->setPoolRefId($this->questionSetConfig->getFirstQuestionPoolRefIdByObjId((int) $newPool->getId()));
939 $srcPoolDefinition->saveToDb();
940
942 $this->testOBJ->getTestId(),
943 $lostPool->getId(),
944 $newPool->getId()
945 );
946 }
947
948 ilUtil::sendSuccess($this->lng->txt('tst_non_available_pool_newly_derived'), true);
949 }
950
951 $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
952 }

References fetchPoolIdsParameter(), fetchTargetRefParameter(), and ilTestRandomQuestionSetStagingPoolQuestionList\updateSourceQuestionPoolId().

+ Here is the call graph for this function:

◆ executeCommand()

ilTestRandomQuestionSetConfigGUI::executeCommand ( )

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

196 {
197 if (!$this->access->checkAccess("write", "", $this->testOBJ->getRefId())) {
198 ilUtil::sendFailure($this->lng->txt("cannot_edit_test"), true);
199 $this->ctrl->redirectByClass('ilObjTestGUI', "infoScreen");
200 }
201
203 ilUtil::sendFailure($this->lng->txt("tst_msg_cannot_modify_random_question_set_conf_due_to_part"), true);
204 $this->ctrl->redirect($this);
205 }
206
207 $this->handleTabs();
208
209 $nextClass = $this->ctrl->getNextClass();
210
211 switch ($nextClass) {
212 case 'iltestrandomquestionsetpooldefinitionformgui':
213 $this->questionSetConfig->loadFromDb();
214 $poolId = $this->fetchQuestionPoolIdParameter();
215 $sourcePoolDefinition = $this->getSourcePoolDefinitionByAvailableQuestionPoolId($poolId);
216 $availableTaxonomyIds = ilObjTaxonomy::getUsageOfObject($sourcePoolDefinition->getPoolId());
218 $form->build($sourcePoolDefinition, $availableTaxonomyIds);
219
220 $this->ctrl->forwardCommand($form);
221 break;
222
223 default:
224
225 $cmd = $this->ctrl->getCmd(self::CMD_SHOW_GENERAL_CONFIG_FORM) . 'Cmd';
226
227 $this->$cmd();
228 }
229 }
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References buildCreateSourcePoolDefinitionFormGUI(), fetchQuestionPoolIdParameter(), getSourcePoolDefinitionByAvailableQuestionPoolId(), ilObjTaxonomy\getUsageOfObject(), handleTabs(), isAvoidManipulationRedirectRequired(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ fetchAfterRebuildQuestionStageCmdParameter()

ilTestRandomQuestionSetConfigGUI::fetchAfterRebuildQuestionStageCmdParameter ( )
private

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

336 {
337 if (!isset($_GET[self::HTTP_PARAM_AFTER_REBUILD_QUESTION_STAGE_CMD])) {
339 }
340
341 if (!strlen($_GET[self::HTTP_PARAM_AFTER_REBUILD_QUESTION_STAGE_CMD])) {
343 }
344
346 }
$_GET["client_id"]

References $_GET, CMD_SHOW_GENERAL_CONFIG_FORM, and HTTP_PARAM_AFTER_REBUILD_QUESTION_STAGE_CMD.

Referenced by buildQuestionStageCmd().

+ Here is the caller graph for this function:

◆ fetchMultiSourcePoolDefinitionIdsParameter()

ilTestRandomQuestionSetConfigGUI::fetchMultiSourcePoolDefinitionIdsParameter ( )
private

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

819 {
820 if (!isset($_POST['src_pool_def_ids']) || !is_array($_POST['src_pool_def_ids'])) {
821 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('tst_please_select_source_pool'), true);
822 $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
823 return [];
824 }
825
826 $definitionIds = array();
827
828 foreach ($_POST['src_pool_def_ids'] as $definitionId) {
829 $definitionId = (int) $definitionId;
830
831 if (!$definitionId) {
832 require_once 'Modules/Test/exceptions/class.ilTestMissingSourcePoolDefinitionParameterException.php';
834 }
835
836 $definitionIds[] = $definitionId;
837 }
838
839 return $definitionIds;
840 }
$_POST["username"]

References $_POST.

Referenced by deleteMultipleSourcePoolDefinitionsCmd().

+ Here is the caller graph for this function:

◆ fetchPoolIdsParameter()

ilTestRandomQuestionSetConfigGUI::fetchPoolIdsParameter ( )
protected

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

866 {
867 if (isset($_POST['derive_pool_ids']) && is_array($_POST['derive_pool_ids'])) {
868 $poolIds = array();
869
870 foreach ($_POST['derive_pool_ids'] as $poolId) {
871 $poolIds[] = (int) $poolId;
872 }
873 } elseif (isset($_GET['derive_pool_ids']) && preg_match('/^\d+(\:\d+)*$/', $_GET['derive_pool_ids'])) {
874 $poolIds = explode(':', $_GET['derive_pool_ids']);
875 } elseif (isset($_GET['derive_pool_id']) && (int) $_GET['derive_pool_id']) {
876 $poolIds = array( (int) $_GET['derive_pool_id'] );
877 }
878
879 return $poolIds;
880 }

References $_GET, and $_POST.

Referenced by deriveNewPoolsCmd(), and selectPoolDerivationTargetCmd().

+ Here is the caller graph for this function:

◆ fetchQuestionPoolIdParameter()

ilTestRandomQuestionSetConfigGUI::fetchQuestionPoolIdParameter ( )
private

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

786 {
787 if (isset($_POST['quest_pool_id']) && (int) $_POST['quest_pool_id']) {
788 return (int) $_POST['quest_pool_id'];
789 }
790
791 if (isset($_GET['quest_pool_id']) && (int) $_GET['quest_pool_id']) {
792 return (int) $_GET['quest_pool_id'];
793 }
794
795 if (isset($_GET['quest_pool_ref']) && (int) $_GET['quest_pool_ref']) {
796 $objCache = $this->dic['ilObjDataCache'];
797 return $objCache->lookupObjId((int) $_GET['quest_pool_ref']);
798 }
799
800 require_once 'Modules/Test/exceptions/class.ilTestMissingQuestionPoolIdParameterException.php';
802 }

References $_GET, and $_POST.

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

+ Here is the caller graph for this function:

◆ fetchSingleSourcePoolDefinitionIdParameter()

ilTestRandomQuestionSetConfigGUI::fetchSingleSourcePoolDefinitionIdParameter ( )
private

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

805 {
806 if (isset($_POST['src_pool_def_id']) && (int) $_POST['src_pool_def_id']) {
807 return (int) $_POST['src_pool_def_id'];
808 }
809
810 if (isset($_GET['src_pool_def_id']) && (int) $_GET['src_pool_def_id']) {
811 return (int) $_GET['src_pool_def_id'];
812 }
813
814 require_once 'Modules/Test/exceptions/class.ilTestMissingSourcePoolDefinitionParameterException.php';
816 }

References $_GET, and $_POST.

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

+ Here is the caller graph for this function:

◆ fetchTargetRefParameter()

ilTestRandomQuestionSetConfigGUI::fetchTargetRefParameter ( )
protected

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

883 {
884 if (isset($_GET['target_ref']) && (int) $_GET['target_ref']) {
885 return (int) $_GET['target_ref'];
886 }
887
888 return null;
889 }

References $_GET.

Referenced by deriveNewPoolsCmd().

+ Here is the caller graph for this function:

◆ getGeneralConfigTabLabel()

ilTestRandomQuestionSetConfigGUI::getGeneralConfigTabLabel ( )
Returns
string

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

966 {
967 return $this->lng->txt('tst_rnd_quest_cfg_tab_general');
968 }

Referenced by handleTabs().

+ Here is the caller graph for this function:

◆ getGeneralModificationSuccessMessage()

ilTestRandomQuestionSetConfigGUI::getGeneralModificationSuccessMessage ( )
private
Returns
string

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

958 {
959 return $this->lng->txt("tst_msg_random_question_set_config_modified");
960 }

Referenced by showGeneralConfigFormCmd(), and showSourcePoolDefinitionListCmd().

+ Here is the caller graph for this function:

◆ getPoolConfigTabLabel()

ilTestRandomQuestionSetConfigGUI::getPoolConfigTabLabel ( )
Returns
string

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

974 {
975 return $this->lng->txt('tst_rnd_quest_cfg_tab_pool');
976 }

Referenced by handleTabs().

+ Here is the caller graph for this function:

◆ getSourcePoolDefinitionByAvailableQuestionPoolId()

ilTestRandomQuestionSetConfigGUI::getSourcePoolDefinitionByAvailableQuestionPoolId (   $poolId)
private

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

843 {
844 $availablePools = $this->testOBJ->getAvailableQuestionpools(
845 true,
846 $this->questionSetConfig->arePoolsWithHomogeneousScoredQuestionsRequired(),
847 false,
848 true,
849 true
850 );
851
852 if (isset($availablePools[$poolId])) {
853 $originalPoolData = $availablePools[$poolId];
854
855 $originalPoolData['qpl_path'] = $this->questionSetConfig->getQuestionPoolPathString($poolId);
856 $originalPoolData['qpl_ref_id'] = $this->questionSetConfig->getFirstQuestionPoolRefIdByObjId($poolId);
857
858 return $this->sourcePoolDefinitionFactory->getSourcePoolDefinitionByOriginalPoolData($originalPoolData);
859 }
860
861 require_once 'Modules/Test/exceptions/class.ilTestQuestionPoolNotAvailableAsSourcePoolException.php';
863 }

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

+ Here is the caller graph for this function:

◆ handleTabs()

ilTestRandomQuestionSetConfigGUI::handleTabs ( )
private

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

276 {
277 $this->tabs->activateTab('assQuestions');
278
279 $this->tabs->addSubTab(
280 'tstRandQuestSetGeneralConfig',
282 $this->ctrl->getLinkTarget($this, self::CMD_SHOW_GENERAL_CONFIG_FORM)
283 );
284
285 $this->tabs->addSubTab(
286 'tstRandQuestSetPoolConfig',
287 $this->getPoolConfigTabLabel(),
288 $this->ctrl->getLinkTarget($this, self::CMD_SHOW_SRC_POOL_DEF_LIST)
289 );
290
291 switch ($this->ctrl->getCmd(self::CMD_SHOW_GENERAL_CONFIG_FORM)) {
294
295 $this->tabs->activateSubTab('tstRandQuestSetGeneralConfig');
296 break;
297
306
307 $this->tabs->activateSubTab('tstRandQuestSetPoolConfig');
308 break;
309
310 default: $this->tabs->activateSubTab('nonTab');
311 }
312 }

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, getGeneralConfigTabLabel(), and getPoolConfigTabLabel().

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

232 {
233 if (!$this->isFrozenConfigRequired()) {
234 return false;
235 }
236
237 if (!$this->isManipulationCommand()) {
238 return false;
239 }
240
241 return true;
242 }

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

245 {
246 if ($this->testOBJ->participantDataExist()) {
247 return true;
248 }
249
250 if ($this->sourcePoolDefinitionList->hasLostPool()) {
251 return true;
252 }
253
254 return false;
255 }

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

+ Here is the caller graph for this function:

◆ isManipulationCommand()

◆ preventFormBecauseOfSync()

ilTestRandomQuestionSetConfigGUI::preventFormBecauseOfSync ( )
protected

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

979 : bool
980 {
981 $return = false;
982 $last_sync = (int) $this->questionSetConfig->getLastQuestionSyncTimestamp();
983
984 if ($last_sync !== null && $last_sync !== 0 &&
985 !$this->isFrozenConfigRequired() && $this->questionSetConfig->isQuestionSetBuildable()) {
986 $return = true;
987
988 $sync_date = new ilDateTime($last_sync, IL_CAL_UNIX);
989 $msg = sprintf(
990 $this->lng->txt('tst_msg_rand_quest_set_stage_pool_last_sync'),
992 );
993
994 $href = $this->ctrl->getLinkTarget($this, self::CMD_RESET_POOLSYNC);
995 $label = $this->lng->txt('tst_btn_reset_pool_sync');
996
997 $buttons = [
998 $this->dic->ui()->factory()->button()->standard($label, $href)
999 ];
1000
1001 $msgbox = $this->dic->ui()->factory()->messageBox()
1002 ->info($msg)
1003 ->withButtons($buttons);
1004 $message = $this->dic->ui()->renderer()->render($msgbox);
1005 $this->dic->ui()->mainTemplate()->setCurrentBlock('mess');
1006 $this->dic->ui()->mainTemplate()->setVariable('MESSAGE', $message);
1007 $this->dic->ui()->mainTemplate()->parseCurrentBlock();
1008 }
1009 return $return;
1010 }
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
$message
Definition: xapiexit.php:14

References $message, ilDatePresentation\formatDate(), IL_CAL_UNIX, and 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 1012 of file class.ilTestRandomQuestionSetConfigGUI.php.

1012 : void
1013 {
1014 $this->questionSetConfig->setLastQuestionSyncTimestamp(0);
1015 $this->questionSetConfig->saveToDb();
1016 $this->ctrl->redirect($this, self::CMD_SHOW_GENERAL_CONFIG_FORM);
1017 }

◆ saveCreateAndNewSourcePoolDefinitionFormCmd()

ilTestRandomQuestionSetConfigGUI::saveCreateAndNewSourcePoolDefinitionFormCmd ( )
private

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

654 {
656 }
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 661 of file class.ilTestRandomQuestionSetConfigGUI.php.

662 {
663 $this->questionSetConfig->loadFromDb();
664
665 $poolId = $this->fetchQuestionPoolIdParameter();
666 $sourcePoolDefinition = $this->getSourcePoolDefinitionByAvailableQuestionPoolId($poolId);
667 $availableTaxonomyIds = ilObjTaxonomy::getUsageOfObject($sourcePoolDefinition->getPoolId());
668
670 $form->build($sourcePoolDefinition, $availableTaxonomyIds);
671
672 $errors = !$form->checkInput(); // ALWAYS CALL BEFORE setValuesByPost()
673 $form->setValuesByPost(); // NEVER CALL THIS BEFORE checkInput()
674
675 if ($errors) {
676 return $this->showCreateSourcePoolDefinitionFormCmd($form);
677 }
678
679 $form->applySubmit($sourcePoolDefinition, $availableTaxonomyIds);
680
681 $sourcePoolDefinition->setSequencePosition($this->sourcePoolDefinitionList->getNextPosition());
682 $sourcePoolDefinition->saveToDb();
683 $this->sourcePoolDefinitionList->addDefinition($sourcePoolDefinition);
684
685 $this->sourcePoolDefinitionList->saveDefinitions();
686
687 $this->questionSetConfig->setLastQuestionSyncTimestamp(0);
688 $this->questionSetConfig->saveToDb();
689
690 $this->testOBJ->saveCompleteStatus($this->questionSetConfig);
691
692 if ($redirect_back_to_form) {
693 ilUtil::sendSuccess($this->lng->txt("tst_msg_random_qsc_modified_add_new_rule"), true);
694 $this->ctrl->setParameter($this, 'src_pool_def_id', $sourcePoolDefinition->getId());
695 $this->ctrl->setParameter($this, 'quest_pool_id', $sourcePoolDefinition->getPoolId());
696 $this->ctrl->redirect($this, self::CMD_SHOW_CREATE_SRC_POOL_DEF_FORM);
697 } else {
698 ilUtil::sendSuccess($this->lng->txt("tst_msg_random_question_set_config_modified"), true);
699 $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
700 }
701 }
showCreateSourcePoolDefinitionFormCmd(ilTestRandomQuestionSetPoolDefinitionFormGUI $form=null)
$errors
Definition: imgupload.php:49

References $errors, buildCreateSourcePoolDefinitionFormGUI(), fetchQuestionPoolIdParameter(), getSourcePoolDefinitionByAvailableQuestionPoolId(), ilObjTaxonomy\getUsageOfObject(), 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 737 of file class.ilTestRandomQuestionSetConfigGUI.php.

738 {
739 $this->questionSetConfig->loadFromDb();
740
742 $sourcePoolDefinition = $this->sourcePoolDefinitionFactory->getSourcePoolDefinitionByDefinitionId($defId);
743 $availableTaxonomyIds = ilObjTaxonomy::getUsageOfObject($sourcePoolDefinition->getPoolId());
744
746 $form->build($sourcePoolDefinition, $availableTaxonomyIds);
747
748 $errors = !$form->checkInput(); // ALWAYS CALL BEFORE setValuesByPost()
749 $form->setValuesByPost(); // NEVER CALL THIS BEFORE checkInput()
750
751 if ($errors) {
752 return $this->showSourcePoolDefinitionListCmd($form);
753 }
754
755 $form->applySubmit($sourcePoolDefinition, $availableTaxonomyIds);
756
757 $sourcePoolDefinition->saveToDb();
758
759 $this->questionSetConfig->setLastQuestionSyncTimestamp(0);
760 $this->questionSetConfig->saveToDb();
761
762 $this->testOBJ->saveCompleteStatus($this->questionSetConfig);
763
764 ilUtil::sendSuccess($this->lng->txt("tst_msg_random_question_set_config_modified"), true);
765 $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
766 }

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

+ Here is the call graph for this function:

◆ saveGeneralConfigFormCmd()

ilTestRandomQuestionSetConfigGUI::saveGeneralConfigFormCmd ( )
private

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

383 {
384 $form = $this->buildGeneralConfigFormGUI();
385
386 $errors = !$form->checkInput(); // ALWAYS CALL BEFORE setValuesByPost()
387 $form->setValuesByPost(); // NEVER CALL THIS BEFORE checkInput()
388
389 if ($errors) {
390 return $this->showGeneralConfigFormCmd($form);
391 }
392
393 $form->save();
394
395 $this->questionSetConfig->setLastQuestionSyncTimestamp(0);
396 $this->questionSetConfig->saveToDb();
397
398 $this->testOBJ->saveCompleteStatus($this->questionSetConfig);
399
400 $this->ctrl->setParameter($this, 'modified', 1);
401 $this->ctrl->redirect($this, self::CMD_SHOW_GENERAL_CONFIG_FORM);
402 }
showGeneralConfigFormCmd(ilTestRandomQuestionSetGeneralConfigFormGUI $form=null)

References $errors, buildGeneralConfigFormGUI(), and showGeneralConfigFormCmd().

+ Here is the call graph for this function:

◆ saveSourcePoolDefinitionListCmd()

ilTestRandomQuestionSetConfigGUI::saveSourcePoolDefinitionListCmd ( )
private

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

483 {
484 $this->questionSetConfig->loadFromDb();
485
487
488 $table->applySubmit($this->sourcePoolDefinitionList);
489
490 $this->sourcePoolDefinitionList->reindexPositions();
491 $this->sourcePoolDefinitionList->saveDefinitions();
492
493 // fau: delayCopyRandomQuestions - don't rebuild the staging pool, just clear the sycn timestamp
494 #$this->stagingPool->rebuild( $this->sourcePoolDefinitionList );
495 #$this->sourcePoolDefinitionList->saveDefinitions();
496 #$this->questionSetConfig->setLastQuestionSyncTimestamp(time());
497 $this->questionSetConfig->setLastQuestionSyncTimestamp(0);
498 // fau.
499 $this->questionSetConfig->saveToDb();
500
501 $this->testOBJ->saveCompleteStatus($this->questionSetConfig);
502
503 $this->ctrl->setParameter($this, 'modified', 1);
504 $this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
505 }

References buildSourcePoolDefinitionListTableGUI().

+ Here is the call graph for this function:

◆ selectPoolDerivationTargetCmd()

ilTestRandomQuestionSetConfigGUI::selectPoolDerivationTargetCmd ( )
private

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

892 {
893 $this->ctrl->setParameter($this, 'derive_pool_ids', implode(':', $this->fetchPoolIdsParameter()));
894
895 require_once 'Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php';
896 $explorer = new ilRepositorySelectorExplorerGUI(
897 $this,
898 self::CMD_SELECT_DERIVATION_TARGET,
899 $this,
900 self::CMD_DERIVE_NEW_POOLS,
901 'target_ref'
902 );
903 $explorer->setClickableTypes($this->objDefinition->getExplorerContainerTypes());
904 $explorer->setSelectableTypes(array());
905
906 if (!$explorer->handleCommand()) {
907 ilUtil::sendInfo($this->lng->txt('tst_please_select_target_for_pool_derives'));
908 $this->tpl->setContent($this->ctrl->getHTML($explorer));
909 }
910 }
Explorer for selecting repository items.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References fetchPoolIdsParameter(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ showCreateSourcePoolDefinitionFormCmd()

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

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

637 {
638 $this->questionSetConfig->loadFromDb();
639
640 $poolId = $this->fetchQuestionPoolIdParameter();
641
642 $sourcePoolDefinition = $this->getSourcePoolDefinitionByAvailableQuestionPoolId($poolId);
643 $availableTaxonomyIds = ilObjTaxonomy::getUsageOfObject($sourcePoolDefinition->getPoolId());
644
645 if ($form === null) {
647 $form->build($sourcePoolDefinition, $availableTaxonomyIds);
648 }
649
650 $this->tpl->setContent($this->ctrl->getHTML($form));
651 }
build(ilTestRandomQuestionSetSourcePoolDefinition $sourcePool, $availableTaxonomyIds)

References buildCreateSourcePoolDefinitionFormGUI(), 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 721 of file class.ilTestRandomQuestionSetConfigGUI.php.

722 {
723 $this->questionSetConfig->loadFromDb();
724
726 $sourcePoolDefinition = $this->sourcePoolDefinitionFactory->getSourcePoolDefinitionByDefinitionId($defId);
727 $availableTaxonomyIds = ilObjTaxonomy::getUsageOfObject($sourcePoolDefinition->getPoolId());
728
729 if ($form === null) {
731 $form->build($sourcePoolDefinition, $availableTaxonomyIds);
732 }
733
734 $this->tpl->setContent($this->ctrl->getHTML($form));
735 }

References buildEditSourcePoolDefinitionFormGUI(), fetchSingleSourcePoolDefinitionIdParameter(), and ilObjTaxonomy\getUsageOfObject().

+ Here is the call graph for this function:

◆ showGeneralConfigFormCmd()

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

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

349 {
350 $disabled_form = $this->preventFormBecauseOfSync();
351
352 if ($form === null) {
353 $this->questionSetConfig->loadFromDb();
354 $form = $this->buildGeneralConfigFormGUI($disabled_form);
355 }
356
357 $this->tpl->setContent($this->ctrl->getHTML($form));
358
359 if (!$disabled_form) {
360 $this->configStateMessageHandler->setContext(
362 );
363
364 $this->configStateMessageHandler->handle();
365
366 if ($this->configStateMessageHandler->hasValidationReports()) {
367 if ($this->configStateMessageHandler->isValidationFailed()) {
369 $this->configStateMessageHandler->getValidationReportHtml()
370 );
371 } else {
372 ilUtil::sendInfo($this->configStateMessageHandler->getValidationReportHtml());
373 }
374 }
375
376 if (isset($_GET['modified']) && (int) $_GET['modified']) {
377 ilUtil::sendSuccess($this->getGeneralModificationSuccessMessage());
378 }
379 }
380 }

References $_GET, buildGeneralConfigFormGUI(), ilTestRandomQuestionSetConfigStateMessageHandler\CONTEXT_GENERAL_CONFIG, getGeneralModificationSuccessMessage(), preventFormBecauseOfSync(), ilUtil\sendFailure(), and ilUtil\sendInfo().

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

614 {
615 $this->questionSetConfig->loadFromDb();
616
617 require_once 'Services/Repository/classes/class.ilTestQuestionPoolSelectorExplorer.php';
619 $this,
620 self::CMD_SHOW_POOL_SELECTOR_EXPLORER,
621 self::CMD_SHOW_CREATE_SRC_POOL_DEF_FORM
622 );
623
624 $selector->setAvailableQuestionPools(
625 array_keys($this->questionSetConfig->getSelectableQuestionPools())
626 );
627
628 if ($selector->handleCommand()) {
629 return;
630 }
631
632 $this->tpl->setContent($selector->getHTML());
633 }

◆ showSourcePoolDefinitionListCmd()

ilTestRandomQuestionSetConfigGUI::showSourcePoolDefinitionListCmd ( )
private

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

433 {
434 $this->questionSetConfig->loadFromDb();
435
436 $disabled_form = $this->preventFormBecauseOfSync();
437
438 $content = '';
439
440 if (!$this->isFrozenConfigRequired() && !$disabled_form) {
441 $toolbar = $this->buildSourcePoolDefinitionListToolbarGUI();
442 $content .= $this->ctrl->getHTML($toolbar);
443 }
444
445 $table = $this->buildSourcePoolDefinitionListTableGUI($disabled_form);
446 $table->init($this->sourcePoolDefinitionList);
447 $content .= $this->ctrl->getHTML($table);
448
449 if (!$this->sourcePoolDefinitionList->areAllUsedPoolsAvailable()) {
450 $table = $this->buildNonAvailablePoolsTableGUI();
451 $table->init($this->sourcePoolDefinitionList);
452 $content .= $this->ctrl->getHTML($table);
453 }
454
455 $this->tpl->setContent($content);
456
457 if ($disabled_form) {
458 return;
459 }
460
461 $this->configStateMessageHandler->setContext(
463 );
464
465 $this->configStateMessageHandler->handle();
466
467 if ($this->configStateMessageHandler->hasValidationReports()) {
468 if ($this->configStateMessageHandler->isValidationFailed()) {
470 $this->configStateMessageHandler->getValidationReportHtml()
471 );
472 } else {
473 ilUtil::sendInfo($this->configStateMessageHandler->getValidationReportHtml());
474 }
475 }
476
477 if (isset($_GET['modified']) && (int) $_GET['modified']) {
478 ilUtil::sendSuccess($this->getGeneralModificationSuccessMessage());
479 }
480 }

References $_GET, buildNonAvailablePoolsTableGUI(), buildSourcePoolDefinitionListTableGUI(), buildSourcePoolDefinitionListToolbarGUI(), ilTestRandomQuestionSetConfigStateMessageHandler\CONTEXT_POOL_SELECTION, getGeneralModificationSuccessMessage(), isFrozenConfigRequired(), preventFormBecauseOfSync(), ilUtil\sendFailure(), and ilUtil\sendInfo().

Referenced by saveEditSourcePoolDefinitionFormCmd().

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

Field Documentation

◆ $access

ilTestRandomQuestionSetConfigGUI::$access = null

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

Referenced by __construct().

◆ $configStateMessageHandler

ilTestRandomQuestionSetConfigGUI::$configStateMessageHandler
protected

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

◆ $ctrl

ilTestRandomQuestionSetConfigGUI::$ctrl = null

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

Referenced by __construct().

◆ $db

ilTestRandomQuestionSetConfigGUI::$db = null

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

Referenced by __construct().

◆ $dic

ilTestRandomQuestionSetConfigGUI::$dic
protected

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

◆ $lng

ilTestRandomQuestionSetConfigGUI::$lng = null

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

Referenced by __construct().

◆ $objDefinition

ilTestRandomQuestionSetConfigGUI::$objDefinition = null

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

◆ $pluginAdmin

ilTestRandomQuestionSetConfigGUI::$pluginAdmin = null

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

Referenced by __construct().

◆ $processLockerFactory

ilTestRandomQuestionSetConfigGUI::$processLockerFactory
private

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

Referenced by __construct().

◆ $questionSetConfig

ilTestRandomQuestionSetConfigGUI::$questionSetConfig = null
protected

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

◆ $sourcePoolDefinitionFactory

ilTestRandomQuestionSetConfigGUI::$sourcePoolDefinitionFactory = null
protected

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

◆ $sourcePoolDefinitionList

ilTestRandomQuestionSetConfigGUI::$sourcePoolDefinitionList = null
protected

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

◆ $stagingPool

ilTestRandomQuestionSetConfigGUI::$stagingPool = null
protected

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

◆ $tabs

ilTestRandomQuestionSetConfigGUI::$tabs = null

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

Referenced by __construct().

◆ $testOBJ

ilTestRandomQuestionSetConfigGUI::$testOBJ = null

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

Referenced by __construct().

◆ $tpl

ilTestRandomQuestionSetConfigGUI::$tpl = null

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

Referenced by __construct().

◆ $tree

ilTestRandomQuestionSetConfigGUI::$tree = null

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

Referenced by __construct().

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

◆ CMD_RESET_POOLSYNC

const ilTestRandomQuestionSetConfigGUI::CMD_RESET_POOLSYNC = 'resetPoolSync'

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

◆ CMD_SAVE_AND_NEW_CREATE_SRC_POOL_DEF_FORM

const ilTestRandomQuestionSetConfigGUI::CMD_SAVE_AND_NEW_CREATE_SRC_POOL_DEF_FORM = 'saveCreateAndNewSourcePoolDefinitionForm'

Definition at line 38 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 37 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 40 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'

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