ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
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 2435 of file class.ilObjTestGUI.php.

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

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

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

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

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

1083 : void
1084 {
1085 $this->tpl->setTitle(
1086 $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
1087 "{$this->getTestObject()->getTitle()}: {$question_title}"
1088 )
1089 );
1090 }

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

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

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

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

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

1758 : Select
1759 {
1760 $options = [0 => $this->lng->txt('first')];
1761 foreach ($questions as $key => $title) {
1762 $options[$key] = $this->lng->txt('behind') . ' ' . $title
1763 . ' [' . $this->lng->txt('question_id_short') . ': ' . $key . ']';
1764 }
1765 return $this->ui_factory->input()->field()->select(
1766 $this->lng->txt('position'),
1767 $options
1768 )->withAdditionalTransformation($this->refinery->kindlyTo()->int());
1769 }
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 1744 of file class.ilObjTestGUI.php.

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

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

2115 {
2117 $this->ui_factory,
2118 $this->lng,
2119 $this->user,
2120 $this->personal_settings_templates_repository,
2121 $this->main_settings_repository,
2122 $this->score_settings_repository,
2123 $this->marks_repository
2124 );
2125 }

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

+ Here is the call graph for this function:

◆ buildPersonalSettingsImportAction()

ilObjTestGUI::buildPersonalSettingsImportAction ( )
protected

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

2128 {
2130 $this->ui_factory,
2131 $this->lng,
2132 $this->data_factory,
2133 $this->temp_file_system,
2134 $this->personal_settings_templates_repository,
2135 $this->main_settings_repository,
2136 $this->score_settings_repository,
2137 $this->marks_repository
2138 );
2139 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ buildPersonalSettingsTable()

ilObjTestGUI::buildPersonalSettingsTable ( )
protected

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

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

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

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

1674 : void
1675 {
1676 $this->ctrl->redirect($this, self::SHOW_QUESTIONS_CMD);
1677 }

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

2388 {
2389 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
2390
2391 $guiFactory = new ilCertificateGUIFactory();
2392 $output_gui = $guiFactory->create($this->getTestObject());
2393
2394 $output_gui->certificateEditor();
2395 }

◆ copyAndLinkQuestionsToPoolObject()

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

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

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

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

◆ copyQuestionsToPoolObject()

ilObjTestGUI::copyQuestionsToPoolObject ( )

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

2466 {
2467 $this->copyQuestionsToPool($this->testrequest->raw('q_id'), $this->testrequest->raw('sel_qpl'));
2468 $this->ctrl->redirect($this, self::SHOW_QUESTIONS_CMD);
2469 }

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

2491 : int
2492 {
2493 $new_title = $target_pool->appendCounterToQuestionTitleIfNecessary(
2494 $source_question_gui->getObject()->getTitle()
2495 );
2496
2497 return $source_question_gui->getObject()->createNewOriginalFromThisDuplicate($target_pool->getId(), $new_title);
2498 }
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 2547 of file class.ilObjTestGUI.php.

2548 {
2549 $this->createQuestionpoolTargetObject('copyQuestionsToPool');
2550 }
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 1694 of file class.ilObjTestGUI.php.

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

References ILIAS\Repository\help().

+ Here is the call graph for this function:

◆ createQuestionPool()

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

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

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

◆ createQuestionPoolAndCopyObject()

ilObjTestGUI::createQuestionPoolAndCopyObject ( )

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

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

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

◆ createTemplateObject()

ilObjTestGUI::createTemplateObject ( )

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

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

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

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

1596 {
1597 $pg_obj = new ilAssQuestionPage($this->testrequest->raw("pg_id"));
1598 $pg_obj->sendParagraph($this->testrequest->raw("par_id"), $this->testrequest->raw("downloadtitle"));
1599 exit;
1600 }
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 1572 of file class.ilObjTestGUI.php.

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

References exit.

◆ executeAfterQuestionCreationTasks()

ilObjTestGUI::executeAfterQuestionCreationTasks ( assQuestionGUI  $question_gui)
private

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

1191 : void
1192 {
1193 if ($this->getTestObject()->getQuestionSetType() === ilObjTest::QUESTION_SET_TYPE_FIXED
1194 && !in_array($question_gui->getObject()->getId(), $this->getTestObject()->getQuestions())) {
1195 $this->getTestObject()->insertQuestion($question_gui->getObject()->getId(), true);
1196 }
1197
1198 if ($question_gui->getMoveAfterQuestionId() !== null) {
1199 $this->getTestObject()->moveQuestions(
1200 [$question_gui->getObject()->getId()],
1201 $question_gui->getMoveAfterQuestionId() === 0
1202 ? $this->getTestObject()->getQuestions()[1]
1203 : $question_gui->getMoveAfterQuestionId(),
1204 $question_gui->getMoveAfterQuestionId() === 0 ? 0 : 1
1205 );
1206 $question_gui->setMoveAfterQuestionId(null);
1207 }
1208
1209 if ($question_gui->getCopyToExistingPoolOnSave() !== null) {
1210 $original_id = $this->copyQuestionToPool(
1211 $question_gui,
1213 );
1214 assQuestion::saveOriginalId($question_gui->getObject()->getId(), $original_id);
1215 $question_gui->setCopyToExistingPoolOnSave(null);
1216 }
1217
1218 if ($question_gui->getCopyToNewPoolOnSave() !== null) {
1219 $question_pool = $this->createQuestionPool($question_gui->getCopyToNewPoolOnSave());
1220 $original_id = $this->copyQuestionToPool(
1221 $question_gui,
1222 $question_pool
1223 );
1224 assQuestion::saveOriginalId($question_gui->getObject()->getId(), $original_id);
1225 $question_gui->setCopyToNewPoolOnSave(null);
1226 }
1227 }
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 1178 of file class.ilObjTestGUI.php.

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

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 (!$this->test_access->checkOtherParticipantsLearningProgressAccess()
562 && !$this->getTestObject()->canShowTestResults($test_session)) {
563 $this->tpl->setOnScreenMessage(
564 'info',
565 $this->lng->txt('tst_res_tab_msg_no_lp_access'),
566 );
567 break;
568 }
569
571 $this->ctrl->forwardCommand($new_gui);
572
573 break;
574
575 case "ilcertificategui":
576 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
578 }
579 $this->prepareOutput();
580 $this->addHeaderAction();
581
582 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
583
585 $output_gui = $gui_factory->create($this->getTestObject());
586
587 $this->ctrl->forwardCommand($output_gui);
588 break;
589
590 case strtolower(ConsecutiveScoringGUI::class):
591 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
593 }
594 $output_gui = $this->gui_factory->get(ConsecutiveScoringGUI::class, $this->getTestObject());
595 $this->prepareOutput();
596 $this->ctrl->forwardCommand($output_gui);
597 $this->addHeaderAction();
598 break;
599
600
601 case strtolower(MarkSchemaGUI::class):
602 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
604 }
606
607 $mark_schema_gui = new MarkSchemaGUI(
608 $this->getTestObject(),
609 $this->user,
610 $this->lng,
611 $this->ctrl,
612 $this->tpl,
613 $this->toolbar,
614 $this->getObject()->getTestLogger(),
615 $this->post_wrapper,
616 $this->request_wrapper,
617 $this->response_handler,
618 $this->request,
619 $this->refinery,
620 $this->ui_factory,
621 $this->ui_renderer,
622 $this->mark_schema_factory
623 );
624 $this->ctrl->forwardCommand($mark_schema_gui);
625
626 $this->prepareOutput();
627 $this->addHeaderAction();
628 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
629 $this->tabs_manager->activateSubTab(TabsManager::SETTINGS_SUBTAB_ID_MARK_SCHEMA);
630
631 break;
632
633 case strtolower(SettingsMainGUI::class):
634 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
636 }
637
638 $gui = new SettingsMainGUI(
639 $this->tpl,
640 $this->ctrl,
641 $this->access,
642 $this->lng,
643 $this->tree,
644 $this->db,
645 $this->obj_data_cache,
646 $this->settings,
647 $this->ui_factory,
648 $this->ui_renderer,
649 $this->refinery,
650 $this->request,
651 $this->component_repository,
652 $this->user,
653 $this,
654 $this->getTestObject()->getTestLogger(),
655 $this->questionrepository
656 );
657 $this->ctrl->forwardCommand($gui);
658 $this->prepareOutput();
659 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
660 $this->tabs_manager->activateSubTab(TabsManager::SUBTAB_ID_GENERAL_SETTINGS);
661 $this->addHeaderAction();
662 break;
663
664 case strtolower(SettingsScoringGUI::class):
665 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
667 }
668 $this->prepareOutput();
669 $this->addHeaderAction();
670 $gui = new SettingsScoringGUI(
671 $this->ctrl,
672 $this->access,
673 $this->lng,
674 $this->tree,
675 $this->db,
676 $this->component_repository,
677 $this,
678 $this->tpl,
679 $this->tabs_gui,
680 $this->getTestObject()->getTestLogger(),
681 $this->getTestObject()->getScoreSettingsRepository(),
682 $this->getTestObject()->getTestId(),
683 $this->ui_factory,
684 $this->ui_renderer,
685 $this->refinery,
686 $this->request,
687 $this->user
688 );
689
690 $this->ctrl->forwardCommand($gui);
691 break;
692
693 case 'iltestrandomquestionsetconfiggui':
694 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
696 }
697 $this->prepareOutput();
698 $this->addHeaderAction();
699 $test_process_locker_factory = (new ilTestProcessLockerFactory(
700 new ilSetting('assessment'),
701 $this->db,
702 $this->getTestObject()->getTestLogger()
703 ))->withContextId($this->getTestObject()->getId());
705 $this->getTestObject(),
706 $this->ctrl,
707 $this->user,
708 $this->access,
709 $this->ui_factory,
710 $this->ui_renderer,
711 $this->data_factory,
712 $this->tabs_manager,
713 $this->lng,
714 $this->getTestObject()->getTestlogger(),
715 $this->tpl,
716 $this->db,
717 $this->tree,
718 $this->component_repository,
719 $this->obj_definition,
720 $this->obj_data_cache,
721 $test_process_locker_factory,
722 $this->testrequest,
723 $this->title_builder,
724 $this->questionrepository
725 );
726 $this->ctrl->forwardCommand($gui);
727 break;
728
729 case 'iltestquestionbrowsertablegui':
730 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
732 }
733 $this->prepareOutput();
734 $this->addHeaderAction();
736 $this->tabs_gui,
737 $this->tree,
738 $this->db,
739 $this->getTestObject()->getTestlogger(),
740 $this->component_repository,
741 $this->getTestObject(),
742 $this->user,
743 $this->access,
744 $this->http,
745 $this->refinery,
746 $this->ui_factory,
747 $this->ui_renderer,
748 $this->testrequest,
749 $this->questionrepository,
750 $this->lng,
751 $this->ctrl,
752 $this->tpl,
753 $this->ui_service,
754 $this->data_factory,
755 $this->taxonomy,
756 );
757 $this->ctrl->forwardCommand($gui);
758 break;
759
760 case 'iltestskilladministrationgui':
761 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
763 }
764 $this->prepareOutput();
765 $this->addHeaderAction();
767 $this->ctrl,
768 $this->access,
769 $this->tabs_manager,
770 $this->tpl,
771 $this->lng,
772 $this->refinery,
773 $this->db,
774 $this->getTestObject()->getTestlogger(),
775 $this->tree,
776 $this->component_repository,
777 $this->getTestObject(),
778 $this->questionrepository,
779 $this->testrequest,
780 $this->http,
781 $this->toolbar,
782 $this->skill_usage_service,
783 $this->ui_factory,
784 $this->ui_renderer,
785 $this->tabs_gui,
786 $this->ref_id
787 );
788 $this->ctrl->forwardCommand($gui);
789 break;
790
791 case 'ilobjectcopygui':
792 if ((!$this->access->checkAccess("copy", "", $this->testrequest->getRefId()))) {
794 }
795 $this->prepareOutput();
796 $this->addHeaderAction();
797 $cp = new ilObjectCopyGUI($this);
798 $cp->setType('tst');
799 $this->ctrl->forwardCommand($cp);
800 break;
801
802 case strtolower(ilAssQuestionPreviewGUI::class):
803 if (!$this->access->checkAccess('write', '', $this->getTestObject()->getRefId())) {
805 }
806 $this->prepareOutput();
808 break;
809 case 'ilassquestionpagegui':
810 if ($cmd === 'finishEditing') {
811 $this->prepareOutput();
813 break;
814 }
815 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
817 }
818 if ($cmd === 'edit' && !$this->access->checkAccess('write', '', $this->testrequest->getRefId())) {
820 }
821 $this->prepareOutput();
822 $forwarder = new ilAssQuestionPageCommandForwarder(
823 $this->getTestObject(),
824 $this->lng,
825 $this->ctrl,
826 $this->tpl,
827 $this->questionrepository,
828 $this->testrequest
829 );
830 $forwarder->forward();
831 break;
832
833 case 'ilassspecfeedbackpagegui':
834 if ((!$this->access->checkAccess("write", "", $this->testrequest->getRefId()))) {
836 }
837 $pg_gui = new ilAssSpecFeedbackPageGUI((int) $this->testrequest->raw("feedback_id"));
838 $this->ctrl->forwardCommand($pg_gui);
839 break;
840
841 case 'ilassgenfeedbackpagegui':
842 if ((!$this->access->checkAccess("write", "", $this->testrequest->getRefId()))) {
844 }
845 $pg_gui = new ilAssGenFeedbackPageGUI($this->testrequest->int("feedback_id"));
846 $this->ctrl->forwardCommand($pg_gui);
847 break;
848
849 case 'illocalunitconfigurationgui':
850 if ((!$this->access->checkAccess("write", "", $this->testrequest->getRefId()))) {
852 }
853 $this->prepareSubGuiOutput();
854
855 // set return target
857 $question = $question_gui->getObject();
858 $question->setObjId($this->getTestObject()->getId());
859 $question_gui->setObject($question);
860 $question_gui->setQuestionTabs();
862 new ilUnitConfigurationRepository($this->testrequest->getQuestionId())
863 );
864 $this->ctrl->forwardCommand($gui);
865 break;
866
867 case "ilcommonactiondispatchergui":
868 if (!$this->access->checkAccess("read", "", $this->testrequest->getRefId()) && !$this->access->checkAccess("visible", "", $this->testrequest->getRefId())) {
870 }
871 $this->prepareOutput();
873 $this->ctrl->forwardCommand($gui);
874 break;
875
876 case 'ilassquestionfeedbackeditinggui':
877 if (!$this->access->checkAccess('write', '', $this->getTestObject()->getRefId())) {
879 }
880 $this->prepareSubGuiOutput();
881
882 // set return target
883 $this->ctrl->setReturnByClass(self::class, self::SHOW_QUESTIONS_CMD);
885 $question = $question_gui->getObject();
886 $question->setObjId($this->getTestObject()->getId());
887 $question_gui->setObject($question);
888 $question_gui->setQuestionTabs();
889 $question_gui->setContextAllowsSyncToPool(true);
890
891 $this->addQuestionTitleToObjectTitle($question->getTitleForHTMLOutput());
892
893 if ($this->getTestObject()->evalTotalPersons() !== 0) {
894 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('question_is_part_of_running_test'), true);
895 $this->prepareOutput();
897 }
899 $question_gui,
900 $this->ctrl,
901 $this->access,
902 $this->tpl,
903 $this->tabs_gui,
904 $this->lng,
905 $this->help,
906 $this->qplrequest,
907 $this->content_style
908 );
909 $this->ctrl->forwardCommand($gui);
910 break;
911
912 case 'iltestcorrectionsgui':
913 if ((!$this->access->checkAccess('read', '', $this->testrequest->getRefId()))) {
915 }
916 $this->prepareOutput();
917 $gui = new ilTestCorrectionsGUI(
918 $this->db,
919 $this->ctrl,
920 $this->lng,
921 $this->tabs_gui,
922 $this->help,
923 $this->ui_factory,
924 $this->tpl,
925 $this->refinery,
926 $this->getTestObject()->getTestLogger(),
927 $this->testrequest,
928 $this->getTestObject(),
929 $this->user,
930 $this->test_pass_result_repository
931 );
932 $this->ctrl->forwardCommand($gui);
933 break;
934
935 case 'iltestpagegui':
936 if ((!$this->access->checkAccess("write", "", $this->testrequest->getRefId()))) {
938 }
939
940 if ($cmd === 'downloadFile') {
941 $page_id = $this->object->getIntroductionPageId();
942 if ($this->testrequest->strVal('page_type') === 'concludingremarkspage') {
943 $page_id = $this->object->getConcludingRemarksPageId();
944 }
945 $this->ctrl->forwardCommand(new ilTestPageGUI('tst', $page_id));
946 }
947 $this->showEditTestPageGUI();
948 break;
949
950 case '':
951 case 'ilobjtestgui':
952 if (!$this->access->checkAccess('read', '', $this->testrequest->getRefId())
953 && !$this->access->checkAccess('visible', '', $this->testrequest->getRefId())) {
955 }
956 $this->prepareOutput();
957 $this->addHeaderAction();
958
959 if ($cmd === 'testScreen') {
960 $this->ctrl->forwardCommand($this->getTestScreenGUIInstance());
961 return;
962 }
963
964 $local_cmd = "{$cmd}Object";
965
966 if (!method_exists($this, $local_cmd)) {
967 $local_cmd = self::SHOW_QUESTIONS_CMD . 'Object';
968 }
969 $this->$local_cmd();
970 break;
971
972 default:
973 if ((!$this->access->checkAccess('read', '', $this->testrequest->getRefId()))) {
975 }
976 if (in_array(
977 $cmd,
978 ['editQuestion', 'previewQuestion', 'save', 'saveReturn', 'uploadImage',
979 'removeImage', 'syncQuestion', 'syncQuestionReturn', 'suggestedsolution']
980 )
981 && !$this->access->checkAccess('write', '', $this->getTestObject()->getRefId())) {
983 }
984 if (in_array($cmd, ['editQuestion', 'save', 'saveReturn', 'suggestedsolution'])
985 && $this->getTestObject()->evalTotalPersons() !== 0) {
986 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('question_is_part_of_running_test'), true);
987 $this->prepareOutput();
989 return;
990 }
991 $this->forwardCommandToQuestion($cmd);
992 break;
993 }
994 if (!in_array(strtolower($this->testrequest->raw('baseClass')), ['iladministrationgui', 'ilrepositorygui'])
995 && $this->getCreationMode() !== true) {
996 $this->tpl->printToStdout();
997 }
998 }
@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.
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(), 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 2102 of file class.ilObjTestGUI.php.

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ exportLegacyLogsObject()

ilObjTestGUI::exportLegacyLogsObject ( )

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

2007 : void
2008 {
2009 $this->protectByWritePermission();
2010
2011 $csv_output = $this->getTestObject()->getTestLogViewer()->getLegacyLogExportForObjId($this->getTestObject()->getId());
2012
2014 $csv_output,
2015 "legacy_logs_for_{$this->getTestObject()->getRefId()}.csv"
2016 );
2017 }
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 1265 of file class.ilObjTestGUI.php.

1266 {
1267 $this->ctrl->redirectByClass('ilTestExportGUI');
1268 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ fetchAuthoringQuestionIdParameter()

ilObjTestGUI::fetchAuthoringQuestionIdParameter ( )
protected
Returns
int
Exceptions
ilTestException

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

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

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

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

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ forwardToEvaluationGUI()

ilObjTestGUI::forwardToEvaluationGUI ( )
private

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

1335 {
1336 $this->prepareOutput();
1337 $this->addHeaderAction();
1338 $gui = new ilTestEvaluationGUI($this->getTestObject());
1339 $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
1340 $gui->setTestAccess($this->getTestAccess());
1341
1342 $this->ctrl->forwardCommand($gui);
1343 }
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 2223 of file class.ilObjTestGUI.php.

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

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getObjectiveOrientedContainer()

ilObjTestGUI::getObjectiveOrientedContainer ( )
protected

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

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getQuestionsTableActions()

ilObjTestGUI::getQuestionsTableActions ( )
protected

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

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

2723 {
2724 if ($this->table_query === null) {
2725 $id = $this->object ? $this->object->getId() : '';
2726 $this->table_query = new QuestionsTableQuery(
2727 $this->http,
2728 $this->refinery,
2729 $this->data_factory,
2730 ['qlist', $id]
2731 );
2732 }
2733 return $this->table_query;
2734 }
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 2770 of file class.ilObjTestGUI.php.

2771 {
2772 return new QuestionsTable(
2773 $this->ui_factory,
2774 $this->refinery,
2775 $this->http->request(),
2776 $this->getQuestionsTableActions(),
2777 $this->lng,
2778 $this->object,
2779 $this->test_questions_repository,
2780 $this->title_builder
2781 );
2782 }

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

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

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

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

1324 : ilTestAccess
1325 {
1326 return $this->test_access;
1327 }
ilTestAccess $test_access

◆ getTestObject()

ilObjTestGUI::getTestObject ( )

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

1473 : ?ilObjTest
1474 {
1475 return $this->object;
1476 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getTestScreenGUIInstance()

ilObjTestGUI::getTestScreenGUIInstance ( )
private

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

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

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

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

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

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

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

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

2216 : void
2217 {
2218 $this->ctrl->redirectByClass(
2219 [ilRepositoryGUI::class, self::class, ilInfoScreenGUI::class]
2220 );
2221 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ insertQuestionsObject()

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

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

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

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

+ Here is the call graph for this function:

◆ isCommandClassAnyInfoScreenChild()

ilObjTestGUI::isCommandClassAnyInfoScreenChild ( )
private

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

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

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

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ populateQuestionBrowserToolbarButtons()

ilObjTestGUI::populateQuestionBrowserToolbarButtons ( ilToolbarGUI  $toolbar)
private

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

1929 : void
1930 {
1931 $this->ctrl->setParameterByClass(
1932 ilTestQuestionBrowserTableGUI::class,
1935 );
1936
1938 $this->lng->txt('tst_browse_for_qpl_questions'),
1939 $this->ctrl->getLinkTargetByClass(
1940 ilTestQuestionBrowserTableGUI::class,
1942 )
1943 );
1944
1945 $this->ctrl->setParameterByClass(
1946 ilTestQuestionBrowserTableGUI::class,
1949 );
1950
1952 $this->lng->txt('tst_browse_for_tst_questions'),
1953 $this->ctrl->getLinkTargetByClass(
1954 ilTestQuestionBrowserTableGUI::class,
1956 )
1957 );
1958 }
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 1350 of file class.ilObjTestGUI.php.

1351 {
1352 $this->tpl->loadStandardTemplate();
1353 $this->setLocator();
1354 $this->setTitleAndDescription();
1355 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ protectByWritePermission()

ilObjTestGUI::protectByWritePermission ( )
protected

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

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

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

1286 {
1287 if ($this->getTestObject()->isRandomTest()) {
1288 $this->ctrl->redirectByClass('ilTestRandomQuestionSetConfigGUI');
1289 }
1290
1291 $this->ctrl->redirectByClass('ilObjTestGUI', self::SHOW_QUESTIONS_CMD);
1292 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ redirectAfterMissingRead()

ilObjTestGUI::redirectAfterMissingRead ( )
protected

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

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

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

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

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

1346 {
1347 $this->ctrl->redirectByClass(SettingsMainGUI::class, SettingsMainGUI::CMD_SHOW_FORM);
1348 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ removeImportFailsObject()

ilObjTestGUI::removeImportFailsObject ( )
protected

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

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

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

+ Here is the call graph for this function:

◆ runObject()

ilObjTestGUI::runObject ( )

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

1358 {
1359 $this->ctrl->redirectByClass([ilRepositoryGUI::class, self::class, ilInfoScreenGUI::class]);
1360 }

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

1330 {
1331 $this->test_access = $test_access;
1332 }

◆ setupToolBarAndMessage()

ilObjTestGUI::setupToolBarAndMessage ( bool  $has_started_test_runs)
private

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

1900 : void
1901 {
1902 if (!$this->access->checkAccess('write', '', $this->ref_id)
1903 || $this->getTestObject()->isRandomTest()) {
1904 return;
1905 }
1906
1907 if ($has_started_test_runs) {
1908 $link = $this->ui_factory->link()->standard(
1909 $this->lng->txt('test_has_datasets_warning_page_view_link'),
1910 $this->ctrl->getLinkTargetByClass([\ilTestParticipantsGUI::class])
1911 );
1912
1913 $message = $this->lng->txt('test_has_datasets_warning_page_view');
1914 $massage_box = $this->ui_factory->messageBox()->info($message)->withLinks([$link]);
1915 $this->tpl->setCurrentBlock('pax_info_message');
1916 $this->tpl->setVariable(
1917 'PAX_INFO_MESSAGE',
1918 $this->ui_renderer->render($massage_box)
1919 );
1920 $this->tpl->parseCurrentBlock();
1921 return;
1922 }
1923
1924 $this->toolbar->addButton($this->lng->txt('ass_create_question'), $this->ctrl->getLinkTarget($this, 'createQuestionForm'));
1925 $this->toolbar->addSeparator();
1927 }
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 1294 of file class.ilObjTestGUI.php.

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

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

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

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

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

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

+ Here is the call graph for this function:

◆ statisticsObject()

ilObjTestGUI::statisticsObject ( )

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

2381 {
2382 }

◆ takenObject()

ilObjTestGUI::takenObject ( )

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

1960 : void
1961 {
1962 }

◆ trackTestObjectReadEvent()

ilObjTestGUI::trackTestObjectReadEvent ( )
protected

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

1252 {
1254 $this->getTestObject()->getType(),
1255 $this->getTestObject()->getRefId(),
1256 $this->getTestObject()->getId(),
1257 $this->user->getId()
1258 );
1259 }
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 2784 of file class.ilObjTestGUI.php.

2784 : bool
2785 {
2786 return $this->settings->get('obj_dis_creation_qpl') !== '1'
2787 && $this->checkPermissionBool('create', '', 'qpl', $this->tree->getParentId($this->ref_id));
2788 }

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: