ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilObjTestGUI Class Reference

Class ilObjTestGUI. More...

+ Inheritance diagram for ilObjTestGUI:
+ Collaboration diagram for ilObjTestGUI:

Public Member Functions

 executeCommand ()
 execute command More...
 
 getTestAccess ()
 
 setTestAccess (ilTestAccess $test_access)
 
 runObject ()
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 afterSave (ilObject $new_object)
 save object @access public More...
 
 backToRepositoryObject ()
 
 getTestObject ()
 
 importVerifiedFileObject (bool $skip_retrieve_selected_questions=false)
 imports question(s) into the questionpool (after verification) More...
 
 downloadFileObject ()
 download file More...
 
 fullscreenObject ()
 show fullscreen view More...
 
 download_paragraphObject ()
 download source code paragraph More...
 
 createQuestionPool ($name="dummy", $description="")
 
 cancelCreateQuestionObject ()
 
 createQuestionFormObject (?Form $form=null)
 
 showQuestionsObject ()
 
 takenObject ()
 
 historyObject ()
 
 exportLegacyLogsObject ()
 
 participantsActionObject ()
 Evaluates the actions on the participants page. More...
 
 defaultsObject ()
 Displays the settings page for test defaults. More...
 
 deleteDefaultsObject ()
 Deletes selected test defaults. More...
 
 confirmedApplyDefaultsObject ()
 
 applyDefaultsObject ($confirmed=false)
 Applies the selected test defaults. More...
 
 addDefaultsObject ()
 Adds the defaults of this test to the defaults. More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 statisticsObject ()
 
 certificateObject ()
 Shows the certificate editor. More...
 
 getTabs ()
 adds tabs to tab gui object More...
 
 copyQuestionsToPoolObject ()
 
 copyQuestionsToPool (array $question_ids, int $qpl_id)
 
 copyQuestionToPool (assQuestionGUI $source_question_gui, ilObjQuestionPool $target_pool)
 
 copyAndLinkQuestionsToPoolObject (?int $ref_id=null, array $question_ids=[])
 
 copyToQuestionpoolObject ()
 
 createQuestionPoolAndCopyObject ()
 
 createQuestionpoolTargetObject (string $cmd)
 Called when a new question should be created from a test Important: $cmd may be overwritten if no question pool is available. More...
 
- Public Member Functions inherited from ilObjectGUI
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 
- Public Member Functions inherited from ilDesktopItemHandling
 addToDeskObject ()
 
 removeFromDeskObject ()
 

Static Public Member Functions

static _goto ($target)
 Redirect script to call a test with the test reference id. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Data Fields

const SHOW_QUESTIONS_CMD = 'showQuestions'
 
- Data Fields inherited from ilObjectGUI
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 

Protected Member Functions

 redirectAfterMissingWrite ()
 
 redirectAfterMissingRead ()
 
 forwardCommandToQuestionPreview (string $cmd, ?assQuestionGUI $question_gui=null)
 
 forwardCommandToQuestion (string $cmd)
 
 trackTestObjectReadEvent ()
 
 exportObject ()
 Gateway for exports initiated from workspace, as there is a generic forward to {objTypeMainGUI}::export() More...
 
 fetchAuthoringQuestionIdParameter ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 removeImportFailsObject ()
 
 getTargetQuestionpoolForm ($questionpools, string $cmd)
 
 protectByWritePermission ()
 
 determineObjectiveOrientedContainer ()
 
 getObjectiveOrientedContainer ()
 
 getQuestionsTableQuery ()
 
 getQuestionsTableActions ()
 
 getTable ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Protected Attributes

TabsManager $tabs_manager = null
 
ilTestAccess $test_access
 
ilNavigationHistory $navigation_history
 
ilComponentRepository $component_repository
 
ilComponentFactory $component_factory
 
ilDBInterface $db
 
ilUIService $ui_service
 
ilHelpGUI $help
 
GlobalScreen $global_screen
 
ilObjectDataCache $obj_data_cache
 
SkillService $skills_service
 
IRSS $irss
 
RequestDataCollector $testrequest
 
ResponseHandler $response_handler
 
ParticipantRepository $participant_repository
 
ResultsDataFactory $results_data_factory
 
ResultsPresentationFactory $results_presentation_factory
 
TestResultRepository $test_pass_result_repository
 
QuestionsTableQuery $table_query = null
 
QuestionsTableActions $table_actions = null
 
DataFactory $data_factory
 
TaxonomyService $taxonomy
 
bool $create_question_mode
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
GlobalHttpState $http
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
CustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Private Member Functions

 addQuestionTitleToObjectTitle (string $question_title)
 
 addPostCreationTasksToQuestionGUI (assQuestionGUI $question_gui)
 
 executeAfterQuestionSaveTasks (assQuestionGUI $question_gui)
 
 executeAfterQuestionCreationTasks (assQuestionGUI $question_gui)
 
 showNextViewAfterQuestionSave (assQuestionGUI $question_gui, string $target)
 
 questionsTabGatewayObject ()
 
 showEditTestPageGUI ()
 
 forwardToEvaluationGUI ()
 
 redirectTo_SettingsMainGUI_showForm_Object ()
 
 prepareSubGuiOutput ()
 
 getSelectedPersonalDefaultsSettingsFromForm ()
 
 insertQuestionsObject (?array $selected_array=null)
 
 buildQuestionCreationForm ()
 
 buildInputQuestionType ()
 
 buildInputPosition (array $questions)
 
 buildInputEditingType ()
 
 buildInputPoolSelection ()
 
 addQuestion ()
 
 setupToolBarAndMessage (bool $has_started_test_runs)
 
 populateQuestionBrowserToolbarButtons (ilToolbarGUI $toolbar)
 
 isCommandClassAnyInfoScreenChild ()
 
 infoScreenObject ()
 
 forwardToInfoScreen ()
 
 getTestScreenGUIInstance ()
 

Private Attributes

const SHOW_LOGS_CMD = 'history'
 
const QUESTION_CREATION_POOL_SELECTION_NO_POOL = 1
 
const QUESTION_CREATION_POOL_SELECTION_NEW_POOL = 2
 
const QUESTION_CREATION_POOL_SELECTION_EXISTING_POOL = 3
 
ilTestQuestionSetConfigFactory $test_question_set_config_factory
 
ilTestPlayerFactory $test_player_factory
 
ilTestSessionFactory $test_session_factory
 
ExportImportFactory $export_factory
 
ExportRepository $export_repository
 
TestQuestionsRepository $test_questions_repository
 
GeneralQuestionPropertiesRepository $questionrepository
 
TestTopListRepository $toplist_repository
 
ilTestParticipantAccessFilterFactory $participant_access_filter_factory
 
QPLRequestDataCollector $qplrequest
 
TitleColumnsBuilder $title_builder
 
ilTestObjectiveOrientedContainer $objective_oriented_container
 
ContentStyle $content_style
 
Archives $archives
 

Detailed Description

Class ilObjTestGUI.

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m
Björn Heyser bheys.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

@ilCtrl_Calls ilObjTestGUI: ilObjCourseGUI, ilObjectMetaDataGUI, ilCertificateGUI, ilPermissionGUI @ilCtrl_Calls ilObjTestGUI: ilTestPlayerFixedQuestionSetGUI, ilTestPlayerRandomQuestionSetGUI @ilCtrl_Calls ilObjTestGUI: ilTestExpresspageObjectGUI, ilAssQuestionPageGUI @ilCtrl_Calls ilObjTestGUI: ilTestParticipantsGUI, ilTestResultsGUI @ilCtrl_Calls ilObjTestGUI: ilLearningProgressGUI, ILIAS\Test\Scoring\Marks\MarkSchemaGUI @ilCtrl_Calls ilObjTestGUI: ilTestEvaluationGUI @ilCtrl_Calls ilObjTestGUI: ilAssGenFeedbackPageGUI, ilAssSpecFeedbackPageGUI @ilCtrl_Calls ilObjTestGUI: ilInfoScreenGUI, ilObjectCopyGUI @ilCtrl_Calls ilObjTestGUI: ILIAS\Test\Presentation\TestScreenGUI @ilCtrl_Calls ilObjTestGUI: ilRepositorySearchGUI, ilTestExportGUI @ilCtrl_Calls ilObjTestGUI: assMultipleChoiceGUI, assClozeTestGUI, assMatchingQuestionGUI @ilCtrl_Calls ilObjTestGUI: assOrderingQuestionGUI, assImagemapQuestionGUI, assNumericGUI, assErrorTextGUI @ilCtrl_Calls ilObjTestGUI: ILIAS\Test\Scoring\Manual\TestScoringByQuestionGUI, ILIAS\Test\Scoring\Manual\TestScoringByParticipantGUI @ilCtrl_Calls ilObjTestGUI: assTextSubsetGUI, assOrderingHorizontalGUI @ilCtrl_Calls ilObjTestGUI: assSingleChoiceGUI, assFileUploadGUI, assTextQuestionGUI @ilCtrl_Calls ilObjTestGUI: assKprimChoiceGUI, assLongMenuGUI @ilCtrl_Calls ilObjTestGUI: ilEditClipboardGUI @ilCtrl_Calls ilObjTestGUI: ILIAS\Test\Settings\MainSettings\SettingsMainGUI, ILIAS\Test\Settings\ScoreReporting\SettingsScoringGUI @ilCtrl_Calls ilObjTestGUI: ilCommonActionDispatcherGUI @ilCtrl_Calls ilObjTestGUI: ilTestFixedQuestionSetConfigGUI, ilTestRandomQuestionSetConfigGUI @ilCtrl_Calls ilObjTestGUI: ilAssQuestionFeedbackEditingGUI, ilLocalUnitConfigurationGUI, assFormulaQuestionGUI @ilCtrl_Calls ilObjTestGUI: ilTestPassDetailsOverviewTableGUI @ilCtrl_Calls ilObjTestGUI: ilTestCorrectionsGUI @ilCtrl_Calls ilObjTestGUI: ilTestSettingsChangeConfirmationGUI @ilCtrl_Calls ilObjTestGUI: ilTestSkillAdministrationGUI @ilCtrl_Calls ilObjTestGUI: ilAssQuestionPreviewGUI @ilCtrl_Calls ilObjTestGUI: ilTestQuestionBrowserTableGUI, ilTestInfoScreenToolbarGUI, ilLTIProviderObjectSettingGUI @ilCtrl_Calls ilObjTestGUI: ilTestPageGUI

\

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

Member Function Documentation

◆ _goto()

static ilObjTestGUI::_goto (   $target)
static

Redirect script to call a test with the test reference id.

Parameters
integer$a_targetThe reference id of the test @access public

Definition at line 2442 of file class.ilObjTestGUI.php.

2443 {
2444 global $DIC;
2445 $main_tpl = $DIC->ui()->mainTemplate();
2446 $ilAccess = $DIC['ilAccess'];
2447 $ilErr = $DIC['ilErr'];
2448 $lng = $DIC['lng'];
2449
2450 if ($ilAccess->checkAccess('read', '', (int) $target)
2451 || $ilAccess->checkAccess('visible', '', (int) $target)) {
2452 $DIC->ctrl()->setParameterByClass(self::class, 'ref_id', (int) $target);
2453 $DIC->ctrl()->redirectByClass(
2454 [
2455 ilRepositoryGUI::class,
2456 ilObjTestGUI::class,
2457 TestScreenGUI::class
2458 ],
2459 TestScreenGUI::DEFAULT_CMD
2460 );
2461 } elseif ($ilAccess->checkAccess('read', '', ROOT_FOLDER_ID)) {
2462 $main_tpl->setOnScreenMessage('info', sprintf(
2463 $lng->txt('msg_no_perm_read_item'),
2465 ), true);
2467 }
2468
2469 $ilErr->raiseError($lng->txt('msg_no_perm_read_lm'), $ilErr->FATAL);
2470 }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
ilLanguage $lng
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
const ROOT_FOLDER_ID
Definition: constants.php:32
$ilErr
Definition: raiseError.php:33
global $DIC
Definition: shib_login.php:26

References $DIC, $ilErr, $lng, ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), and ROOT_FOLDER_ID.

Referenced by ILIAS\StaticURL\Handler\LegacyGotoHandler\handle().

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

◆ addDefaultsObject()

ilObjTestGUI::addDefaultsObject ( )

Adds the defaults of this test to the defaults.

Definition at line 2146 of file class.ilObjTestGUI.php.

2146 : void
2147 {
2148 $this->protectByWritePermission();
2149
2150 $name = $this->testrequest->strVal('name');
2151 if ($name !== '') {
2152 $this->getTestObject()->addDefaults($name);
2153 } else {
2154 $this->tpl->setOnScreenMessage('info', $this->lng->txt('tst_defaults_enter_name'));
2155 }
2156 $this->defaultsObject();
2157 }
defaultsObject()
Displays the settings page for test defaults.

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjTestGUI::addLocatorItems ( )

should be overwritten to add object specific items (repository items are preloaded)

Reimplemented from ilObjectGUI.

Definition at line 2320 of file class.ilObjTestGUI.php.

2320 : void
2321 {
2322 switch ($this->ctrl->getCmd()) {
2323 case "run":
2324 case "infoScreen":
2325 case "redirectToInfoScreen":
2326 case "start":
2327 case "resume":
2328 case "previous":
2329 case "next":
2330 case "summary":
2331 case "finishTest":
2332 case "outCorrectSolution":
2333 case "showAnswersOfUser":
2334 case "outUserResultsOverview":
2335 case "backFromSummary":
2336 case "show_answers":
2337 case "setsolved":
2338 case "resetsolved":
2339 case "outTestSummary":
2340 case "outQuestionSummary":
2341 case "gotoQuestion":
2342 case "selectImagemapRegion":
2343 case "confirmSubmitAnswers":
2344 case "finalSubmission":
2345 case "postpone":
2346 case "outUserPassDetails":
2347 case "checkPassword":
2348 $this->locator->addItem(
2349 $this->getTestObject()->getTitle(),
2350 $this->ctrl->getLinkTargetByClass(
2351 [self::class, TestScreenGUI::class],
2352 TestScreenGUI::DEFAULT_CMD
2353 ),
2354 '',
2355 $this->testrequest->getRefId()
2356 );
2357 break;
2358 case "eval_stat":
2359 case "evalAllUsers":
2360 case "evalUserDetail":
2361 $this->locator->addItem(
2362 $this->getTestObject()->getTitle(),
2363 $this->ctrl->getLinkTarget($this, 'eval_stat'),
2364 '',
2365 $this->testrequest->getRefId()
2366 );
2367 break;
2368 case "importFile":
2369 case "cloneAll":
2370 case "importVerifiedFile":
2371 case "cancelImport":
2372 break;
2373 default:
2374 $this->locator->addItem(
2375 $this->getTestObject()->getTitle(),
2376 $this->ctrl->getLinkTargetByClass(
2377 [self::class, TestScreenGUI::class],
2378 TestScreenGUI::DEFAULT_CMD
2379 ),
2380 '',
2381 $this->testrequest->getRefId()
2382 );
2383 break;
2384 }
2385 }

References ILIAS\Repository\ctrl(), ILIAS\GlobalScreen\Scope\Footer\Factory\getTitle(), and ILIAS\Repository\locator().

+ Here is the call graph for this function:

◆ addPostCreationTasksToQuestionGUI()

ilObjTestGUI::addPostCreationTasksToQuestionGUI ( assQuestionGUI  $question_gui)
private

Definition at line 1114 of file class.ilObjTestGUI.php.

1116 : assQuestionGUI {
1117 if ($this->testrequest->isset('move_after_question_with_id')) {
1118 $question_gui->setMoveAfterQuestionId(
1119 $this->testrequest->int('move_after_question_with_id')
1120 );
1121 }
1122
1123 if ($this->testrequest->isset('pool_title')) {
1124 $question_gui->setCopyToNewPoolOnSave(
1125 $this->testrequest->strVal('pool_title')
1126 );
1127 }
1128
1129 if ($this->testrequest->isset('pool_ref')) {
1130 $question_gui->setCopyToExistingPoolOnSave(
1131 $this->testrequest->int('pool_ref')
1132 );
1133 }
1134 return $question_gui;
1135 }
setMoveAfterQuestionId(?int $question_id)
setCopyToNewPoolOnSave(?string $pool_title)
setCopyToExistingPoolOnSave(?int $pool_ref_id)

References assQuestionGUI\setMoveAfterQuestionId().

+ Here is the call graph for this function:

◆ addQuestion()

ilObjTestGUI::addQuestion ( )
private

Definition at line 1855 of file class.ilObjTestGUI.php.

1855 : void
1856 {
1857 $selected_array = [$this->testrequest->int('add')];
1858 $total = $this->getTestObject()->evalTotalPersons();
1859 if ($total > 0) {
1860 // the test was executed previously
1861 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('test_has_datasets_warning_page_view'));
1862 $this->showQuestionsObject();
1863 return;
1864 }
1865 $this->tpl->setOnScreenMessage('info', $this->lng->txt('tst_insert_questions'));
1866 $this->insertQuestionsObject($selected_array);
1867 }
insertQuestionsObject(?array $selected_array=null)

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ addQuestionTitleToObjectTitle()

ilObjTestGUI::addQuestionTitleToObjectTitle ( string  $question_title)
private

Definition at line 1042 of file class.ilObjTestGUI.php.

1042 : void
1043 {
1044 $this->tpl->setTitle(
1045 $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
1046 "{$this->getTestObject()->getTitle()}: {$question_title}"
1047 )
1048 );
1049 }

References ILIAS\Repository\refinery().

Referenced by executeCommand().

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

◆ afterSave()

ilObjTestGUI::afterSave ( ilObject  $new_object)

save object @access public

Reimplemented from ilObjectGUI.

Definition at line 1411 of file class.ilObjTestGUI.php.

1411 : void
1412 {
1413 $info = '';
1414 $new_object->saveToDb();
1415
1416 $test_def_id = $this->getSelectedPersonalDefaultsSettingsFromForm();
1417 if ($test_def_id !== null
1418 && ($defaults = $new_object->getTestDefaults($test_def_id)) !== null) {
1419 $info = $new_object->applyDefaults($defaults);
1420 }
1421
1422 $new_object->saveToDb();
1423
1424 if ($new_object->getTestLogger()->isLoggingEnabled()) {
1425 $new_object->getTestLogger()->logTestAdministrationInteraction(
1426 $new_object->getTestLogger()->getInteractionFactory()->buildTestAdministrationInteraction(
1427 $this->getRefId(),
1428 $this->user->getId(),
1429 TestAdministrationInteractionTypes::NEW_TEST_CREATED,
1430 []
1431 )
1432 );
1433 }
1434
1435 if ($info === '') {
1436 $this->tpl->setOnScreenMessage('success', $this->lng->txt('object_added'), true);
1437 } else {
1438 $this->tpl->setOnScreenMessage('info', $this->lng->txt($info), true);
1439 }
1440 $this->ctrl->setParameter($this, 'ref_id', $new_object->getRefId());
1441 $this->ctrl->redirectByClass(SettingsMainGUI::class);
1442 }
getSelectedPersonalDefaultsSettingsFromForm()
$info
Definition: entry_point.php:21

References $info, ILIAS\Repository\ctrl(), ilObject\getRefId(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ applyDefaultsObject()

ilObjTestGUI::applyDefaultsObject (   $confirmed = false)

Applies the selected test defaults.

Definition at line 2054 of file class.ilObjTestGUI.php.

2054 : void
2055 {
2056 $this->protectByWritePermission();
2057
2058 $defaults_id = $this->testrequest->retrieveArrayOfIntsFromPost('chb_defaults');
2059 if ($defaults_id === []) {
2060 $this->tpl->setOnScreenMessage('info', $this->lng->txt('tst_defaults_apply_select_one'));
2061 $this->defaultsObject();
2062 return;
2063 }
2064
2065 // do not apply if user datasets exist
2066 if ($this->getTestObject()->evalTotalPersons() > 0
2067 || ($defaults = $this->getTestObject()->getTestDefaults($defaults_id[0])) === null) {
2068 $this->tpl->setOnScreenMessage('info', $this->lng->txt('tst_defaults_apply_not_possible'));
2069 $this->defaultsObject();
2070 return;
2071 }
2072
2073 $default_settings = unserialize(
2074 $defaults['defaults'],
2075 ['allowed_classes' => [DateTimeImmutable::class]]
2076 );
2077
2078 if (isset($default_settings['isRandomTest'])) {
2079 if ($default_settings['isRandomTest']) {
2080 $new_question_set_type = ilObjTest::QUESTION_SET_TYPE_RANDOM;
2081 $this->getTestObject()->setQuestionSetType(ilObjTest::QUESTION_SET_TYPE_RANDOM);
2082 } else {
2083 $new_question_set_type = ilObjTest::QUESTION_SET_TYPE_FIXED;
2084 $this->getTestObject()->setQuestionSetType(ilObjTest::QUESTION_SET_TYPE_FIXED);
2085 }
2086 } elseif (isset($default_settings['questionSetType'])) {
2087 $new_question_set_type = $default_settings['questionSetType'];
2088 }
2089 $old_question_set_type = $this->getTestObject()->getQuestionSetType();
2090 $question_set_type_setting_switched = ($old_question_set_type != $new_question_set_type);
2091
2092 $old_question_set_config = $this->test_question_set_config_factory->getQuestionSetConfig();
2093
2094 switch (true) {
2095 case !$question_set_type_setting_switched:
2096 case !$old_question_set_config->doesQuestionSetRelatedDataExist():
2097 case $confirmed:
2098
2099 break;
2100
2101 default:
2102
2103 $confirmation = new ilTestSettingsChangeConfirmationGUI($this->testrequest, $this->getTestObject());
2104
2105 $confirmation->setFormAction($this->ctrl->getFormAction($this));
2106 $confirmation->setCancel($this->lng->txt('cancel'), 'defaults');
2107 $confirmation->setConfirm($this->lng->txt('confirm'), 'confirmedApplyDefaults');
2108
2109 $confirmation->setOldQuestionSetType($this->getTestObject()->getQuestionSetType());
2110 $confirmation->setNewQuestionSetType($new_question_set_type);
2111 $confirmation->setQuestionLossInfoEnabled(false);
2112 $confirmation->build();
2113
2114 $confirmation->populateParametersFromPost();
2115
2116 $this->tpl->setContent($this->ctrl->getHTML($confirmation));
2117
2118 return;
2119 }
2120
2121 if ($question_set_type_setting_switched && !$this->getTestObject()->getOfflineStatus()) {
2122 $this->getTestObject()->setOfflineStatus(true);
2123 $info = $this->lng->txt('tst_set_offline_due_to_switched_question_set_type_setting');
2124 $this->tpl->setOnScreenMessage('info', $info, true);
2125 }
2126
2127 $info = $this->getTestObject()->applyDefaults($defaults);
2128 if ($info === '') {
2129 $this->tpl->setOnScreenMessage('success', $this->lng->txt('tst_defaults_applied'), true);
2130 } else {
2131 $this->tpl->setOnScreenMessage('info', $this->lng->txt($info), true);
2132 }
2133
2134
2135
2136 if ($question_set_type_setting_switched && $old_question_set_config->doesQuestionSetRelatedDataExist()) {
2137 $old_question_set_config->removeQuestionSetRelatedData();
2138 }
2139
2140 $this->ctrl->redirect($this, 'defaults');
2141 }
const QUESTION_SET_TYPE_RANDOM
const QUESTION_SET_TYPE_FIXED

References $info, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilObjTest\QUESTION_SET_TYPE_FIXED, and ilObjTest\QUESTION_SET_TYPE_RANDOM.

+ Here is the call graph for this function:

◆ backToRepositoryObject()

ilObjTestGUI::backToRepositoryObject ( )

Definition at line 1454 of file class.ilObjTestGUI.php.

1455 {
1456 $path = $this->tree->getPathFull($this->getTestObject()->getRefID());
1457 ilUtil::redirect($this->getReturnLocation("cancel", "./ilias.php?baseClass=ilRepositoryGUI&cmd=frameset&ref_id=" . $path[count($path) - 2]["child"]));
1458 }
getReturnLocation(string $cmd, string $default_location="")
Get return location for command (command is method name without "Object", e.g.
static redirect(string $a_script)
$path
Definition: ltiservices.php:30

References $path, and ilUtil\redirect().

+ Here is the call graph for this function:

◆ buildInputEditingType()

ilObjTestGUI::buildInputEditingType ( )
private

Definition at line 1750 of file class.ilObjTestGUI.php.

1750 : Input
1751 {
1752 if (!$this->getTestObject()->getGlobalSettings()->isPageEditorEnabled()) {
1753 return $this->ui_factory->input()->field()->hidden()->withValue(
1755 );
1756 }
1757
1758 return $this->ui_factory->input()->field()->radio($this->lng->txt('tst_add_quest_cont_edit_mode'))
1759 ->withOption(
1761 $this->lng->txt('tst_add_quest_cont_edit_mode_IPE'),
1762 $this->lng->txt('tst_add_quest_cont_edit_mode_IPE_info')
1763 )->withOption(
1765 $this->lng->txt('tst_add_quest_cont_edit_mode_RTE'),
1766 $this->lng->txt('tst_add_quest_cont_edit_mode_RTE_info')
1767 )
1769 }
const ADDITIONAL_CONTENT_EDITING_MODE_RTE
const ADDITIONAL_CONTENT_EDITING_MODE_IPE
This describes commonalities between all inputs.
Definition: Input.php:47
withValue($value)
Get an input like this with another value displayed on the client side.

References assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_IPE, assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_RTE, ILIAS\Repository\lng(), and ILIAS\UI\Component\Input\Input\withValue().

+ Here is the call graph for this function:

◆ buildInputPoolSelection()

ilObjTestGUI::buildInputPoolSelection ( )
private

Definition at line 1771 of file class.ilObjTestGUI.php.

1772 {
1773 $f = $this->ui_factory->input()->field();
1774 $kt = $this->refinery->kindlyTo();
1775
1776 $trafo = $this->refinery->custom()->transformation(
1777 static function ($values) use ($kt): array {
1778 $return['qpl_type'] = $kt->int()->transform($values[0]);
1779 if ($return['qpl_type'] === self::QUESTION_CREATION_POOL_SELECTION_NO_POOL) {
1780 return $return;
1781 }
1782 if ($return['qpl_type'] === self::QUESTION_CREATION_POOL_SELECTION_NEW_POOL) {
1783 return $return + ['title' => $kt->string()->transform($values[1][0])];
1784 }
1785 return $return + ['pool_ref_id' => $kt->int()->transform($values[1][0])];
1786 }
1787 );
1788
1789 $questionpools = ilObjQuestionPool::_getAvailableQuestionpools(false, false, true, false, false, "write");
1790 $pools_data = [];
1791 foreach ($questionpools as $key => $p) {
1792 $pools_data[$key] = $p['title'];
1793 }
1794
1795 $inputs = [
1796 self::QUESTION_CREATION_POOL_SELECTION_NO_POOL => $f->group([], $this->lng->txt('assessment_no_pool')),
1797 self::QUESTION_CREATION_POOL_SELECTION_EXISTING_POOL => $f->group(
1798 [$f->select($this->lng->txt('select_questionpool'), $pools_data)],
1799 $this->lng->txt('assessment_existing_pool')
1800 ),
1801 self::QUESTION_CREATION_POOL_SELECTION_NEW_POOL => $f->group(
1802 [$f->text($this->lng->txt('name'))],
1803 $this->lng->txt('assessment_new_pool')
1804 )
1805 ];
1806
1807 return $f->switchableGroup(
1808 $inputs,
1809 $this->lng->txt('assessment_pool_selection')
1810 )->withAdditionalTransformation($trafo)
1811 ->withRequired(true)
1812 ->withValue(1);
1813 }
static _getAvailableQuestionpools(bool $use_object_id=false, bool $equal_points=false, bool $could_be_offline=false, bool $showPath=false, bool $with_questioncount=false, string $permission='read', int $usr_id=0)
Returns the available question pools for the active user.
This describes switchable group inputs.

References Vendor\Package\$f, ILIAS\UI\Implementation\Component\Input\$inputs, ilObjQuestionPool\_getAvailableQuestionpools(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Refinery\transform().

+ Here is the call graph for this function:

◆ buildInputPosition()

ilObjTestGUI::buildInputPosition ( array  $questions)
private

Definition at line 1737 of file class.ilObjTestGUI.php.

1737 : Select
1738 {
1739 $options = [0 => $this->lng->txt('first')];
1740 foreach ($questions as $key => $title) {
1741 $options[$key] = $this->lng->txt('behind') . ' ' . $title
1742 . ' [' . $this->lng->txt('question_id_short') . ': ' . $key . ']';
1743 }
1744 return $this->ui_factory->input()->field()->select(
1745 $this->lng->txt('position'),
1746 $options
1747 )->withAdditionalTransformation($this->refinery->kindlyTo()->int());
1748 }
This describes select field.
Definition: Select.php:29

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

+ Here is the call graph for this function:

◆ buildInputQuestionType()

ilObjTestGUI::buildInputQuestionType ( )
private

Definition at line 1723 of file class.ilObjTestGUI.php.

1723 : Select
1724 {
1725 $question_types = (new ilObjQuestionPool())->getQuestionTypes(false, true, false);
1726 $options = [];
1727 foreach ($question_types as $label => $data) {
1728 $options[$data['question_type_id']] = $label;
1729 }
1730
1731 return $this->ui_factory->input()->field()->select(
1732 $this->lng->txt('question_type'),
1733 $options
1734 )->withRequired(true);
1735 }

References $data, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ buildQuestionCreationForm()

ilObjTestGUI::buildQuestionCreationForm ( )
private

Definition at line 1693 of file class.ilObjTestGUI.php.

1693 : Form
1694 {
1695 $inputs['question_type'] = $this->buildInputQuestionType();
1696 $questions = $this->getTestObject()->getQuestionTitlesAndIndexes();
1697 if ($questions !== []) {
1698 $inputs['position'] = $this->buildInputPosition($questions);
1699 }
1700
1701 $inputs['editing_type'] = $this->buildInputEditingType();
1702
1703 if ($inputs['editing_type'] instanceof Radio) {
1704 $sub_screen_id[] = 'editMode';
1705 }
1706
1707 $sub_screen_id[] = 'poolSelect';
1708
1709 $inputs['pool_selection'] = $this->buildInputPoolSelection();
1710
1711 $section = [
1712 $this->ui_factory->input()->field()->section($inputs, $this->lng->txt('ass_create_question'))
1713 ];
1714
1715 $form = $this->ui_factory->input()->container()->form()->standard(
1716 $this->ctrl->getFormAction($this, 'createQuestion'),
1717 $section
1718 )->withSubmitLabel($this->lng->txt('create'));
1719
1720 return $form;
1721 }
buildInputPosition(array $questions)
This describes commonalities between all forms.
Definition: Form.php:33
This is what a radio-input looks like.
Definition: Radio.php:29

References ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ cancelCreateQuestionObject()

ilObjTestGUI::cancelCreateQuestionObject ( )

Definition at line 1653 of file class.ilObjTestGUI.php.

1653 : void
1654 {
1655 $this->ctrl->redirect($this, self::SHOW_QUESTIONS_CMD);
1656 }

References ILIAS\Repository\ctrl().

Referenced by ilObjTestGUITest\testCancelCreateQuestionObject().

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

◆ certificateObject()

ilObjTestGUI::certificateObject ( )

Shows the certificate editor.

Definition at line 2394 of file class.ilObjTestGUI.php.

2395 {
2396 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
2397
2398 $guiFactory = new ilCertificateGUIFactory();
2399 $output_gui = $guiFactory->create($this->getTestObject());
2400
2401 $output_gui->certificateEditor();
2402 }

◆ confirmedApplyDefaultsObject()

ilObjTestGUI::confirmedApplyDefaultsObject ( )

Definition at line 2043 of file class.ilObjTestGUI.php.

2044 {
2045 $this->protectByWritePermission();
2046
2047 $this->applyDefaultsObject(true);
2048 return;
2049 }
applyDefaultsObject($confirmed=false)
Applies the selected test defaults.

◆ copyAndLinkQuestionsToPoolObject()

ilObjTestGUI::copyAndLinkQuestionsToPoolObject ( ?int  $ref_id = null,
array  $question_ids = [] 
)

Definition at line 2507 of file class.ilObjTestGUI.php.

2510 {
2511
2512 $ref_id = $ref_id ?? $this->testrequest->int('sel_qpl');
2513 if ($ref_id === null
2514 || $ref_id === 0) {
2515 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("questionpool_not_selected"));
2516 $this->showQuestionsObject();
2517 return;
2518 }
2519
2520 $qpl_id = $this->obj_data_cache->lookupObjId($ref_id);
2521
2522
2523 if ($question_ids === []) {
2524 $question_ids = $this->testrequest->getQuestionIds();
2525 $question_id = $this->testrequest->getQuestionId();
2526 if ($question_ids === [] && $question_id !== 0) {
2527 $question_ids = [$question_id];
2528 }
2529 }
2530
2531 if ($question_ids === []) {
2532 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("tst_no_question_selected_for_moving_to_qpl"));
2533 $this->ctrl->redirect($this, 'questions');
2534 }
2535
2536 $result = $this->copyQuestionsToPool($question_ids, $qpl_id);
2537
2538 foreach ($result->ids as $oldId => $newId) {
2539 $questionInstance = assQuestion::instantiateQuestion($oldId);
2540
2541 $original_question_id = $questionInstance->getOriginalId();
2542 if ($original_question_id !== null
2543 && $this->test_questions_repository->originalQuestionExists($original_question_id)) {
2544 $oldOriginal = assQuestion::instantiateQuestion($original_question_id);
2545 $oldOriginal->delete($oldOriginal->getId());
2546 }
2547 assQuestion::saveOriginalId($questionInstance->getId(), $newId);
2548 }
2549
2550 $this->tpl->setOnScreenMessage('success', $this->lng->txt('tst_qst_added_to_pool_' . (count($result->ids) > 1 ? 'p' : 's')), true);
2551 $this->ctrl->redirect($this, self::SHOW_QUESTIONS_CMD);
2552 }
static saveOriginalId(int $questionId, int $originalId)
static instantiateQuestion(int $question_id)
copyQuestionsToPool(array $question_ids, int $qpl_id)

References $ref_id, ILIAS\Repository\ctrl(), assQuestion\instantiateQuestion(), ILIAS\Repository\lng(), and assQuestion\saveOriginalId().

+ Here is the call graph for this function:

◆ copyQuestionsToPool()

ilObjTestGUI::copyQuestionsToPool ( array  $question_ids,
int  $qpl_id 
)
Parameters
<int>array $question_ids

Definition at line 2482 of file class.ilObjTestGUI.php.

2482 : stdClass
2483 {
2484 $target_pool = new ilObjQuestionPool($qpl_id, false);
2485 $new_ids = [];
2486 foreach ($question_ids as $q_id) {
2487 $new_id = $this->copyQuestionToPool(assQuestion::instantiateQuestionGUI($q_id), $target_pool);
2488 $new_ids[$q_id] = $new_id;
2489 }
2490
2491 $result = new stdClass();
2492 $result->ids = $new_ids;
2493 $result->qpoolid = $qpl_id;
2494
2495 return $result;
2496 }
copyQuestionToPool(assQuestionGUI $source_question_gui, ilObjQuestionPool $target_pool)

◆ copyQuestionsToPoolObject()

ilObjTestGUI::copyQuestionsToPoolObject ( )

Definition at line 2472 of file class.ilObjTestGUI.php.

2473 {
2474 $this->copyQuestionsToPool($this->testrequest->raw('q_id'), $this->testrequest->raw('sel_qpl'));
2475 $this->ctrl->redirect($this, self::SHOW_QUESTIONS_CMD);
2476 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ copyQuestionToPool()

ilObjTestGUI::copyQuestionToPool ( assQuestionGUI  $source_question_gui,
ilObjQuestionPool  $target_pool 
)

Definition at line 2498 of file class.ilObjTestGUI.php.

2498 : int
2499 {
2500 $new_title = $target_pool->appendCounterToQuestionTitleIfNecessary(
2501 $source_question_gui->getObject()->getTitle()
2502 );
2503
2504 return $source_question_gui->getObject()->createNewOriginalFromThisDuplicate($target_pool->getId(), $new_title);
2505 }
appendCounterToQuestionTitleIfNecessary(string $title)

References ilObjQuestionPool\appendCounterToQuestionTitleIfNecessary(), ilObject\getId(), and assQuestionGUI\getObject().

+ Here is the call graph for this function:

◆ copyToQuestionpoolObject()

ilObjTestGUI::copyToQuestionpoolObject ( )

Definition at line 2554 of file class.ilObjTestGUI.php.

2555 {
2556 $this->createQuestionpoolTargetObject('copyQuestionsToPool');
2557 }
createQuestionpoolTargetObject(string $cmd)
Called when a new question should be created from a test Important: $cmd may be overwritten if no que...

◆ createQuestionFormObject()

ilObjTestGUI::createQuestionFormObject ( ?Form  $form = null)

Definition at line 1673 of file class.ilObjTestGUI.php.

1673 : void
1674 {
1675 $this->protectByWritePermission();
1676
1677 $this->tabs_manager->getQuestionsSubTabs();
1678 $this->tabs_manager->activateSubTab(TabsManager::SUBTAB_ID_QST_LIST_VIEW);
1679
1680 $sub_screen_id = ['createQuestion'];
1681
1682 $this->tabs_manager->activateTab(TabsManager::TAB_ID_QUESTIONS);
1683 $this->help->setScreenId('assQuestions');
1684 $this->help->setSubScreenId(implode('_', $sub_screen_id));
1685
1686 $this->tpl->setContent(
1687 $this->ui_renderer->render(
1688 $form ?? $this->buildQuestionCreationForm()
1689 )
1690 );
1691 }

References ILIAS\Repository\help().

+ Here is the call graph for this function:

◆ createQuestionPool()

ilObjTestGUI::createQuestionPool (   $name = "dummy",
  $description = "" 
)

Definition at line 1589 of file class.ilObjTestGUI.php.

1590 {
1591 $parent_ref = $this->tree->getParentId($this->getTestObject()->getRefId());
1592 $qpl = new ilObjQuestionPool();
1593 $qpl->setType("qpl");
1594 $qpl->setTitle($name);
1595 $qpl->setDescription($description);
1596 $qpl->create();
1597 $qpl->createReference();
1598 $qpl->putInTree($parent_ref);
1599 $qpl->setPermissions($parent_ref);
1600 $qpl->getObjectProperties()->storePropertyIsOnline($qpl->getObjectProperties()->getPropertyIsOnline()->withOnline()); // must be online to be available
1601 $qpl->saveToDb();
1602 return $qpl;
1603 }

◆ createQuestionPoolAndCopyObject()

ilObjTestGUI::createQuestionPoolAndCopyObject ( )

Definition at line 2559 of file class.ilObjTestGUI.php.

2560 {
2561 if (!$this->access->checkAccess('write', '', $this->object->getRefId())
2562 || !$this->checkPermissionBool('create', '', 'qpl')) {
2564 }
2565
2566 if ($this->testrequest->raw('title')) {
2567 $title = $this->testrequest->raw('title');
2568 } else {
2569 $title = $this->testrequest->raw('txt_qpl');
2570 }
2571
2572 if (!$title) {
2573 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('questionpool_not_entered'));
2574 $this->createQuestionpoolTargetObject('createQuestionPoolAndCopy');
2575 return;
2576 }
2577
2578 $question_pool = $this->createQuestionPool($title, $this->testrequest->raw('description'));
2579 $_REQUEST['sel_qpl'] = $question_pool->getRefId();
2580
2582 }
createQuestionPool($name="dummy", $description="")
copyAndLinkQuestionsToPoolObject(?int $ref_id=null, array $question_ids=[])

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

+ Here is the call graph for this function:

◆ createQuestionpoolTargetObject()

ilObjTestGUI::createQuestionpoolTargetObject ( string  $cmd)

Called when a new question should be created from a test Important: $cmd may be overwritten if no question pool is available.

Definition at line 2588 of file class.ilObjTestGUI.php.

2588 : void
2589 {
2590 $this->protectByWritePermission();
2591
2592 $this->tabs_manager->getQuestionsSubTabs();
2593 $this->tabs_manager->activateSubTab(TabsManager::SUBTAB_ID_QST_LIST_VIEW);
2594
2595 $questionpools = $this->getTestObject()->getAvailableQuestionpools(
2596 false,
2597 false,
2598 false,
2599 true,
2600 false,
2601 'write'
2602 );
2603
2604 if ($questionpools === []) {
2605 $form = $this->getTargetQuestionpoolForm($questionpools, 'createQuestionPoolAndCopy');
2606 } else {
2607 $form = $this->getTargetQuestionpoolForm($questionpools, $cmd);
2608
2609 switch ($cmd) {
2610 case 'copyQuestionsToPool':
2611 break;
2612
2613 case 'copyAndLinkQuestionsToPool':
2614 $hidden = new ilHiddenInputGUI('link');
2615 $hidden->setValue('1');
2616 $form->addItem($hidden);
2617 break;
2618 }
2619 }
2620
2621 $this->tpl->setContent($form->getHTML());
2622 }
This class represents a hidden form property in a property form.
getTargetQuestionpoolForm($questionpools, string $cmd)

◆ defaultsObject()

ilObjTestGUI::defaultsObject ( )

Displays the settings page for test defaults.

Definition at line 2007 of file class.ilObjTestGUI.php.

2008 {
2009 $this->protectByWritePermission();
2010
2011 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
2012
2013 $this->toolbar->setFormAction($this->ctrl->getFormAction($this, 'addDefaults'));
2014 $this->toolbar->addFormButton($this->lng->txt('add'), 'addDefaults');
2015 $this->toolbar->addInputItem(new ilTextInputGUI($this->lng->txt('tst_defaults_defaults_of_test'), 'name'), true);
2016 $table = new ilTestPersonalDefaultSettingsTableGUI($this, 'defaults');
2017 $defaults = $this->getTestObject()->getAvailableDefaults();
2018 $table->setData($defaults);
2019 $this->tpl->setContent($table->getHTML());
2020 }
This class represents a text property in a property form.

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

+ Here is the call graph for this function:

◆ deleteDefaultsObject()

ilObjTestGUI::deleteDefaultsObject ( )

Deletes selected test defaults.

Definition at line 2025 of file class.ilObjTestGUI.php.

2026 {
2027 $this->protectByWritePermission();
2028
2029 $defaults_ids = $this->testrequest->retrieveArrayOfIntsFromPost('chb_defaults');
2030 if ($defaults_ids !== null && $defaults_ids !== []) {
2031 foreach ($defaults_ids as $test_default_id) {
2032 $this->getTestObject()->deleteDefaults($test_default_id);
2033 }
2034 } else {
2035 $this->tpl->setOnScreenMessage('info', $this->lng->txt('select_one'));
2036 }
2037 $this->defaultsObject();
2038 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ determineObjectiveOrientedContainer()

ilObjTestGUI::determineObjectiveOrientedContainer ( )
protected

Definition at line 2682 of file class.ilObjTestGUI.php.

2683 {
2684 if (!ilLOSettings::isObjectiveTest($this->ref_id)) {
2685 return;
2686 }
2687
2688 $path = $this->tree->getPathFull($this->ref_id);
2689
2690 while ($parent = array_pop($path)) {
2691 if ($parent['type'] === 'crs') {
2692 $container_ref_id = $parent['ref_id'];
2693 break;
2694 }
2695 }
2696
2697 $container_obj_id = ilObject2::_lookupObjId($container_ref_id);
2698
2699 $this->objective_oriented_container->setObjId($container_obj_id);
2700 $this->objective_oriented_container->setRefId($container_ref_id);
2701 }
static isObjectiveTest(int $a_trst_ref_id)
Check if test ref_id is used in an objective course.

References $path, ilObject\_lookupObjId(), and ilLOSettings\isObjectiveTest().

Referenced by executeCommand().

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

◆ download_paragraphObject()

ilObjTestGUI::download_paragraphObject ( )

download source code paragraph

Definition at line 1582 of file class.ilObjTestGUI.php.

1583 {
1584 $pg_obj = new ilAssQuestionPage($this->testrequest->raw("pg_id"));
1585 $pg_obj->sendParagraph($this->testrequest->raw("par_id"), $this->testrequest->raw("downloadtitle"));
1586 exit;
1587 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
exit

References exit.

◆ downloadFileObject()

ilObjTestGUI::downloadFileObject ( )

download file

Definition at line 1559 of file class.ilObjTestGUI.php.

1560 {
1561 $file = explode("_", $this->testrequest->raw("file_id"));
1562 $fileObj = new ilObjFile((int) $file[count($file) - 1], false);
1563 $fileObj->sendFile();
1564 exit;
1565 }
Class ilObjFile.

References exit.

◆ executeAfterQuestionCreationTasks()

ilObjTestGUI::executeAfterQuestionCreationTasks ( assQuestionGUI  $question_gui)
private

Definition at line 1150 of file class.ilObjTestGUI.php.

1150 : void
1151 {
1152 if ($this->getTestObject()->getQuestionSetType() === ilObjTest::QUESTION_SET_TYPE_FIXED
1153 && !in_array($question_gui->getObject()->getId(), $this->getTestObject()->getQuestions())) {
1154 $this->getTestObject()->insertQuestion($question_gui->getObject()->getId(), true);
1155 }
1156
1157 if ($question_gui->getMoveAfterQuestionId() !== null) {
1158 $this->getTestObject()->moveQuestions(
1159 [$question_gui->getObject()->getId()],
1160 $question_gui->getMoveAfterQuestionId() === 0
1161 ? $this->getTestObject()->getQuestions()[1]
1162 : $question_gui->getMoveAfterQuestionId(),
1163 $question_gui->getMoveAfterQuestionId() === 0 ? 0 : 1
1164 );
1165 $question_gui->setMoveAfterQuestionId(null);
1166 }
1167
1168 if ($question_gui->getCopyToExistingPoolOnSave() !== null) {
1169 $original_id = $this->copyQuestionToPool(
1170 $question_gui,
1172 );
1173 assQuestion::saveOriginalId($question_gui->getObject()->getId(), $original_id);
1174 $question_gui->setCopyToExistingPoolOnSave(null);
1175 }
1176
1177 if ($question_gui->getCopyToNewPoolOnSave() !== null) {
1178 $question_pool = $this->createQuestionPool($question_gui->getCopyToNewPoolOnSave());
1179 $original_id = $this->copyQuestionToPool(
1180 $question_gui,
1181 $question_pool
1182 );
1183 assQuestion::saveOriginalId($question_gui->getObject()->getId(), $original_id);
1184 $question_gui->setCopyToNewPoolOnSave(null);
1185 }
1186 }

References assQuestionGUI\getCopyToExistingPoolOnSave(), assQuestionGUI\getCopyToNewPoolOnSave(), assQuestionGUI\getMoveAfterQuestionId(), assQuestionGUI\getObject(), ilObjTest\QUESTION_SET_TYPE_FIXED, assQuestion\saveOriginalId(), assQuestionGUI\setCopyToExistingPoolOnSave(), assQuestionGUI\setCopyToNewPoolOnSave(), and assQuestionGUI\setMoveAfterQuestionId().

+ Here is the call graph for this function:

◆ executeAfterQuestionSaveTasks()

ilObjTestGUI::executeAfterQuestionSaveTasks ( assQuestionGUI  $question_gui)
private

Definition at line 1137 of file class.ilObjTestGUI.php.

1137 : void
1138 {
1139 if ($this->getTestObject()->getTestLogger()->isLoggingEnabled()) {
1140 $this->getTestObject()->getTestLogger()->logQuestionAdministrationInteraction(
1141 $question_gui->getObject()->toQuestionAdministrationInteraction(
1142 $this->getTestObject()->getTestLogger()->getAdditionalInformationGenerator(),
1143 $this->getTestObject()->getRefId(),
1144 TestQuestionAdministrationInteractionTypes::QUESTION_MODIFIED
1145 )
1146 );
1147 }
1148 }

References assQuestionGUI\getObject().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjTestGUI::executeCommand ( )

execute command

@skergomard 2024-10-21: I've moved this down here, to avoid errors when initializing async-modals and to avoid an unnecessary redirect on errors.

Reimplemented from ilObjectGUI.

Definition at line 249 of file class.ilObjTestGUI.php.

249 : void
250 {
251 $cmd = $this->ctrl->getCmd('testScreen');
252
253 $cmds_disabled_due_to_offline_status = [
254 'resumePlayer', 'resumePlayer', 'outUserResultsOverview', 'outUserListOfAnswerPasses'
255 ];
256
257 if (!$this->getCreationMode() && $this->object->getOfflineStatus() && in_array($cmd, $cmds_disabled_due_to_offline_status)) {
258 $cmd = 'infoScreen';
259 }
260
261 $next_class = $this->ctrl->getNextClass($this);
262
263 // add entry to navigation history
264 if (!$this->getCreationMode() &&
265 $this->access->checkAccess('read', '', $this->testrequest->getRefId())
266 ) {
267 $this->navigation_history->addItem(
268 $this->testrequest->getRefId(),
269 ilLink::_getLink($this->testrequest->getRefId(), 'tst'),
270 'tst',
271 );
272 }
273
275
276 switch ($next_class) {
277 case 'illtiproviderobjectsettinggui':
278 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
280 }
281 $this->prepareOutput();
282 $this->addHeaderAction();
283 $this->tabs_manager->getSettingsSubTabs();
284 $this->tabs_manager->activateTab('settings');
285 $this->tabs_manager->activateSubTab('lti_provider');
286 $lti_gui = new ilLTIProviderObjectSettingGUI($this->getTestObject()->getRefId());
287 $lti_gui->setCustomRolesForSelection($this->rbac_review->getLocalRoles($this->getTestObject()->getRefId()));
288 $lti_gui->offerLTIRolesForSelection(false);
289 $this->ctrl->forwardCommand($lti_gui);
290 break;
291
292 case 'iltestexportgui':
293 if (!$this->access->checkAccess('write', '', $this->ref_id)) {
295 }
296
297 $this->prepareOutput();
298 $this->addHeaderAction();
299 $this->tabs_manager->activateTab(TabsManager::TAB_ID_EXPORT);
300
301 $selected_files = [];
302 if ($this->testrequest->isset('file') && $this->testrequest->raw('file')) {
303 $selected_files = $this->testrequest->raw('file');
304 }
305
306 if (is_string($selected_files)) {
307 $selected_files = [$selected_files];
308 }
309
310 $export_gui = new ilTestExportGUI(
311 $this,
312 $this->db,
313 $this->obj_data_cache,
314 $this->user,
315 $this->ui_factory,
316 $this->ui_renderer,
317 $this->irss,
318 $this->request,
319 $this->export_repository,
320 $this->temp_file_system,
321 $this->participant_access_filter_factory,
323 $selected_files,
324 $this->questionrepository,
325 $this->testrequest
326 );
327 $this->ctrl->forwardCommand($export_gui);
328 break;
329
330 case strtolower(ilInfoScreenGUI::class):
331 if (
332 !$this->access->checkAccess('read', '', $this->testrequest->getRefId())
333 && !$this->access->checkAccess('visible', '', $this->testrequest->getRefId())
334 ) {
336 }
337
338 $this->prepareOutput();
339 $this->addHeaderAction();
340 $this->forwardToInfoScreen();
341 break;
342
343 case strtolower(TestScreenGUI::class):
344 if (!$this->access->checkAccess('read', '', $this->testrequest->getRefId()) && !$this->access->checkAccess('visible', '', $this->testrequest->getRefId())) {
346 }
347 $this->prepareOutput();
348 $this->addHeaderAction();
349 $this->ctrl->forwardCommand($this->getTestScreenGUIInstance());
350 break;
351
352 case 'ilobjectmetadatagui':
353 if (!$this->access->checkAccess('write', '', $this->getTestObject()->getRefId())) {
355 }
356
357 $this->prepareOutput();
358 $this->addHeaderAction();
359 $this->tabs_manager->activateTab(TabsManager::TAB_ID_META_DATA);
360 $md_gui = new ilObjectMetaDataGUI($this->getTestObject());
361 $this->ctrl->forwardCommand($md_gui);
362 break;
363
364 case strtolower(ilTestParticipantsGUI::class):
365 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
367 }
368
369 $gui = new ilTestParticipantsGUI(
370 $this->getTestObject(),
371 $this->user,
373 $this->test_question_set_config_factory->getQuestionSetConfig(),
374 $this->access,
375 $this->test_access,
376 $this->tpl,
377 $this->ui_factory,
378 $this->ui_renderer,
379 $this->ui_service,
380 $this->data_factory,
381 $this->lng,
382 $this->ctrl,
383 $this->refinery,
384 $this->db,
385 $this->tabs_manager,
386 $this->toolbar,
387 $this->component_factory,
388 $this->export_factory,
389 $this->testrequest,
390 $this->response_handler,
391 $this->participant_repository,
392 $this->results_data_factory,
393 $this->results_presentation_factory,
394 $this->test_pass_result_repository
395 );
396
397 $this->ctrl->forwardCommand($gui);
398
404 $this->prepareOutput();
405 $this->addHeaderAction();
406 $this->tabs_manager->activateTab(TabsManager::TAB_ID_PARTICIPANTS);
407
408 break;
409
410 case 'iltestresultsgui':
411 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
413 }
414 $this->prepareOutput();
415 $this->addHeaderAction();
416
417 $gui = new ilTestResultsGUI(
418 $this->getTestObject(),
419 $this->ctrl,
420 $this->test_access,
421 $this->db,
422 $this->refinery,
423 $this->user,
424 $this->lng,
425 $this->getTestObject()->getTestlogger(),
426 $this->component_repository,
427 $this->tabs_manager,
428 $this->toolbar,
429 $this->tpl,
430 $this->ui_factory,
431 $this->ui_renderer,
432 $this->skills_service,
433 $this->questionrepository,
434 $this->toplist_repository,
435 $this->testrequest,
436 $this->http,
437 $this->data_factory,
438 $this->test_session_factory->getSession(),
439 $this->getObjectiveOrientedContainer()
440 );
441
442 $this->ctrl->forwardCommand($gui);
443 break;
444
445 case "iltestplayerfixedquestionsetgui":
446 if (
447 $cmd !== 'autosave' &&
448 (!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))
449 ) {
451 }
453 if (!$this->getTestObject()->getKioskMode()) {
454 $this->prepareOutput();
455 }
457 $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
458 $this->ctrl->forwardCommand($gui);
459 break;
460
461 case "iltestplayerrandomquestionsetgui":
462 if (
463 $cmd !== 'autosave' &&
464 (!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))
465 ) {
467 }
469 if (!$this->getTestObject()->getKioskMode()) {
470 $this->prepareOutput();
471 }
473 $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
474 $this->ctrl->forwardCommand($gui);
475 break;
476
477 case "iltestevaluationgui":
478 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
480 }
481 $this->forwardToEvaluationGUI();
482 break;
483
484 case "iltestservicegui":
485 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
487 }
488 $this->prepareOutput();
489 $this->addHeaderAction();
490 $serviceGUI = new ilTestServiceGUI($this->getTestObject());
491 $this->ctrl->forwardCommand($serviceGUI);
492 break;
493
494 case 'ilpermissiongui':
495 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
497 }
498 $this->prepareOutput();
499 $this->addHeaderAction();
500 $this->tabs_manager->activateTab(TabsManager::TAB_ID_PERMISSIONS);
501 $perm_gui = new ilPermissionGUI($this);
502 $ret = $this->ctrl->forwardCommand($perm_gui);
503 break;
504
505 case "illearningprogressgui":
506 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
508 }
509
510 $this->prepareOutput();
511 $this->addHeaderAction();
512 $this->tabs_manager->activateTab(TabsManager::TAB_ID_LEARNING_PROGRESS);
513
514 $test_session = $this->test_session_factory->getSessionByUserId($this->user->getId());
515 if (!$this->test_access->checkOtherParticipantsLearningProgressAccess()
516 && !$this->getTestObject()->canShowTestResults($test_session)) {
517 $this->tpl->setOnScreenMessage(
518 'info',
519 $this->lng->txt('tst_res_tab_msg_no_lp_access'),
520 );
521 break;
522 }
523
525 $this->ctrl->forwardCommand($new_gui);
526
527 break;
528
529 case "ilcertificategui":
530 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
532 }
533 $this->prepareOutput();
534 $this->addHeaderAction();
535
536 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
537
538 $gui_factory = new ilCertificateGUIFactory();
539 $output_gui = $gui_factory->create($this->getTestObject());
540
541 $this->ctrl->forwardCommand($output_gui);
542 break;
543
544 case strtolower(TestScoringByQuestionGUI::class):
545 if (!$this->access->checkAccess("read", "", $this->testrequest->getRefId())
546 && !$this->access->checkAccess("score_anon", "", $this->testrequest->getRefId())
547 ) {
549 }
550 $this->prepareOutput();
551 $this->addHeaderAction();
552 $output_gui = new TestScoringByQuestionGUI($this->getTestObject(), $this->ui_service);
553 $output_gui->setTestAccess($this->getTestAccess());
554 $this->ctrl->forwardCommand($output_gui);
555 break;
556
557 case strtolower(TestScoringByParticipantGUI::class):
558 if (!$this->access->checkAccess("read", "", $this->testrequest->getRefId())
559 && !$this->access->checkAccess("score_anon", "", $this->testrequest->getRefId())
560 ) {
562 }
563 $this->prepareOutput();
564 $this->addHeaderAction();
565 $output_gui = new TestScoringByParticipantGUI($this->getTestObject());
566 $output_gui->setTestAccess($this->getTestAccess());
567 $this->ctrl->forwardCommand($output_gui);
568 break;
569
570 case strtolower(MarkSchemaGUI::class):
571 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
573 }
575
576 $mark_schema_gui = new MarkSchemaGUI(
577 $this->getTestObject(),
578 $this->user,
579 $this->lng,
580 $this->ctrl,
581 $this->tpl,
582 $this->toolbar,
583 $this->getObject()->getTestLogger(),
584 $this->post_wrapper,
585 $this->request_wrapper,
586 $this->response_handler,
587 $this->request,
588 $this->refinery,
589 $this->ui_factory,
590 $this->ui_renderer
591 );
592 $this->ctrl->forwardCommand($mark_schema_gui);
593
594 $this->prepareOutput();
595 $this->addHeaderAction();
596 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
597 $this->tabs_manager->activateSubTab(TabsManager::SETTINGS_SUBTAB_ID_MARK_SCHEMA);
598
599 break;
600
601 case strtolower(SettingsMainGUI::class):
602 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
604 }
605
606 $gui = new SettingsMainGUI(
607 $this->tpl,
608 $this->toolbar,
609 $this->ctrl,
610 $this->access,
611 $this->lng,
612 $this->tree,
613 $this->db,
614 $this->obj_data_cache,
615 $this->settings,
616 $this->ui_factory,
617 $this->ui_renderer,
618 $this->refinery,
619 $this->request,
620 $this->component_repository,
621 $this->user,
622 $this,
623 $this->getTestObject()->getTestLogger(),
624 $this->questionrepository
625 );
626 $this->ctrl->forwardCommand($gui);
627 $this->prepareOutput();
628 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
629 $this->tabs_manager->activateSubTab(TabsManager::SUBTAB_ID_GENERAL_SETTINGS);
630 $this->addHeaderAction();
631 break;
632
633 case strtolower(SettingsScoringGUI::class):
634 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
636 }
637 $this->prepareOutput();
638 $this->addHeaderAction();
639 $gui = new SettingsScoringGUI(
640 $this->ctrl,
641 $this->access,
642 $this->lng,
643 $this->tree,
644 $this->db,
645 $this->component_repository,
646 $this,
647 $this->tpl,
648 $this->tabs_gui,
649 $this->getTestObject()->getTestLogger(),
650 $this->getTestObject()->getScoreSettingsRepository(),
651 $this->getTestObject()->getTestId(),
652 $this->ui_factory,
653 $this->ui_renderer,
654 $this->refinery,
655 $this->request,
656 $this->user
657 );
658
659 $this->ctrl->forwardCommand($gui);
660 break;
661
662 case 'iltestrandomquestionsetconfiggui':
663 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
665 }
666 $this->prepareOutput();
667 $this->addHeaderAction();
668 $test_process_locker_factory = (new ilTestProcessLockerFactory(
669 new ilSetting('assessment'),
670 $this->db
671 ))->withContextId($this->getTestObject()->getId());
673 $this->getTestObject(),
674 $this->ctrl,
675 $this->user,
676 $this->access,
677 $this->ui_factory,
678 $this->ui_renderer,
679 $this->data_factory,
680 $this->tabs_manager,
681 $this->lng,
682 $this->getTestObject()->getTestlogger(),
683 $this->tpl,
684 $this->db,
685 $this->tree,
686 $this->component_repository,
687 $this->obj_definition,
688 $this->obj_data_cache,
689 $test_process_locker_factory,
690 $this->testrequest,
691 $this->title_builder,
692 $this->questionrepository
693 );
694 $this->ctrl->forwardCommand($gui);
695 break;
696
697 case 'iltestquestionbrowsertablegui':
698 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
700 }
701 $this->prepareOutput();
702 $this->addHeaderAction();
704 $this->tabs_gui,
705 $this->tree,
706 $this->db,
707 $this->getTestObject()->getTestlogger(),
708 $this->component_repository,
709 $this->getTestObject(),
710 $this->user,
711 $this->access,
712 $this->http,
713 $this->refinery,
714 $this->ui_factory,
715 $this->ui_renderer,
716 $this->testrequest,
717 $this->questionrepository,
718 $this->lng,
719 $this->ctrl,
720 $this->tpl,
721 $this->ui_service,
722 $this->data_factory,
723 $this->taxonomy,
724 );
725 $this->ctrl->forwardCommand($gui);
726 break;
727
728 case 'iltestskilladministrationgui':
729 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
731 }
732 $this->prepareOutput();
733 $this->addHeaderAction();
735 $this->ctrl,
736 $this->access,
737 $this->tabs_manager,
738 $this->tpl,
739 $this->lng,
740 $this->refinery,
741 $this->db,
742 $this->getTestObject()->getTestlogger(),
743 $this->tree,
744 $this->component_repository,
745 $this->getTestObject(),
746 $this->questionrepository,
747 $this->testrequest,
748 $this->ref_id
749 );
750 $this->ctrl->forwardCommand($gui);
751 break;
752
753 case 'ilobjectcopygui':
754 if ((!$this->access->checkAccess("copy", "", $this->testrequest->getRefId()))) {
756 }
757 $this->prepareOutput();
758 $this->addHeaderAction();
759 $cp = new ilObjectCopyGUI($this);
760 $cp->setType('tst');
761 $this->ctrl->forwardCommand($cp);
762 break;
763
764 case strtolower(ilAssQuestionPreviewGUI::class):
765 if (!$this->access->checkAccess('write', '', $this->getTestObject()->getRefId())) {
767 }
768 $this->prepareOutput();
770 break;
771 case 'ilassquestionpagegui':
772 if ($cmd === 'finishEditing') {
773 $this->prepareOutput();
775 break;
776 }
777 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
779 }
780 if ($cmd === 'edit' && !$this->access->checkAccess('write', '', $this->testrequest->getRefId())) {
782 }
783 $this->prepareOutput();
784 $forwarder = new ilAssQuestionPageCommandForwarder(
785 $this->getTestObject(),
786 $this->lng,
787 $this->ctrl,
788 $this->tpl,
789 $this->questionrepository,
790 $this->testrequest
791 );
792 $forwarder->forward();
793 break;
794
795 case 'ilassspecfeedbackpagegui':
796 if ((!$this->access->checkAccess("write", "", $this->testrequest->getRefId()))) {
798 }
799 $pg_gui = new ilAssSpecFeedbackPageGUI((int) $this->testrequest->raw("feedback_id"));
800 $this->ctrl->forwardCommand($pg_gui);
801 break;
802
803 case 'ilassgenfeedbackpagegui':
804 if ((!$this->access->checkAccess("write", "", $this->testrequest->getRefId()))) {
806 }
807 $pg_gui = new ilAssGenFeedbackPageGUI($this->testrequest->int("feedback_id"));
808 $this->ctrl->forwardCommand($pg_gui);
809 break;
810
811 case 'illocalunitconfigurationgui':
812 if ((!$this->access->checkAccess("write", "", $this->testrequest->getRefId()))) {
814 }
815 $this->prepareSubGuiOutput();
816
817 // set return target
819 $question = $question_gui->getObject();
820 $question->setObjId($this->getTestObject()->getId());
821 $question_gui->setObject($question);
822 $question_gui->setQuestionTabs();
824 new ilUnitConfigurationRepository($this->testrequest->getQuestionId())
825 );
826 $this->ctrl->forwardCommand($gui);
827 break;
828
829 case "ilcommonactiondispatchergui":
830 if (!$this->access->checkAccess("read", "", $this->testrequest->getRefId()) && !$this->access->checkAccess("visible", "", $this->testrequest->getRefId())) {
832 }
833 $this->prepareOutput();
835 $this->ctrl->forwardCommand($gui);
836 break;
837
838 case 'ilassquestionfeedbackeditinggui':
839 if (!$this->access->checkAccess('write', '', $this->getTestObject()->getRefId())) {
841 }
842 $this->prepareSubGuiOutput();
843
844 // set return target
845 $this->ctrl->setReturnByClass(self::class, self::SHOW_QUESTIONS_CMD);
847 $question = $question_gui->getObject();
848 $question->setObjId($this->getTestObject()->getId());
849 $question_gui->setObject($question);
850 $question_gui->setQuestionTabs();
851
852 $this->addQuestionTitleToObjectTitle($question->getTitleForHTMLOutput());
853
854 if ($this->getTestObject()->evalTotalPersons() !== 0) {
855 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('question_is_part_of_running_test'), true);
856 $this->prepareOutput();
858 }
860 $question_gui,
861 $this->ctrl,
862 $this->access,
863 $this->tpl,
864 $this->tabs_gui,
865 $this->lng,
866 $this->help,
867 $this->qplrequest,
868 $this->content_style
869 );
870 $this->ctrl->forwardCommand($gui);
871 break;
872
873 case 'iltestcorrectionsgui':
874 if ((!$this->access->checkAccess('read', '', $this->testrequest->getRefId()))) {
876 }
877 $this->prepareOutput();
878 $gui = new ilTestCorrectionsGUI(
879 $this->db,
880 $this->ctrl,
881 $this->lng,
882 $this->tabs_gui,
883 $this->help,
884 $this->ui_factory,
885 $this->tpl,
886 $this->refinery,
887 $this->getTestObject()->getTestLogger(),
888 $this->testrequest,
889 $this->getTestObject(),
890 $this->user
891 );
892 $this->ctrl->forwardCommand($gui);
893 break;
894
895 case 'iltestpagegui':
896 if ((!$this->access->checkAccess("write", "", $this->testrequest->getRefId()))) {
898 }
899
900 if ($cmd === 'downloadFile') {
901 $page_id = $this->object->getIntroductionPageId();
902 if ($this->testrequest->strVal('page_type') === 'concludingremarkspage') {
903 $page_id = $this->object->getConcludingRemarksPageId();
904 }
905 $this->ctrl->forwardCommand(new ilTestPageGUI('tst', $page_id));
906 }
907 $this->showEditTestPageGUI();
908 break;
909
910 case '':
911 case 'ilobjtestgui':
912 if (!$this->access->checkAccess('read', '', $this->testrequest->getRefId())
913 && !$this->access->checkAccess('visible', '', $this->testrequest->getRefId())) {
915 }
916 $this->prepareOutput();
917 $this->addHeaderAction();
918
919 if ($cmd === 'testScreen') {
920 $this->ctrl->forwardCommand($this->getTestScreenGUIInstance());
921 return;
922 }
923
924 $local_cmd = $cmd . 'Object';
925 if (!method_exists($this, $local_cmd)) {
926 $local_cmd = self::SHOW_QUESTIONS_CMD . 'Object';
927 }
928 $this->$local_cmd();
929 break;
930
931 default:
932 if ((!$this->access->checkAccess('read', '', $this->testrequest->getRefId()))) {
934 }
935 if (in_array(
936 $cmd,
937 ['editQuestion', 'previewQuestion', 'save', 'saveReturn', 'uploadImage',
938 'removeImage', 'syncQuestion', 'syncQuestionReturn', 'suggestedsolution']
939 )
940 && !$this->access->checkAccess('write', '', $this->getTestObject()->getRefId())) {
942 }
943 if (in_array($cmd, ['editQuestion', 'save', 'saveReturn', 'suggestedsolution'])
944 && $this->getTestObject()->evalTotalPersons() !== 0) {
945 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('question_is_part_of_running_test'), true);
946 $this->prepareOutput();
948 return;
949 }
950 $this->forwardCommandToQuestion($cmd);
951 break;
952 }
953 if (!in_array(strtolower($this->testrequest->raw('baseClass')), ['iladministrationgui', 'ilrepositorygui'])
954 && $this->getCreationMode() !== true) {
955 $this->tpl->printToStdout();
956 }
957 }
@ilCtrl_Calls ILIAS\Test\Settings\MainSettings\SettingsMainGUI: ilPropertyFormGUI @ilCtrl_Calls ILIAS...
static _getQuestionGUI(string $question_type='', int $question_id=-1)
Creates a question gui representation and returns the alias to the question gui.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
GUI class for LTI provider object settings.
Class ilObjUserTrackingGUI.
Class ilLocalUnitConfigurationGUI.
addQuestionTitleToObjectTitle(string $question_title)
forwardCommandToQuestionPreview(string $cmd, ?assQuestionGUI $question_gui=null)
forwardCommandToQuestion(string $cmd)
GUI class for the workflow of copying objects.
addHeaderAction()
Add header action menu.
prepareOutput(bool $show_sub_objects=true)
Class ilObjectMetaDataGUI.
ILIAS Setting Class.
Export User Interface Class.
Class that handles PDF generation for test and assessment.
@ilCtrl_Calls ilTestPageGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMDEditorGUI @ilCtrl_Calls ilTestP...
Class ilTestParticipantsGUI.
@ilCtrl_Calls ilTestQuestionBrowserTableGUI: ilFormPropertyDispatchGUI
Service GUI class for tests.
Class ilUnitConfigurationRepository.
static http()
Fetches the global http state from ILIAS.
if(!file_exists('../ilias.ini.php'))

References assQuestionGUI\_getQuestionGUI(), ILIAS\Repository\access(), ilObjectGUI\addHeaderAction(), addQuestionTitleToObjectTitle(), ilAssQuestionPreviewGUI\CMD_SHOW, ILIAS\Repository\ctrl(), determineObjectiveOrientedContainer(), fetchAuthoringQuestionIdParameter(), forwardCommandToQuestion(), forwardCommandToQuestionPreview(), forwardToEvaluationGUI(), forwardToInfoScreen(), ilObjectGUI\getCreationMode(), ILIAS\Survey\Mode\getId(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ilObjectGUI\getObject(), getObjectiveOrientedContainer(), ilObjectGUI\getRefId(), getTestAccess(), getTestObject(), getTestScreenGUIInstance(), ILIAS\Repository\help(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, ILIAS\Repository\object(), ilObjectGUI\prepareOutput(), prepareSubGuiOutput(), protectByWritePermission(), redirectAfterMissingRead(), redirectAfterMissingWrite(), ILIAS\Repository\refinery(), ILIAS\Repository\settings(), showEditTestPageGUI(), ILIAS\Repository\toolbar(), trackTestObjectReadEvent(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ exportLegacyLogsObject()

ilObjTestGUI::exportLegacyLogsObject ( )

Definition at line 1976 of file class.ilObjTestGUI.php.

1976 : void
1977 {
1978 $this->protectByWritePermission();
1979
1980 $csv_output = $this->getTestObject()->getTestLogViewer()->getLegacyLogExportForObjId($this->getTestObject()->getId());
1981
1983 $csv_output,
1984 "legacy_logs_for_{$this->getTestObject()->getRefId()}.csv"
1985 );
1986 }
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")

References ilUtil\deliverData(), and ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ exportObject()

ilObjTestGUI::exportObject ( )
protected

Gateway for exports initiated from workspace, as there is a generic forward to {objTypeMainGUI}::export()

Definition at line 1224 of file class.ilObjTestGUI.php.

1225 {
1226 $this->ctrl->redirectByClass('ilTestExportGUI');
1227 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ fetchAuthoringQuestionIdParameter()

ilObjTestGUI::fetchAuthoringQuestionIdParameter ( )
protected
Returns
int
Exceptions
ilTestException

Definition at line 1233 of file class.ilObjTestGUI.php.

1233 : int
1234 {
1235 $qid = $this->testrequest->int('q_id');
1236
1237 if ($qid === 0 || $this->getTestObject()->checkQuestionParent($qid)) {
1238 return $qid;
1239 }
1240
1241 throw new ilTestException('question id does not relate to parent object!');
1242 }
Base Exception for all Exceptions relating to Modules/Test.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ forwardCommandToQuestion()

ilObjTestGUI::forwardCommandToQuestion ( string  $cmd)
protected

Definition at line 1051 of file class.ilObjTestGUI.php.

1051 : void
1052 {
1053 $this->create_question_mode = true;
1054 $this->prepareOutput();
1055
1056 try {
1057 $qid = $this->fetchAuthoringQuestionIdParameter();
1058
1059 $this->ctrl->setReturnByClass(self::class, self::SHOW_QUESTIONS_CMD);
1060
1061 $question_gui = assQuestionGUI::_getQuestionGUI(
1062 ilUtil::stripSlashes($this->testrequest->strVal('question_type')),
1063 $qid
1064 );
1065
1066 $question_gui->setEditContext(assQuestionGUI::EDIT_CONTEXT_AUTHORING);
1067 $question = $question_gui->getObject();
1068 $question->setObjId($this->getTestObject()->getId());
1069 $question_gui->setObject($question);
1070 $question_gui->setContextAllowsSyncToPool(true);
1071 $question_gui->setQuestionTabs();
1072
1073 $this->addQuestionTitleToObjectTitle($question->getTitleForHTMLOutput());
1074
1075 $target = strpos($cmd, 'Return') === false ? 'stay' : 'return';
1076
1077 if (in_array($cmd, ['syncQuestion', 'syncQuestionReturn'])) {
1078 $question_gui->syncQuestion();
1079 $this->showNextViewAfterQuestionSave($question_gui, $target);
1080 return;
1081 }
1082
1083 if ($question_gui->isSaveCommand()
1084 || $question_gui->cmdNeedsExistingQuestion($cmd)) {
1085 $question_gui = $this->addPostCreationTasksToQuestionGUI($question_gui);
1086 }
1087
1088 if ($qid === 0 && $question_gui->cmdNeedsExistingQuestion($cmd)) {
1089 $question_gui->getObject()->createNewQuestion();
1090 $question_gui->setQuestionTabs();
1091 $this->executeAfterQuestionCreationTasks($question_gui);
1092 }
1093
1094 if (!$question_gui->isSaveCommand()) {
1095 $this->ctrl->forwardCommand($question_gui);
1096 return;
1097 }
1098
1099 if (!$question_gui->saveQuestion()) {
1100 return;
1101 }
1102
1103 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
1104 if ($qid === 0) {
1105 $this->executeAfterQuestionCreationTasks($question_gui);
1106 }
1107 $this->executeAfterQuestionSaveTasks($question_gui);
1108 $this->showNextViewAfterQuestionSave($question_gui, $target);
1109 } catch (ilTestException $e) {
1110 $this->showQuestionsObject();
1111 }
1112 }
addPostCreationTasksToQuestionGUI(assQuestionGUI $question_gui)
executeAfterQuestionCreationTasks(assQuestionGUI $question_gui)
showNextViewAfterQuestionSave(assQuestionGUI $question_gui, string $target)
executeAfterQuestionSaveTasks(assQuestionGUI $question_gui)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")

References Vendor\Package\$e, assQuestionGUI\_getQuestionGUI(), ILIAS\Repository\ctrl(), assQuestionGUI\EDIT_CONTEXT_AUTHORING, ILIAS\Survey\Mode\getId(), ILIAS\Repository\lng(), and ilUtil\stripSlashes().

Referenced by executeCommand().

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

◆ forwardCommandToQuestionPreview()

ilObjTestGUI::forwardCommandToQuestionPreview ( string  $cmd,
?assQuestionGUI  $question_gui = null 
)
protected

Definition at line 977 of file class.ilObjTestGUI.php.

980 : void {
981 $nr_of_participants_with_results = $this->getTestObject()->evalTotalPersons();
982
983 $this->ctrl->saveParameterByClass(self::class, 'q_id');
984 $gui = new ilAssQuestionPreviewGUI(
985 $this->ctrl,
986 $this->rbac_system,
987 $this->tabs_gui,
988 $this->toolbar,
989 $this->tpl,
990 $this->ui_factory,
991 $this->lng,
992 $this->db,
993 $this->refinery->random(),
994 $this->global_screen,
995 $this->http,
996 $this->refinery,
997 $this->ref_id
998 );
999
1000 if ($nr_of_participants_with_results > 0) {
1001 $gui->addAdditionalCmd(
1002 $this->lng->txt('tst_corrections_qst_form'),
1003 $this->ctrl->getLinkTargetByClass(ilTestCorrectionsGUI::class, 'showQuestion')
1004 );
1005 }
1006
1007 $question_gui ??= assQuestion::instantiateQuestionGUI($this->fetchAuthoringQuestionIdParameter());
1008
1009 $this->addQuestionTitleToObjectTitle($question_gui->getObject()->getTitleForHTMLOutput());
1010
1011 if (!$this->getTestObject()->isRandomTest() && $nr_of_participants_with_results === 0) {
1012 $gui->setPrimaryCmd(
1013 $this->lng->txt('edit_question'),
1014 $this->ctrl->getLinkTargetByClass(
1015 get_class($question_gui),
1016 'editQuestion'
1017 )
1018 );
1019 $gui->addAdditionalCmd(
1020 $this->lng->txt('edit_page'),
1021 $this->ctrl->getLinkTargetByClass(
1022 ilAssQuestionPageGUI::class,
1023 'edit'
1024 )
1025 );
1026 }
1027
1028 $gui->initQuestion($question_gui, $this->getTestObject()->getId());
1029 $gui->initPreviewSettings($this->getTestObject()->getRefId());
1030 $gui->initPreviewSession($this->user->getId(), $this->testrequest->getQuestionId());
1031 $gui->initStyleSheets();
1032
1033 $this->ctrl->clearParameterByClass(self::class, 'q_id');
1034 $this->tabs_gui->setBackTarget(
1035 $this->lng->txt('backtocallingtest'),
1036 $this->ctrl->getLinkTargetByClass(self::class, self::SHOW_QUESTIONS_CMD)
1037 );
1038 $this->ctrl->saveParameterByClass(self::class, 'q_id');
1039 $gui->{$cmd . 'Cmd'}();
1040 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ forwardToEvaluationGUI()

ilObjTestGUI::forwardToEvaluationGUI ( )
private

Definition at line 1293 of file class.ilObjTestGUI.php.

1294 {
1295 $this->prepareOutput();
1296 $this->addHeaderAction();
1297 $gui = new ilTestEvaluationGUI($this->getTestObject());
1298 $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
1299 $gui->setTestAccess($this->getTestAccess());
1300
1301 $this->ctrl->forwardCommand($gui);
1302 }
Output class for assessment test evaluation.

References ILIAS\Repository\ctrl().

Referenced by executeCommand().

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

◆ forwardToInfoScreen()

ilObjTestGUI::forwardToInfoScreen ( )
private

Definition at line 2181 of file class.ilObjTestGUI.php.

2181 : void
2182 {
2183 if (!$this->access->checkAccess('visible', '', $this->ref_id)
2184 && !$this->access->checkAccess('read', '', $this->ref_id)) {
2185 $this->redirectAfterMissingRead();
2186 }
2187
2188 if ($this->getTestObject()->getMainSettings()->getAdditionalSettings()->getHideInfoTab()) {
2189 $this->ctrl->redirectByClass([self::class, TestScreenGUI::class], TestScreenGUI::DEFAULT_CMD);
2190 }
2191
2192 $this->tabs_manager->activateTab(TabsManager::TAB_ID_INFOSCREEN);
2193
2194 if ($this->access->checkAccess('read', '', $this->ref_id)) {
2195 $this->trackTestObjectReadEvent();
2196 }
2197 $info = new ilInfoScreenGUI($this);
2198
2199 if ($this->isCommandClassAnyInfoScreenChild()) {
2200 $this->ctrl->forwardCommand($info);
2201 }
2202
2204 $this->getTestObject(),
2205 $this->test_player_factory->getPlayerGUI(),
2206 $this->test_question_set_config_factory->getQuestionSetConfig(),
2207 $this->test_session_factory->getSession(),
2208 $this->db,
2209 $this->access,
2210 $this->ctrl,
2211 $this->lng,
2212 $this->ui_factory,
2213 $this->ui_renderer,
2214 $this->tpl,
2215 $this->toolbar
2216 );
2217
2218 $toolbar->setCloseFormTag(false);
2219
2220 $toolbar->setSessionLockString('');
2221 $toolbar->build();
2222 $toolbar->sendMessages();
2223
2224 $info->enablePrivateNotes();
2225
2226 $info->addSection($this->lng->txt('tst_general_properties'));
2227 $info->addProperty(
2228 $this->lng->txt('author'),
2229 $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
2230 $this->getTestObject()->getAuthor()
2231 )
2232 );
2233 $info->addProperty(
2234 $this->lng->txt('title'),
2235 $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
2236 $this->getTestObject()->getTitle()
2237 )
2238 );
2239
2240 if ($this->type !== 'tst') {
2241 $info->hideFurtherSections(false);
2242 }
2243
2244 $info->addSection($this->lng->txt('tst_sequence_properties'));
2245 $info->addProperty(
2246 $this->lng->txt('tst_sequence'),
2247 $this->lng->txt(
2248 $this->getTestObject()->getMainSettings()->getParticipantFunctionalitySettings()->getPostponedQuestionsMoveToEnd()
2249 ? 'tst_sequence_postpone' : 'tst_sequence_fixed'
2250 )
2251 );
2252
2253 $info->addSection($this->lng->txt('tst_heading_scoring'));
2254 $info->addProperty(
2255 $this->lng->txt('tst_text_count_system'),
2256 $this->lng->txt(
2257 ($this->getTestObject()->getCountSystem() == SettingsScoring::COUNT_PARTIAL_SOLUTIONS) ? 'tst_count_partial_solutions' : 'tst_count_correct_solutions'
2258 )
2259 );
2260 if ($this->getTestObject()->isRandomTest()) {
2261 $info->addProperty($this->lng->txt('tst_pass_scoring'), $this->lng->txt(($this->getTestObject()->getPassScoring() == ilObjTest::SCORE_BEST_PASS) ? 'tst_pass_best_pass' : 'tst_pass_last_pass'));
2262 }
2263
2264 $info->addSection($this->lng->txt('tst_score_reporting'));
2265 $info->addProperty(
2266 $this->lng->txt('tst_score_reporting'),
2267 $this->getTestObject()->getScoreSettings()->getResultSummarySettings()
2268 ->getScoreReporting()->getTranslatedValue($this->lng)
2269 );
2270 $reporting_date = $this->getTestObject()
2271 ->getScoreSettings()
2272 ->getResultSummarySettings()
2273 ->getReportingDate();
2274 if ($reporting_date !== null) {
2275 $info->addProperty(
2276 $this->lng->txt('tst_score_reporting_date'),
2277 $reporting_date
2278 ->setTimezone(new DateTimeZone($this->user->getTimeZone()))
2279 ->format($this->user->getDateTimeFormat()->toString())
2280 );
2281 }
2282
2283 $info->addSection($this->lng->txt('tst_session_settings'));
2284 $info->addProperty($this->lng->txt('tst_nr_of_tries'), $this->getTestObject()->getNrOfTries() === 0 ? $this->lng->txt('unlimited') : (string) $this->getTestObject()->getNrOfTries());
2285 if ($this->getTestObject()->getNrOfTries() != 1) {
2286 $info->addProperty(
2287 $this->lng->txt('tst_nr_of_tries_of_user'),
2288 ($this->test_session_factory->getSession()->getPass() === 0) ?
2289 $this->lng->txt('tst_no_tries') : (string) $this->test_session_factory->getSession()->getPass()
2290 );
2291 }
2292
2293 if ($this->getTestObject()->getEnableProcessingTime()) {
2294 $info->addProperty($this->lng->txt('tst_processing_time'), $this->getTestObject()->getProcessingTime());
2295 }
2296
2297 $starting_time = $this->getTestObject()->getStartingTime();
2298 if ($this->getTestObject()->isStartingTimeEnabled() && $starting_time !== 0) {
2299 $info->addProperty($this->lng->txt('tst_starting_time'), ilDatePresentation::formatDate(new ilDateTime($starting_time, IL_CAL_UNIX)));
2300 }
2301 $ending_time = $this->getTestObject()->getEndingTime();
2302 if ($this->getTestObject()->isEndingTimeEnabled() && $ending_time != 0) {
2303 $info->addProperty($this->lng->txt('tst_ending_time'), ilDatePresentation::formatDate(new ilDateTime($ending_time, IL_CAL_UNIX)));
2304 }
2305 $info->addMetaDataSections($this->getTestObject()->getId(), 0, $this->getTestObject()->getType());
2306
2307 $this->ctrl->forwardCommand($info);
2308 }
const IL_CAL_UNIX
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
Class ilInfoScreenGUI.
const SCORE_BEST_PASS
ilToolbarGUI $toolbar
setCloseFormTag(bool $a_val)

References $info, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilDatePresentation\formatDate(), ILIAS\Survey\Mode\getId(), IL_CAL_UNIX, ILIAS\Repository\lng(), ilObjTest\SCORE_BEST_PASS, and ILIAS\Repository\user().

Referenced by executeCommand().

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

◆ fullscreenObject()

ilObjTestGUI::fullscreenObject ( )

show fullscreen view

Definition at line 1570 of file class.ilObjTestGUI.php.

1571 {
1572 $page_gui = new ilAssQuestionPageGUI($this->testrequest->raw('pg_id'));
1573 $page_gui->setFileDownloadLink(
1574 $this->ctrl->getLinkTargetByClass(ilObjTestGUI::class, 'downloadFile')
1575 );
1576 $page_gui->showMediaFullscreen();
1577 }
Question page GUI class.

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getObjectiveOrientedContainer()

ilObjTestGUI::getObjectiveOrientedContainer ( )
protected

Definition at line 2703 of file class.ilObjTestGUI.php.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getQuestionsTableActions()

ilObjTestGUI::getQuestionsTableActions ( )
protected

Definition at line 2743 of file class.ilObjTestGUI.php.

2744 {
2745 if ($this->table_actions === null) {
2746 $this->table_actions = new QuestionsTableActions(
2747 $this->ui_factory,
2748 $this->ui_renderer,
2749 $this->tpl,
2750 $this->request,
2751 $this->getQuestionsTableQuery(),
2752 $this->lng,
2753 $this->ctrl,
2754 $this->test_questions_repository,
2755 new QuestionPrinter(
2756 $this->ui_factory,
2757 $this->tpl,
2758 $this->tabs_manager,
2759 $this->toolbar,
2760 $this->refinery,
2761 $this->lng,
2762 $this->ctrl,
2763 $this->user,
2765 $this->getTestObject()
2766 ),
2767 $this->object,
2768 $this->getTestObject()->getGlobalSettings()->isAdjustingQuestionsWithResultsAllowed(),
2769 $this->getTestObject()->evalTotalPersons() !== 0,
2770 $this->getTestObject()->isRandomTest(),
2771 $this->test_question_set_config_factory
2772 );
2773 }
2774 return $this->table_actions;
2775 }
QuestionsTableActions $table_actions

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getQuestionsTableQuery()

ilObjTestGUI::getQuestionsTableQuery ( )
protected

Definition at line 2729 of file class.ilObjTestGUI.php.

2730 {
2731 if ($this->table_query === null) {
2732 $id = $this->object ? $this->object->getId() : '';
2733 $this->table_query = new QuestionsTableQuery(
2734 $this->http,
2735 $this->refinery,
2736 $this->data_factory,
2737 ['qlist', $id]
2738 );
2739 }
2740 return $this->table_query;
2741 }
QuestionsTableQuery $table_query

References $id, ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ getSelectedPersonalDefaultsSettingsFromForm()

ilObjTestGUI::getSelectedPersonalDefaultsSettingsFromForm ( )
private

Definition at line 1444 of file class.ilObjTestGUI.php.

1444 : ?int
1445 {
1446 $data = $this->initCreateForm($this->type)
1447 ->withRequest($this->request)
1448 ->getData();
1449 return isset($data['didactic_templates'])
1450 ? $this->parseDidacticTemplateVar($data['didactic_templates'], 'tstdef')
1451 : null;
1452 }
initCreateForm(string $new_type)
parseDidacticTemplateVar(string $var, string $type)

References $data.

◆ getTable()

ilObjTestGUI::getTable ( )
protected

Definition at line 2777 of file class.ilObjTestGUI.php.

2778 {
2779 return new QuestionsTable(
2780 $this->ui_factory,
2781 $this->refinery,
2782 $this->http->request(),
2783 $this->getQuestionsTableActions(),
2784 $this->lng,
2785 $this->object,
2786 $this->test_questions_repository,
2787 $this->title_builder
2788 );
2789 }

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ getTabs()

ilObjTestGUI::getTabs ( )

adds tabs to tab gui object

Parameters
ilTabsGUI$tabs_gui

Reimplemented from ilObjectGUI.

Definition at line 2409 of file class.ilObjTestGUI.php.

2409 : void
2410 {
2411 $this->help->setScreenIdComponent("tst");
2412
2413 if ($this->tabs_manager === null) {
2414 return;
2415 }
2416
2417 if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
2418 $courseLink = ilLink::_getLink($this->getObjectiveOrientedContainer()->getRefId());
2419 $this->tabs_manager->setParentBackLabel($this->lng->txt('back_to_objective_container'));
2420 $this->tabs_manager->setParentBackHref($courseLink);
2421 }
2422
2423 $this->tabs_manager->perform();
2424 }

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

+ Here is the call graph for this function:

◆ getTargetQuestionpoolForm()

ilObjTestGUI::getTargetQuestionpoolForm (   $questionpools,
string  $cmd 
)
protected

Definition at line 2624 of file class.ilObjTestGUI.php.

2625 {
2626 $form = new ilPropertyFormGUI();
2627 $form->setFormAction($this->ctrl->getFormAction($this));
2628 $form->addCommandButton($cmd, $this->lng->txt('submit'));
2629 $form->addCommandButton('cancelCreateQuestion', $this->lng->txt('cancel'));
2630
2631 if (count($questionpools) == 0) {
2632 $form->setTitle($this->lng->txt("tst_enter_questionpool"));
2633
2634 $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
2635 $title->setRequired(true);
2636 $form->addItem($title);
2637
2638 $description = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
2639 $form->addItem($description);
2640 } else {
2641 $form->setTitle($this->lng->txt("tst_select_questionpool"));
2642
2643 $selectOptions = [
2644 '' => $this->lng->txt('please_select')
2645 ];
2646
2647 foreach ($questionpools as $key => $value) {
2648 $selectOptions[$key] = $value["title"];
2649 }
2650
2651 $select = new ilSelectInputGUI($this->lng->txt('tst_source_question_pool'), 'sel_qpl');
2652 $select->setRequired(true);
2653 $select->setOptions($selectOptions);
2654
2655 $form->addItem($select);
2656 }
2657
2659 if ($table_query->getTableAction() !== null) {
2660 $question_ids = $table_query->getRowIds($this->object);
2661 } elseif ($this->testrequest->isset('q_id') && is_array($this->testrequest->raw('q_id'))) {
2662 $question_ids = $this->testrequest->raw('q_id');
2663 }
2664
2665 foreach ($question_ids as $id) {
2666 $hidden = new ilHiddenInputGUI('q_id[]');
2667 $hidden->setValue((string) $id);
2668 $form->addItem($hidden);
2669 }
2670
2671 return $form;
2672 }
This class represents a property form user interface.
This class represents a selection list property in a property form.
This class represents a text area property in a property form.

References $id, ILIAS\Repository\ctrl(), ILIAS\Test\Questions\Presentation\QuestionsTableQuery\getRowIds(), ILIAS\Test\Questions\Presentation\QuestionsTableQuery\getTableAction(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getTestAccess()

ilObjTestGUI::getTestAccess ( )

Definition at line 1283 of file class.ilObjTestGUI.php.

1283 : ilTestAccess
1284 {
1285 return $this->test_access;
1286 }
ilTestAccess $test_access

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getTestObject()

ilObjTestGUI::getTestObject ( )

Definition at line 1460 of file class.ilObjTestGUI.php.

1460 : ?ilObjTest
1461 {
1462 return $this->object;
1463 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getTestScreenGUIInstance()

ilObjTestGUI::getTestScreenGUIInstance ( )
private

Definition at line 2708 of file class.ilObjTestGUI.php.

2709 {
2710 return new TestScreenGUI(
2711 $this->getTestObject(),
2712 $this->user,
2713 $this->ui_factory,
2714 $this->ui_renderer,
2715 $this->lng,
2716 $this->refinery,
2717 $this->ctrl,
2718 $this->tpl,
2719 $this->content_style,
2720 $this->http,
2721 $this->tabs_manager,
2722 $this->access,
2723 $this->test_access,
2724 $this->db,
2725 $this->rbac_system
2726 );
2727 }

References ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\user().

Referenced by executeCommand().

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

◆ historyObject()

ilObjTestGUI::historyObject ( )

Definition at line 1933 of file class.ilObjTestGUI.php.

1933 : void
1934 {
1935 if (!$this->getTestObject()->getTestLogger()->isLoggingEnabled()
1936 || !$this->rbac_review->isAssigned($this->user->getId(), SYSTEM_ROLE_ID)
1937 && !$this->access->checkAccess('tst_history_read', '', $this->getTestObject()->getRefId())) {
1939 }
1940
1941 $here_uri = $this->data_factory->uri(ILIAS_HTTP_PATH
1942 . '/' . $this->ctrl->getLinkTargetByClass(self::class, self::SHOW_LOGS_CMD));
1943 list($url_builder, $action_parameter_token, $row_id_token) = (new URLBuilder($here_uri))->acquireParameters(
1944 LogTable::QUERY_PARAMETER_NAME_SPACE,
1945 LogTable::ACTION_TOKEN_STRING,
1946 LogTable::ENTRY_TOKEN_STRING
1947 );
1948
1949 if ($this->request_wrapper->has($action_parameter_token->getName())) {
1950 $this->getTestObject()->getTestLogViewer()->executeLogTableAction(
1951 $url_builder,
1952 $action_parameter_token,
1953 $row_id_token,
1954 $this->getTestObject()->getRefId()
1955 );
1956 }
1957
1958 $this->toolbar->addComponent(
1959 $this->ui_factory->button()->standard(
1960 $this->lng->txt('export_legacy_logs'),
1961 $this->ctrl->getLinkTargetByClass(self::class, 'exportLegacyLogs')
1962 )
1963 );
1964 $this->tabs_manager->activateTab(TabsManager::TAB_ID_HISTORY);
1965
1966 list($filter, $table_gui) = $this->getTestObject()->getTestLogViewer()->getLogTable(
1967 $url_builder,
1968 $action_parameter_token,
1969 $row_id_token,
1970 $this->getTestObject()->getRefId()
1971 );
1972
1973 $this->tpl->setVariable('ADM_CONTENT', $this->ui_renderer->render([$filter, $table_gui]));
1974 }
const SYSTEM_ROLE_ID
Definition: constants.php:29

References ILIAS\Repository\ctrl(), SYSTEM_ROLE_ID, and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

◆ importFile()

ilObjTestGUI::importFile ( string  $file_to_import,
string  $path_to_uploaded_file_in_temp_dir 
)
protected

Reimplemented from ilObjectGUI.

Definition at line 1321 of file class.ilObjTestGUI.php.

1321 : void
1322 {
1323 list($subdir, $importdir, $xmlfile, $qtifile) = $this->buildImportDirectoriesFromImportFile($file_to_import);
1324
1326 ->withZipOutputPath($this->getImportTempDirectory());
1327
1328 $unzip = $this->archives->unzip(Streams::ofResource(fopen($file_to_import, 'r')), $options);
1329 $unzip->extract();
1330
1331 if (!is_file($qtifile)) {
1332 ilFileUtils::delDir($importdir);
1333 $this->deleteUploadedImportFile($path_to_uploaded_file_in_temp_dir);
1334 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('tst_import_non_ilias_zip'), true);
1335 }
1336 $qtiParser = new ilQTIParser($importdir, $qtifile, ilQTIParser::IL_MO_VERIFY_QTI, 0, []);
1337 $qtiParser->startParsing();
1338 $founditems = $qtiParser->getFoundItems();
1339
1340 $complete = 0;
1341 $incomplete = 0;
1342 foreach ($founditems as $item) {
1343 if ($item["type"] !== '') {
1344 $complete++;
1345 } else {
1346 $incomplete++;
1347 }
1348 }
1349
1350 if (count($founditems) && $complete == 0) {
1351 ilFileUtils::delDir($importdir);
1352 $this->deleteUploadedImportFile($path_to_uploaded_file_in_temp_dir);
1353 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_import_non_ilias_files'));
1354 return;
1355 }
1356
1357 ilSession::set('path_to_import_file', $file_to_import);
1358 ilSession::set('path_to_uploaded_file_in_temp_dir', $path_to_uploaded_file_in_temp_dir);
1359
1360 if ($qtiParser->getQuestionSetType() !== ilObjTest::QUESTION_SET_TYPE_FIXED
1361 || file_exists($this->buildResultsFilePath($importdir, $subdir))
1362 || $founditems === []) {
1363 $this->importVerifiedFileObject(true);
1364 return;
1365 }
1366
1367 $form = $this->buildImportQuestionsSelectionForm(
1368 'importVerifiedFile',
1369 $importdir,
1370 $qtifile,
1371 $file_to_import,
1372 $path_to_uploaded_file_in_temp_dir
1373 );
1374
1375 if ($form === null) {
1376 return;
1377 }
1378
1379 $panel = $this->ui_factory->panel()->standard(
1380 $this->lng->txt('import_tst'),
1381 [
1382 $this->ui_factory->legacy()->content($this->lng->txt('qpl_import_verify_found_questions')),
1383 $form
1384 ]
1385 );
1386 $this->tpl->setContent($this->ui_renderer->render($panel));
1387 $this->tpl->printToStdout();
1388 exit;
1389 }
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
importVerifiedFileObject(bool $skip_retrieve_selected_questions=false)
imports question(s) into the questionpool (after verification)
deleteUploadedImportFile(string $path_to_uploaded_file_in_temp_dir)
static set(string $a_var, $a_val)
Set a value.
buildImportQuestionsSelectionForm(string $form_cmd, string $importdir, string $qtifile, ?string $path_to_uploaded_file_in_temp_dir=null)
buildImportDirectoriesFromImportFile(string $file_to_import)
buildResultsFilePath(string $importdir, string $subdir)

References ILIAS\TestQuestionPool\Import\buildImportDirectoriesFromImportFile(), ILIAS\TestQuestionPool\Import\buildImportQuestionsSelectionForm(), ILIAS\TestQuestionPool\Import\buildResultsFilePath(), ilFileUtils\delDir(), exit, ILIAS\TestQuestionPool\Import\getImportTempDirectory(), ilQTIParser\IL_MO_VERIFY_QTI, ILIAS\Repository\lng(), ilObjTest\QUESTION_SET_TYPE_FIXED, and ilSession\set().

+ Here is the call graph for this function:

◆ importVerifiedFileObject()

ilObjTestGUI::importVerifiedFileObject ( bool  $skip_retrieve_selected_questions = false)

imports question(s) into the questionpool (after verification)

2025-03-22, sk: This is now only needed for legacy exports as now also exports with results do contain a manifest.xml.

Definition at line 1468 of file class.ilObjTestGUI.php.

1470 : void {
1471 if (!$this->checkPermissionBool('create', '', 'tst')) {
1472 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_permission'), true);
1473 $this->ctrl->returnToParent($this);
1474 }
1475 $file_to_import = ilSession::get('path_to_import_file');
1476 $path_to_uploaded_file_in_temp_dir = ilSession::get('path_to_uploaded_file_in_temp_dir');
1477 list($subdir, $importdir, $xmlfile, $qtifile) = $this->buildImportDirectoriesFromImportFile($file_to_import);
1478
1479 $new_obj = new ilObjTest(0, true);
1480 $new_obj->setTitle('dummy');
1481 $new_obj->setDescription('test import');
1482 $new_obj->create(true);
1483 $new_obj->createReference();
1484 $new_obj->putInTree($this->testrequest->getRefId());
1485 $new_obj->setPermissions($this->testrequest->getRefId());
1486 $new_obj->saveToDb();
1487
1488 $selected_questions = [];
1489 if (!$skip_retrieve_selected_questions) {
1491 'importVerifiedFile',
1492 $importdir,
1493 $qtifile,
1494 $this->request
1495 );
1496 }
1497
1498 ilSession::set('tst_import_selected_questions', $selected_questions);
1499
1500 $imp = new ilImport($this->testrequest->getRefId());
1501 $map = $imp->getMapping();
1502 $map->addMapping('components/ILIAS/Test', 'tst', 'new_id', (string) $new_obj->getId());
1503
1508 if (is_file($importdir . DIRECTORY_SEPARATOR . '/manifest.xml')) {
1509 $imp->importObject($new_obj, $file_to_import, basename($file_to_import), 'tst', 'components/ILIAS/Test', true);
1510 } else {
1511 $test_importer = new ilTestImporter();
1512 $test_importer->setImport($imp);
1513 $test_importer->setInstallId(IL_INST_ID);
1514 $test_importer->setImportDirectory($importdir . '/' . $subdir);
1515 $test_importer->init();
1516
1517 $test_importer->importXmlRepresentation(
1518 '',
1519 '',
1520 '',
1521 $map,
1522 );
1523 }
1524
1525 if ($new_obj->getTestLogger()->isLoggingEnabled()) {
1526 $new_obj->getTestLogger()->logTestAdministrationInteraction(
1527 $new_obj->getTestLogger()->getInteractionFactory()->buildTestAdministrationInteraction(
1528 $new_obj->getRefId(),
1529 $this->user->getId(),
1530 TestAdministrationInteractionTypes::NEW_TEST_CREATED,
1531 []
1532 )
1533 );
1534 }
1535
1536 ilFileUtils::delDir($importdir);
1537 $this->deleteUploadedImportFile($path_to_uploaded_file_in_temp_dir);
1538 ilSession::clear('path_to_import_file');
1539 ilSession::clear('path_to_uploaded_file_in_temp_dir');
1540
1541 $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_imported"), true);
1542
1543 $question_skill_assignments_import_fails = new ilAssQuestionSkillAssignmentImportFails($new_obj->getId());
1544 if ($question_skill_assignments_import_fails->failedImportsRegistered()) {
1545 $this->tpl->setOnScreenMessage(
1546 'info',
1547 $question_skill_assignments_import_fails->getFailedImportsMessage($this->lng),
1548 true
1549 );
1550 }
1551
1552 $this->ctrl->setParameterByClass(ilObjTestGUI::class, 'ref_id', $new_obj->getRefId());
1553 $this->ctrl->redirectByClass(ilObjTestGUI::class);
1554 }
Import class.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static get(string $a_var)
static clear(string $a_var)
Importer class for files.
const IL_INST_ID
Definition: constants.php:40
retrieveSelectedQuestionsFromImportQuestionsSelectionForm(string $form_cmd, string $importdir, string $qtifile, ServerRequestInterface $request)

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

+ Here is the call graph for this function:

◆ infoScreenObject()

ilObjTestGUI::infoScreenObject ( )
private

Definition at line 2174 of file class.ilObjTestGUI.php.

2174 : void
2175 {
2176 $this->ctrl->redirectByClass(
2177 [ilRepositoryGUI::class, self::class, ilInfoScreenGUI::class]
2178 );
2179 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ insertQuestionsObject()

ilObjTestGUI::insertQuestionsObject ( ?array  $selected_array = null)
private

Definition at line 1658 of file class.ilObjTestGUI.php.

1658 : void
1659 {
1660 $this->protectByWritePermission();
1661
1662 if (($selected_array ?? $this->testrequest->getQuestionIds()) === []) {
1663 $this->tpl->setOnScreenMessage('info', $this->lng->txt('tst_insert_missing_question'), true);
1664 $this->ctrl->redirect($this, 'browseForQuestions');
1665 }
1666
1667 $this->getTestObject()->saveCompleteStatus($this->test_question_set_config_factory->getQuestionSetConfig());
1668 $this->tpl->setOnScreenMessage('success', $this->lng->txt('tst_questions_inserted'), true);
1669 $this->ctrl->redirect($this, self::SHOW_QUESTIONS_CMD);
1670 return;
1671 }

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

+ Here is the call graph for this function:

◆ isCommandClassAnyInfoScreenChild()

ilObjTestGUI::isCommandClassAnyInfoScreenChild ( )
private

Definition at line 2159 of file class.ilObjTestGUI.php.

2159 : bool
2160 {
2161 if (in_array(
2162 $this->ctrl->getCmdClass(),
2163 [
2164 strtolower(PublicProfileGUI::class),
2165 'ilobjportfoliogui'
2166 ]
2167 )) {
2168 return true;
2169 }
2170
2171 return false;
2172 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ participantsActionObject()

ilObjTestGUI::participantsActionObject ( )

Evaluates the actions on the participants page.

Definition at line 1991 of file class.ilObjTestGUI.php.

1991 : void
1992 {
1993 $command = $this->testrequest->strVal('command');
1994 if ($command === '') {
1995 $method = $command . 'Object';
1996 if (method_exists($this, $method)) {
1997 $this->$method();
1998 return;
1999 }
2000 }
2001 $this->ctrl->redirect($this, 'participants');
2002 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ populateQuestionBrowserToolbarButtons()

ilObjTestGUI::populateQuestionBrowserToolbarButtons ( ilToolbarGUI  $toolbar)
private

Definition at line 1898 of file class.ilObjTestGUI.php.

1898 : void
1899 {
1900 $this->ctrl->setParameterByClass(
1901 ilTestQuestionBrowserTableGUI::class,
1904 );
1905
1907 $this->lng->txt('tst_browse_for_qpl_questions'),
1908 $this->ctrl->getLinkTargetByClass(
1909 ilTestQuestionBrowserTableGUI::class,
1911 )
1912 );
1913
1914 $this->ctrl->setParameterByClass(
1915 ilTestQuestionBrowserTableGUI::class,
1918 );
1919
1921 $this->lng->txt('tst_browse_for_tst_questions'),
1922 $this->ctrl->getLinkTargetByClass(
1923 ilTestQuestionBrowserTableGUI::class,
1925 )
1926 );
1927 }
addButton(string $a_txt, string $a_cmd, string $a_target="", ?int $a_acc_key=null, string $a_additional_attrs='', string $a_id="", string $a_class='submit')

References ilToolbarGUI\addButton(), ilTestQuestionBrowserTableGUI\CMD_BROWSE_QUESTIONS, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilTestQuestionBrowserTableGUI\MODE_BROWSE_POOLS, ilTestQuestionBrowserTableGUI\MODE_BROWSE_TESTS, and ilTestQuestionBrowserTableGUI\MODE_PARAMETER.

+ Here is the call graph for this function:

◆ prepareSubGuiOutput()

ilObjTestGUI::prepareSubGuiOutput ( )
private

Definition at line 1309 of file class.ilObjTestGUI.php.

1310 {
1311 $this->tpl->loadStandardTemplate();
1312 $this->setLocator();
1313 $this->setTitleAndDescription();
1314 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ protectByWritePermission()

ilObjTestGUI::protectByWritePermission ( )
protected

Definition at line 2674 of file class.ilObjTestGUI.php.

2674 : void
2675 {
2676 if (!$this->access->checkAccess('write', '', $this->ref_id)) {
2677 $this->tpl->setOnScreenMessage('info', $this->lng->txt('cannot_edit_test'), true);
2678 $this->ctrl->redirectByClass([ilRepositoryGUI::class, self::class, ilInfoScreenGUI::class]);
2679 }
2680 }

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

Referenced by executeCommand().

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

◆ questionsTabGatewayObject()

ilObjTestGUI::questionsTabGatewayObject ( )
private

Definition at line 1244 of file class.ilObjTestGUI.php.

1245 {
1246 if ($this->getTestObject()->isRandomTest()) {
1247 $this->ctrl->redirectByClass('ilTestRandomQuestionSetConfigGUI');
1248 }
1249
1250 $this->ctrl->redirectByClass('ilObjTestGUI', self::SHOW_QUESTIONS_CMD);
1251 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ redirectAfterMissingRead()

ilObjTestGUI::redirectAfterMissingRead ( )
protected

Definition at line 967 of file class.ilObjTestGUI.php.

967 : void
968 {
969 $this->tpl->setOnScreenMessage('failure', sprintf(
970 $this->lng->txt("msg_no_perm_read_item"),
971 $this->object->getTitle()
972 ), true);
973 $this->ctrl->setParameterByClass('ilrepositorygui', 'ref_id', ROOT_FOLDER_ID);
974 $this->ctrl->redirectByClass('ilrepositorygui');
975 }

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

Referenced by executeCommand().

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

◆ redirectAfterMissingWrite()

ilObjTestGUI::redirectAfterMissingWrite ( )
protected

Definition at line 959 of file class.ilObjTestGUI.php.

960 {
961 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_permission'), true);
962 $target_class = get_class($this->object) . 'GUI';
963 $this->ctrl->setParameterByClass($target_class, 'ref_id', $this->ref_id);
964 $this->ctrl->redirectByClass($target_class);
965 }

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

Referenced by executeCommand().

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

◆ redirectTo_SettingsMainGUI_showForm_Object()

ilObjTestGUI::redirectTo_SettingsMainGUI_showForm_Object ( )
private

Definition at line 1304 of file class.ilObjTestGUI.php.

1305 {
1306 $this->ctrl->redirectByClass(SettingsMainGUI::class, SettingsMainGUI::CMD_SHOW_FORM);
1307 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ removeImportFailsObject()

ilObjTestGUI::removeImportFailsObject ( )
protected

Definition at line 2310 of file class.ilObjTestGUI.php.

2311 {
2312 $qsaImportFails = new ilAssQuestionSkillAssignmentImportFails($this->getTestObject()->getId());
2313 $qsaImportFails->deleteRegisteredImportFails();
2314 $sltImportFails = new ilTestSkillLevelThresholdImportFails($this->getTestObject()->getId());
2315 $sltImportFails->deleteRegisteredImportFails();
2316
2317 $this->ctrl->redirectByClass([ilRepositoryGUI::class, self::class, ilInfoScreenGUI::class]);
2318 }

References ILIAS\Repository\ctrl(), and ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ retrieveAdditionalDidacticTemplateOptions()

ilObjTestGUI::retrieveAdditionalDidacticTemplateOptions ( )
Returns
array<string>

Reimplemented from ilObjectGUI.

Definition at line 1391 of file class.ilObjTestGUI.php.

1391 : array
1392 {
1393 $tst = new ilObjTest();
1394 $defaults = $tst->getAvailableDefaults();
1395 if ($defaults === []) {
1396 return [];
1397 }
1398
1399 $additional_options = [];
1400 foreach ($defaults as $row) {
1401 $additional_options["tstdef_" . $row["test_defaults_id"]] = [$row["name"],
1402 $this->lng->txt("tst_default_settings")];
1403 }
1404 return $additional_options;
1405 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ runObject()

ilObjTestGUI::runObject ( )

Definition at line 1316 of file class.ilObjTestGUI.php.

1317 {
1318 $this->ctrl->redirectByClass([ilRepositoryGUI::class, self::class, ilInfoScreenGUI::class]);
1319 }

References ILIAS\Repository\ctrl().

Referenced by ilObjTestGUITest\testRunObject().

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

◆ setTestAccess()

ilObjTestGUI::setTestAccess ( ilTestAccess  $test_access)

Definition at line 1288 of file class.ilObjTestGUI.php.

1289 {
1290 $this->test_access = $test_access;
1291 }

◆ setupToolBarAndMessage()

ilObjTestGUI::setupToolBarAndMessage ( bool  $has_started_test_runs)
private

Definition at line 1869 of file class.ilObjTestGUI.php.

1869 : void
1870 {
1871 if (!$this->access->checkAccess('write', '', $this->ref_id)
1872 || $this->getTestObject()->isRandomTest()) {
1873 return;
1874 }
1875
1876 if ($has_started_test_runs) {
1877 $link = $this->ui_factory->link()->standard(
1878 $this->lng->txt('test_has_datasets_warning_page_view_link'),
1879 $this->ctrl->getLinkTargetByClass([\ilTestParticipantsGUI::class])
1880 );
1881
1882 $message = $this->lng->txt('test_has_datasets_warning_page_view');
1883 $massage_box = $this->ui_factory->messageBox()->info($message)->withLinks([$link]);
1884 $this->tpl->setCurrentBlock('mess');
1885 $this->tpl->setVariable(
1886 'MESSAGE',
1887 $this->ui_renderer->render($massage_box)
1888 );
1889 $this->tpl->parseCurrentBlock();
1890 return;
1891 }
1892
1893 $this->toolbar->addButton($this->lng->txt('ass_create_question'), $this->ctrl->getLinkTarget($this, 'createQuestionForm'));
1894 $this->toolbar->addSeparator();
1896 }
populateQuestionBrowserToolbarButtons(ilToolbarGUI $toolbar)
$message
Definition: xapiexit.php:31

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

+ Here is the call graph for this function:

◆ showEditTestPageGUI()

ilObjTestGUI::showEditTestPageGUI ( )
private

Definition at line 1253 of file class.ilObjTestGUI.php.

1253 : void
1254 {
1255 $this->prepareOutput();
1256 $this->tabs_manager->getSettingsSubTabs();
1257
1258 if ($this->request_wrapper->has('page_type')
1259 && $this->request_wrapper->retrieve(
1260 'page_type',
1261 $this->refinery->kindlyTo()->string()
1262 ) === 'introductionpage'
1263 ) {
1264 $page_type = 'IntroductionPage';
1265 $this->tabs_manager->activateSubTab(TabsManager::SETTINGS_SUBTAB_ID_EDIT_INTRODUCTION_PAGE);
1266 $page_id = $this->getTestObject()->getIntroductionPageId();
1267 } else {
1268 $page_type = 'ConcludingRemarksPage';
1269 $this->tabs_manager->activateSubTab(TabsManager::SETTINGS_SUBTAB_ID_EDIT_CONCLUSION_PAGE);
1270 $page_id = $this->getTestObject()->getConcludingRemarksPageId();
1271 }
1272 $this->ctrl->saveParameterByClass(ilTestPageGUI::class, 'page_type');
1273
1274 $gui = new ilTestPageGUI('tst', $page_id);
1275 $this->content_style->gui()->addCss($this->tpl, $this->ref_id);
1276 $this->tpl->setContent($this->ctrl->forwardCommand($gui));
1277
1278 if ($this->ctrl->getCmdClass() === strtolower(ilTestPageGUI::class)) {
1279 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
1280 }
1281 }

References ILIAS\Repository\ctrl().

Referenced by executeCommand().

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

◆ showNextViewAfterQuestionSave()

ilObjTestGUI::showNextViewAfterQuestionSave ( assQuestionGUI  $question_gui,
string  $target 
)
private

Definition at line 1188 of file class.ilObjTestGUI.php.

1188 : void
1189 {
1190 if ($target === 'return') {
1193 $question_gui
1194 );
1195 }
1196
1197 if ($target === 'stay') {
1198 $this->ctrl->setParameterByClass(ilAssQuestionPreviewGUI::class, 'q_id', $question_gui->getObject()->getId());
1199 $this->tabs_gui->setBackTarget(
1200 $this->lng->txt('backtocallingpage'),
1201 $this->ctrl->getLinkTargetByClass(
1202 ilAssQuestionPreviewGUI::class,
1204 )
1205 );
1206 $question_gui->editQuestion(false, false);
1207 }
1208 }
editQuestion(bool $checkonly=false, ?bool $is_save_cmd=null)

References ilAssQuestionPreviewGUI\CMD_SHOW, ILIAS\Repository\ctrl(), assQuestionGUI\editQuestion(), assQuestionGUI\getObject(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ showQuestionsObject()

ilObjTestGUI::showQuestionsObject ( )

Definition at line 1815 of file class.ilObjTestGUI.php.

1816 {
1817 $this->protectByWritePermission();
1818
1819 if ($this->testrequest->raw('add')) {
1820 $this->addQuestion();
1821 return;
1822 }
1823
1825 if (($table_cmd = $table_query->getTableAction()) !== null) {
1826 if (!$this->getQuestionsTableActions()->handleCommand(
1827 $table_cmd,
1828 $table_query->getRowIds($this->object),
1829 fn() => $this->protectByWritePermission(),
1830 fn() => $this->createQuestionpoolTargetObject('copyAndLinkQuestionsToPool'),
1831 fn() => $this->getTable()
1832 )) {
1833 return;
1834 }
1835 }
1836
1837 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.il_as_tst_questions.html', 'components/ILIAS/Test');
1838
1839 $this->setupToolBarAndMessage($this->getTestObject()->evalTotalPersons() !== 0);
1840
1841 $this->tabs_manager->getQuestionsSubTabs();
1842 $this->tabs_manager->activateSubTab(TabsManager::SUBTAB_ID_QST_LIST_VIEW);
1843
1844 $this->tpl->setCurrentBlock('adm_content');
1845 $this->tpl->setVariable('ACTION_QUESTION_FORM', $this->ctrl->getFormAction($this));
1846 $this->tpl->setVariable(
1847 'QUESTIONBROWSER',
1848 $this->ui_renderer->render(
1849 $this->getTable()->getTableComponent()
1850 )
1851 );
1852 $this->tpl->parseCurrentBlock();
1853 }
setupToolBarAndMessage(bool $has_started_test_runs)

References ILIAS\Repository\ctrl(), ILIAS\Test\Questions\Presentation\QuestionsTableQuery\getRowIds(), and ILIAS\Test\Questions\Presentation\QuestionsTableQuery\getTableAction().

+ Here is the call graph for this function:

◆ statisticsObject()

ilObjTestGUI::statisticsObject ( )

Definition at line 2387 of file class.ilObjTestGUI.php.

2388 {
2389 }

◆ takenObject()

ilObjTestGUI::takenObject ( )

Definition at line 1929 of file class.ilObjTestGUI.php.

1929 : void
1930 {
1931 }

◆ trackTestObjectReadEvent()

ilObjTestGUI::trackTestObjectReadEvent ( )
protected

Definition at line 1210 of file class.ilObjTestGUI.php.

1211 {
1213 $this->getTestObject()->getType(),
1214 $this->getTestObject()->getRefId(),
1215 $this->getTestObject()->getId(),
1216 $this->user->getId()
1217 );
1218 }
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)

References ilChangeEvent\_recordReadEvent(), ILIAS\Survey\Mode\getId(), and ILIAS\Repository\user().

Referenced by executeCommand().

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

Field Documentation

◆ $archives

Archives ilObjTestGUI::$archives
private

Definition at line 146 of file class.ilObjTestGUI.php.

◆ $component_factory

ilComponentFactory ilObjTestGUI::$component_factory
protected

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

◆ $component_repository

ilComponentRepository ilObjTestGUI::$component_repository
protected

Definition at line 136 of file class.ilObjTestGUI.php.

◆ $content_style

ContentStyle ilObjTestGUI::$content_style
private

Definition at line 140 of file class.ilObjTestGUI.php.

◆ $create_question_mode

bool ilObjTestGUI::$create_question_mode
protected

Definition at line 158 of file class.ilObjTestGUI.php.

◆ $data_factory

DataFactory ilObjTestGUI::$data_factory
protected

Definition at line 155 of file class.ilObjTestGUI.php.

◆ $db

ilDBInterface ilObjTestGUI::$db
protected

Definition at line 138 of file class.ilObjTestGUI.php.

◆ $export_factory

ExportImportFactory ilObjTestGUI::$export_factory
private

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

◆ $export_repository

ExportRepository ilObjTestGUI::$export_repository
private

Definition at line 125 of file class.ilObjTestGUI.php.

◆ $global_screen

GlobalScreen ilObjTestGUI::$global_screen
protected

Definition at line 142 of file class.ilObjTestGUI.php.

◆ $help

ilHelpGUI ilObjTestGUI::$help
protected

Definition at line 141 of file class.ilObjTestGUI.php.

◆ $irss

IRSS ilObjTestGUI::$irss
protected

Definition at line 145 of file class.ilObjTestGUI.php.

◆ $navigation_history

ilNavigationHistory ilObjTestGUI::$navigation_history
protected

Definition at line 135 of file class.ilObjTestGUI.php.

◆ $obj_data_cache

ilObjectDataCache ilObjTestGUI::$obj_data_cache
protected

Definition at line 143 of file class.ilObjTestGUI.php.

◆ $objective_oriented_container

ilTestObjectiveOrientedContainer ilObjTestGUI::$objective_oriented_container
private

Definition at line 133 of file class.ilObjTestGUI.php.

◆ $participant_access_filter_factory

ilTestParticipantAccessFilterFactory ilObjTestGUI::$participant_access_filter_factory
private

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

◆ $participant_repository

ParticipantRepository ilObjTestGUI::$participant_repository
protected

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

◆ $qplrequest

QPLRequestDataCollector ilObjTestGUI::$qplrequest
private

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

◆ $questionrepository

GeneralQuestionPropertiesRepository ilObjTestGUI::$questionrepository
private

Definition at line 127 of file class.ilObjTestGUI.php.

◆ $response_handler

ResponseHandler ilObjTestGUI::$response_handler
protected

Definition at line 148 of file class.ilObjTestGUI.php.

◆ $results_data_factory

ResultsDataFactory ilObjTestGUI::$results_data_factory
protected

Definition at line 150 of file class.ilObjTestGUI.php.

◆ $results_presentation_factory

ResultsPresentationFactory ilObjTestGUI::$results_presentation_factory
protected

Definition at line 151 of file class.ilObjTestGUI.php.

◆ $skills_service

SkillService ilObjTestGUI::$skills_service
protected

Definition at line 144 of file class.ilObjTestGUI.php.

◆ $table_actions

QuestionsTableActions ilObjTestGUI::$table_actions = null
protected

Definition at line 154 of file class.ilObjTestGUI.php.

◆ $table_query

QuestionsTableQuery ilObjTestGUI::$table_query = null
protected

Definition at line 153 of file class.ilObjTestGUI.php.

◆ $tabs_manager

TabsManager ilObjTestGUI::$tabs_manager = null
protected

Definition at line 132 of file class.ilObjTestGUI.php.

◆ $taxonomy

TaxonomyService ilObjTestGUI::$taxonomy
protected

Definition at line 156 of file class.ilObjTestGUI.php.

◆ $test_access

ilTestAccess ilObjTestGUI::$test_access
protected

Definition at line 134 of file class.ilObjTestGUI.php.

◆ $test_pass_result_repository

TestResultRepository ilObjTestGUI::$test_pass_result_repository
protected

Definition at line 152 of file class.ilObjTestGUI.php.

◆ $test_player_factory

ilTestPlayerFactory ilObjTestGUI::$test_player_factory
private

Definition at line 122 of file class.ilObjTestGUI.php.

◆ $test_question_set_config_factory

ilTestQuestionSetConfigFactory ilObjTestGUI::$test_question_set_config_factory
private

Definition at line 121 of file class.ilObjTestGUI.php.

◆ $test_questions_repository

TestQuestionsRepository ilObjTestGUI::$test_questions_repository
private

Definition at line 126 of file class.ilObjTestGUI.php.

◆ $test_session_factory

ilTestSessionFactory ilObjTestGUI::$test_session_factory
private

Definition at line 123 of file class.ilObjTestGUI.php.

◆ $testrequest

RequestDataCollector ilObjTestGUI::$testrequest
protected

Definition at line 147 of file class.ilObjTestGUI.php.

◆ $title_builder

TitleColumnsBuilder ilObjTestGUI::$title_builder
private

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

◆ $toplist_repository

TestTopListRepository ilObjTestGUI::$toplist_repository
private

Definition at line 128 of file class.ilObjTestGUI.php.

◆ $ui_service

ilUIService ilObjTestGUI::$ui_service
protected

Definition at line 139 of file class.ilObjTestGUI.php.

◆ QUESTION_CREATION_POOL_SELECTION_EXISTING_POOL

const ilObjTestGUI::QUESTION_CREATION_POOL_SELECTION_EXISTING_POOL = 3
private

Definition at line 119 of file class.ilObjTestGUI.php.

◆ QUESTION_CREATION_POOL_SELECTION_NEW_POOL

const ilObjTestGUI::QUESTION_CREATION_POOL_SELECTION_NEW_POOL = 2
private

Definition at line 118 of file class.ilObjTestGUI.php.

◆ QUESTION_CREATION_POOL_SELECTION_NO_POOL

const ilObjTestGUI::QUESTION_CREATION_POOL_SELECTION_NO_POOL = 1
private

Definition at line 117 of file class.ilObjTestGUI.php.

◆ SHOW_LOGS_CMD

const ilObjTestGUI::SHOW_LOGS_CMD = 'history'
private

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

◆ SHOW_QUESTIONS_CMD


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