ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
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 ()
 
 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...
 
 showTemplatesObject (?Modal $modal=null)
 
 createTemplateObject ()
 
 importTemplateObject ()
 
 executeTemplatesActionObject ()
 
 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)
 
 buildPersonalSettingsCreateAction ()
 
 buildPersonalSettingsImportAction ()
 
 buildPersonalSettingsTable ()
 
 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
 
PersonalSettingsRepository $personal_settings_templates_repository
 
MainSettingsRepository $main_settings_repository
 
ScoreSettingsRepository $score_settings_repository
 
MarksRepository $marks_repository
 
SettingsFactory $settings_factory
 
MarkSchemaFactory $mark_schema_factory
 
AdditionalInformationGenerator $additional_information_generator
 
PersonalSettingsExporter $personal_settings_exporter
 
QuestionsTableQuery $table_query = null
 
QuestionsTableActions $table_actions = null
 
DataFactory $data_factory
 
TaxonomyService $taxonomy
 
GUIFactory $gui_factory
 
SkillUsageService $skill_usage_service
 
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 ()
 
 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 ()
 
 userCanCreatePoolAtCurrentLocation ()
 

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: 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 @ilCtrl_Calls ilObjTestGUI: ILIAS\Test\Scoring\Manual\ConsecutiveScoringGUI @ilCtrl_Calls ilObjTestGUI: PersonalSettingsImportHandlerGUI

\

Definition at line 126 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 2439 of file class.ilObjTestGUI.php.

2440 {
2441 global $DIC;
2442 $main_tpl = $DIC->ui()->mainTemplate();
2443 $ilAccess = $DIC['ilAccess'];
2444 $ilErr = $DIC['ilErr'];
2445 $lng = $DIC['lng'];
2446
2447 if ($ilAccess->checkAccess('read', '', (int) $target)
2448 || $ilAccess->checkAccess('visible', '', (int) $target)) {
2449 $DIC->ctrl()->setParameterByClass(self::class, 'ref_id', (int) $target);
2450 $DIC->ctrl()->redirectByClass(
2451 [
2452 ilRepositoryGUI::class,
2453 ilObjTestGUI::class,
2454 TestScreenGUI::class
2455 ],
2456 TestScreenGUI::DEFAULT_CMD
2457 );
2458 } elseif ($ilAccess->checkAccess('read', '', ROOT_FOLDER_ID)) {
2459 $main_tpl->setOnScreenMessage('info', sprintf(
2460 $lng->txt('msg_no_perm_read_item'),
2462 ), true);
2464 }
2465
2466 $ilErr->raiseError($lng->txt('msg_no_perm_read_lm'), $ilErr->FATAL);
2467 }
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:

◆ addLocatorItems()

ilObjTestGUI::addLocatorItems ( )

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

Reimplemented from ilObjectGUI.

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

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

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 1159 of file class.ilObjTestGUI.php.

1161 : assQuestionGUI {
1162 if ($this->testrequest->isset('move_after_question_with_id')) {
1163 $question_gui->setMoveAfterQuestionId(
1164 $this->testrequest->int('move_after_question_with_id')
1165 );
1166 }
1167
1168 if ($this->testrequest->isset('pool_title')) {
1169 $question_gui->setCopyToNewPoolOnSave(
1170 $this->testrequest->strVal('pool_title')
1171 );
1172 }
1173
1174 if ($this->testrequest->isset('pool_ref')) {
1175 $question_gui->setCopyToExistingPoolOnSave(
1176 $this->testrequest->int('pool_ref')
1177 );
1178 }
1179 return $question_gui;
1180 }
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 1890 of file class.ilObjTestGUI.php.

1890 : void
1891 {
1892 $selected_array = [$this->testrequest->int('add')];
1893 $total = $this->getTestObject()->evalTotalPersons();
1894 if ($total > 0) {
1895 // the test was executed previously
1896 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('test_has_datasets_warning_page_view'));
1897 $this->showQuestionsObject();
1898 return;
1899 }
1900 $this->tpl->setOnScreenMessage('info', $this->lng->txt('tst_insert_questions'));
1901 $this->insertQuestionsObject($selected_array);
1902 }
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 1087 of file class.ilObjTestGUI.php.

1087 : void
1088 {
1089 $this->tpl->setTitle(
1090 $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
1091 "{$this->getTestObject()->getTitle()}: {$question_title}"
1092 )
1093 );
1094 }

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 1445 of file class.ilObjTestGUI.php.

1445 : void
1446 {
1447 $info = '';
1448 $new_object->saveToDb();
1449
1450 if ($new_object->getTestLogger()->isLoggingEnabled()) {
1451 $new_object->getTestLogger()->logTestAdministrationInteraction(
1452 $new_object->getTestLogger()->getInteractionFactory()->buildTestAdministrationInteraction(
1453 $this->getRefId(),
1454 $this->user->getId(),
1455 TestAdministrationInteractionTypes::NEW_TEST_CREATED,
1456 []
1457 )
1458 );
1459 }
1460
1461 if ($info === '') {
1462 $this->tpl->setOnScreenMessage('success', $this->lng->txt('object_added'), true);
1463 } else {
1464 $this->tpl->setOnScreenMessage('info', $this->lng->txt($info), true);
1465 }
1466 $this->ctrl->setParameter($this, 'ref_id', $new_object->getRefId());
1467 $this->ctrl->redirectByClass(SettingsMainGUI::class);
1468 }
$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:

◆ backToRepositoryObject()

ilObjTestGUI::backToRepositoryObject ( )

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

1472 {
1473 $path = $this->tree->getPathFull($this->getTestObject()->getRefID());
1474 ilUtil::redirect($this->getReturnLocation("cancel", "./ilias.php?baseClass=ilRepositoryGUI&cmd=frameset&ref_id=" . $path[count($path) - 2]["child"]));
1475 }
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 1775 of file class.ilObjTestGUI.php.

1775 : Input
1776 {
1777 if (!$this->getTestObject()->getGlobalSettings()->isPageEditorEnabled()) {
1778 return $this->ui_factory->input()->field()->hidden()->withValue(
1780 );
1781 }
1782
1783 return $this->ui_factory->input()->field()->radio($this->lng->txt('tst_add_quest_cont_edit_mode'))
1784 ->withOption(
1786 $this->lng->txt('tst_add_quest_cont_edit_mode_IPE'),
1787 $this->lng->txt('tst_add_quest_cont_edit_mode_IPE_info')
1788 )->withOption(
1790 $this->lng->txt('tst_add_quest_cont_edit_mode_RTE'),
1791 $this->lng->txt('tst_add_quest_cont_edit_mode_RTE_info')
1792 )
1794 }
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 1796 of file class.ilObjTestGUI.php.

1797 {
1798 $f = $this->ui_factory->input()->field();
1799 $kt = $this->refinery->kindlyTo();
1800
1801 $trafo = $this->refinery->custom()->transformation(
1802 static function ($values) use ($kt): array {
1803 $return['qpl_type'] = $kt->int()->transform($values[0]);
1804 if ($return['qpl_type'] === self::QUESTION_CREATION_POOL_SELECTION_NO_POOL) {
1805 return $return;
1806 }
1807 if ($return['qpl_type'] === self::QUESTION_CREATION_POOL_SELECTION_NEW_POOL) {
1808 return $return + ['title' => $kt->string()->transform($values[1][0])];
1809 }
1810 return $return + [
1811 'pool_ref_id' => $kt->int()->transform($values[1][0])
1812 ];
1813 }
1814 );
1815
1816 $questionpools = ilObjQuestionPool::_getAvailableQuestionpools(false, false, true, false, false, "write");
1817 $pools_data = [];
1818 foreach ($questionpools as $key => $p) {
1819 $pools_data[$key] = $p['title'];
1820 }
1821
1822 $inputs = [
1823 self::QUESTION_CREATION_POOL_SELECTION_NO_POOL => $f->group([], $this->lng->txt('assessment_no_pool')),
1824 self::QUESTION_CREATION_POOL_SELECTION_EXISTING_POOL => $f->group(
1825 [
1826 $f->select(
1827 $this->lng->txt('select_questionpool'),
1828 $pools_data
1829 )->withRequired(true)
1830 ],
1831 $this->lng->txt('assessment_existing_pool')
1832 )
1833 ];
1834
1837 [$f->text($this->lng->txt('name'))],
1838 $this->lng->txt('assessment_new_pool')
1839 );
1840 }
1841
1842 return $f->switchableGroup(
1843 $inputs,
1844 $this->lng->txt('assessment_pool_selection')
1845 )->withAdditionalTransformation($trafo)
1846 ->withRequired(true)
1847 ->withValue(1);
1848 }
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.
const QUESTION_CREATION_POOL_SELECTION_NEW_POOL
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 1762 of file class.ilObjTestGUI.php.

1762 : Select
1763 {
1764 $options = [0 => $this->lng->txt('first')];
1765 foreach ($questions as $key => $title) {
1766 $options[$key] = $this->lng->txt('behind') . ' ' . $title
1767 . ' [' . $this->lng->txt('question_id_short') . ': ' . $key . ']';
1768 }
1769 return $this->ui_factory->input()->field()->select(
1770 $this->lng->txt('position'),
1771 $options
1772 )->withAdditionalTransformation($this->refinery->kindlyTo()->int());
1773 }
This describes select field.
Definition: Select.php:29

References ILIAS\UI\Implementation\Component\Input\Field\$options, ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ buildInputQuestionType()

ilObjTestGUI::buildInputQuestionType ( )
private

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

1748 : Select
1749 {
1750 $question_types = (new ilObjQuestionPool())->getQuestionTypes(false, true, false);
1751 $options = [];
1752 foreach ($question_types as $label => $data) {
1753 $options[$data['question_type_id']] = $label;
1754 }
1755
1756 return $this->ui_factory->input()->field()->select(
1757 $this->lng->txt('question_type'),
1758 $options
1759 )->withRequired(true);
1760 }

References $data, ILIAS\UI\Implementation\Component\Input\Field\$options, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ buildPersonalSettingsCreateAction()

ilObjTestGUI::buildPersonalSettingsCreateAction ( )
protected

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

2119 {
2121 $this->ui_factory,
2122 $this->lng,
2123 $this->user,
2124 $this->personal_settings_templates_repository,
2125 $this->main_settings_repository,
2126 $this->score_settings_repository,
2127 $this->marks_repository
2128 );
2129 }

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

+ Here is the call graph for this function:

◆ buildPersonalSettingsImportAction()

ilObjTestGUI::buildPersonalSettingsImportAction ( )
protected

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

2132 {
2134 $this->ui_factory,
2135 $this->lng,
2136 $this->data_factory,
2137 $this->temp_file_system,
2138 $this->personal_settings_templates_repository,
2139 $this->main_settings_repository,
2140 $this->score_settings_repository,
2141 $this->marks_repository
2142 );
2143 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ buildPersonalSettingsTable()

ilObjTestGUI::buildPersonalSettingsTable ( )
protected

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

2146 {
2147 $actions = new PersonalSettingsTableActions(
2148 $this->testrequest,
2149 $this->response_handler,
2150 $this->ui_renderer,
2151 $this->ui_factory,
2152 $this->lng,
2153 $this->user,
2154 $this->personal_settings_templates_repository,
2155 [
2156 PersonalSettingsTableShowAction::ACTION_ID => new PersonalSettingsTableShowAction(
2157 $this->lng,
2158 $this->ui_factory,
2159 $this->user,
2160 $this->personal_settings_templates_repository,
2161 $this->main_settings_repository,
2162 $this->score_settings_repository,
2163 $this->marks_repository,
2164 $this->additional_information_generator
2165 ),
2166 PersonalSettingsTableApplyAction::ACTION_ID => new PersonalSettingsTableApplyAction(
2167 $this->lng,
2168 $this->ui_factory,
2169 $this->test_question_set_config_factory,
2170 $this->tpl,
2171 $this->getTestObject(),
2172 $this->personal_settings_templates_repository,
2173 $this->main_settings_repository,
2174 $this->score_settings_repository,
2175 $this->marks_repository
2176 ),
2177 PersonalSettingsTableExportAction::ACTION_ID => new PersonalSettingsTableExportAction(
2178 $this->lng,
2179 $this->ui_factory,
2180 $this->personal_settings_exporter
2181 ),
2182 PersonalSettingsTableDeleteAction::ACTION_ID => new PersonalSettingsTableDeleteAction(
2183 $this->lng,
2184 $this->ui_factory,
2185 $this->tpl,
2186 $this->personal_settings_templates_repository,
2187 $this->marks_repository
2188 ),
2189 ]
2190 );
2191
2192 $uri = $this->ctrl->getLinkTargetByClass(self::class, 'executeTemplatesAction', '', true);
2193 return new PersonalSettingsTable(
2194 $this->lng,
2195 $this->ui_factory,
2196 $this->data_factory,
2197 $this->user,
2198 $this->testrequest,
2199 $actions,
2200 new URLBuilder($this->data_factory->uri(ILIAS_HTTP_PATH . '/' . $uri)),
2201 $this->personal_settings_templates_repository,
2202 );
2203 }

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

+ Here is the call graph for this function:

◆ buildQuestionCreationForm()

ilObjTestGUI::buildQuestionCreationForm ( )
private

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

1718 : Form
1719 {
1720 $inputs['question_type'] = $this->buildInputQuestionType();
1721 $questions = $this->getTestObject()->getQuestionTitlesAndIndexes();
1722 if ($questions !== []) {
1723 $inputs['position'] = $this->buildInputPosition($questions);
1724 }
1725
1726 $inputs['editing_type'] = $this->buildInputEditingType();
1727
1728 if ($inputs['editing_type'] instanceof Radio) {
1729 $sub_screen_id[] = 'editMode';
1730 }
1731
1732 $sub_screen_id[] = 'poolSelect';
1733
1734 $inputs['pool_selection'] = $this->buildInputPoolSelection();
1735
1736 $section = [
1737 $this->ui_factory->input()->field()->section($inputs, $this->lng->txt('ass_create_question'))
1738 ];
1739
1740 $form = $this->ui_factory->input()->container()->form()->standard(
1741 $this->ctrl->getFormAction($this, 'createQuestion'),
1742 $section
1743 )->withSubmitLabel($this->lng->txt('create'));
1744
1745 return $form;
1746 }
buildInputPosition(array $questions)
This describes commonalities between all forms.
Definition: Form.php:34
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 1678 of file class.ilObjTestGUI.php.

1678 : void
1679 {
1680 $this->ctrl->redirect($this, self::SHOW_QUESTIONS_CMD);
1681 }

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 2391 of file class.ilObjTestGUI.php.

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

◆ copyAndLinkQuestionsToPoolObject()

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

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

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

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

◆ copyQuestionsToPoolObject()

ilObjTestGUI::copyQuestionsToPoolObject ( )

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

2470 {
2471 $this->copyQuestionsToPool($this->testrequest->raw('q_id'), $this->testrequest->raw('sel_qpl'));
2472 $this->ctrl->redirect($this, self::SHOW_QUESTIONS_CMD);
2473 }

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 2495 of file class.ilObjTestGUI.php.

2495 : int
2496 {
2497 $new_title = $target_pool->appendCounterToQuestionTitleIfNecessary(
2498 $source_question_gui->getObject()->getTitle()
2499 );
2500
2501 return $source_question_gui->getObject()->createNewOriginalFromThisDuplicate($target_pool->getId(), $new_title);
2502 }
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 2551 of file class.ilObjTestGUI.php.

2552 {
2553 $this->createQuestionpoolTargetObject('copyQuestionsToPool');
2554 }
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 1698 of file class.ilObjTestGUI.php.

1698 : void
1699 {
1700 $this->protectByWritePermission();
1701
1702 $this->tabs_manager->getQuestionsSubTabs();
1703 $this->tabs_manager->activateSubTab(TabsManager::SUBTAB_ID_QST_LIST_VIEW);
1704
1705 $sub_screen_id = ['createQuestion'];
1706
1707 $this->tabs_manager->activateTab(TabsManager::TAB_ID_QUESTIONS);
1708 $this->help->setScreenId('assQuestions');
1709 $this->help->setSubScreenId(implode('_', $sub_screen_id));
1710
1711 $this->tpl->setContent(
1712 $this->ui_renderer->render(
1713 $form ?? $this->buildQuestionCreationForm()
1714 )
1715 );
1716 }

References ILIAS\Repository\help().

+ Here is the call graph for this function:

◆ createQuestionPool()

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

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

1607 {
1608 $parent_ref = $this->tree->getParentId($this->getTestObject()->getRefId());
1609 $qpl = new ilObjQuestionPool();
1610 $qpl->setType("qpl");
1611 $qpl->setTitle($name);
1612 $qpl->setDescription($description);
1613 $qpl->create();
1614 $qpl->createReference();
1615 $qpl->putInTree($parent_ref);
1616 $qpl->setPermissions($parent_ref);
1617 $qpl->getObjectProperties()->storePropertyIsOnline($qpl->getObjectProperties()->getPropertyIsOnline()->withOnline()); // must be online to be available
1618 $qpl->saveToDb();
1619 return $qpl;
1620 }

◆ createQuestionPoolAndCopyObject()

ilObjTestGUI::createQuestionPoolAndCopyObject ( )

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

2557 {
2558 if (!$this->access->checkAccess('write', '', $this->object->getRefId())
2559 || !$this->checkPermissionBool('create', '', 'qpl')) {
2561 }
2562
2563 if ($this->testrequest->raw('title')) {
2564 $title = $this->testrequest->raw('title');
2565 } else {
2566 $title = $this->testrequest->raw('txt_qpl');
2567 }
2568
2569 if (!$title) {
2570 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('questionpool_not_entered'));
2571 $this->createQuestionpoolTargetObject('createQuestionPoolAndCopy');
2572 return;
2573 }
2574
2575 $question_pool = $this->createQuestionPool($title, $this->testrequest->raw('description'));
2576 $_REQUEST['sel_qpl'] = $question_pool->getRefId();
2577
2579 }
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 2585 of file class.ilObjTestGUI.php.

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

◆ createTemplateObject()

ilObjTestGUI::createTemplateObject ( )

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

2076 : void
2077 {
2078 $this->protectByWritePermission();
2079
2080 try {
2082 ->perform($this->getTestObject()->getTestId(), $this->request);
2083 } catch (\InvalidArgumentException $e) {
2084 $this->tpl->setOnScreenMessage('failure', $this->lng->txt($e->getMessage()), true);
2085 }
2086
2087 $this->ctrl->redirectByClass(self::class, 'showTemplates');
2088 }

References Vendor\Package\$e, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ determineObjectiveOrientedContainer()

ilObjTestGUI::determineObjectiveOrientedContainer ( )
protected

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

2680 {
2681 if (!ilLOSettings::isObjectiveTest($this->ref_id)) {
2682 return;
2683 }
2684
2685 $path = $this->tree->getPathFull($this->ref_id);
2686
2687 while ($parent = array_pop($path)) {
2688 if ($parent['type'] === 'crs') {
2689 $container_ref_id = $parent['ref_id'];
2690 break;
2691 }
2692 }
2693
2694 $container_obj_id = ilObject2::_lookupObjId($container_ref_id);
2695
2696 $this->objective_oriented_container->setObjId($container_obj_id);
2697 $this->objective_oriented_container->setRefId($container_ref_id);
2698 }
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 1599 of file class.ilObjTestGUI.php.

1600 {
1601 $pg_obj = new ilAssQuestionPage($this->testrequest->raw("pg_id"));
1602 $pg_obj->sendParagraph($this->testrequest->raw("par_id"), $this->testrequest->raw("downloadtitle"));
1603 exit;
1604 }
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 1576 of file class.ilObjTestGUI.php.

1577 {
1578 $file = explode("_", $this->testrequest->raw("file_id"));
1579 $fileObj = new ilObjFile((int) $file[count($file) - 1], false);
1580 $fileObj->sendFile();
1581 exit;
1582 }
Class ilObjFile.

References exit.

◆ executeAfterQuestionCreationTasks()

ilObjTestGUI::executeAfterQuestionCreationTasks ( assQuestionGUI  $question_gui)
private

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

1195 : void
1196 {
1197 if ($this->getTestObject()->getQuestionSetType() === ilObjTest::QUESTION_SET_TYPE_FIXED
1198 && !in_array($question_gui->getObject()->getId(), $this->getTestObject()->getQuestions())) {
1199 $this->getTestObject()->insertQuestion($question_gui->getObject()->getId(), true);
1200 }
1201
1202 if ($question_gui->getMoveAfterQuestionId() !== null) {
1203 $this->getTestObject()->moveQuestions(
1204 [$question_gui->getObject()->getId()],
1205 $question_gui->getMoveAfterQuestionId() === 0
1206 ? $this->getTestObject()->getQuestions()[1]
1207 : $question_gui->getMoveAfterQuestionId(),
1208 $question_gui->getMoveAfterQuestionId() === 0 ? 0 : 1
1209 );
1210 $question_gui->setMoveAfterQuestionId(null);
1211 }
1212
1213 if ($question_gui->getCopyToExistingPoolOnSave() !== null) {
1214 $original_id = $this->copyQuestionToPool(
1215 $question_gui,
1217 );
1218 assQuestion::saveOriginalId($question_gui->getObject()->getId(), $original_id);
1219 $question_gui->setCopyToExistingPoolOnSave(null);
1220 }
1221
1222 if ($question_gui->getCopyToNewPoolOnSave() !== null) {
1223 $question_pool = $this->createQuestionPool($question_gui->getCopyToNewPoolOnSave());
1224 $original_id = $this->copyQuestionToPool(
1225 $question_gui,
1226 $question_pool
1227 );
1228 assQuestion::saveOriginalId($question_gui->getObject()->getId(), $original_id);
1229 $question_gui->setCopyToNewPoolOnSave(null);
1230 }
1231 }
const QUESTION_SET_TYPE_FIXED

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 1182 of file class.ilObjTestGUI.php.

1182 : void
1183 {
1184 if ($this->getTestObject()->getTestLogger()->isLoggingEnabled()) {
1185 $this->getTestObject()->getTestLogger()->logQuestionAdministrationInteraction(
1186 $question_gui->getObject()->toQuestionAdministrationInteraction(
1187 $this->getTestObject()->getTestLogger()->getAdditionalInformationGenerator(),
1188 $this->getTestObject()->getRefId(),
1189 TestQuestionAdministrationInteractionTypes::QUESTION_MODIFIED
1190 )
1191 );
1192 }
1193 }

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 291 of file class.ilObjTestGUI.php.

291 : void
292 {
293 if ($this->object === null) {
294 $this->error->raiseError($this->lng->txt('tst_settings_not_found_msg'), $this->error->MESSAGE);
295 return;
296 }
297
298 $cmd = $this->ctrl->getCmd('testScreen');
299
300 $cmds_disabled_due_to_offline_status = [
301 'resumePlayer', 'resumePlayer', 'outUserResultsOverview', 'outUserListOfAnswerPasses'
302 ];
303
304 if (!$this->getCreationMode() && $this->object->getOfflineStatus() && in_array($cmd, $cmds_disabled_due_to_offline_status)) {
305 $cmd = 'infoScreen';
306 }
307
308 $next_class = $this->ctrl->getNextClass($this);
309
310 // add entry to navigation history
311 if (!$this->getCreationMode() &&
312 $this->access->checkAccess('read', '', $this->testrequest->getRefId())
313 ) {
314 $this->navigation_history->addItem(
315 $this->testrequest->getRefId(),
316 ilLink::_getLink($this->testrequest->getRefId(), 'tst'),
317 'tst',
318 );
319 }
320
322
323 switch ($next_class) {
324 case 'illtiproviderobjectsettinggui':
325 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
327 }
328 $this->prepareOutput();
329 $this->addHeaderAction();
330 $this->tabs_manager->getSettingsSubTabs();
331 $this->tabs_manager->activateTab('settings');
332 $this->tabs_manager->activateSubTab('lti_provider');
333 $lti_gui = new ilLTIProviderObjectSettingGUI($this->getTestObject()->getRefId());
334 $lti_gui->setCustomRolesForSelection($this->rbac_review->getLocalRoles($this->getTestObject()->getRefId()));
335 $lti_gui->offerLTIRolesForSelection(false);
336 $this->ctrl->forwardCommand($lti_gui);
337 break;
338
339 case 'iltestexportgui':
340 if (!$this->access->checkAccess('write', '', $this->ref_id)) {
342 }
343
344 $this->prepareOutput();
345 $this->addHeaderAction();
346 $this->tabs_manager->activateTab(TabsManager::TAB_ID_EXPORT);
347
348 $selected_files = [];
349 if ($this->testrequest->isset('file') && $this->testrequest->raw('file')) {
350 $selected_files = $this->testrequest->raw('file');
351 }
352
353 if (is_string($selected_files)) {
354 $selected_files = [$selected_files];
355 }
356
357 $export_gui = new ilTestExportGUI(
358 $this,
359 $this->db,
360 $this->obj_data_cache,
361 $this->user,
362 $this->ui_factory,
363 $this->ui_renderer,
364 $this->irss,
365 $this->request,
366 $this->export_repository,
367 $this->temp_file_system,
368 $this->participant_access_filter_factory,
369 $this->test_pass_result_repository,
371 );
372 $this->ctrl->forwardCommand($export_gui);
373 break;
374
375 case strtolower(ilInfoScreenGUI::class):
376 if (
377 !$this->access->checkAccess('read', '', $this->testrequest->getRefId())
378 && !$this->access->checkAccess('visible', '', $this->testrequest->getRefId())
379 ) {
381 }
382
383 $this->prepareOutput();
384 $this->addHeaderAction();
385 $this->forwardToInfoScreen();
386 break;
387
388 case strtolower(TestScreenGUI::class):
389 if (!$this->access->checkAccess('read', '', $this->testrequest->getRefId()) && !$this->access->checkAccess('visible', '', $this->testrequest->getRefId())) {
391 }
392 $this->prepareOutput();
393 $this->addHeaderAction();
394 $this->ctrl->forwardCommand($this->getTestScreenGUIInstance());
395 break;
396
397 case 'ilobjectmetadatagui':
398 if (!$this->access->checkAccess('write', '', $this->getTestObject()->getRefId())) {
400 }
401
402 $this->prepareOutput();
403 $this->addHeaderAction();
404 $this->tabs_manager->activateTab(TabsManager::TAB_ID_META_DATA);
405 $md_gui = new ilObjectMetaDataGUI($this->getTestObject());
406 $this->ctrl->forwardCommand($md_gui);
407 break;
408
409 case strtolower(ilTestParticipantsGUI::class):
410 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
412 }
413
414 $gui = new ilTestParticipantsGUI(
415 $this->getTestObject(),
416 $this->user,
418 $this->test_question_set_config_factory->getQuestionSetConfig(),
419 $this->access,
420 $this->test_access,
421 $this->tpl,
422 $this->ui_factory,
423 $this->ui_renderer,
424 $this->ui_service,
425 $this->data_factory,
426 $this->lng,
427 $this->ctrl,
428 $this->refinery,
429 $this->db,
430 $this->tabs_manager,
431 $this->toolbar,
432 $this->component_factory,
433 $this->export_factory,
434 $this->testrequest,
435 $this->response_handler,
436 $this->participant_repository,
437 $this->results_data_factory,
438 $this->results_presentation_factory,
439 $this->test_pass_result_repository
440 );
441
442 $this->ctrl->forwardCommand($gui);
443
449 $this->prepareOutput();
450 $this->addHeaderAction();
451 $this->tabs_manager->activateTab(TabsManager::TAB_ID_PARTICIPANTS);
452
453 break;
454
455 case 'iltestresultsgui':
456 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
458 }
459 $this->prepareOutput();
460 $this->addHeaderAction();
461
462 $gui = new ilTestResultsGUI(
463 $this->getTestObject(),
464 $this->ctrl,
465 $this->test_access,
466 $this->db,
467 $this->refinery,
468 $this->user,
469 $this->lng,
470 $this->getTestObject()->getTestlogger(),
471 $this->component_repository,
472 $this->tabs_manager,
473 $this->toolbar,
474 $this->tpl,
475 $this->ui_factory,
476 $this->ui_renderer,
477 $this->skills_service,
478 $this->questionrepository,
479 $this->toplist_repository,
480 $this->testrequest,
481 $this->http,
482 $this->data_factory,
483 $this->test_session_factory->getSession(),
484 $this->getObjectiveOrientedContainer(),
485 $this->participant_repository
486 );
487
488 $this->ctrl->forwardCommand($gui);
489 break;
490
491 case "iltestplayerfixedquestionsetgui":
492 if (
493 $cmd !== 'autosave' &&
494 (!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))
495 ) {
497 }
499 if (!$this->getTestObject()->getKioskMode()) {
500 $this->prepareOutput();
501 }
503 $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
504 $this->ctrl->forwardCommand($gui);
505 break;
506
507 case "iltestplayerrandomquestionsetgui":
508 if (
509 $cmd !== 'autosave' &&
510 (!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))
511 ) {
513 }
515 if (!$this->getTestObject()->getKioskMode()) {
516 $this->prepareOutput();
517 }
519 $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
520 $this->ctrl->forwardCommand($gui);
521 break;
522
523 case "iltestevaluationgui":
524 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
526 }
527 $this->forwardToEvaluationGUI();
528 break;
529
530 case "iltestservicegui":
531 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
533 }
534 $this->prepareOutput();
535 $this->addHeaderAction();
536 $serviceGUI = new ilTestServiceGUI($this->getTestObject());
537 $this->ctrl->forwardCommand($serviceGUI);
538 break;
539
540 case 'ilpermissiongui':
541 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
543 }
544 $this->prepareOutput();
545 $this->addHeaderAction();
546 $this->tabs_manager->activateTab(TabsManager::TAB_ID_PERMISSIONS);
547 $perm_gui = new ilPermissionGUI($this);
548 $ret = $this->ctrl->forwardCommand($perm_gui);
549 break;
550
551 case "illearningprogressgui":
552 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
554 }
555
556 $this->prepareOutput();
557 $this->addHeaderAction();
558 $this->tabs_manager->activateTab(TabsManager::TAB_ID_LEARNING_PROGRESS);
559
560 $test_session = $this->test_session_factory->getSessionByUserId($this->user->getId());
561 if (
562 !$this->test_access->checkOtherParticipantsLearningProgressAccess()
563 && !$this->getTestObject()->canShowTestResults($test_session)
564 && !\ilLearningProgressAccess::checkAccess($this->getTestObject()->getRefId())
565 ) {
566 $this->tpl->setOnScreenMessage(
567 'info',
568 $this->lng->txt('tst_res_tab_msg_no_lp_access'),
569 );
570 break;
571 }
572
574 $this->ctrl->forwardCommand($new_gui);
575
576 break;
577
578 case "ilcertificategui":
579 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
581 }
582 $this->prepareOutput();
583 $this->addHeaderAction();
584
585 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
586
588 $output_gui = $gui_factory->create($this->getTestObject());
589
590 $this->ctrl->forwardCommand($output_gui);
591 break;
592
593 case strtolower(ConsecutiveScoringGUI::class):
594 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
596 }
597 $output_gui = $this->gui_factory->get(ConsecutiveScoringGUI::class, $this->getTestObject());
598 $this->prepareOutput();
599 $this->ctrl->forwardCommand($output_gui);
600 $this->addHeaderAction();
601 break;
602
603
604 case strtolower(MarkSchemaGUI::class):
605 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
607 }
609
610 $mark_schema_gui = new MarkSchemaGUI(
611 $this->getTestObject(),
612 $this->user,
613 $this->lng,
614 $this->ctrl,
615 $this->tpl,
616 $this->toolbar,
617 $this->getObject()->getTestLogger(),
618 $this->post_wrapper,
619 $this->request_wrapper,
620 $this->response_handler,
621 $this->request,
622 $this->refinery,
623 $this->ui_factory,
624 $this->ui_renderer,
625 $this->mark_schema_factory
626 );
627 $this->ctrl->forwardCommand($mark_schema_gui);
628
629 $this->prepareOutput();
630 $this->addHeaderAction();
631 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
632 $this->tabs_manager->activateSubTab(TabsManager::SETTINGS_SUBTAB_ID_MARK_SCHEMA);
633
634 break;
635
636 case strtolower(SettingsMainGUI::class):
637 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
639 }
640
641 $gui = new SettingsMainGUI(
642 $this->tpl,
643 $this->ctrl,
644 $this->access,
645 $this->lng,
646 $this->tree,
647 $this->db,
648 $this->obj_data_cache,
649 $this->settings,
650 $this->ui_factory,
651 $this->ui_renderer,
652 $this->refinery,
653 $this->request,
654 $this->component_repository,
655 $this->user,
656 $this,
657 $this->getTestObject()->getTestLogger(),
658 $this->questionrepository
659 );
660 $this->ctrl->forwardCommand($gui);
661 $this->prepareOutput();
662 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
663 $this->tabs_manager->activateSubTab(TabsManager::SUBTAB_ID_GENERAL_SETTINGS);
664 $this->addHeaderAction();
665 break;
666
667 case strtolower(SettingsScoringGUI::class):
668 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
670 }
671 $this->prepareOutput();
672 $this->addHeaderAction();
673 $gui = new SettingsScoringGUI(
674 $this->ctrl,
675 $this->access,
676 $this->lng,
677 $this->tree,
678 $this->db,
679 $this->component_repository,
680 $this,
681 $this->tpl,
682 $this->tabs_gui,
683 $this->getTestObject()->getTestLogger(),
684 $this->getTestObject()->getScoreSettingsRepository(),
685 $this->getTestObject()->getTestId(),
686 $this->ui_factory,
687 $this->ui_renderer,
688 $this->refinery,
689 $this->request,
690 $this->user
691 );
692
693 $this->ctrl->forwardCommand($gui);
694 break;
695
696 case 'iltestrandomquestionsetconfiggui':
697 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
699 }
700 $this->prepareOutput();
701 $this->addHeaderAction();
702 $test_process_locker_factory = (new ilTestProcessLockerFactory(
703 new ilSetting('assessment'),
704 $this->db,
705 $this->getTestObject()->getTestLogger()
706 ))->withContextId($this->getTestObject()->getId());
708 $this->getTestObject(),
709 $this->ctrl,
710 $this->user,
711 $this->access,
712 $this->ui_factory,
713 $this->ui_renderer,
714 $this->data_factory,
715 $this->tabs_manager,
716 $this->lng,
717 $this->getTestObject()->getTestlogger(),
718 $this->tpl,
719 $this->db,
720 $this->tree,
721 $this->component_repository,
722 $this->obj_definition,
723 $this->obj_data_cache,
724 $test_process_locker_factory,
725 $this->testrequest,
726 $this->title_builder,
727 $this->questionrepository
728 );
729 $this->ctrl->forwardCommand($gui);
730 break;
731
732 case 'iltestquestionbrowsertablegui':
733 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
735 }
736 $this->prepareOutput();
737 $this->addHeaderAction();
739 $this->tabs_gui,
740 $this->tree,
741 $this->db,
742 $this->getTestObject()->getTestlogger(),
743 $this->component_repository,
744 $this->getTestObject(),
745 $this->user,
746 $this->access,
747 $this->http,
748 $this->refinery,
749 $this->ui_factory,
750 $this->ui_renderer,
751 $this->testrequest,
752 $this->questionrepository,
753 $this->lng,
754 $this->ctrl,
755 $this->tpl,
756 $this->ui_service,
757 $this->data_factory,
758 $this->taxonomy,
759 );
760 $this->ctrl->forwardCommand($gui);
761 break;
762
763 case 'iltestskilladministrationgui':
764 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
766 }
767 $this->prepareOutput();
768 $this->addHeaderAction();
770 $this->ctrl,
771 $this->access,
772 $this->tabs_manager,
773 $this->tpl,
774 $this->lng,
775 $this->refinery,
776 $this->db,
777 $this->getTestObject()->getTestlogger(),
778 $this->tree,
779 $this->component_repository,
780 $this->getTestObject(),
781 $this->questionrepository,
782 $this->testrequest,
783 $this->http,
784 $this->toolbar,
785 $this->skill_usage_service,
786 $this->ui_factory,
787 $this->ui_renderer,
788 $this->tabs_gui,
789 $this->ref_id
790 );
791 $this->ctrl->forwardCommand($gui);
792 break;
793
794 case 'ilobjectcopygui':
795 if ((!$this->access->checkAccess("copy", "", $this->testrequest->getRefId()))) {
797 }
798 $this->prepareOutput();
799 $this->addHeaderAction();
800 $cp = new ilObjectCopyGUI($this);
801 $cp->setType('tst');
802 $this->ctrl->forwardCommand($cp);
803 break;
804
805 case strtolower(ilAssQuestionPreviewGUI::class):
806 if (!$this->access->checkAccess('write', '', $this->getTestObject()->getRefId())) {
808 }
809 $this->prepareOutput();
811 break;
812 case 'ilassquestionpagegui':
813 if ($cmd === 'finishEditing') {
814 $this->prepareOutput();
816 break;
817 }
818 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
820 }
821 if ($cmd === 'edit' && !$this->access->checkAccess('write', '', $this->testrequest->getRefId())) {
823 }
824 $this->prepareOutput();
825 $forwarder = new ilAssQuestionPageCommandForwarder(
826 $this->getTestObject(),
827 $this->lng,
828 $this->ctrl,
829 $this->tpl,
830 $this->questionrepository,
831 $this->testrequest
832 );
833 $forwarder->forward();
834 break;
835
836 case 'ilassspecfeedbackpagegui':
837 if ((!$this->access->checkAccess("write", "", $this->testrequest->getRefId()))) {
839 }
840 $pg_gui = new ilAssSpecFeedbackPageGUI((int) $this->testrequest->raw("feedback_id"));
841 $this->ctrl->forwardCommand($pg_gui);
842 break;
843
844 case 'ilassgenfeedbackpagegui':
845 if ((!$this->access->checkAccess("write", "", $this->testrequest->getRefId()))) {
847 }
848 $pg_gui = new ilAssGenFeedbackPageGUI($this->testrequest->int("feedback_id"));
849 $this->ctrl->forwardCommand($pg_gui);
850 break;
851
852 case 'illocalunitconfigurationgui':
853 if ((!$this->access->checkAccess("write", "", $this->testrequest->getRefId()))) {
855 }
856 $this->prepareSubGuiOutput();
857
858 // set return target
860 $question = $question_gui->getObject();
861 $question->setObjId($this->getTestObject()->getId());
862 $question_gui->setObject($question);
863 $question_gui->setQuestionTabs();
865 new ilUnitConfigurationRepository($this->testrequest->getQuestionId())
866 );
867 $this->ctrl->forwardCommand($gui);
868 break;
869
870 case "ilcommonactiondispatchergui":
871 if (!$this->access->checkAccess("read", "", $this->testrequest->getRefId()) && !$this->access->checkAccess("visible", "", $this->testrequest->getRefId())) {
873 }
874 $this->prepareOutput();
876 $this->ctrl->forwardCommand($gui);
877 break;
878
879 case 'ilassquestionfeedbackeditinggui':
880 if (!$this->access->checkAccess('write', '', $this->getTestObject()->getRefId())) {
882 }
883 $this->prepareSubGuiOutput();
884
885 // set return target
886 $this->ctrl->setReturnByClass(self::class, self::SHOW_QUESTIONS_CMD);
888 $question = $question_gui->getObject();
889 $question->setObjId($this->getTestObject()->getId());
890 $question_gui->setObject($question);
891 $question_gui->setQuestionTabs();
892 $question_gui->setContextAllowsSyncToPool(true);
893
894 $this->addQuestionTitleToObjectTitle($question->getTitleForHTMLOutput());
895
896 if ($this->getTestObject()->evalTotalPersons() !== 0) {
897 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('question_is_part_of_running_test'), true);
898 $this->prepareOutput();
900 }
902 $question_gui,
903 $this->ctrl,
904 $this->access,
905 $this->tpl,
906 $this->tabs_gui,
907 $this->lng,
908 $this->help,
909 $this->qplrequest,
910 $this->content_style
911 );
912 $this->ctrl->forwardCommand($gui);
913 break;
914
915 case 'iltestcorrectionsgui':
916 if ((!$this->access->checkAccess('read', '', $this->testrequest->getRefId()))) {
918 }
919 $this->prepareOutput();
920 $gui = new ilTestCorrectionsGUI(
921 $this->db,
922 $this->ctrl,
923 $this->lng,
924 $this->tabs_gui,
925 $this->help,
926 $this->ui_factory,
927 $this->tpl,
928 $this->refinery,
929 $this->getTestObject()->getTestLogger(),
930 $this->testrequest,
931 $this->getTestObject(),
932 $this->user,
933 $this->test_pass_result_repository
934 );
935 $this->ctrl->forwardCommand($gui);
936 break;
937
938 case 'iltestpagegui':
939 if ((!$this->access->checkAccess("write", "", $this->testrequest->getRefId()))) {
941 }
942
943 if ($cmd === 'downloadFile') {
944 $page_id = $this->object->getIntroductionPageId();
945 if ($this->testrequest->strVal('page_type') === 'concludingremarkspage') {
946 $page_id = $this->object->getConcludingRemarksPageId();
947 }
948 $this->ctrl->forwardCommand(new ilTestPageGUI('tst', $page_id));
949 }
950 $this->showEditTestPageGUI();
951 break;
952
953 case '':
954 case 'ilobjtestgui':
955 if (!$this->access->checkAccess('read', '', $this->testrequest->getRefId())
956 && !$this->access->checkAccess('visible', '', $this->testrequest->getRefId())) {
958 }
959 $this->prepareOutput();
960 $this->addHeaderAction();
961
962 if ($cmd === 'testScreen') {
963 $this->ctrl->forwardCommand($this->getTestScreenGUIInstance());
964 return;
965 }
966
967 $local_cmd = "{$cmd}Object";
968
969 if (!method_exists($this, $local_cmd)) {
970 $local_cmd = self::SHOW_QUESTIONS_CMD . 'Object';
971 }
972 $this->$local_cmd();
973 break;
974
975 default:
976 if ((!$this->access->checkAccess('read', '', $this->testrequest->getRefId()))) {
978 }
979 if (in_array(
980 $cmd,
981 ['editQuestion', 'previewQuestion', 'save', 'saveReturn', 'uploadImage',
982 'removeImage', 'syncQuestion', 'syncQuestionReturn', 'suggestedsolution']
983 )
984 && !$this->access->checkAccess('write', '', $this->getTestObject()->getRefId())) {
986 }
987 if (in_array($cmd, ['editQuestion', 'save', 'saveReturn', 'suggestedsolution'])
988 && $this->getTestObject()->evalTotalPersons() !== 0) {
989 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('question_is_part_of_running_test'), true);
990 $this->prepareOutput();
992 return;
993 }
994 $this->forwardCommandToQuestion($cmd);
995 break;
996 }
997 if (!in_array(strtolower($this->testrequest->raw('baseClass')), ['iladministrationgui', 'ilrepositorygui'])
998 && $this->getCreationMode() !== true) {
999 $this->tpl->printToStdout();
1000 }
1001 }
@ilCtrl_Calls ILIAS\Test\Settings\MainSettings\SettingsMainGUI: ilPropertyFormGUI @ilCtrl_Calls ILIAS...
error(string $a_errmsg)
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.
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
Class ilObjUserTrackingGUI.
Class ilLocalUnitConfigurationGUI.
addQuestionTitleToObjectTitle(string $question_title)
forwardCommandToQuestionPreview(string $cmd, ?assQuestionGUI $question_gui=null)
forwardCommandToQuestion(string $cmd)
GUIFactory $gui_factory
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 $gui_factory, assQuestionGUI\_getQuestionGUI(), ILIAS\Repository\access(), ilObjectGUI\addHeaderAction(), addQuestionTitleToObjectTitle(), ilLearningProgressAccess\checkAccess(), ilAssQuestionPreviewGUI\CMD_SHOW, ILIAS\Repository\ctrl(), determineObjectiveOrientedContainer(), error(), fetchAuthoringQuestionIdParameter(), forwardCommandToQuestion(), forwardCommandToQuestionPreview(), forwardToEvaluationGUI(), forwardToInfoScreen(), ilObjectGUI\getCreationMode(), ILIAS\Survey\Mode\getId(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ilObjectGUI\getObject(), getObjectiveOrientedContainer(), ilObjectGUI\getRefId(), 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:

◆ executeTemplatesActionObject()

ilObjTestGUI::executeTemplatesActionObject ( )

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

2106 : void
2107 {
2108 $this->protectByWritePermission();
2109
2110 $modal = $this->buildPersonalSettingsTable()->perform();
2111 if ($modal !== null) {
2112 $this->showTemplatesObject($modal);
2113 return;
2114 }
2115 $this->ctrl->redirectByClass(self::class, 'showTemplates');
2116 }
showTemplatesObject(?Modal $modal=null)

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ exportLegacyLogsObject()

ilObjTestGUI::exportLegacyLogsObject ( )

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

2011 : void
2012 {
2013 $this->protectByWritePermission();
2014
2015 $csv_output = $this->getTestObject()->getTestLogViewer()->getLegacyLogExportForObjId($this->getTestObject()->getId());
2016
2018 $csv_output,
2019 "legacy_logs_for_{$this->getTestObject()->getRefId()}.csv"
2020 );
2021 }
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 1269 of file class.ilObjTestGUI.php.

1270 {
1271 $this->ctrl->redirectByClass('ilTestExportGUI');
1272 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ fetchAuthoringQuestionIdParameter()

ilObjTestGUI::fetchAuthoringQuestionIdParameter ( )
protected
Returns
int
Exceptions
ilTestException

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

1278 : int
1279 {
1280 $qid = $this->testrequest->int('q_id');
1281
1282 if ($qid === 0 || $this->getTestObject()->checkQuestionParent($qid)) {
1283 return $qid;
1284 }
1285
1286 throw new ilTestException('question id does not relate to parent object!');
1287 }
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 1096 of file class.ilObjTestGUI.php.

1096 : void
1097 {
1098 $this->create_question_mode = true;
1099 $this->prepareOutput();
1100
1101 try {
1102 $qid = $this->fetchAuthoringQuestionIdParameter();
1103
1104 $this->ctrl->setReturnByClass(self::class, self::SHOW_QUESTIONS_CMD);
1105
1106 $question_gui = assQuestionGUI::_getQuestionGUI(
1107 ilUtil::stripSlashes($this->testrequest->strVal('question_type')),
1108 $qid
1109 );
1110
1111 $question_gui->setEditContext(assQuestionGUI::EDIT_CONTEXT_AUTHORING);
1112 $question = $question_gui->getObject();
1113 $question->setObjId($this->getTestObject()->getId());
1114 $question_gui->setObject($question);
1115 $question_gui->setContextAllowsSyncToPool(true);
1116 $question_gui->setQuestionTabs();
1117
1118 $this->addQuestionTitleToObjectTitle($question->getTitleForHTMLOutput());
1119
1120 $target = strpos($cmd, 'Return') === false ? 'stay' : 'return';
1121
1122 if (in_array($cmd, ['syncQuestion', 'syncQuestionReturn'])) {
1123 $question_gui->syncQuestion();
1124 $this->showNextViewAfterQuestionSave($question_gui, $target);
1125 return;
1126 }
1127
1128 if ($question_gui->isSaveCommand()
1129 || $question_gui->cmdNeedsExistingQuestion($cmd)) {
1130 $question_gui = $this->addPostCreationTasksToQuestionGUI($question_gui);
1131 }
1132
1133 if ($qid === 0 && $question_gui->cmdNeedsExistingQuestion($cmd)) {
1134 $question_gui->getObject()->createNewQuestion();
1135 $question_gui->setQuestionTabs();
1136 $this->executeAfterQuestionCreationTasks($question_gui);
1137 }
1138
1139 if (!$question_gui->isSaveCommand()) {
1140 $this->ctrl->forwardCommand($question_gui);
1141 return;
1142 }
1143
1144 if (!$question_gui->saveQuestion()) {
1145 return;
1146 }
1147
1148 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
1149 if ($qid === 0) {
1150 $this->executeAfterQuestionCreationTasks($question_gui);
1151 }
1152 $this->executeAfterQuestionSaveTasks($question_gui);
1153 $this->showNextViewAfterQuestionSave($question_gui, $target);
1154 } catch (ilTestException $e) {
1155 $this->showQuestionsObject();
1156 }
1157 }
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 1021 of file class.ilObjTestGUI.php.

1024 : void {
1025 $nr_of_participants_with_results = $this->getTestObject()->evalTotalPersons();
1026
1027 $this->ctrl->saveParameterByClass(self::class, 'q_id');
1028 $gui = new ilAssQuestionPreviewGUI(
1029 $this->ctrl,
1030 $this->rbac_system,
1031 $this->tabs_gui,
1032 $this->toolbar,
1033 $this->tpl,
1034 $this->ui_factory,
1035 $this->lng,
1036 $this->db,
1037 $this->refinery->random(),
1038 $this->global_screen,
1039 $this->http,
1040 $this->refinery,
1041 $this->ref_id
1042 );
1043
1044 if ($nr_of_participants_with_results > 0
1045 && $this->getTestObject()->getGlobalSettings()->isAdjustingQuestionsWithResultsAllowed()) {
1046 $gui->addAdditionalCmd(
1047 $this->lng->txt('tst_corrections_qst_form'),
1048 $this->ctrl->getLinkTargetByClass(ilTestCorrectionsGUI::class, 'showQuestion')
1049 );
1050 }
1051
1052 $question_gui ??= assQuestion::instantiateQuestionGUI($this->fetchAuthoringQuestionIdParameter());
1053
1054 $this->addQuestionTitleToObjectTitle($question_gui->getObject()->getTitleForHTMLOutput());
1055
1056 if (!$this->getTestObject()->isRandomTest() && $nr_of_participants_with_results === 0) {
1057 $gui->setPrimaryCmd(
1058 $this->lng->txt('edit_question'),
1059 $this->ctrl->getLinkTargetByClass(
1060 get_class($question_gui),
1061 'editQuestion'
1062 )
1063 );
1064 $gui->addAdditionalCmd(
1065 $this->lng->txt('edit_page'),
1066 $this->ctrl->getLinkTargetByClass(
1067 ilAssQuestionPageGUI::class,
1068 'edit'
1069 )
1070 );
1071 }
1072
1073 $gui->initQuestion($question_gui, $this->getTestObject()->getId());
1074 $gui->initPreviewSettings($this->getTestObject()->getRefId());
1075 $gui->initPreviewSession($this->user->getId(), $this->testrequest->getQuestionId());
1076 $gui->initStyleSheets();
1077
1078 $this->ctrl->clearParameterByClass(self::class, 'q_id');
1079 $this->tabs_gui->setBackTarget(
1080 $this->lng->txt('backtocallingtest'),
1081 $this->ctrl->getLinkTargetByClass(self::class, self::SHOW_QUESTIONS_CMD)
1082 );
1083 $this->ctrl->saveParameterByClass(self::class, 'q_id');
1084 $gui->{$cmd . 'Cmd'}();
1085 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ forwardToEvaluationGUI()

ilObjTestGUI::forwardToEvaluationGUI ( )
private

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

1339 {
1340 $this->prepareOutput();
1341 $this->addHeaderAction();
1342 $gui = new ilTestEvaluationGUI($this->getTestObject());
1343 $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
1344 $gui->setTestAccess($this->getTestAccess());
1345
1346 $this->ctrl->forwardCommand($gui);
1347 }
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 2227 of file class.ilObjTestGUI.php.

2227 : void
2228 {
2229 if (!$this->access->checkAccess('visible', '', $this->ref_id)
2230 && !$this->access->checkAccess('read', '', $this->ref_id)) {
2231 $this->redirectAfterMissingRead();
2232 }
2233
2234 if ($this->getTestObject()->getMainSettings()->getAdditionalSettings()->getHideInfoTab()) {
2235 $this->ctrl->redirectByClass([self::class, TestScreenGUI::class], TestScreenGUI::DEFAULT_CMD);
2236 }
2237
2238 $this->tabs_manager->activateTab(TabsManager::TAB_ID_INFOSCREEN);
2239
2240 if ($this->access->checkAccess('read', '', $this->ref_id)) {
2241 $this->trackTestObjectReadEvent();
2242 }
2243 $info = new ilInfoScreenGUI($this);
2244
2245 if ($this->isCommandClassAnyInfoScreenChild()) {
2246 $this->ctrl->forwardCommand($info);
2247 }
2248
2250 $this->getTestObject(),
2251 $this->test_player_factory->getPlayerGUI(),
2252 $this->test_question_set_config_factory->getQuestionSetConfig(),
2253 $this->test_session_factory->getSession(),
2254 $this->db,
2255 $this->access,
2256 $this->ctrl,
2257 $this->lng,
2258 $this->ui_factory,
2259 $this->ui_renderer,
2260 $this->tpl,
2261 $this->toolbar
2262 );
2263
2264 $toolbar->setCloseFormTag(false);
2265
2266 $toolbar->setSessionLockString('');
2267 $toolbar->build();
2268 $toolbar->sendMessages();
2269
2270 $info->enablePrivateNotes();
2271
2272 $info->addSection($this->lng->txt('tst_general_properties'));
2273 $info->addProperty(
2274 $this->lng->txt('author'),
2275 $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
2276 $this->getTestObject()->getAuthor()
2277 )
2278 );
2279 $info->addProperty(
2280 $this->lng->txt('title'),
2281 $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
2282 $this->getTestObject()->getTitle()
2283 )
2284 );
2285
2286 if ($this->type !== 'tst') {
2287 $info->hideFurtherSections(false);
2288 }
2289
2290 if ($this->getTestObject()->getEnableProcessingTime()) {
2291 $info->addProperty($this->lng->txt('tst_processing_time'), $this->getTestObject()->getProcessingTime());
2292 }
2293
2294 $starting_time = $this->getTestObject()->getStartingTime();
2295 if ($this->getTestObject()->isStartingTimeEnabled() && $starting_time !== 0) {
2296 $info->addProperty($this->lng->txt('tst_starting_time'), ilDatePresentation::formatDate(new ilDateTime($starting_time, IL_CAL_UNIX)));
2297 }
2298 $ending_time = $this->getTestObject()->getEndingTime();
2299 if ($this->getTestObject()->isEndingTimeEnabled() && $ending_time != 0) {
2300 $info->addProperty($this->lng->txt('tst_ending_time'), ilDatePresentation::formatDate(new ilDateTime($ending_time, IL_CAL_UNIX)));
2301 }
2302 $info->addMetaDataSections($this->getTestObject()->getId(), 0, $this->getTestObject()->getType());
2303
2304 $this->ctrl->forwardCommand($info);
2305 }
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.
ilToolbarGUI $toolbar
setCloseFormTag(bool $a_val)

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

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 1587 of file class.ilObjTestGUI.php.

1588 {
1589 $page_gui = new ilAssQuestionPageGUI($this->testrequest->raw('pg_id'));
1590 $page_gui->setFileDownloadLink(
1591 $this->ctrl->getLinkTargetByClass(ilObjTestGUI::class, 'downloadFile')
1592 );
1593 $page_gui->showMediaFullscreen();
1594 }
Question page GUI class.

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getObjectiveOrientedContainer()

ilObjTestGUI::getObjectiveOrientedContainer ( )
protected

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

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getQuestionsTableActions()

ilObjTestGUI::getQuestionsTableActions ( )
protected

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

2741 {
2742 if ($this->table_actions === null) {
2743 $this->table_actions = new QuestionsTableActions(
2744 $this->ui_factory,
2745 $this->ui_renderer,
2746 $this->tpl,
2747 $this->request,
2748 $this->getQuestionsTableQuery(),
2749 $this->lng,
2750 $this->ctrl,
2751 $this->test_questions_repository,
2752 new QuestionPrinter(
2753 $this->ui_factory,
2754 $this->tpl,
2755 $this->tabs_manager,
2756 $this->toolbar,
2757 $this->refinery,
2758 $this->lng,
2759 $this->ctrl,
2760 $this->user,
2762 $this->getTestObject()
2763 ),
2764 $this->object,
2765 $this->getTestObject()->getGlobalSettings()->isAdjustingQuestionsWithResultsAllowed(),
2766 $this->getTestObject()->evalTotalPersons() !== 0,
2767 $this->getTestObject()->isRandomTest(),
2768 $this->test_question_set_config_factory
2769 );
2770 }
2771 return $this->table_actions;
2772 }
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 2726 of file class.ilObjTestGUI.php.

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

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

+ Here is the call graph for this function:

◆ getTable()

ilObjTestGUI::getTable ( )
protected

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

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

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 2406 of file class.ilObjTestGUI.php.

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

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 2621 of file class.ilObjTestGUI.php.

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

1328 : ilTestAccess
1329 {
1330 return $this->test_access;
1331 }
ilTestAccess $test_access

◆ getTestObject()

ilObjTestGUI::getTestObject ( )

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

1477 : ?ilObjTest
1478 {
1479 return $this->object;
1480 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getTestScreenGUIInstance()

ilObjTestGUI::getTestScreenGUIInstance ( )
private

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

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

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 1968 of file class.ilObjTestGUI.php.

1968 : void
1969 {
1970 if (!$this->getTestObject()->getTestLogger()->isLoggingEnabled()
1971 || !$this->rbac_review->isAssigned($this->user->getId(), SYSTEM_ROLE_ID)
1972 && !$this->access->checkAccess('tst_history_read', '', $this->getTestObject()->getRefId())) {
1974 }
1975
1976 $here_uri = $this->data_factory->uri(ILIAS_HTTP_PATH
1977 . '/' . $this->ctrl->getLinkTargetByClass(self::class, self::SHOW_LOGS_CMD));
1978 list($url_builder, $action_parameter_token, $row_id_token) = (new URLBuilder($here_uri))->acquireParameters(
1979 LogTable::QUERY_PARAMETER_NAME_SPACE,
1980 LogTable::ACTION_TOKEN_STRING,
1981 LogTable::ENTRY_TOKEN_STRING
1982 );
1983
1984 if ($this->request_wrapper->has($action_parameter_token->getName())) {
1985 $this->getTestObject()->getTestLogViewer()->executeLogTableAction(
1986 $url_builder,
1987 $action_parameter_token,
1988 $row_id_token,
1989 $this->getTestObject()->getRefId()
1990 );
1991 }
1992
1993 $this->toolbar->addComponent(
1994 $this->ui_factory->button()->standard(
1995 $this->lng->txt('export_legacy_logs'),
1996 $this->ctrl->getLinkTargetByClass(self::class, 'exportLegacyLogs')
1997 )
1998 );
1999 $this->tabs_manager->activateTab(TabsManager::TAB_ID_HISTORY);
2000
2001 list($filter, $table_gui) = $this->getTestObject()->getTestLogViewer()->getLogTable(
2002 $url_builder,
2003 $action_parameter_token,
2004 $row_id_token,
2005 $this->getTestObject()->getRefId()
2006 );
2007
2008 $this->tpl->setVariable('ADM_CONTENT', $this->ui_renderer->render([$filter, $table_gui]));
2009 }
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 1366 of file class.ilObjTestGUI.php.

1366 : void
1367 {
1368 list($subdir, $importdir, $xmlfile, $qtifile) = $this->buildImportDirectoriesFromImportFile($file_to_import);
1369
1371 ->withZipOutputPath($this->getImportTempDirectory());
1372
1373 $unzip = $this->archives->unzip(Streams::ofResource(fopen($file_to_import, 'r')), $options);
1374 $unzip->extract();
1375
1376 if (!is_file($qtifile)) {
1377 ilFileUtils::delDir($importdir);
1378 $this->deleteUploadedImportFile($path_to_uploaded_file_in_temp_dir);
1379 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('tst_import_non_ilias_zip'), true);
1380 }
1381 $qtiParser = new ilQTIParser($importdir, $qtifile, ilQTIParser::IL_MO_VERIFY_QTI, 0, [], [], true);
1382 try {
1383 $qtiParser->startParsing();
1384 } catch (ilSaxParserException) {
1385 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('import_file_not_valid'), true);
1386 $this->ctrl->redirect($this, 'create');
1387 }
1388 $founditems = $qtiParser->getFoundItems();
1389
1390 $complete = 0;
1391 $incomplete = 0;
1392 foreach ($founditems as $item) {
1393 if ($item["type"] !== '') {
1394 $complete++;
1395 } else {
1396 $incomplete++;
1397 }
1398 }
1399
1400 if (count($founditems) && $complete == 0) {
1401 ilFileUtils::delDir($importdir);
1402 $this->deleteUploadedImportFile($path_to_uploaded_file_in_temp_dir);
1403 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_import_non_ilias_files'));
1404 return;
1405 }
1406
1407 ilSession::set('path_to_import_file', $file_to_import);
1408 ilSession::set('path_to_uploaded_file_in_temp_dir', $path_to_uploaded_file_in_temp_dir);
1409
1410 if ($qtiParser->getQuestionSetType() !== ilObjTest::QUESTION_SET_TYPE_FIXED
1411 || file_exists($this->buildResultsFilePath($importdir, $subdir))
1412 || $founditems === []) {
1413 $this->importVerifiedFileObject(true);
1414 return;
1415 }
1416
1417 $form = $this->buildImportQuestionsSelectionForm(
1418 'importVerifiedFile',
1419 $importdir,
1420 $qtifile,
1421 $file_to_import,
1422 $path_to_uploaded_file_in_temp_dir
1423 );
1424
1425 if ($form === null) {
1426 return;
1427 }
1428
1429 $panel = $this->ui_factory->panel()->standard(
1430 $this->lng->txt('import_tst'),
1431 [
1432 $this->ui_factory->legacy()->content($this->lng->txt('qpl_import_verify_found_questions')),
1433 $form
1434 ]
1435 );
1436 $this->tpl->setContent($this->ui_renderer->render($panel));
1437 $this->tpl->printToStdout();
1438 exit;
1439 }
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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\UI\Implementation\Component\Input\Field\$options, ILIAS\TestQuestionPool\Import\buildImportDirectoriesFromImportFile(), ILIAS\TestQuestionPool\Import\buildImportQuestionsSelectionForm(), ILIAS\TestQuestionPool\Import\buildResultsFilePath(), ILIAS\Repository\ctrl(), 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:

◆ importTemplateObject()

ilObjTestGUI::importTemplateObject ( )

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

2090 : void
2091 {
2092 $this->protectByWritePermission();
2093
2094 try {
2096 ->perform($this->request);
2097
2098 $this->tpl->setOnScreenMessage('success', $this->lng->txt('personal_settings_import_success'), true);
2099 } catch (\InvalidArgumentException $e) {
2100 $this->tpl->setOnScreenMessage('failure', $this->lng->txt($e->getMessage()), true);
2101 }
2102
2103 $this->ctrl->redirectByClass(self::class, 'showTemplates');
2104 }

References Vendor\Package\$e, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ 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 1485 of file class.ilObjTestGUI.php.

1487 : void {
1488 if (!$this->checkPermissionBool('create', '', 'tst')) {
1489 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_permission'), true);
1490 $this->ctrl->returnToParent($this);
1491 }
1492 $file_to_import = ilSession::get('path_to_import_file');
1493 $path_to_uploaded_file_in_temp_dir = ilSession::get('path_to_uploaded_file_in_temp_dir');
1494 list($subdir, $importdir, $xmlfile, $qtifile) = $this->buildImportDirectoriesFromImportFile($file_to_import);
1495
1496 $new_obj = new ilObjTest(0, true);
1497 $new_obj->setTitle('dummy');
1498 $new_obj->setDescription('test import');
1499 $new_obj->create(true);
1500 $new_obj->createReference();
1501 $new_obj->putInTree($this->testrequest->getRefId());
1502 $new_obj->setPermissions($this->testrequest->getRefId());
1503 $new_obj->saveToDb();
1504
1505 $selected_questions = [];
1506 if (!$skip_retrieve_selected_questions) {
1508 'importVerifiedFile',
1509 $importdir,
1510 $qtifile,
1511 $this->request
1512 );
1513 }
1514
1515 ilSession::set('tst_import_selected_questions', $selected_questions);
1516
1517 $imp = new ilImport($this->testrequest->getRefId());
1518 $map = $imp->getMapping();
1519 $map->addMapping('components/ILIAS/Test', 'tst', 'new_id', (string) $new_obj->getId());
1520
1525 if (is_file($importdir . DIRECTORY_SEPARATOR . '/manifest.xml')) {
1526 $imp->importObject($new_obj, $file_to_import, basename($file_to_import), 'tst', 'components/ILIAS/Test', true);
1527 } else {
1528 $test_importer = new ilTestImporter();
1529 $test_importer->setImport($imp);
1530 $test_importer->setInstallId(IL_INST_ID);
1531 $test_importer->setImportDirectory($importdir . '/' . $subdir);
1532 $test_importer->init();
1533
1534 $test_importer->importXmlRepresentation(
1535 '',
1536 '',
1537 '',
1538 $map,
1539 );
1540 }
1541
1542 if ($new_obj->getTestLogger()->isLoggingEnabled()) {
1543 $new_obj->getTestLogger()->logTestAdministrationInteraction(
1544 $new_obj->getTestLogger()->getInteractionFactory()->buildTestAdministrationInteraction(
1545 $new_obj->getRefId(),
1546 $this->user->getId(),
1547 TestAdministrationInteractionTypes::NEW_TEST_CREATED,
1548 []
1549 )
1550 );
1551 }
1552
1553 ilFileUtils::delDir($importdir);
1554 $this->deleteUploadedImportFile($path_to_uploaded_file_in_temp_dir);
1555 ilSession::clear('path_to_import_file');
1556 ilSession::clear('path_to_uploaded_file_in_temp_dir');
1557
1558 $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_imported"), true);
1559
1560 $question_skill_assignments_import_fails = new ilAssQuestionSkillAssignmentImportFails($new_obj->getId());
1561 if ($question_skill_assignments_import_fails->failedImportsRegistered()) {
1562 $this->tpl->setOnScreenMessage(
1563 'info',
1564 $question_skill_assignments_import_fails->getFailedImportsMessage($this->lng),
1565 true
1566 );
1567 }
1568
1569 $this->ctrl->setParameterByClass(ilObjTestGUI::class, 'ref_id', $new_obj->getRefId());
1570 $this->ctrl->redirectByClass(ilObjTestGUI::class);
1571 }
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 2220 of file class.ilObjTestGUI.php.

2220 : void
2221 {
2222 $this->ctrl->redirectByClass(
2223 [ilRepositoryGUI::class, self::class, ilInfoScreenGUI::class]
2224 );
2225 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ insertQuestionsObject()

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

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

1683 : void
1684 {
1685 $this->protectByWritePermission();
1686
1687 if (($selected_array ?? $this->testrequest->getQuestionIds()) === []) {
1688 $this->tpl->setOnScreenMessage('info', $this->lng->txt('tst_insert_missing_question'), true);
1689 $this->ctrl->redirect($this, 'browseForQuestions');
1690 }
1691
1692 $this->getTestObject()->saveCompleteStatus($this->test_question_set_config_factory->getQuestionSetConfig());
1693 $this->tpl->setOnScreenMessage('success', $this->lng->txt('tst_questions_inserted'), true);
1694 $this->ctrl->redirect($this, self::SHOW_QUESTIONS_CMD);
1695 return;
1696 }

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

+ Here is the call graph for this function:

◆ isCommandClassAnyInfoScreenChild()

ilObjTestGUI::isCommandClassAnyInfoScreenChild ( )
private

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

2205 : bool
2206 {
2207 if (in_array(
2208 $this->ctrl->getCmdClass(),
2209 [
2210 strtolower(PublicProfileGUI::class),
2211 'ilobjportfoliogui'
2212 ]
2213 )) {
2214 return true;
2215 }
2216
2217 return false;
2218 }

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 2026 of file class.ilObjTestGUI.php.

2026 : void
2027 {
2028 $command = $this->testrequest->strVal('command');
2029 if ($command === '') {
2030 $method = $command . 'Object';
2031 if (method_exists($this, $method)) {
2032 $this->$method();
2033 return;
2034 }
2035 }
2036 $this->ctrl->redirect($this, 'participants');
2037 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ populateQuestionBrowserToolbarButtons()

ilObjTestGUI::populateQuestionBrowserToolbarButtons ( ilToolbarGUI  $toolbar)
private

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

1933 : void
1934 {
1935 $this->ctrl->setParameterByClass(
1936 ilTestQuestionBrowserTableGUI::class,
1939 );
1940
1942 $this->lng->txt('tst_browse_for_qpl_questions'),
1943 $this->ctrl->getLinkTargetByClass(
1944 ilTestQuestionBrowserTableGUI::class,
1946 )
1947 );
1948
1949 $this->ctrl->setParameterByClass(
1950 ilTestQuestionBrowserTableGUI::class,
1953 );
1954
1956 $this->lng->txt('tst_browse_for_tst_questions'),
1957 $this->ctrl->getLinkTargetByClass(
1958 ilTestQuestionBrowserTableGUI::class,
1960 )
1961 );
1962 }
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 1354 of file class.ilObjTestGUI.php.

1355 {
1356 $this->tpl->loadStandardTemplate();
1357 $this->setLocator();
1358 $this->setTitleAndDescription();
1359 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ protectByWritePermission()

ilObjTestGUI::protectByWritePermission ( )
protected

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

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

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 1289 of file class.ilObjTestGUI.php.

1290 {
1291 if ($this->getTestObject()->isRandomTest()) {
1292 $this->ctrl->redirectByClass('ilTestRandomQuestionSetConfigGUI');
1293 }
1294
1295 $this->ctrl->redirectByClass('ilObjTestGUI', self::SHOW_QUESTIONS_CMD);
1296 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ redirectAfterMissingRead()

ilObjTestGUI::redirectAfterMissingRead ( )
protected

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

1011 : void
1012 {
1013 $this->tpl->setOnScreenMessage('failure', sprintf(
1014 $this->lng->txt("msg_no_perm_read_item"),
1015 $this->object->getTitle()
1016 ), true);
1017 $this->ctrl->setParameterByClass('ilrepositorygui', 'ref_id', ROOT_FOLDER_ID);
1018 $this->ctrl->redirectByClass('ilrepositorygui');
1019 }

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 1003 of file class.ilObjTestGUI.php.

1004 {
1005 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_permission'), true);
1006 $target_class = get_class($this->object) . 'GUI';
1007 $this->ctrl->setParameterByClass($target_class, 'ref_id', $this->ref_id);
1008 $this->ctrl->redirectByClass($target_class);
1009 }

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 1349 of file class.ilObjTestGUI.php.

1350 {
1351 $this->ctrl->redirectByClass(SettingsMainGUI::class, SettingsMainGUI::CMD_SHOW_FORM);
1352 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ removeImportFailsObject()

ilObjTestGUI::removeImportFailsObject ( )
protected

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

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

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

+ Here is the call graph for this function:

◆ runObject()

ilObjTestGUI::runObject ( )

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

1362 {
1363 $this->ctrl->redirectByClass([ilRepositoryGUI::class, self::class, ilInfoScreenGUI::class]);
1364 }

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 1333 of file class.ilObjTestGUI.php.

1334 {
1335 $this->test_access = $test_access;
1336 }

◆ setupToolBarAndMessage()

ilObjTestGUI::setupToolBarAndMessage ( bool  $has_started_test_runs)
private

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

1904 : void
1905 {
1906 if (!$this->access->checkAccess('write', '', $this->ref_id)
1907 || $this->getTestObject()->isRandomTest()) {
1908 return;
1909 }
1910
1911 if ($has_started_test_runs) {
1912 $link = $this->ui_factory->link()->standard(
1913 $this->lng->txt('test_has_datasets_warning_page_view_link'),
1914 $this->ctrl->getLinkTargetByClass([\ilTestParticipantsGUI::class])
1915 );
1916
1917 $message = $this->lng->txt('test_has_datasets_warning_page_view');
1918 $massage_box = $this->ui_factory->messageBox()->info($message)->withLinks([$link]);
1919 $this->tpl->setCurrentBlock('pax_info_message');
1920 $this->tpl->setVariable(
1921 'PAX_INFO_MESSAGE',
1922 $this->ui_renderer->render($massage_box)
1923 );
1924 $this->tpl->parseCurrentBlock();
1925 return;
1926 }
1927
1928 $this->toolbar->addButton($this->lng->txt('ass_create_question'), $this->ctrl->getLinkTarget($this, 'createQuestionForm'));
1929 $this->toolbar->addSeparator();
1931 }
populateQuestionBrowserToolbarButtons(ilToolbarGUI $toolbar)

References 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 1298 of file class.ilObjTestGUI.php.

1298 : void
1299 {
1300 $this->prepareOutput();
1301 $this->tabs_manager->getSettingsSubTabs();
1302
1303 if ($this->request_wrapper->has('page_type')
1304 && $this->request_wrapper->retrieve(
1305 'page_type',
1306 $this->refinery->kindlyTo()->string()
1307 ) === 'introductionpage'
1308 ) {
1309 $page_type = 'IntroductionPage';
1310 $this->tabs_manager->activateSubTab(TabsManager::SETTINGS_SUBTAB_ID_EDIT_INTRODUCTION_PAGE);
1311 $page_id = $this->getTestObject()->getIntroductionPageId();
1312 } else {
1313 $page_type = 'ConcludingRemarksPage';
1314 $this->tabs_manager->activateSubTab(TabsManager::SETTINGS_SUBTAB_ID_EDIT_CONCLUSION_PAGE);
1315 $page_id = $this->getTestObject()->getConcludingRemarksPageId();
1316 }
1317 $this->ctrl->saveParameterByClass(ilTestPageGUI::class, 'page_type');
1318
1319 $gui = new ilTestPageGUI('tst', $page_id);
1320 $this->content_style->gui()->addCss($this->tpl, $this->ref_id);
1321 $this->tpl->setContent($this->ctrl->forwardCommand($gui));
1322
1323 if ($this->ctrl->getCmdClass() === strtolower(ilTestPageGUI::class)) {
1324 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
1325 }
1326 }

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 1233 of file class.ilObjTestGUI.php.

1233 : void
1234 {
1235 if ($target === 'return') {
1238 $question_gui
1239 );
1240 }
1241
1242 if ($target === 'stay') {
1243 $this->ctrl->setParameterByClass(ilAssQuestionPreviewGUI::class, 'q_id', $question_gui->getObject()->getId());
1244 $this->tabs_gui->setBackTarget(
1245 $this->lng->txt('backtocallingpage'),
1246 $this->ctrl->getLinkTargetByClass(
1247 ilAssQuestionPreviewGUI::class,
1249 )
1250 );
1251 $question_gui->editQuestion(false, false);
1252 }
1253 }
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 1850 of file class.ilObjTestGUI.php.

1851 {
1852 $this->protectByWritePermission();
1853
1854 if ($this->testrequest->raw('add')) {
1855 $this->addQuestion();
1856 return;
1857 }
1858
1860 if (($table_cmd = $table_query->getTableAction()) !== null) {
1861 if (!$this->getQuestionsTableActions()->handleCommand(
1862 $table_cmd,
1863 $table_query->getRowIds($this->object),
1864 fn() => $this->protectByWritePermission(),
1865 fn() => $this->createQuestionpoolTargetObject('copyAndLinkQuestionsToPool'),
1866 fn() => $this->getTable()
1867 )) {
1868 return;
1869 }
1870 }
1871
1872 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.il_as_tst_questions.html', 'components/ILIAS/Test');
1873
1874 $this->setupToolBarAndMessage($this->getTestObject()->evalTotalPersons() !== 0);
1875
1876 $this->tabs_manager->getQuestionsSubTabs();
1877 $this->tabs_manager->activateSubTab(TabsManager::SUBTAB_ID_QST_LIST_VIEW);
1878
1879 $this->tpl->setCurrentBlock('adm_content');
1880 $this->tpl->setVariable('ACTION_QUESTION_FORM', $this->ctrl->getFormAction($this));
1881 $this->tpl->setVariable(
1882 'QUESTIONBROWSER',
1883 $this->ui_renderer->render(
1884 $this->getTable()->getTableComponent()
1885 )
1886 );
1887 $this->tpl->parseCurrentBlock();
1888 }
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:

◆ showTemplatesObject()

ilObjTestGUI::showTemplatesObject ( ?Modal  $modal = null)

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

2040 : void
2041 {
2042 $this->protectByWritePermission();
2043
2044 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
2045
2046 $create_input = $this->buildPersonalSettingsCreateAction()
2047 ->buildModal($this->ctrl->getLinkTargetByClass(self::class, 'createTemplate'));
2048 $import_input = $this->buildPersonalSettingsImportAction()
2049 ->buildModal($this->ctrl->getLinkTargetByClass(self::class, 'importTemplate'));
2050
2051 $this->toolbar->addComponent(
2052 $this->ui_factory->button()->standard(
2053 $this->lng->txt('personal_settings_create'),
2054 $create_input->getShowSignal()
2055 )
2056 );
2057 $this->toolbar->addComponent(
2058 $this->ui_factory->button()->standard(
2059 $this->lng->txt('personal_settings_import'),
2060 $import_input->getShowSignal()
2061 )
2062 );
2063
2064 $components = [
2065 $this->buildPersonalSettingsTable()->getComponent(),
2066 $modal,
2067 $create_input,
2068 $import_input
2069 ];
2070
2071 $this->tpl->setContent(
2072 $this->ui_renderer->render(array_filter($components))
2073 );
2074 }
$components

References $components, ILIAS\Repository\ctrl(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

◆ statisticsObject()

ilObjTestGUI::statisticsObject ( )

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

2385 {
2386 }

◆ takenObject()

ilObjTestGUI::takenObject ( )

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

1964 : void
1965 {
1966 }

◆ trackTestObjectReadEvent()

ilObjTestGUI::trackTestObjectReadEvent ( )
protected

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

1256 {
1258 $this->getTestObject()->getType(),
1259 $this->getTestObject()->getRefId(),
1260 $this->getTestObject()->getId(),
1261 $this->user->getId()
1262 );
1263 }
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, $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:

◆ userCanCreatePoolAtCurrentLocation()

ilObjTestGUI::userCanCreatePoolAtCurrentLocation ( )
private

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

2788 : bool
2789 {
2790 return $this->settings->get('obj_dis_creation_qpl') !== '1'
2791 && $this->checkPermissionBool('create', '', 'qpl', $this->tree->getParentId($this->ref_id));
2792 }

References ILIAS\Repository\settings().

+ Here is the call graph for this function:

Field Documentation

◆ $additional_information_generator

AdditionalInformationGenerator ilObjTestGUI::$additional_information_generator
protected

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

◆ $archives

Archives ilObjTestGUI::$archives
private

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

◆ $component_factory

ilComponentFactory ilObjTestGUI::$component_factory
protected

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

◆ $component_repository

ilComponentRepository ilObjTestGUI::$component_repository
protected

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

◆ $content_style

ContentStyle ilObjTestGUI::$content_style
private

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

◆ $create_question_mode

bool ilObjTestGUI::$create_question_mode
protected

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

◆ $data_factory

DataFactory ilObjTestGUI::$data_factory
protected

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

◆ $db

ilDBInterface ilObjTestGUI::$db
protected

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

◆ $export_factory

ExportImportFactory ilObjTestGUI::$export_factory
private

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

◆ $export_repository

ExportRepository ilObjTestGUI::$export_repository
private

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

◆ $global_screen

GlobalScreen ilObjTestGUI::$global_screen
protected

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

◆ $gui_factory

GUIFactory ilObjTestGUI::$gui_factory
protected

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

Referenced by executeCommand().

◆ $help

ilHelpGUI ilObjTestGUI::$help
protected

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

◆ $irss

IRSS ilObjTestGUI::$irss
protected

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

◆ $main_settings_repository

MainSettingsRepository ilObjTestGUI::$main_settings_repository
protected

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

◆ $mark_schema_factory

MarkSchemaFactory ilObjTestGUI::$mark_schema_factory
protected

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

◆ $marks_repository

MarksRepository ilObjTestGUI::$marks_repository
protected

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

◆ $navigation_history

ilNavigationHistory ilObjTestGUI::$navigation_history
protected

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

◆ $obj_data_cache

ilObjectDataCache ilObjTestGUI::$obj_data_cache
protected

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

◆ $objective_oriented_container

ilTestObjectiveOrientedContainer ilObjTestGUI::$objective_oriented_container
private

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

◆ $participant_access_filter_factory

ilTestParticipantAccessFilterFactory ilObjTestGUI::$participant_access_filter_factory
private

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

◆ $participant_repository

ParticipantRepository ilObjTestGUI::$participant_repository
protected

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

◆ $personal_settings_exporter

PersonalSettingsExporter ilObjTestGUI::$personal_settings_exporter
protected

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

◆ $personal_settings_templates_repository

PersonalSettingsRepository ilObjTestGUI::$personal_settings_templates_repository
protected

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

◆ $qplrequest

QPLRequestDataCollector ilObjTestGUI::$qplrequest
private

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

◆ $questionrepository

GeneralQuestionPropertiesRepository ilObjTestGUI::$questionrepository
private

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

◆ $response_handler

ResponseHandler ilObjTestGUI::$response_handler
protected

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

◆ $results_data_factory

ResultsDataFactory ilObjTestGUI::$results_data_factory
protected

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

◆ $results_presentation_factory

ResultsPresentationFactory ilObjTestGUI::$results_presentation_factory
protected

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

◆ $score_settings_repository

ScoreSettingsRepository ilObjTestGUI::$score_settings_repository
protected

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

◆ $settings_factory

SettingsFactory ilObjTestGUI::$settings_factory
protected

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

◆ $skill_usage_service

SkillUsageService ilObjTestGUI::$skill_usage_service
protected

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

◆ $skills_service

SkillService ilObjTestGUI::$skills_service
protected

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

◆ $table_actions

QuestionsTableActions ilObjTestGUI::$table_actions = null
protected

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

◆ $table_query

QuestionsTableQuery ilObjTestGUI::$table_query = null
protected

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

◆ $tabs_manager

TabsManager ilObjTestGUI::$tabs_manager = null
protected

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

◆ $taxonomy

TaxonomyService ilObjTestGUI::$taxonomy
protected

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

◆ $test_access

ilTestAccess ilObjTestGUI::$test_access
protected

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

◆ $test_pass_result_repository

TestResultRepository ilObjTestGUI::$test_pass_result_repository
protected

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

◆ $test_player_factory

ilTestPlayerFactory ilObjTestGUI::$test_player_factory
private

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

◆ $test_question_set_config_factory

ilTestQuestionSetConfigFactory ilObjTestGUI::$test_question_set_config_factory
private

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

◆ $test_questions_repository

TestQuestionsRepository ilObjTestGUI::$test_questions_repository
private

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

◆ $test_session_factory

ilTestSessionFactory ilObjTestGUI::$test_session_factory
private

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

◆ $testrequest

RequestDataCollector ilObjTestGUI::$testrequest
protected

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

◆ $title_builder

TitleColumnsBuilder ilObjTestGUI::$title_builder
private

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

◆ $toplist_repository

TestTopListRepository ilObjTestGUI::$toplist_repository
private

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

◆ $ui_service

ilUIService ilObjTestGUI::$ui_service
protected

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

◆ QUESTION_CREATION_POOL_SELECTION_EXISTING_POOL

const ilObjTestGUI::QUESTION_CREATION_POOL_SELECTION_EXISTING_POOL = 3
private

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

◆ QUESTION_CREATION_POOL_SELECTION_NEW_POOL

const ilObjTestGUI::QUESTION_CREATION_POOL_SELECTION_NEW_POOL = 2
private

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

◆ QUESTION_CREATION_POOL_SELECTION_NO_POOL

const ilObjTestGUI::QUESTION_CREATION_POOL_SELECTION_NO_POOL = 1
private

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

◆ SHOW_LOGS_CMD

const ilObjTestGUI::SHOW_LOGS_CMD = 'history'
private

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

◆ SHOW_QUESTIONS_CMD


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