ILIAS  trunk Revision v12.0_alpha-424-g0abf7026fd4
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 2426 of file class.ilObjTestGUI.php.

2427 {
2428 global $DIC;
2429 $main_tpl = $DIC->ui()->mainTemplate();
2430 $ilAccess = $DIC['ilAccess'];
2431 $ilErr = $DIC['ilErr'];
2432 $lng = $DIC['lng'];
2433
2434 if ($ilAccess->checkAccess('read', '', (int) $target)
2435 || $ilAccess->checkAccess('visible', '', (int) $target)) {
2436 $DIC->ctrl()->setParameterByClass(self::class, 'ref_id', (int) $target);
2437 $DIC->ctrl()->redirectByClass(
2438 [
2439 ilRepositoryGUI::class,
2440 ilObjTestGUI::class,
2441 TestScreenGUI::class
2442 ],
2443 TestScreenGUI::DEFAULT_CMD
2444 );
2445 } elseif ($ilAccess->checkAccess('read', '', ROOT_FOLDER_ID)) {
2446 $main_tpl->setOnScreenMessage('info', sprintf(
2447 $lng->txt('msg_no_perm_read_item'),
2449 ), true);
2451 }
2452
2453 $ilErr->raiseError($lng->txt('msg_no_perm_read_lm'), $ilErr->FATAL);
2454 }
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 2304 of file class.ilObjTestGUI.php.

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

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

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

1877 : void
1878 {
1879 $selected_array = [$this->testrequest->int('add')];
1880 $total = $this->getTestObject()->evalTotalPersons();
1881 if ($total > 0) {
1882 // the test was executed previously
1883 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('test_has_datasets_warning_page_view'));
1884 $this->showQuestionsObject();
1885 return;
1886 }
1887 $this->tpl->setOnScreenMessage('info', $this->lng->txt('tst_insert_questions'));
1888 $this->insertQuestionsObject($selected_array);
1889 }
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 1081 of file class.ilObjTestGUI.php.

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

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

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

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

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

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

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

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

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

2106 {
2108 $this->ui_factory,
2109 $this->lng,
2110 $this->user,
2111 $this->personal_settings_templates_repository,
2112 $this->main_settings_repository,
2113 $this->score_settings_repository,
2114 $this->marks_repository
2115 );
2116 }

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

+ Here is the call graph for this function:

◆ buildPersonalSettingsImportAction()

ilObjTestGUI::buildPersonalSettingsImportAction ( )
protected

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

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

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ buildPersonalSettingsTable()

ilObjTestGUI::buildPersonalSettingsTable ( )
protected

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

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

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

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

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

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

2379 {
2380 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
2381
2382 $guiFactory = new ilCertificateGUIFactory();
2383 $output_gui = $guiFactory->create($this->getTestObject());
2384
2385 $output_gui->certificateEditor();
2386 }

◆ copyAndLinkQuestionsToPoolObject()

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

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

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

2466 : stdClass
2467 {
2468 $target_pool = new ilObjQuestionPool($qpl_id, false);
2469 $new_ids = [];
2470 foreach ($question_ids as $q_id) {
2471 $new_id = $this->copyQuestionToPool(assQuestion::instantiateQuestionGUI($q_id), $target_pool);
2472 $new_ids[$q_id] = $new_id;
2473 }
2474
2475 $result = new stdClass();
2476 $result->ids = $new_ids;
2477 $result->qpoolid = $qpl_id;
2478
2479 return $result;
2480 }
copyQuestionToPool(assQuestionGUI $source_question_gui, ilObjQuestionPool $target_pool)

◆ copyQuestionsToPoolObject()

ilObjTestGUI::copyQuestionsToPoolObject ( )

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

2457 {
2458 $this->copyQuestionsToPool($this->testrequest->raw('q_id'), $this->testrequest->raw('sel_qpl'));
2459 $this->ctrl->redirect($this, self::SHOW_QUESTIONS_CMD);
2460 }

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

2482 : int
2483 {
2484 $new_title = $target_pool->appendCounterToQuestionTitleIfNecessary(
2485 $source_question_gui->getObject()->getTitle()
2486 );
2487
2488 return $source_question_gui->getObject()->createNewOriginalFromThisDuplicate($target_pool->getId(), $new_title);
2489 }
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 2538 of file class.ilObjTestGUI.php.

2539 {
2540 $this->createQuestionpoolTargetObject('copyQuestionsToPool');
2541 }
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 1692 of file class.ilObjTestGUI.php.

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

References ILIAS\Repository\help().

+ Here is the call graph for this function:

◆ createQuestionPool()

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

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

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

◆ createQuestionPoolAndCopyObject()

ilObjTestGUI::createQuestionPoolAndCopyObject ( )

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

2544 {
2545 if (!$this->access->checkAccess('write', '', $this->object->getRefId())
2546 || !$this->checkPermissionBool('create', '', 'qpl')) {
2548 }
2549
2550 if ($this->testrequest->raw('title')) {
2551 $title = $this->testrequest->raw('title');
2552 } else {
2553 $title = $this->testrequest->raw('txt_qpl');
2554 }
2555
2556 if (!$title) {
2557 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('questionpool_not_entered'));
2558 $this->createQuestionpoolTargetObject('createQuestionPoolAndCopy');
2559 return;
2560 }
2561
2562 $question_pool = $this->createQuestionPool($title, $this->testrequest->raw('description'));
2563 $_REQUEST['sel_qpl'] = $question_pool->getRefId();
2564
2566 }
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 2572 of file class.ilObjTestGUI.php.

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

◆ createTemplateObject()

ilObjTestGUI::createTemplateObject ( )

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

2063 : void
2064 {
2065 $this->protectByWritePermission();
2066
2067 try {
2069 ->perform($this->getTestObject()->getTestId(), $this->request);
2070 } catch (\InvalidArgumentException $e) {
2071 $this->tpl->setOnScreenMessage('failure', $this->lng->txt($e->getMessage()), true);
2072 }
2073
2074 $this->ctrl->redirectByClass(self::class, 'showTemplates');
2075 }

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

2667 {
2668 if (!ilLOSettings::isObjectiveTest($this->ref_id)) {
2669 return;
2670 }
2671
2672 $path = $this->tree->getPathFull($this->ref_id);
2673
2674 while ($parent = array_pop($path)) {
2675 if ($parent['type'] === 'crs') {
2676 $container_ref_id = $parent['ref_id'];
2677 break;
2678 }
2679 }
2680
2681 $container_obj_id = ilObject2::_lookupObjId($container_ref_id);
2682
2683 $this->objective_oriented_container->setObjId($container_obj_id);
2684 $this->objective_oriented_container->setRefId($container_ref_id);
2685 }
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 1593 of file class.ilObjTestGUI.php.

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

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

References exit.

◆ executeAfterQuestionCreationTasks()

ilObjTestGUI::executeAfterQuestionCreationTasks ( assQuestionGUI  $question_gui)
private

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

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

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

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 );
486
487 $this->ctrl->forwardCommand($gui);
488 break;
489
490 case "iltestplayerfixedquestionsetgui":
491 if (
492 $cmd !== 'autosave' &&
493 (!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))
494 ) {
496 }
498 if (!$this->getTestObject()->getKioskMode()) {
499 $this->prepareOutput();
500 }
502 $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
503 $this->ctrl->forwardCommand($gui);
504 break;
505
506 case "iltestplayerrandomquestionsetgui":
507 if (
508 $cmd !== 'autosave' &&
509 (!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))
510 ) {
512 }
514 if (!$this->getTestObject()->getKioskMode()) {
515 $this->prepareOutput();
516 }
518 $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
519 $this->ctrl->forwardCommand($gui);
520 break;
521
522 case "iltestevaluationgui":
523 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
525 }
526 $this->forwardToEvaluationGUI();
527 break;
528
529 case "iltestservicegui":
530 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
532 }
533 $this->prepareOutput();
534 $this->addHeaderAction();
535 $serviceGUI = new ilTestServiceGUI($this->getTestObject());
536 $this->ctrl->forwardCommand($serviceGUI);
537 break;
538
539 case 'ilpermissiongui':
540 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
542 }
543 $this->prepareOutput();
544 $this->addHeaderAction();
545 $this->tabs_manager->activateTab(TabsManager::TAB_ID_PERMISSIONS);
546 $perm_gui = new ilPermissionGUI($this);
547 $ret = $this->ctrl->forwardCommand($perm_gui);
548 break;
549
550 case "illearningprogressgui":
551 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
553 }
554
555 $this->prepareOutput();
556 $this->addHeaderAction();
557 $this->tabs_manager->activateTab(TabsManager::TAB_ID_LEARNING_PROGRESS);
558
559 $test_session = $this->test_session_factory->getSessionByUserId($this->user->getId());
560 if (!$this->test_access->checkOtherParticipantsLearningProgressAccess()
561 && !$this->getTestObject()->canShowTestResults($test_session)) {
562 $this->tpl->setOnScreenMessage(
563 'info',
564 $this->lng->txt('tst_res_tab_msg_no_lp_access'),
565 );
566 break;
567 }
568
570 $this->ctrl->forwardCommand($new_gui);
571
572 break;
573
574 case "ilcertificategui":
575 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
577 }
578 $this->prepareOutput();
579 $this->addHeaderAction();
580
581 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
582
584 $output_gui = $gui_factory->create($this->getTestObject());
585
586 $this->ctrl->forwardCommand($output_gui);
587 break;
588
589 case strtolower(ConsecutiveScoringGUI::class):
590 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
592 }
593 $output_gui = $this->gui_factory->get(ConsecutiveScoringGUI::class, $this->getTestObject());
594 $this->prepareOutput();
595 $this->ctrl->forwardCommand($output_gui);
596 $this->addHeaderAction();
597 break;
598
599
600 case strtolower(MarkSchemaGUI::class):
601 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
603 }
605
606 $mark_schema_gui = new MarkSchemaGUI(
607 $this->getTestObject(),
608 $this->user,
609 $this->lng,
610 $this->ctrl,
611 $this->tpl,
612 $this->toolbar,
613 $this->getObject()->getTestLogger(),
614 $this->post_wrapper,
615 $this->request_wrapper,
616 $this->response_handler,
617 $this->request,
618 $this->refinery,
619 $this->ui_factory,
620 $this->ui_renderer,
621 $this->mark_schema_factory
622 );
623 $this->ctrl->forwardCommand($mark_schema_gui);
624
625 $this->prepareOutput();
626 $this->addHeaderAction();
627 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
628 $this->tabs_manager->activateSubTab(TabsManager::SETTINGS_SUBTAB_ID_MARK_SCHEMA);
629
630 break;
631
632 case strtolower(SettingsMainGUI::class):
633 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
635 }
636
637 $gui = new SettingsMainGUI(
638 $this->tpl,
639 $this->ctrl,
640 $this->access,
641 $this->lng,
642 $this->tree,
643 $this->db,
644 $this->obj_data_cache,
645 $this->settings,
646 $this->ui_factory,
647 $this->ui_renderer,
648 $this->refinery,
649 $this->request,
650 $this->component_repository,
651 $this->user,
652 $this,
653 $this->getTestObject()->getTestLogger(),
654 $this->questionrepository
655 );
656 $this->ctrl->forwardCommand($gui);
657 $this->prepareOutput();
658 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
659 $this->tabs_manager->activateSubTab(TabsManager::SUBTAB_ID_GENERAL_SETTINGS);
660 $this->addHeaderAction();
661 break;
662
663 case strtolower(SettingsScoringGUI::class):
664 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
666 }
667 $this->prepareOutput();
668 $this->addHeaderAction();
669 $gui = new SettingsScoringGUI(
670 $this->ctrl,
671 $this->access,
672 $this->lng,
673 $this->tree,
674 $this->db,
675 $this->component_repository,
676 $this,
677 $this->tpl,
678 $this->tabs_gui,
679 $this->getTestObject()->getTestLogger(),
680 $this->getTestObject()->getScoreSettingsRepository(),
681 $this->getTestObject()->getTestId(),
682 $this->ui_factory,
683 $this->ui_renderer,
684 $this->refinery,
685 $this->request,
686 $this->user
687 );
688
689 $this->ctrl->forwardCommand($gui);
690 break;
691
692 case 'iltestrandomquestionsetconfiggui':
693 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
695 }
696 $this->prepareOutput();
697 $this->addHeaderAction();
698 $test_process_locker_factory = (new ilTestProcessLockerFactory(
699 new ilSetting('assessment'),
700 $this->db,
701 $this->getTestObject()->getTestLogger()
702 ))->withContextId($this->getTestObject()->getId());
704 $this->getTestObject(),
705 $this->ctrl,
706 $this->user,
707 $this->access,
708 $this->ui_factory,
709 $this->ui_renderer,
710 $this->data_factory,
711 $this->tabs_manager,
712 $this->lng,
713 $this->getTestObject()->getTestlogger(),
714 $this->tpl,
715 $this->db,
716 $this->tree,
717 $this->component_repository,
718 $this->obj_definition,
719 $this->obj_data_cache,
720 $test_process_locker_factory,
721 $this->testrequest,
722 $this->title_builder,
723 $this->questionrepository
724 );
725 $this->ctrl->forwardCommand($gui);
726 break;
727
728 case 'iltestquestionbrowsertablegui':
729 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
731 }
732 $this->prepareOutput();
733 $this->addHeaderAction();
735 $this->tabs_gui,
736 $this->tree,
737 $this->db,
738 $this->getTestObject()->getTestlogger(),
739 $this->component_repository,
740 $this->getTestObject(),
741 $this->user,
742 $this->access,
743 $this->http,
744 $this->refinery,
745 $this->ui_factory,
746 $this->ui_renderer,
747 $this->testrequest,
748 $this->questionrepository,
749 $this->lng,
750 $this->ctrl,
751 $this->tpl,
752 $this->ui_service,
753 $this->data_factory,
754 $this->taxonomy,
755 );
756 $this->ctrl->forwardCommand($gui);
757 break;
758
759 case 'iltestskilladministrationgui':
760 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
762 }
763 $this->prepareOutput();
764 $this->addHeaderAction();
766 $this->ctrl,
767 $this->access,
768 $this->tabs_manager,
769 $this->tpl,
770 $this->lng,
771 $this->refinery,
772 $this->db,
773 $this->getTestObject()->getTestlogger(),
774 $this->tree,
775 $this->component_repository,
776 $this->getTestObject(),
777 $this->questionrepository,
778 $this->testrequest,
779 $this->http,
780 $this->toolbar,
781 $this->skill_usage_service,
782 $this->ui_factory,
783 $this->ui_renderer,
784 $this->tabs_gui,
785 $this->ref_id
786 );
787 $this->ctrl->forwardCommand($gui);
788 break;
789
790 case 'ilobjectcopygui':
791 if ((!$this->access->checkAccess("copy", "", $this->testrequest->getRefId()))) {
793 }
794 $this->prepareOutput();
795 $this->addHeaderAction();
796 $cp = new ilObjectCopyGUI($this);
797 $cp->setType('tst');
798 $this->ctrl->forwardCommand($cp);
799 break;
800
801 case strtolower(ilAssQuestionPreviewGUI::class):
802 if (!$this->access->checkAccess('write', '', $this->getTestObject()->getRefId())) {
804 }
805 $this->prepareOutput();
807 break;
808 case 'ilassquestionpagegui':
809 if ($cmd === 'finishEditing') {
810 $this->prepareOutput();
812 break;
813 }
814 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
816 }
817 if ($cmd === 'edit' && !$this->access->checkAccess('write', '', $this->testrequest->getRefId())) {
819 }
820 $this->prepareOutput();
821 $forwarder = new ilAssQuestionPageCommandForwarder(
822 $this->getTestObject(),
823 $this->lng,
824 $this->ctrl,
825 $this->tpl,
826 $this->questionrepository,
827 $this->testrequest
828 );
829 $forwarder->forward();
830 break;
831
832 case 'ilassspecfeedbackpagegui':
833 if ((!$this->access->checkAccess("write", "", $this->testrequest->getRefId()))) {
835 }
836 $pg_gui = new ilAssSpecFeedbackPageGUI((int) $this->testrequest->raw("feedback_id"));
837 $this->ctrl->forwardCommand($pg_gui);
838 break;
839
840 case 'ilassgenfeedbackpagegui':
841 if ((!$this->access->checkAccess("write", "", $this->testrequest->getRefId()))) {
843 }
844 $pg_gui = new ilAssGenFeedbackPageGUI($this->testrequest->int("feedback_id"));
845 $this->ctrl->forwardCommand($pg_gui);
846 break;
847
848 case 'illocalunitconfigurationgui':
849 if ((!$this->access->checkAccess("write", "", $this->testrequest->getRefId()))) {
851 }
852 $this->prepareSubGuiOutput();
853
854 // set return target
856 $question = $question_gui->getObject();
857 $question->setObjId($this->getTestObject()->getId());
858 $question_gui->setObject($question);
859 $question_gui->setQuestionTabs();
861 new ilUnitConfigurationRepository($this->testrequest->getQuestionId())
862 );
863 $this->ctrl->forwardCommand($gui);
864 break;
865
866 case "ilcommonactiondispatchergui":
867 if (!$this->access->checkAccess("read", "", $this->testrequest->getRefId()) && !$this->access->checkAccess("visible", "", $this->testrequest->getRefId())) {
869 }
870 $this->prepareOutput();
872 $this->ctrl->forwardCommand($gui);
873 break;
874
875 case 'ilassquestionfeedbackeditinggui':
876 if (!$this->access->checkAccess('write', '', $this->getTestObject()->getRefId())) {
878 }
879 $this->prepareSubGuiOutput();
880
881 // set return target
882 $this->ctrl->setReturnByClass(self::class, self::SHOW_QUESTIONS_CMD);
884 $question = $question_gui->getObject();
885 $question->setObjId($this->getTestObject()->getId());
886 $question_gui->setObject($question);
887 $question_gui->setQuestionTabs();
888 $question_gui->setContextAllowsSyncToPool(true);
889
890 $this->addQuestionTitleToObjectTitle($question->getTitleForHTMLOutput());
891
892 if ($this->getTestObject()->evalTotalPersons() !== 0) {
893 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('question_is_part_of_running_test'), true);
894 $this->prepareOutput();
896 }
898 $question_gui,
899 $this->ctrl,
900 $this->access,
901 $this->tpl,
902 $this->tabs_gui,
903 $this->lng,
904 $this->help,
905 $this->qplrequest,
906 $this->content_style
907 );
908 $this->ctrl->forwardCommand($gui);
909 break;
910
911 case 'iltestcorrectionsgui':
912 if ((!$this->access->checkAccess('read', '', $this->testrequest->getRefId()))) {
914 }
915 $this->prepareOutput();
916 $gui = new ilTestCorrectionsGUI(
917 $this->db,
918 $this->ctrl,
919 $this->lng,
920 $this->tabs_gui,
921 $this->help,
922 $this->ui_factory,
923 $this->tpl,
924 $this->refinery,
925 $this->getTestObject()->getTestLogger(),
926 $this->testrequest,
927 $this->getTestObject(),
928 $this->user
929 );
930 $this->ctrl->forwardCommand($gui);
931 break;
932
933 case 'iltestpagegui':
934 if ((!$this->access->checkAccess("write", "", $this->testrequest->getRefId()))) {
936 }
937
938 if ($cmd === 'downloadFile') {
939 $page_id = $this->object->getIntroductionPageId();
940 if ($this->testrequest->strVal('page_type') === 'concludingremarkspage') {
941 $page_id = $this->object->getConcludingRemarksPageId();
942 }
943 $this->ctrl->forwardCommand(new ilTestPageGUI('tst', $page_id));
944 }
945 $this->showEditTestPageGUI();
946 break;
947
948 case '':
949 case 'ilobjtestgui':
950 if (!$this->access->checkAccess('read', '', $this->testrequest->getRefId())
951 && !$this->access->checkAccess('visible', '', $this->testrequest->getRefId())) {
953 }
954 $this->prepareOutput();
955 $this->addHeaderAction();
956
957 if ($cmd === 'testScreen') {
958 $this->ctrl->forwardCommand($this->getTestScreenGUIInstance());
959 return;
960 }
961
962 $local_cmd = "{$cmd}Object";
963
964 if (!method_exists($this, $local_cmd)) {
965 $local_cmd = self::SHOW_QUESTIONS_CMD . 'Object';
966 }
967 $this->$local_cmd();
968 break;
969
970 default:
971 if ((!$this->access->checkAccess('read', '', $this->testrequest->getRefId()))) {
973 }
974 if (in_array(
975 $cmd,
976 ['editQuestion', 'previewQuestion', 'save', 'saveReturn', 'uploadImage',
977 'removeImage', 'syncQuestion', 'syncQuestionReturn', 'suggestedsolution']
978 )
979 && !$this->access->checkAccess('write', '', $this->getTestObject()->getRefId())) {
981 }
982 if (in_array($cmd, ['editQuestion', 'save', 'saveReturn', 'suggestedsolution'])
983 && $this->getTestObject()->evalTotalPersons() !== 0) {
984 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('question_is_part_of_running_test'), true);
985 $this->prepareOutput();
987 return;
988 }
989 $this->forwardCommandToQuestion($cmd);
990 break;
991 }
992 if (!in_array(strtolower($this->testrequest->raw('baseClass')), ['iladministrationgui', 'ilrepositorygui'])
993 && $this->getCreationMode() !== true) {
994 $this->tpl->printToStdout();
995 }
996 }
@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 2093 of file class.ilObjTestGUI.php.

2093 : void
2094 {
2095 $this->protectByWritePermission();
2096
2097 $modal = $this->buildPersonalSettingsTable()->perform();
2098 if ($modal !== null) {
2099 $this->showTemplatesObject($modal);
2100 return;
2101 }
2102 $this->ctrl->redirectByClass(self::class, 'showTemplates');
2103 }
showTemplatesObject(?Modal $modal=null)

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ exportLegacyLogsObject()

ilObjTestGUI::exportLegacyLogsObject ( )

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

1998 : void
1999 {
2000 $this->protectByWritePermission();
2001
2002 $csv_output = $this->getTestObject()->getTestLogViewer()->getLegacyLogExportForObjId($this->getTestObject()->getId());
2003
2005 $csv_output,
2006 "legacy_logs_for_{$this->getTestObject()->getRefId()}.csv"
2007 );
2008 }
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 1263 of file class.ilObjTestGUI.php.

1264 {
1265 $this->ctrl->redirectByClass('ilTestExportGUI');
1266 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ fetchAuthoringQuestionIdParameter()

ilObjTestGUI::fetchAuthoringQuestionIdParameter ( )
protected
Returns
int
Exceptions
ilTestException

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

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

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

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

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ forwardToEvaluationGUI()

ilObjTestGUI::forwardToEvaluationGUI ( )
private

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

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

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

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getObjectiveOrientedContainer()

ilObjTestGUI::getObjectiveOrientedContainer ( )
protected

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

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getQuestionsTableActions()

ilObjTestGUI::getQuestionsTableActions ( )
protected

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

2728 {
2729 if ($this->table_actions === null) {
2730 $this->table_actions = new QuestionsTableActions(
2731 $this->ui_factory,
2732 $this->ui_renderer,
2733 $this->tpl,
2734 $this->request,
2735 $this->getQuestionsTableQuery(),
2736 $this->lng,
2737 $this->ctrl,
2738 $this->test_questions_repository,
2739 new QuestionPrinter(
2740 $this->ui_factory,
2741 $this->tpl,
2742 $this->tabs_manager,
2743 $this->toolbar,
2744 $this->refinery,
2745 $this->lng,
2746 $this->ctrl,
2747 $this->user,
2749 $this->getTestObject()
2750 ),
2751 $this->object,
2752 $this->getTestObject()->getGlobalSettings()->isAdjustingQuestionsWithResultsAllowed(),
2753 $this->getTestObject()->evalTotalPersons() !== 0,
2754 $this->getTestObject()->isRandomTest(),
2755 $this->test_question_set_config_factory
2756 );
2757 }
2758 return $this->table_actions;
2759 }
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 2713 of file class.ilObjTestGUI.php.

2714 {
2715 if ($this->table_query === null) {
2716 $id = $this->object ? $this->object->getId() : '';
2717 $this->table_query = new QuestionsTableQuery(
2718 $this->http,
2719 $this->refinery,
2720 $this->data_factory,
2721 ['qlist', $id]
2722 );
2723 }
2724 return $this->table_query;
2725 }
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 2761 of file class.ilObjTestGUI.php.

2762 {
2763 return new QuestionsTable(
2764 $this->ui_factory,
2765 $this->refinery,
2766 $this->http->request(),
2767 $this->getQuestionsTableActions(),
2768 $this->lng,
2769 $this->object,
2770 $this->test_questions_repository,
2771 $this->title_builder
2772 );
2773 }

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

2393 : void
2394 {
2395 $this->help->setScreenIdComponent("tst");
2396
2397 if ($this->tabs_manager === null) {
2398 return;
2399 }
2400
2401 if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
2402 $courseLink = ilLink::_getLink($this->getObjectiveOrientedContainer()->getRefId());
2403 $this->tabs_manager->setParentBackLabel($this->lng->txt('back_to_objective_container'));
2404 $this->tabs_manager->setParentBackHref($courseLink);
2405 }
2406
2407 $this->tabs_manager->perform();
2408 }

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

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

1322 : ilTestAccess
1323 {
1324 return $this->test_access;
1325 }
ilTestAccess $test_access

◆ getTestObject()

ilObjTestGUI::getTestObject ( )

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

1471 : ?ilObjTest
1472 {
1473 return $this->object;
1474 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getTestScreenGUIInstance()

ilObjTestGUI::getTestScreenGUIInstance ( )
private

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

2693 {
2694 return new TestScreenGUI(
2695 $this->getTestObject(),
2696 $this->user,
2697 $this->ui_factory,
2698 $this->ui_renderer,
2699 $this->lng,
2700 $this->refinery,
2701 $this->ctrl,
2702 $this->tpl,
2703 $this->content_style,
2704 $this->http,
2705 $this->tabs_manager,
2706 $this->access,
2707 $this->test_access,
2708 $this->db,
2709 $this->rbac_system
2710 );
2711 }

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

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

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

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

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

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

2207 : void
2208 {
2209 $this->ctrl->redirectByClass(
2210 [ilRepositoryGUI::class, self::class, ilInfoScreenGUI::class]
2211 );
2212 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ insertQuestionsObject()

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

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

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

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

+ Here is the call graph for this function:

◆ isCommandClassAnyInfoScreenChild()

ilObjTestGUI::isCommandClassAnyInfoScreenChild ( )
private

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

2192 : bool
2193 {
2194 if (in_array(
2195 $this->ctrl->getCmdClass(),
2196 [
2197 strtolower(PublicProfileGUI::class),
2198 'ilobjportfoliogui'
2199 ]
2200 )) {
2201 return true;
2202 }
2203
2204 return false;
2205 }

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

2013 : void
2014 {
2015 $command = $this->testrequest->strVal('command');
2016 if ($command === '') {
2017 $method = $command . 'Object';
2018 if (method_exists($this, $method)) {
2019 $this->$method();
2020 return;
2021 }
2022 }
2023 $this->ctrl->redirect($this, 'participants');
2024 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ populateQuestionBrowserToolbarButtons()

ilObjTestGUI::populateQuestionBrowserToolbarButtons ( ilToolbarGUI  $toolbar)
private

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

1920 : void
1921 {
1922 $this->ctrl->setParameterByClass(
1923 ilTestQuestionBrowserTableGUI::class,
1926 );
1927
1929 $this->lng->txt('tst_browse_for_qpl_questions'),
1930 $this->ctrl->getLinkTargetByClass(
1931 ilTestQuestionBrowserTableGUI::class,
1933 )
1934 );
1935
1936 $this->ctrl->setParameterByClass(
1937 ilTestQuestionBrowserTableGUI::class,
1940 );
1941
1943 $this->lng->txt('tst_browse_for_tst_questions'),
1944 $this->ctrl->getLinkTargetByClass(
1945 ilTestQuestionBrowserTableGUI::class,
1947 )
1948 );
1949 }
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 1348 of file class.ilObjTestGUI.php.

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

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ protectByWritePermission()

ilObjTestGUI::protectByWritePermission ( )
protected

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

2658 : void
2659 {
2660 if (!$this->access->checkAccess('write', '', $this->ref_id)) {
2661 $this->tpl->setOnScreenMessage('info', $this->lng->txt('cannot_edit_test'), true);
2662 $this->ctrl->redirectByClass([ilRepositoryGUI::class, self::class, ilInfoScreenGUI::class]);
2663 }
2664 }

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

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ redirectAfterMissingRead()

ilObjTestGUI::redirectAfterMissingRead ( )
protected

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

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

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

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

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

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ removeImportFailsObject()

ilObjTestGUI::removeImportFailsObject ( )
protected

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

2295 {
2296 $qsaImportFails = new ilAssQuestionSkillAssignmentImportFails($this->getTestObject()->getId());
2297 $qsaImportFails->deleteRegisteredImportFails();
2298 $sltImportFails = new ilTestSkillLevelThresholdImportFails($this->getTestObject()->getId());
2299 $sltImportFails->deleteRegisteredImportFails();
2300
2301 $this->ctrl->redirectByClass([ilRepositoryGUI::class, self::class, ilInfoScreenGUI::class]);
2302 }

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

+ Here is the call graph for this function:

◆ runObject()

ilObjTestGUI::runObject ( )

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

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

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

1328 {
1329 $this->test_access = $test_access;
1330 }

◆ setupToolBarAndMessage()

ilObjTestGUI::setupToolBarAndMessage ( bool  $has_started_test_runs)
private

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

1891 : void
1892 {
1893 if (!$this->access->checkAccess('write', '', $this->ref_id)
1894 || $this->getTestObject()->isRandomTest()) {
1895 return;
1896 }
1897
1898 if ($has_started_test_runs) {
1899 $link = $this->ui_factory->link()->standard(
1900 $this->lng->txt('test_has_datasets_warning_page_view_link'),
1901 $this->ctrl->getLinkTargetByClass([\ilTestParticipantsGUI::class])
1902 );
1903
1904 $message = $this->lng->txt('test_has_datasets_warning_page_view');
1905 $massage_box = $this->ui_factory->messageBox()->info($message)->withLinks([$link]);
1906 $this->tpl->setCurrentBlock('mess');
1907 $this->tpl->setVariable(
1908 'MESSAGE',
1909 $this->ui_renderer->render($massage_box)
1910 );
1911 $this->tpl->parseCurrentBlock();
1912 return;
1913 }
1914
1915 $this->toolbar->addButton($this->lng->txt('ass_create_question'), $this->ctrl->getLinkTarget($this, 'createQuestionForm'));
1916 $this->toolbar->addSeparator();
1918 }
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 1292 of file class.ilObjTestGUI.php.

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

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

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

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

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

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

+ Here is the call graph for this function:

◆ statisticsObject()

ilObjTestGUI::statisticsObject ( )

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

2372 {
2373 }

◆ takenObject()

ilObjTestGUI::takenObject ( )

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

1951 : void
1952 {
1953 }

◆ trackTestObjectReadEvent()

ilObjTestGUI::trackTestObjectReadEvent ( )
protected

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

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

2775 : bool
2776 {
2777 return $this->settings->get('obj_dis_creation_qpl') !== '1'
2778 && $this->checkPermissionBool('create', '', 'qpl', $this->tree->getParentId($this->ref_id));
2779 }

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: