ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
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 ()
 
 processImportObject ()
 
 afterSave (ilObject $new_object)
 save object @access public More...
 
 backToRepositoryObject ()
 
 getTestObject ()
 
 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 ()
 
 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 ()
 
 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
 
ImportSessionRepository $import_session_repository
 
LoggerInterface $import_logger
 
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 ()
 
 afterImportCompleted (ImportSession $session)
 
 buildImportWizard ()
 
 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 array QUESTION_FUNCTIONS_NEEDING_WRITE
 
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
 
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 135 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 2402 of file class.ilObjTestGUI.php.

2403 {
2404 global $DIC;
2405 $main_tpl = $DIC->ui()->mainTemplate();
2406 $ilAccess = $DIC['ilAccess'];
2407 $ilErr = $DIC['ilErr'];
2408 $lng = $DIC['lng'];
2409
2410 if ($ilAccess->checkAccess('read', '', (int) $target)
2411 || $ilAccess->checkAccess('visible', '', (int) $target)) {
2412 $DIC->ctrl()->setParameterByClass(self::class, 'ref_id', (int) $target);
2413 $DIC->ctrl()->redirectByClass(
2414 [
2415 ilRepositoryGUI::class,
2416 ilObjTestGUI::class,
2417 TestScreenGUI::class
2418 ],
2419 TestScreenGUI::DEFAULT_CMD
2420 );
2421 } elseif ($ilAccess->checkAccess('read', '', ROOT_FOLDER_ID)) {
2422 $main_tpl->setOnScreenMessage('info', sprintf(
2423 $lng->txt('msg_no_perm_read_item'),
2425 ), true);
2427 }
2428
2429 $ilErr->raiseError($lng->txt('msg_no_perm_read_lm'), $ilErr->FATAL);
2430 }
txt(string|LanguageIdentifier $a_topic, ?int $n=null)
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
global $DIC
Definition: shib_login.php:26

References $DIC, $lng, ILIAS\Scripts\PHPStan\$target, 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 2253 of file class.ilObjTestGUI.php.

2253 : void
2254 {
2255 $next_class = $this->ctrl->getNextClass();
2256 $class_parents = class_exists($next_class)
2257 ? get_parent_class($next_class)
2258 : '';
2259
2260 if (in_array(
2261 strtolower($next_class),
2262 [
2263 strtolower(ilAssQuestionPreviewGUI::class),
2264 strtolower(ilTestQuestionBrowserTableGUI::class),
2265 strtolower(ilAssQuestionPageGUI::class),
2266 strtolower(ilAssQuestionFeedbackEditingGUI::class)
2267 ]
2268 ) || $class_parents === assQuestionGUI::class) {
2269 $this->locator->addItem(
2270 $this->getTestObject()->getTitle(),
2271 $this->ctrl->getLinkTargetByClass(
2272 self::class,
2273 self::SHOW_QUESTIONS_CMD
2274 ),
2275 '',
2276 $this->testrequest->getRefId()
2277 );
2278 return;
2279 }
2280
2281 switch ($this->ctrl->getCmd()) {
2282 case "run":
2283 case "infoScreen":
2284 case "redirectToInfoScreen":
2285 case "start":
2286 case "resume":
2287 case "previous":
2288 case "next":
2289 case "summary":
2290 case "finishTest":
2291 case "outCorrectSolution":
2292 case "showAnswersOfUser":
2293 case "outUserResultsOverview":
2294 case "backFromSummary":
2295 case "show_answers":
2296 case "setsolved":
2297 case "resetsolved":
2298 case "outTestSummary":
2299 case "outQuestionSummary":
2300 case "gotoQuestion":
2301 case "selectImagemapRegion":
2302 case "confirmSubmitAnswers":
2303 case "finalSubmission":
2304 case "postpone":
2305 case "outUserPassDetails":
2306 case "checkPassword":
2307 $this->locator->addItem(
2308 $this->getTestObject()->getTitle(),
2309 $this->ctrl->getLinkTargetByClass(
2310 [self::class, TestScreenGUI::class],
2311 TestScreenGUI::DEFAULT_CMD
2312 ),
2313 '',
2314 $this->testrequest->getRefId()
2315 );
2316 break;
2317 case "eval_stat":
2318 case "evalAllUsers":
2319 case "evalUserDetail":
2320 $this->locator->addItem(
2321 $this->getTestObject()->getTitle(),
2322 $this->ctrl->getLinkTarget($this, 'eval_stat'),
2323 '',
2324 $this->testrequest->getRefId()
2325 );
2326 break;
2327 case "importFile":
2328 case "processImport":
2329 case "cloneAll":
2330 case "importVerifiedFile":
2331 case "cancelImport":
2332 break;
2333 default:
2334 $this->locator->addItem(
2335 $this->getTestObject()->getTitle(),
2336 $this->ctrl->getLinkTargetByClass(
2337 [self::class, TestScreenGUI::class],
2338 TestScreenGUI::DEFAULT_CMD
2339 ),
2340 '',
2341 $this->testrequest->getRefId()
2342 );
2343 break;
2344 }
2345 }

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

1186 : assQuestionGUI {
1187 if ($this->testrequest->isset('move_after_question_with_id')) {
1188 $question_gui->setMoveAfterQuestionId(
1189 $this->testrequest->int('move_after_question_with_id')
1190 );
1191 }
1192
1193 if ($this->testrequest->isset('pool_title')) {
1194 $question_gui->setCopyToNewPoolOnSave(
1195 $this->testrequest->strVal('pool_title')
1196 );
1197 }
1198
1199 if ($this->testrequest->isset('pool_ref')) {
1200 $question_gui->setCopyToExistingPoolOnSave(
1201 $this->testrequest->int('pool_ref')
1202 );
1203 }
1204 return $question_gui;
1205 }
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 1852 of file class.ilObjTestGUI.php.

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

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

+ Here is the call graph for this function:

◆ addQuestionTitleToObjectTitle()

ilObjTestGUI::addQuestionTitleToObjectTitle ( string  $question_title)
private

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

1112 : void
1113 {
1114 $this->tpl->setTitle(
1115 $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
1116 "{$this->getTestObject()->getTitle()}: {$question_title}"
1117 )
1118 );
1119 }

References ILIAS\Repository\refinery().

Referenced by executeCommand().

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

◆ afterImportCompleted()

ilObjTestGUI::afterImportCompleted ( ImportSession  $session)
private

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

1434 : void
1435 {
1436 $new_obj = new ilObjTest(0, false);
1437 $new_obj->setId($session->testObjId() ?? 0);
1438 $new_obj->setRefId($session->testRefId() ?? 0);
1439
1440 if ($new_obj->getTestLogger()->isLoggingEnabled()) {
1441 $new_obj->getTestLogger()->logTestAdministrationInteraction(
1442 $new_obj->getTestLogger()->getInteractionFactory()->buildTestAdministrationInteraction(
1443 $new_obj->getRefId(),
1444 $this->user->getId(),
1445 TestAdministrationInteractionTypes::NEW_TEST_CREATED,
1446 []
1447 )
1448 );
1449 }
1450
1451 $question_skill_assignments_import_fails = new ilAssQuestionSkillAssignmentImportFails($new_obj->getId());
1452 if ($question_skill_assignments_import_fails->failedImportsRegistered()) {
1453 $this->tpl->setOnScreenMessage(
1454 GlobalTemplate::MESSAGE_TYPE_INFO,
1455 $question_skill_assignments_import_fails->getFailedImportsMessage($this->lng),
1456 true
1457 );
1458 }
1459
1460 $this->tpl->setOnScreenMessage(
1461 GlobalTemplate::MESSAGE_TYPE_SUCCESS,
1462 $this->lng->txt('object_imported'),
1463 true
1464 );
1465 $this->ctrl->setParameterByClass(ilObjTestGUI::class, 'ref_id', $new_obj->getRefId());
1466 $this->ctrl->redirectByClass(self::class, self::SHOW_QUESTIONS_CMD);
1467 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\TestQuestionPool\ExportImport\Foundation\Import\ImportSession\testObjId(), and ILIAS\TestQuestionPool\ExportImport\Foundation\Import\ImportSession\testRefId().

+ Here is the call graph for this function:

◆ afterSave()

ilObjTestGUI::afterSave ( ilObject  $new_object)

save object @access public

Reimplemented from ilObjectGUI.

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

1506 : void
1507 {
1508 $info = '';
1509 $new_object->saveToDb();
1510
1511 if ($new_object->getTestLogger()->isLoggingEnabled()) {
1512 $new_object->getTestLogger()->logTestAdministrationInteraction(
1513 $new_object->getTestLogger()->getInteractionFactory()->buildTestAdministrationInteraction(
1514 $this->getRefId(),
1515 $this->user->getId(),
1516 TestAdministrationInteractionTypes::NEW_TEST_CREATED,
1517 []
1518 )
1519 );
1520 }
1521
1522 if ($info === '') {
1523 $this->tpl->setOnScreenMessage('success', $this->lng->txt('object_added'), true);
1524 } else {
1525 $this->tpl->setOnScreenMessage('info', $this->lng->txt($info), true);
1526 }
1527 $this->ctrl->setParameter($this, 'ref_id', $new_object->getRefId());
1528 $this->ctrl->redirectByClass(SettingsMainGUI::class);
1529 }
$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 1532 of file class.ilObjTestGUI.php.

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

References ilUtil\redirect().

+ Here is the call graph for this function:

◆ buildImportWizard()

ilObjTestGUI::buildImportWizard ( )
private

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

1469 : ImportWizard
1470 {
1471 return new ImportWizard(
1472 [
1474 $this->archives,
1475 $this->lng,
1476 $this->import_logger,
1477 'components/ILIAS/Test'
1478 ),
1479 new DetectLegacyImportStage($this->import_logger),
1481 $this->lng,
1482 $this->import_logger,
1483 $this->component_factory,
1484 $this->ui_factory,
1485 $this->request,
1486 $this->ctrl->getFormActionByClass(self::class, 'processImport'),
1487 $this->lng->txt('import_tst')
1488 ),
1489 new PersistStage(
1490 $this->lng,
1491 $this->import_logger,
1492 $this->requested_ref_id,
1493 $this->import_session_repository
1494 ),
1495 ],
1496 $this->import_session_repository,
1497 new CleanupStage($this->import_logger)
1498 );
1499 }
Runs import stages until one needs user interaction, reports an error, or every stage has finished.
Final import stage that cleans up the temporary files and directories after successful import or erro...
Final stage of the test import process.

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

+ Here is the call graph for this function:

◆ buildInputEditingType()

ilObjTestGUI::buildInputEditingType ( )
private

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

1734 : Input
1735 {
1736 if (!$this->getTestObject()->getGlobalSettings()->isPageEditorEnabled()) {
1737 return $this->ui_factory->input()->field()->hidden()->withValue(
1739 );
1740 }
1741
1742 return $this->ui_factory->input()->field()->radio($this->lng->txt('tst_add_quest_cont_edit_mode'))
1743 ->withOption(
1745 $this->lng->txt('tst_add_quest_cont_edit_mode_IPE'),
1746 $this->lng->txt('tst_add_quest_cont_edit_mode_IPE_info')
1747 )->withOption(
1749 $this->lng->txt('tst_add_quest_cont_edit_mode_RTE'),
1750 $this->lng->txt('tst_add_quest_cont_edit_mode_RTE_info')
1751 )
1753 }
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 1755 of file class.ilObjTestGUI.php.

1756 {
1757 $f = $this->ui_factory->input()->field();
1758 $kt = $this->refinery->kindlyTo();
1759
1760 $trafo = $this->refinery->custom()->transformation(
1761 static function ($values) use ($kt): array {
1762 $return['qpl_type'] = $kt->int()->transform($values[0]);
1763 if ($return['qpl_type'] === self::QUESTION_CREATION_POOL_SELECTION_NO_POOL) {
1764 return $return;
1765 }
1766 if ($return['qpl_type'] === self::QUESTION_CREATION_POOL_SELECTION_NEW_POOL) {
1767 return $return + ['title' => $kt->string()->transform($values[1][0])];
1768 }
1769 return $return + [
1770 'pool_ref_id' => $kt->int()->transform($values[1][0])
1771 ];
1772 }
1773 );
1774
1775 $questionpools = ilObjQuestionPool::_getAvailableQuestionpools(false, false, true, false, false, "write");
1776 $pools_data = [];
1777 foreach ($questionpools as $key => $p) {
1778 $pools_data[$key] = $p['title'];
1779 }
1780
1781 $inputs = [
1782 self::QUESTION_CREATION_POOL_SELECTION_NO_POOL => $f->group([], $this->lng->txt('assessment_no_pool')),
1783 self::QUESTION_CREATION_POOL_SELECTION_EXISTING_POOL => $f->group(
1784 [
1785 $f->select(
1786 $this->lng->txt('select_questionpool'),
1787 $pools_data
1788 )->withRequired(true)
1789 ],
1790 $this->lng->txt('assessment_existing_pool')
1791 )
1792 ];
1793
1796 [$f->text($this->lng->txt('name'))],
1797 $this->lng->txt('assessment_new_pool')
1798 );
1799 }
1800
1801 return $f->switchableGroup(
1802 $inputs,
1803 $this->lng->txt('assessment_pool_selection')
1804 )->withAdditionalTransformation($trafo)
1805 ->withRequired(true)
1806 ->withValue(1);
1807 }
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 1721 of file class.ilObjTestGUI.php.

1721 : Select
1722 {
1723 $options = [0 => $this->lng->txt('first')];
1724 foreach ($questions as $key => $title) {
1725 $options[$key] = $this->lng->txt('behind') . ' ' . $title
1726 . ' [' . $this->lng->txt('question_id_short') . ': ' . $key . ']';
1727 }
1728 return $this->ui_factory->input()->field()->select(
1729 $this->lng->txt('position'),
1730 $options
1731 )->withAdditionalTransformation($this->refinery->kindlyTo()->int());
1732 }
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 1707 of file class.ilObjTestGUI.php.

1707 : Select
1708 {
1709 $question_types = (new ilObjQuestionPool())->getQuestionTypes(false, true, false);
1710 $options = [];
1711 foreach ($question_types as $label => $data) {
1712 $options[$data['question_type_id']] = $label;
1713 }
1714
1715 return $this->ui_factory->input()->field()->select(
1716 $this->lng->txt('question_type'),
1717 $options
1718 )->withRequired(true);
1719 }

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

2065 {
2067 $this->ui_factory,
2068 $this->lng,
2069 $this->user,
2070 $this->personal_settings_templates_repository,
2071 $this->main_settings_repository,
2072 $this->score_settings_repository,
2073 $this->marks_repository
2074 );
2075 }

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

+ Here is the call graph for this function:

◆ buildPersonalSettingsImportAction()

ilObjTestGUI::buildPersonalSettingsImportAction ( )
protected

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

2078 {
2080 $this->ui_factory,
2081 $this->lng,
2082 $this->data_factory,
2083 $this->temp_file_system,
2084 $this->personal_settings_templates_repository,
2085 $this->main_settings_repository,
2086 $this->score_settings_repository,
2087 $this->marks_repository
2088 );
2089 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ buildPersonalSettingsTable()

ilObjTestGUI::buildPersonalSettingsTable ( )
protected

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

2092 {
2093 $actions = new PersonalSettingsTableActions(
2094 $this->testrequest,
2095 $this->response_handler,
2096 $this->ui_renderer,
2097 $this->ui_factory,
2098 $this->lng,
2099 $this->user,
2100 $this->personal_settings_templates_repository,
2101 [
2102 PersonalSettingsTableShowAction::ACTION_ID => new PersonalSettingsTableShowAction(
2103 $this->lng,
2104 $this->ui_factory,
2105 $this->user,
2106 $this->personal_settings_templates_repository,
2107 $this->main_settings_repository,
2108 $this->score_settings_repository,
2109 $this->marks_repository,
2110 $this->additional_information_generator
2111 ),
2112 PersonalSettingsTableApplyAction::ACTION_ID => new PersonalSettingsTableApplyAction(
2113 $this->lng,
2114 $this->ui_factory,
2115 $this->test_question_set_config_factory,
2116 $this->tpl,
2117 $this->getTestObject(),
2118 $this->personal_settings_templates_repository,
2119 $this->main_settings_repository,
2120 $this->score_settings_repository,
2121 $this->marks_repository
2122 ),
2123 PersonalSettingsTableExportAction::ACTION_ID => new PersonalSettingsTableExportAction(
2124 $this->lng,
2125 $this->ui_factory,
2126 $this->personal_settings_exporter
2127 ),
2128 PersonalSettingsTableDeleteAction::ACTION_ID => new PersonalSettingsTableDeleteAction(
2129 $this->lng,
2130 $this->ui_factory,
2131 $this->tpl,
2132 $this->personal_settings_templates_repository,
2133 $this->marks_repository
2134 ),
2135 ]
2136 );
2137
2138 $uri = $this->ctrl->getLinkTargetByClass(self::class, 'executeTemplatesAction', '', true);
2139 return new PersonalSettingsTable(
2140 $this->lng,
2141 $this->ui_factory,
2142 $this->data_factory,
2143 $this->user,
2144 $this->testrequest,
2145 $actions,
2146 new URLBuilder($this->data_factory->uri(ILIAS_HTTP_PATH . '/' . $uri)),
2147 $this->personal_settings_templates_repository,
2148 );
2149 }

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

1677 : Form
1678 {
1679 $inputs['question_type'] = $this->buildInputQuestionType();
1680 $questions = $this->getTestObject()->getQuestionTitlesAndIndexes();
1681 if ($questions !== []) {
1682 $inputs['position'] = $this->buildInputPosition($questions);
1683 }
1684
1685 $inputs['editing_type'] = $this->buildInputEditingType();
1686
1687 if ($inputs['editing_type'] instanceof Radio) {
1688 $sub_screen_id[] = 'editMode';
1689 }
1690
1691 $sub_screen_id[] = 'poolSelect';
1692
1693 $inputs['pool_selection'] = $this->buildInputPoolSelection();
1694
1695 $section = [
1696 $this->ui_factory->input()->field()->section($inputs, $this->lng->txt('create_question'))
1697 ];
1698
1699 $form = $this->ui_factory->input()->container()->form()->standard(
1700 $this->ctrl->getFormAction($this, 'createQuestion'),
1701 $section
1702 )->withSubmitLabel($this->lng->txt('create'));
1703
1704 return $form;
1705 }
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 1637 of file class.ilObjTestGUI.php.

1637 : void
1638 {
1639 $this->ctrl->redirect($this, self::SHOW_QUESTIONS_CMD);
1640 }

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

2355 {
2356 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
2357
2358 $guiFactory = new ilCertificateGUIFactory();
2359 $output_gui = $guiFactory->create($this->getTestObject());
2360
2361 $output_gui->certificateEditor();
2362 }

◆ copyAndLinkQuestionsToPoolObject()

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

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

2470 {
2471
2472 $ref_id = $ref_id ?? $this->testrequest->int('sel_qpl');
2473 if ($ref_id === null
2474 || $ref_id === 0) {
2475 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("questionpool_not_selected"));
2476 $this->showQuestionsObject();
2477 return;
2478 }
2479
2480 $qpl_id = $this->obj_data_cache->lookupObjId($ref_id);
2481
2482
2483 if ($question_ids === []) {
2484 $question_ids = $this->testrequest->getQuestionIds();
2485 $question_id = $this->testrequest->getQuestionId();
2486 if ($question_ids === [] && $question_id !== 0) {
2487 $question_ids = [$question_id];
2488 }
2489 }
2490
2491 if ($question_ids === []) {
2492 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("tst_no_question_selected_for_moving_to_qpl"));
2493 $this->ctrl->redirect($this, 'questions');
2494 }
2495
2496 $result = $this->copyQuestionsToPool($question_ids, $qpl_id);
2497
2498 foreach ($result->ids as $oldId => $newId) {
2499 $questionInstance = assQuestion::instantiateQuestion($oldId);
2500
2501 $original_question_id = $questionInstance->getOriginalId();
2502 if ($original_question_id !== null
2503 && $this->test_questions_repository->originalQuestionExists($original_question_id)) {
2504 $oldOriginal = assQuestion::instantiateQuestion($original_question_id);
2505 $oldOriginal->delete($oldOriginal->getId());
2506 }
2507 assQuestion::saveOriginalId($questionInstance->getId(), $newId);
2508 }
2509
2510 $this->tpl->setOnScreenMessage('success', $this->lng->txt('tst_qst_added_to_pool_' . (count($result->ids) > 1 ? 'p' : 's')), true);
2511 $this->ctrl->redirect($this, self::SHOW_QUESTIONS_CMD);
2512 }
static saveOriginalId(int $questionId, int $originalId)
static instantiateQuestion(int $question_id)
copyQuestionsToPool(array $question_ids, int $qpl_id)

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

2442 : stdClass
2443 {
2444 $target_pool = new ilObjQuestionPool($qpl_id, false);
2445 $new_ids = [];
2446 foreach ($question_ids as $q_id) {
2447 $new_id = $this->copyQuestionToPool(assQuestion::instantiateQuestionGUI($q_id), $target_pool);
2448 $new_ids[$q_id] = $new_id;
2449 }
2450
2451 $result = new stdClass();
2452 $result->ids = $new_ids;
2453 $result->qpoolid = $qpl_id;
2454
2455 return $result;
2456 }
copyQuestionToPool(assQuestionGUI $source_question_gui, ilObjQuestionPool $target_pool)

◆ copyQuestionsToPoolObject()

ilObjTestGUI::copyQuestionsToPoolObject ( )

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

2433 {
2434 $this->copyQuestionsToPool($this->testrequest->raw('q_id'), $this->testrequest->raw('sel_qpl'));
2435 $this->ctrl->redirect($this, self::SHOW_QUESTIONS_CMD);
2436 }

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

2458 : int
2459 {
2460 $new_title = $target_pool->appendCounterToQuestionTitleIfNecessary(
2461 $source_question_gui->getObject()->getTitle()
2462 );
2463
2464 return $source_question_gui->getObject()->createNewOriginalFromThisDuplicate($target_pool->getId(), $new_title);
2465 }
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 2514 of file class.ilObjTestGUI.php.

2515 {
2516 $this->createQuestionpoolTargetObject('copyQuestionsToPool');
2517 }
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 1657 of file class.ilObjTestGUI.php.

1657 : void
1658 {
1659 $this->protectByWritePermission();
1660
1661 $this->tabs_manager->getQuestionsSubTabs();
1662 $this->tabs_manager->activateSubTab(TabsManager::SUBTAB_ID_QST_LIST_VIEW);
1663
1664 $sub_screen_id = ['createQuestion'];
1665
1666 $this->tabs_manager->activateTab(TabsManager::TAB_ID_QUESTIONS);
1667 $this->help->setScreenId('assQuestions');
1668 $this->help->setSubScreenId(implode('_', $sub_screen_id));
1669
1670 $this->tpl->setContent(
1671 $this->ui_renderer->render(
1672 $form ?? $this->buildQuestionCreationForm()
1673 )
1674 );
1675 }

References ILIAS\Repository\help().

+ Here is the call graph for this function:

◆ createQuestionPool()

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

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

1566 {
1567 $parent_ref = $this->tree->getParentId($this->getTestObject()->getRefId());
1568 $qpl = new ilObjQuestionPool();
1569 $qpl->setType("qpl");
1570 $qpl->setTitle($name);
1571 $qpl->setDescription($description);
1572 $qpl->create();
1573 $qpl->createReference();
1574 $qpl->putInTree($parent_ref);
1575 $qpl->setPermissions($parent_ref);
1576 $qpl->getObjectProperties()->storePropertyIsOnline($qpl->getObjectProperties()->getPropertyIsOnline()->withOnline()); // must be online to be available
1577 $qpl->saveToDb();
1578 return $qpl;
1579 }

◆ createQuestionPoolAndCopyObject()

ilObjTestGUI::createQuestionPoolAndCopyObject ( )

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

2520 {
2521 if (!$this->access->checkAccess('write', '', $this->object->getRefId())
2522 || !$this->checkPermissionBool('create', '', 'qpl')) {
2524 }
2525
2526 if ($this->testrequest->raw('title')) {
2527 $title = $this->testrequest->raw('title');
2528 } else {
2529 $title = $this->testrequest->raw('txt_qpl');
2530 }
2531
2532 if (!$title) {
2533 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('questionpool_not_entered'));
2534 $this->createQuestionpoolTargetObject('createQuestionPoolAndCopy');
2535 return;
2536 }
2537
2538 $question_pool = $this->createQuestionPool($title, $this->testrequest->raw('description'));
2539
2540 $this->copyAndLinkQuestionsToPoolObject($question_pool->getRefId());
2541 }
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 2547 of file class.ilObjTestGUI.php.

2547 : void
2548 {
2549 $this->protectByWritePermission();
2550
2551 $this->tabs_manager->getQuestionsSubTabs();
2552 $this->tabs_manager->activateSubTab(TabsManager::SUBTAB_ID_QST_LIST_VIEW);
2553
2554 $questionpools = $this->getTestObject()->getAvailableQuestionpools(
2555 false,
2556 false,
2557 false,
2558 true,
2559 false,
2560 'write'
2561 );
2562
2563 if ($questionpools === []) {
2564 $form = $this->getTargetQuestionpoolForm($questionpools, 'createQuestionPoolAndCopy');
2565 } else {
2566 $form = $this->getTargetQuestionpoolForm($questionpools, $cmd);
2567
2568 switch ($cmd) {
2569 case 'copyQuestionsToPool':
2570 break;
2571
2572 case 'copyAndLinkQuestionsToPool':
2573 $hidden = new ilHiddenInputGUI('link');
2574 $hidden->setValue('1');
2575 $form->addItem($hidden);
2576 break;
2577 }
2578 }
2579
2580 $this->tpl->setContent($form->getHTML());
2581 }
This class represents a hidden form property in a property form.
getTargetQuestionpoolForm($questionpools, string $cmd)

◆ createTemplateObject()

ilObjTestGUI::createTemplateObject ( )

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

2038 : void
2039 {
2040 $this->protectByWritePermission();
2041
2042 try {
2044 ->perform($this->getTestObject()->getTestId(), $this->request);
2045 } catch (\InvalidArgumentException $e) {
2046 $this->tpl->setOnScreenMessage('failure', $this->lng->txt($e->getMessage()), true);
2047 }
2048
2049 $this->ctrl->redirectByClass(self::class, 'showTemplates');
2050 }

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

2642 {
2643 if (!ilLOSettings::isObjectiveTest($this->ref_id)) {
2644 return;
2645 }
2646
2647 $path = $this->tree->getPathFull($this->ref_id);
2648
2649 while ($parent = array_pop($path)) {
2650 if ($parent['type'] === 'crs') {
2651 $container_ref_id = $parent['ref_id'];
2652 break;
2653 }
2654 }
2655
2656 $container_obj_id = ilObject2::_lookupObjId($container_ref_id);
2657
2658 $this->objective_oriented_container->setObjId($container_obj_id);
2659 $this->objective_oriented_container->setRefId($container_ref_id);
2660 }
static isObjectiveTest(int $a_trst_ref_id)
Check if test ref_id is used in an objective course.

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

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

References exit.

◆ executeAfterQuestionCreationTasks()

ilObjTestGUI::executeAfterQuestionCreationTasks ( assQuestionGUI  $question_gui)
private

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

1221 : void
1222 {
1223 if ($this->getTestObject()->getQuestionSetType() === ilObjTest::QUESTION_SET_TYPE_FIXED
1224 && !in_array($question_gui->getObject()->getId(), $this->getTestObject()->getQuestions())) {
1225 $this->getTestObject()->insertQuestion($question_gui->getObject()->getId(), true);
1226 }
1227
1228 if ($question_gui->getMoveAfterQuestionId() !== null) {
1229 $this->getTestObject()->moveQuestions(
1230 [$question_gui->getObject()->getId()],
1231 $question_gui->getMoveAfterQuestionId() === 0
1232 ? $this->getTestObject()->getQuestions()[1]
1233 : $question_gui->getMoveAfterQuestionId(),
1234 $question_gui->getMoveAfterQuestionId() === 0 ? 0 : 1
1235 );
1236 $question_gui->setMoveAfterQuestionId(null);
1237 }
1238
1239 if ($question_gui->getCopyToExistingPoolOnSave() !== null) {
1240 $original_id = $this->copyQuestionToPool(
1241 $question_gui,
1243 );
1244 assQuestion::saveOriginalId($question_gui->getObject()->getId(), $original_id);
1245 $question_gui->setCopyToExistingPoolOnSave(null);
1246 }
1247
1248 if ($question_gui->getCopyToNewPoolOnSave() !== null) {
1249 $question_pool = $this->createQuestionPool($question_gui->getCopyToNewPoolOnSave());
1250 $original_id = $this->copyQuestionToPool(
1251 $question_gui,
1252 $question_pool
1253 );
1254 assQuestion::saveOriginalId($question_gui->getObject()->getId(), $original_id);
1255 $question_gui->setCopyToNewPoolOnSave(null);
1256 }
1257 }
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 1207 of file class.ilObjTestGUI.php.

1207 : void
1208 {
1209 $this->addQuestionTitleToObjectTitle($question_gui->getObject()->getTitle());
1210 if ($this->getTestObject()->getTestLogger()->isLoggingEnabled()) {
1211 $this->getTestObject()->getTestLogger()->logQuestionAdministrationInteraction(
1212 $question_gui->getObject()->toQuestionAdministrationInteraction(
1213 $this->getTestObject()->getTestLogger()->getAdditionalInformationGenerator(),
1214 $this->getTestObject()->getRefId(),
1215 TestQuestionAdministrationInteractionTypes::QUESTION_MODIFIED
1216 )
1217 );
1218 }
1219 }
addQuestionTitleToObjectTitle(string $question_title)

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

319 : void
320 {
321 if ($this->object === null) {
322 $this->error->raiseError($this->lng->txt('tst_settings_not_found_msg'), $this->error->MESSAGE);
323 return;
324 }
325
326 $cmd = $this->ctrl->getCmd('testScreen');
327
328 $cmds_disabled_due_to_offline_status = [
329 'resumePlayer', 'resumePlayer', 'outUserResultsOverview', 'outUserListOfAnswerPasses'
330 ];
331
332 if (!$this->getCreationMode() && $this->object->getOfflineStatus() && in_array($cmd, $cmds_disabled_due_to_offline_status)) {
333 $cmd = 'infoScreen';
334 }
335
336 $next_class = $this->ctrl->getNextClass($this);
337
338 // add entry to navigation history
339 if (!$this->getCreationMode() &&
340 $this->access->checkAccess('read', '', $this->testrequest->getRefId())
341 ) {
342 $this->navigation_history->addItem(
343 $this->testrequest->getRefId(),
344 ilLink::_getLink($this->testrequest->getRefId(), 'tst'),
345 'tst',
346 );
347 }
348
350
351 switch ($next_class) {
352 case 'illtiproviderobjectsettinggui':
353 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
355 }
356 $this->prepareOutput();
357 $this->addHeaderAction();
358 $this->tabs_manager->getSettingsSubTabs();
359 $this->tabs_manager->activateTab('settings');
360 $this->tabs_manager->activateSubTab('lti_provider');
361 $lti_gui = new ilLTIProviderObjectSettingGUI($this->getTestObject()->getRefId());
362 $lti_gui->setCustomRolesForSelection($this->rbac_review->getLocalRoles($this->getTestObject()->getRefId()));
363 $lti_gui->offerLTIRolesForSelection(false);
364 $this->ctrl->forwardCommand($lti_gui);
365 break;
366
367 case 'iltestexportgui':
368 if (!$this->access->checkAccess('write', '', $this->ref_id)) {
370 }
371
372 $this->prepareOutput();
373 $this->addHeaderAction();
374 $this->tabs_manager->activateTab(TabsManager::TAB_ID_EXPORT);
375
376 $selected_files = [];
377 if ($this->testrequest->isset('file') && $this->testrequest->raw('file')) {
378 $selected_files = $this->testrequest->raw('file');
379 }
380
381 if (is_string($selected_files)) {
382 $selected_files = [$selected_files];
383 }
384
385
386 $this->tpl->setOnScreenMessage(
387 'info',
388 $this->lng->txt('no_manual_feedback_export_info')
389 );
390
391 $export_gui = new ilTestExportGUI(
392 $this,
393 $this->db,
394 $this->obj_data_cache,
395 $this->user,
396 $this->ui_factory,
397 $this->ui_renderer,
398 $this->irss,
399 $this->request,
400 $this->participant_access_filter_factory,
401 $this->test_pass_result_repository,
403 );
404 $this->ctrl->forwardCommand($export_gui);
405 break;
406
407 case strtolower(ilInfoScreenGUI::class):
408 if (
409 !$this->access->checkAccess('read', '', $this->testrequest->getRefId())
410 && !$this->access->checkAccess('visible', '', $this->testrequest->getRefId())
411 ) {
413 }
414
415 $this->prepareOutput();
416 $this->addHeaderAction();
417 $this->forwardToInfoScreen();
418 break;
419
420 case strtolower(TestScreenGUI::class):
421 if (!$this->access->checkAccess('read', '', $this->testrequest->getRefId()) && !$this->access->checkAccess('visible', '', $this->testrequest->getRefId())) {
423 }
424 $this->prepareOutput();
425 $this->addHeaderAction();
426 $this->ctrl->forwardCommand($this->getTestScreenGUIInstance());
427 break;
428
429 case 'ilobjectmetadatagui':
430 if (!$this->access->checkAccess('write', '', $this->getTestObject()->getRefId())) {
432 }
433
434 $this->prepareOutput();
435 $this->addHeaderAction();
436 $this->tabs_manager->activateTab(TabsManager::TAB_ID_META_DATA);
437 $md_gui = new ilObjectMetaDataGUI($this->getTestObject());
438 $this->ctrl->forwardCommand($md_gui);
439 break;
440
441 case strtolower(ilTestParticipantsGUI::class):
442 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
444 }
445
446 $gui = new ilTestParticipantsGUI(
447 $this->getTestObject(),
448 $this->user,
450 $this->test_question_set_config_factory->getQuestionSetConfig(),
451 $this->access,
452 $this->test_access,
453 $this->tpl,
454 $this->ui_factory,
455 $this->ui_renderer,
456 $this->ui_service,
457 $this->data_factory,
458 $this->lng,
459 $this->ctrl,
460 $this->refinery,
461 $this->db,
462 $this->tabs_manager,
463 $this->toolbar,
464 $this->component_factory,
465 $this->export_factory,
466 $this->testrequest,
467 $this->response_handler,
468 $this->participant_repository,
469 $this->results_data_factory,
470 $this->results_presentation_factory,
471 $this->test_pass_result_repository
472 );
473
474 $this->ctrl->forwardCommand($gui);
475
481 $this->prepareOutput();
482 $this->addHeaderAction();
483 $this->tabs_manager->activateTab(TabsManager::TAB_ID_PARTICIPANTS);
484
485 break;
486
487 case 'iltestresultsgui':
488 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
490 }
491 $this->prepareOutput();
492 $this->addHeaderAction();
493
494 $gui = new ilTestResultsGUI(
495 $this->getTestObject(),
496 $this->ctrl,
497 $this->test_access,
498 $this->db,
499 $this->refinery,
500 $this->user,
501 $this->lng,
502 $this->getTestObject()->getTestlogger(),
503 $this->component_repository,
504 $this->component_factory,
505 $this->tabs_manager,
506 $this->toolbar,
507 $this->tpl,
508 $this->ui_factory,
509 $this->skills_service,
510 $this->content_style,
511 $this->testrequest,
512 $this->test_session_factory->getSession(),
513 $this->getObjectiveOrientedContainer()
514 );
515
516 $this->ctrl->forwardCommand($gui);
517 break;
518
519 case "iltestplayerfixedquestionsetgui":
520 if (
521 $cmd !== 'autosave' &&
522 (!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))
523 ) {
525 }
527 if (!$this->getTestObject()->getKioskMode()) {
528 $this->prepareOutput();
529 }
531 $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
532 $this->ctrl->forwardCommand($gui);
533 break;
534
535 case "iltestplayerrandomquestionsetgui":
536 if (
537 $cmd !== 'autosave' &&
538 (!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))
539 ) {
541 }
543 if (!$this->getTestObject()->getKioskMode()) {
544 $this->prepareOutput();
545 }
547 $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
548 $this->ctrl->forwardCommand($gui);
549 break;
550
551 case "iltestevaluationgui":
552 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
554 }
555 $this->forwardToEvaluationGUI();
556 break;
557
558 case "iltestservicegui":
559 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
561 }
562 $this->prepareOutput();
563 $this->addHeaderAction();
564 $serviceGUI = new ilTestServiceGUI($this->getTestObject());
565 $this->ctrl->forwardCommand($serviceGUI);
566 break;
567
568 case 'ilpermissiongui':
569 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
571 }
572 $this->prepareOutput();
573 $this->addHeaderAction();
574 $this->tabs_manager->activateTab(TabsManager::TAB_ID_PERMISSIONS);
575 $perm_gui = new ilPermissionGUI($this);
576 $ret = $this->ctrl->forwardCommand($perm_gui);
577 break;
578
579 case "illearningprogressgui":
580 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
582 }
583
584 $this->prepareOutput();
585 $this->addHeaderAction();
586 $this->tabs_manager->activateTab(TabsManager::TAB_ID_LEARNING_PROGRESS);
587
588 $test_session = $this->test_session_factory->getSessionByUserId($this->user->getId());
589 if (
590 !$this->test_access->checkOtherParticipantsLearningProgressAccess()
591 && !$this->getTestObject()->canShowTestResults($test_session)
592 && !\ilLearningProgressAccess::checkAccess($this->getTestObject()->getRefId())
593 ) {
594 $this->tpl->setOnScreenMessage(
595 'info',
596 $this->lng->txt('tst_res_tab_msg_no_lp_access'),
597 );
598 break;
599 }
600
602 $this->ctrl->forwardCommand($new_gui);
603
604 break;
605
606 case "ilcertificategui":
607 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
609 }
610 $this->prepareOutput();
611 $this->addHeaderAction();
612
613 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
614
616 $output_gui = $gui_factory->create($this->getTestObject());
617
618 $this->ctrl->forwardCommand($output_gui);
619 break;
620
621 case strtolower(ConsecutiveScoringGUI::class):
622 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
624 }
625 $output_gui = $this->gui_factory->get(ConsecutiveScoringGUI::class, $this->getTestObject());
626 $this->prepareOutput();
627 $this->ctrl->forwardCommand($output_gui);
628 $this->addHeaderAction();
629 break;
630
631
632 case strtolower(MarkSchemaGUI::class):
633 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
635 }
637
638 $mark_schema_gui = new MarkSchemaGUI(
639 $this->getTestObject(),
640 $this->user,
641 $this->lng,
642 $this->ctrl,
643 $this->tpl,
644 $this->toolbar,
645 $this->getObject()->getTestLogger(),
646 $this->post_wrapper,
647 $this->request_wrapper,
648 $this->response_handler,
649 $this->request,
650 $this->refinery,
651 $this->ui_factory,
652 $this->ui_renderer,
653 $this->mark_schema_factory
654 );
655 $this->ctrl->forwardCommand($mark_schema_gui);
656
657 $this->prepareOutput();
658 $this->addHeaderAction();
659 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
660 $this->tabs_manager->activateSubTab(TabsManager::SETTINGS_SUBTAB_ID_MARK_SCHEMA);
661
662 break;
663
664 case strtolower(SettingsMainGUI::class):
665 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
667 }
668
669 $gui = new SettingsMainGUI(
670 $this->tpl,
671 $this->ctrl,
672 $this->access,
673 $this->lng,
674 $this->tree,
675 $this->db,
676 $this->obj_data_cache,
677 $this->settings,
678 $this->ui_factory,
679 $this->ui_renderer,
680 $this->refinery,
681 $this->request,
682 $this->component_repository,
683 $this->user,
684 $this,
685 $this->getTestObject()->getTestLogger(),
686 $this->questionrepository
687 );
688 $this->ctrl->forwardCommand($gui);
689 $this->prepareOutput();
690 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
691 $this->tabs_manager->activateSubTab(TabsManager::SUBTAB_ID_GENERAL_SETTINGS);
692 $this->addHeaderAction();
693 break;
694
695 case strtolower(SettingsScoringGUI::class):
696 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
698 }
699 $this->prepareOutput();
700 $this->addHeaderAction();
701 $gui = new SettingsScoringGUI(
702 $this->ctrl,
703 $this->access,
704 $this->lng,
705 $this->tree,
706 $this->db,
707 $this->component_repository,
708 $this,
709 $this->tpl,
710 $this->tabs_gui,
711 $this->getTestObject()->getTestLogger(),
712 $this->getTestObject()->getScoreSettingsRepository(),
713 $this->getTestObject()->getTestId(),
714 $this->ui_factory,
715 $this->ui_renderer,
716 $this->refinery,
717 $this->request,
718 $this->user
719 );
720
721 $this->ctrl->forwardCommand($gui);
722 break;
723
724 case 'iltestrandomquestionsetconfiggui':
725 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
727 }
728 $this->prepareOutput();
729 $this->addHeaderAction();
730 $test_process_locker_factory = (new ilTestProcessLockerFactory(
731 new ilSetting('assessment'),
732 $this->db,
733 $this->getTestObject()->getTestLogger()
734 ))->withContextId($this->getTestObject()->getId());
736 $this->getTestObject(),
737 $this->ctrl,
738 $this->user,
739 $this->access,
740 $this->ui_factory,
741 $this->ui_renderer,
742 $this->data_factory,
743 $this->tabs_manager,
744 $this->lng,
745 $this->getTestObject()->getTestlogger(),
746 $this->tpl,
747 $this->db,
748 $this->tree,
749 $this->component_repository,
750 $this->obj_definition,
751 $this->obj_data_cache,
752 $test_process_locker_factory,
753 $this->testrequest,
754 $this->title_builder,
755 $this->questionrepository
756 );
757 $this->ctrl->forwardCommand($gui);
758 break;
759
760 case 'iltestquestionbrowsertablegui':
761 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
763 }
764 $this->prepareOutput();
765 $this->addHeaderAction();
767 $this->tabs_gui,
768 $this->tree,
769 $this->db,
770 $this->getTestObject()->getTestlogger(),
771 $this->component_repository,
772 $this->component_factory,
773 $this->getTestObject(),
774 $this->user,
775 $this->access,
776 $this->http,
777 $this->refinery,
778 $this->ui_factory,
779 $this->ui_renderer,
780 $this->testrequest,
781 $this->questionrepository,
782 $this->lng,
783 $this->ctrl,
784 $this->tpl,
785 $this->ui_service,
786 $this->data_factory,
787 $this->taxonomy,
788 );
789 $this->ctrl->forwardCommand($gui);
790 break;
791
792 case 'iltestskilladministrationgui':
793 if ((!$this->access->checkAccess("read", "", $this->testrequest->getRefId()))) {
795 }
796 $this->prepareOutput();
797 $this->addHeaderAction();
799 $this->ctrl,
800 $this->access,
801 $this->tabs_manager,
802 $this->tpl,
803 $this->lng,
804 $this->refinery,
805 $this->db,
806 $this->getTestObject()->getTestlogger(),
807 $this->tree,
808 $this->component_repository,
809 $this->component_factory,
810 $this->getTestObject(),
811 $this->questionrepository,
812 $this->testrequest,
813 $this->http,
814 $this->toolbar,
815 $this->skill_usage_service,
816 $this->ui_factory,
817 $this->ui_renderer,
818 $this->tabs_gui,
819 $this->ref_id
820 );
821 $this->ctrl->forwardCommand($gui);
822 break;
823
824 case 'ilobjectcopygui':
825 if ((!$this->access->checkAccess("copy", "", $this->testrequest->getRefId()))) {
827 }
828 $this->prepareOutput();
829 $this->addHeaderAction();
830 $cp = new ilObjectCopyGUI($this);
831 $cp->setType('tst');
832 $this->ctrl->forwardCommand($cp);
833 break;
834
835 case strtolower(ilAssQuestionPreviewGUI::class):
836 if (!$this->access->checkAccess('write', '', $this->getTestObject()->getRefId())) {
838 }
839 $this->prepareOutput();
841 break;
842 case 'ilassquestionpagegui':
843 if (!$this->access->checkAccess('write', '', $this->testrequest->getRefId())) {
845 }
846 if ($cmd === 'finishEditing') {
847 $this->prepareOutput();
849 break;
850 }
851 $this->prepareOutput();
852 $forwarder = new ilAssQuestionPageCommandForwarder(
853 $this->getTestObject(),
854 $this->lng,
855 $this->ctrl,
856 $this->tpl,
857 $this->content_style,
858 $this->testrequest
859 );
860 $forwarder->forward();
861 break;
862
863 case 'ilassspecfeedbackpagegui':
864 if ((!$this->access->checkAccess("write", "", $this->testrequest->getRefId()))) {
866 }
867 $pg_gui = new ilAssSpecFeedbackPageGUI((int) $this->testrequest->raw("feedback_id"));
868 $this->ctrl->forwardCommand($pg_gui);
869 break;
870
871 case 'ilassgenfeedbackpagegui':
872 if ((!$this->access->checkAccess("write", "", $this->testrequest->getRefId()))) {
874 }
875 $pg_gui = new ilAssGenFeedbackPageGUI($this->testrequest->int("feedback_id"));
876 $this->ctrl->forwardCommand($pg_gui);
877 break;
878
879 case 'illocalunitconfigurationgui':
880 if ((!$this->access->checkAccess("write", "", $this->testrequest->getRefId()))) {
882 }
883 $this->prepareSubGuiOutput();
884
885 // set return target
887 $question = $question_gui->getObject();
888 $question->setObjId($this->getTestObject()->getId());
889 $question_gui->setObject($question);
890 $question_gui->setQuestionTabs();
892 new ilUnitConfigurationRepository($this->testrequest->getQuestionId())
893 );
894 $this->ctrl->forwardCommand($gui);
895 break;
896
897 case "ilcommonactiondispatchergui":
898 if (!$this->access->checkAccess("read", "", $this->testrequest->getRefId()) && !$this->access->checkAccess("visible", "", $this->testrequest->getRefId())) {
900 }
901 $this->prepareOutput();
903 $this->ctrl->forwardCommand($gui);
904 break;
905
906 case 'ilassquestionfeedbackeditinggui':
907 if (!$this->access->checkAccess('write', '', $this->getTestObject()->getRefId())) {
909 }
910 $this->prepareSubGuiOutput();
911
912 // set return target
913 $this->ctrl->setReturnByClass(self::class, self::SHOW_QUESTIONS_CMD);
915 $question = $question_gui->getObject();
916 $question->setObjId($this->getTestObject()->getId());
917 $question_gui->setObject($question);
918 $question_gui->setQuestionTabs();
919 $question_gui->setContextAllowsSyncToPool(true);
920
921 $this->addQuestionTitleToObjectTitle($question->getTitle());
922
923 if ($this->getTestObject()->evalTotalPersons() !== 0) {
924 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('question_is_part_of_running_test'), true);
925 $this->prepareOutput();
927 }
929 $question_gui,
930 $this->ctrl,
931 $this->access,
932 $this->tpl,
933 $this->tabs_gui,
934 $this->lng,
935 $this->help,
936 $this->qplrequest,
937 $this->content_style
938 );
939 $this->ctrl->forwardCommand($gui);
940 break;
941
942 case 'iltestcorrectionsgui':
943 if ((!$this->access->checkAccess('read', '', $this->testrequest->getRefId()))) {
945 }
946 $this->prepareOutput();
947 $gui = new ilTestCorrectionsGUI(
948 $this->db,
949 $this->ctrl,
950 $this->lng,
951 $this->tabs_gui,
952 $this->help,
953 $this->ui_factory,
954 $this->tpl,
955 $this->refinery,
956 $this->getTestObject()->getTestLogger(),
957 $this->testrequest,
958 $this->getTestObject(),
959 $this->user,
960 $this->test_pass_result_repository
961 );
962 $this->ctrl->forwardCommand($gui);
963 break;
964
965 case 'iltestpagegui':
966 if ((!$this->access->checkAccess("write", "", $this->testrequest->getRefId()))) {
968 }
969
970 if ($cmd === 'downloadFile') {
971 $page_id = $this->object->getIntroductionPageId();
972 if ($this->testrequest->strVal('page_type') === 'concludingremarkspage') {
973 $page_id = $this->object->getConcludingRemarksPageId();
974 }
975 $this->ctrl->forwardCommand(new ilTestPageGUI('tst', $page_id));
976 }
977 $this->showEditTestPageGUI();
978 break;
979
980 case '':
981 case 'ilobjtestgui':
982 if (!$this->access->checkAccess('read', '', $this->testrequest->getRefId())
983 && !$this->access->checkAccess('visible', '', $this->testrequest->getRefId())) {
985 }
986 $this->prepareOutput();
987 $this->addHeaderAction();
988
989 if ($cmd === 'testScreen') {
990 $this->ctrl->forwardCommand($this->getTestScreenGUIInstance());
991 return;
992 }
993
994 $local_cmd = "{$cmd}Object";
995
996 if (!method_exists($this, $local_cmd)) {
997 $local_cmd = self::SHOW_QUESTIONS_CMD . 'Object';
998 }
999 $this->$local_cmd();
1000 break;
1001
1002 default:
1003 if ((!$this->access->checkAccess('read', '', $this->testrequest->getRefId()))) {
1004 $this->redirectAfterMissingRead();
1005 }
1006 if (in_array(
1007 $cmd,
1008 self::QUESTION_FUNCTIONS_NEEDING_WRITE
1009 )
1010 && !$this->access->checkAccess('write', '', $this->getTestObject()->getRefId())) {
1012 }
1013 if (in_array($cmd, ['editQuestion', 'save', 'saveReturn', 'suggestedsolution'])
1014 && $this->getTestObject()->evalTotalPersons() !== 0) {
1015 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('question_is_part_of_running_test'), true);
1016 $this->prepareOutput();
1018 return;
1019 }
1020 $this->forwardCommandToQuestion($cmd);
1021 break;
1022 }
1023 if (!in_array(strtolower($this->testrequest->raw('baseClass')), ['iladministrationgui', 'ilrepositorygui'])
1024 && $this->getCreationMode() !== true) {
1025 $this->tpl->printToStdout();
1026 }
1027 }
@ilCtrl_Calls ILIAS\Test\Settings\MainSettings\SettingsMainGUI: ilPropertyFormGUI @ilCtrl_Calls ILIAS...
static _getQuestionGUI(string $question_type='', int $question_id=-1)
Creates a question gui representation and returns the alias to the question gui.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
The tab of an ILIAS object that releases it to the platforms allowed for its type,...
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
Class ilObjUserTrackingGUI.
Class ilLocalUnitConfigurationGUI.
forwardCommandToQuestionPreview(string $cmd, ?assQuestionGUI $question_gui=null)
forwardCommandToQuestion(string $cmd)
GUIFactory $gui_factory
GUI class for the workflow of copying objects.
addHeaderAction()
Add header action menu.
prepareOutput(bool $show_sub_objects=true)
Class ilObjectMetaDataGUI.
ILIAS Setting Class.
Export User Interface Class.
Class that handles PDF generation for test and assessment.
@ilCtrl_Calls ilTestPageGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMDEditorGUI @ilCtrl_Calls ilTestP...
Class ilTestParticipantsGUI.
@ilCtrl_Calls ilTestQuestionBrowserTableGUI: ilFormPropertyDispatchGUI
Service GUI class for tests.
Class ilUnitConfigurationRepository.
static http()
Fetches the global http state from ILIAS.
if(!file_exists('../ilias.ini.php'))

References $gui_factory, assQuestionGUI\_getQuestionGUI(), ILIAS\Repository\access(), ilObjectGUI\addHeaderAction(), addQuestionTitleToObjectTitle(), ilLearningProgressAccess\checkAccess(), ilAssQuestionPreviewGUI\CMD_SHOW, ILIAS\Repository\ctrl(), determineObjectiveOrientedContainer(), 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 2052 of file class.ilObjTestGUI.php.

2052 : void
2053 {
2054 $this->protectByWritePermission();
2055
2056 $modal = $this->buildPersonalSettingsTable()->perform();
2057 if ($modal !== null) {
2058 $this->showTemplatesObject($modal);
2059 return;
2060 }
2061 $this->ctrl->redirectByClass(self::class, 'showTemplates');
2062 }
showTemplatesObject(?Modal $modal=null)

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ exportLegacyLogsObject()

ilObjTestGUI::exportLegacyLogsObject ( )

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

1973 : void
1974 {
1975 $this->protectByWritePermission();
1976
1977 $csv_output = $this->getTestObject()->getTestLogViewer()->getLegacyLogExportForObjId($this->getTestObject()->getId());
1978
1980 $csv_output,
1981 "legacy_logs_for_{$this->getTestObject()->getRefId()}.csv"
1982 );
1983 }
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 1295 of file class.ilObjTestGUI.php.

1296 {
1297 $this->ctrl->redirectByClass('ilTestExportGUI');
1298 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ fetchAuthoringQuestionIdParameter()

ilObjTestGUI::fetchAuthoringQuestionIdParameter ( )
protected
Returns
int
Exceptions
ilTestException

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

1304 : int
1305 {
1306 $qid = $this->testrequest->int('q_id');
1307
1308 if ($qid === 0 || $this->getTestObject()->checkQuestionParent($qid)) {
1309 return $qid;
1310 }
1311
1312 throw new ilTestException('question id does not relate to parent object!');
1313 }
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 1121 of file class.ilObjTestGUI.php.

1121 : void
1122 {
1123 $this->create_question_mode = true;
1124 $this->prepareOutput();
1125
1126 try {
1127 $qid = $this->fetchAuthoringQuestionIdParameter();
1128
1129 $this->ctrl->setReturnByClass(self::class, self::SHOW_QUESTIONS_CMD);
1130
1131 $question_gui = assQuestionGUI::_getQuestionGUI(
1132 ilUtil::stripSlashes($this->testrequest->strVal('question_type')),
1133 $qid
1134 );
1135
1136 $question_gui->setEditContext(assQuestionGUI::EDIT_CONTEXT_AUTHORING);
1137 $question = $question_gui->getObject();
1138 $question->setObjId($this->getTestObject()->getId());
1139 $question_gui->setObject($question);
1140 $question_gui->setContextAllowsSyncToPool(true);
1141 $question_gui->setQuestionTabs();
1142
1143 $this->addQuestionTitleToObjectTitle($question->getTitle());
1144
1145 $target = strpos($cmd, 'Return') === false ? 'stay' : 'return';
1146
1147 if (in_array($cmd, ['syncQuestion', 'syncQuestionReturn'])) {
1148 $question_gui->syncQuestion();
1149 $this->showNextViewAfterQuestionSave($question_gui, $target);
1150 return;
1151 }
1152
1153 if ($question_gui->isSaveCommand()
1154 || $question_gui->cmdNeedsExistingQuestion($cmd)) {
1155 $question_gui = $this->addPostCreationTasksToQuestionGUI($question_gui);
1156 }
1157
1158 if ($qid === 0 && $question_gui->cmdNeedsExistingQuestion($cmd)) {
1159 $question_gui->getObject()->createNewQuestion();
1160 $question_gui->setQuestionTabs();
1161 $this->executeAfterQuestionCreationTasks($question_gui);
1162 }
1163
1164 if (!$question_gui->isSaveCommand()) {
1165 $this->ctrl->forwardCommand($question_gui);
1166 return;
1167 }
1168
1169 if (!$question_gui->saveQuestion()) {
1170 return;
1171 }
1172
1173 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
1174 if ($qid === 0) {
1175 $this->executeAfterQuestionCreationTasks($question_gui);
1176 }
1177 $this->executeAfterQuestionSaveTasks($question_gui);
1178 $this->showNextViewAfterQuestionSave($question_gui, $target);
1179 } catch (ilTestException $e) {
1180 $this->showQuestionsObject();
1181 }
1182 }
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, ILIAS\Scripts\PHPStan\$target, 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 1047 of file class.ilObjTestGUI.php.

1050 : void {
1051 $nr_of_participants_with_results = $this->getTestObject()->evalTotalPersons();
1052
1053 $this->ctrl->saveParameterByClass(self::class, 'q_id');
1054 $gui = new ilAssQuestionPreviewGUI(
1055 $this->ctrl,
1056 $this->rbac_system,
1057 $this->tabs_gui,
1058 $this->toolbar,
1059 $this->tpl,
1060 $this->ui_factory,
1061 $this->lng,
1062 $this->db,
1063 $this->refinery->random(),
1064 $this->global_screen,
1065 $this->content_style,
1066 $this->ref_id
1067 );
1068
1069 if ($nr_of_participants_with_results > 0
1070 && $this->getTestObject()->getGlobalSettings()->isAdjustingQuestionsWithResultsAllowed()) {
1071 $gui->addAdditionalCmd(
1072 $this->lng->txt('tst_corrections_qst_form'),
1073 $this->ctrl->getLinkTargetByClass(ilTestCorrectionsGUI::class, 'showQuestion')
1074 );
1075 }
1076
1077 $question_gui ??= assQuestion::instantiateQuestionGUI($this->fetchAuthoringQuestionIdParameter());
1078
1079 $this->addQuestionTitleToObjectTitle($question_gui->getObject()->getTitle());
1080
1081 if (!$this->getTestObject()->isRandomTest() && $nr_of_participants_with_results === 0) {
1082 $gui->setPrimaryCmd(
1083 $this->lng->txt('edit_question'),
1084 $this->ctrl->getLinkTargetByClass(
1085 get_class($question_gui),
1086 'editQuestion'
1087 )
1088 );
1089 $gui->addAdditionalCmd(
1090 $this->lng->txt('edit_page'),
1091 $this->ctrl->getLinkTargetByClass(
1092 ilAssQuestionPageGUI::class,
1093 'edit'
1094 )
1095 );
1096 }
1097
1098 $gui->initQuestion($question_gui, $this->getTestObject()->getId());
1099 $gui->initPreviewSettings($this->getTestObject()->getRefId());
1100 $gui->initPreviewSession($this->user->getId(), $this->testrequest->getQuestionId());
1101 $gui->initStyleSheets();
1102
1103 $this->ctrl->clearParameterByClass(self::class, 'q_id');
1104 $this->tabs_gui->setBackTarget(
1105 $this->lng->txt('backtocallingtest'),
1106 $this->ctrl->getLinkTargetByClass(self::class, self::SHOW_QUESTIONS_CMD)
1107 );
1108 $this->ctrl->saveParameterByClass(self::class, 'q_id');
1109 $gui->{$cmd . 'Cmd'}();
1110 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ forwardToEvaluationGUI()

ilObjTestGUI::forwardToEvaluationGUI ( )
private

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

1365 {
1366 $this->prepareOutput();
1367 $this->addHeaderAction();
1368 $gui = new ilTestEvaluationGUI($this->getTestObject());
1369 $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
1370 $gui->setTestAccess($this->getTestAccess());
1371
1372 $this->ctrl->forwardCommand($gui);
1373 }
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 2173 of file class.ilObjTestGUI.php.

2173 : void
2174 {
2175 if (!$this->access->checkAccess('visible', '', $this->ref_id)
2176 && !$this->access->checkAccess('read', '', $this->ref_id)) {
2177 $this->redirectAfterMissingRead();
2178 }
2179
2180 if ($this->getTestObject()->getMainSettings()->getAdditionalSettings()->getHideInfoTab()) {
2181 $this->ctrl->redirectByClass([self::class, TestScreenGUI::class], TestScreenGUI::DEFAULT_CMD);
2182 }
2183
2184 $this->tabs_manager->activateTab(TabsManager::TAB_ID_INFOSCREEN);
2185
2186 if ($this->access->checkAccess('read', '', $this->ref_id)) {
2187 $this->trackTestObjectReadEvent();
2188 }
2189 $info = new ilInfoScreenGUI($this);
2190
2191 if ($this->isCommandClassAnyInfoScreenChild()) {
2192 $this->ctrl->forwardCommand($info);
2193 }
2194
2196 $this->getTestObject(),
2197 $this->test_player_factory->getPlayerGUI(),
2198 $this->test_question_set_config_factory->getQuestionSetConfig(),
2199 $this->test_session_factory->getSession(),
2200 $this->db,
2201 $this->access,
2202 $this->ctrl,
2203 $this->lng,
2204 $this->ui_factory,
2205 $this->ui_renderer,
2206 $this->tpl,
2207 $this->toolbar
2208 );
2209
2210 $toolbar->setCloseFormTag(false);
2211
2212 $toolbar->setSessionLockString('');
2213 $toolbar->build();
2214 $toolbar->sendMessages();
2215
2216 $info->enablePrivateNotes();
2217
2218 $info->addSection($this->lng->txt('tst_general_properties'));
2219 $info->addProperty(
2220 $this->lng->txt('author'),
2221 $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
2222 $this->getTestObject()->getAuthor()
2223 )
2224 );
2225 $info->addProperty(
2226 $this->lng->txt('title'),
2227 $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
2228 $this->getTestObject()->getTitle()
2229 )
2230 );
2231
2232 if ($this->type !== 'tst') {
2233 $info->hideFurtherSections(false);
2234 }
2235
2236 if ($this->getTestObject()->getEnableProcessingTime()) {
2237 $info->addProperty($this->lng->txt('tst_processing_time'), $this->getTestObject()->getProcessingTime());
2238 }
2239
2240 $starting_time = $this->getTestObject()->getStartingTime();
2241 if ($this->getTestObject()->isStartingTimeEnabled() && $starting_time !== 0) {
2242 $info->addProperty($this->lng->txt('tst_starting_time'), ilDatePresentation::formatDate(new ilDateTime($starting_time, IL_CAL_UNIX)));
2243 }
2244 $ending_time = $this->getTestObject()->getEndingTime();
2245 if ($this->getTestObject()->isEndingTimeEnabled() && $ending_time != 0) {
2246 $info->addProperty($this->lng->txt('tst_ending_time'), ilDatePresentation::formatDate(new ilDateTime($ending_time, IL_CAL_UNIX)));
2247 }
2248 $info->addMetaDataSections($this->getTestObject()->getId(), 0, $this->getTestObject()->getType());
2249
2250 $this->ctrl->forwardCommand($info);
2251 }
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 1546 of file class.ilObjTestGUI.php.

1547 {
1548 $page_gui = new ilAssQuestionPageGUI($this->testrequest->raw('pg_id'));
1549 $page_gui->setFileDownloadLink(
1550 $this->ctrl->getLinkTargetByClass(ilObjTestGUI::class, 'downloadFile')
1551 );
1552 $page_gui->showMediaFullscreen();
1553 }
Question page GUI class.

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getObjectiveOrientedContainer()

ilObjTestGUI::getObjectiveOrientedContainer ( )
protected

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

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getQuestionsTableActions()

ilObjTestGUI::getQuestionsTableActions ( )
protected

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

2703 {
2704 if ($this->table_actions === null) {
2705 $this->table_actions = new QuestionsTableActions(
2706 $this->ui_factory,
2707 $this->ui_renderer,
2708 $this->tpl,
2709 $this->request,
2710 $this->getQuestionsTableQuery(),
2711 $this->lng,
2712 $this->ctrl,
2713 $this->test_questions_repository,
2714 new QuestionPrinter(
2715 $this->ui_factory,
2716 $this->tpl,
2717 $this->tabs_manager,
2718 $this->toolbar,
2719 $this->refinery,
2720 $this->lng,
2721 $this->ctrl,
2722 $this->user,
2724 $this->getTestObject()
2725 ),
2726 $this->object,
2727 $this->getTestObject()->getGlobalSettings()->isAdjustingQuestionsWithResultsAllowed(),
2728 $this->getTestObject()->evalTotalPersons() !== 0,
2729 $this->getTestObject()->isRandomTest(),
2730 $this->test_question_set_config_factory,
2731 $this->response_handler
2732 );
2733 }
2734 return $this->table_actions;
2735 }
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 2688 of file class.ilObjTestGUI.php.

2689 {
2690 if ($this->table_query === null) {
2691 $id = $this->object ? $this->object->getId() : '';
2692 $this->table_query = new QuestionsTableQuery(
2693 $this->http,
2694 $this->refinery,
2695 $this->data_factory,
2696 ['qlist', $id]
2697 );
2698 }
2699 return $this->table_query;
2700 }
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 2737 of file class.ilObjTestGUI.php.

2738 {
2739 return new QuestionsTable(
2740 $this->ui_factory,
2741 $this->refinery,
2742 $this->http->request(),
2743 $this->getQuestionsTableActions(),
2744 $this->lng,
2745 $this->object,
2746 $this->test_questions_repository,
2747 $this->title_builder
2748 );
2749 }

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

2369 : void
2370 {
2371 $this->help->setScreenIdComponent("tst");
2372
2373 if ($this->tabs_manager === null) {
2374 return;
2375 }
2376
2377 if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
2378 $courseLink = ilLink::_getLink($this->getObjectiveOrientedContainer()->getRefId());
2379 $this->tabs_manager->setParentBackLabel($this->lng->txt('back_to_objective_container'));
2380 $this->tabs_manager->setParentBackHref($courseLink);
2381 }
2382
2383 $this->tabs_manager->perform();
2384 }

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

2584 {
2585 $form = new ilPropertyFormGUI();
2586 $form->setFormAction($this->ctrl->getFormAction($this));
2587 $form->addCommandButton($cmd, $this->lng->txt('submit'));
2588 $form->addCommandButton('cancelCreateQuestion', $this->lng->txt('cancel'));
2589
2590 if (count($questionpools) == 0) {
2591 $form->setTitle($this->lng->txt("tst_enter_questionpool"));
2592
2593 $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
2594 $title->setRequired(true);
2595 $form->addItem($title);
2596
2597 $description = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
2598 $form->addItem($description);
2599 } else {
2600 $form->setTitle($this->lng->txt("tst_select_questionpool"));
2601
2602 $selectOptions = [
2603 '' => $this->lng->txt('please_select')
2604 ];
2605
2606 foreach ($questionpools as $key => $value) {
2607 $selectOptions[$key] = $value["title"];
2608 }
2609
2610 $select = new ilSelectInputGUI($this->lng->txt('tst_source_question_pool'), 'sel_qpl');
2611 $select->setRequired(true);
2612 $select->setOptions($selectOptions);
2613
2614 $form->addItem($select);
2615 }
2616
2618 if ($table_query->getTableAction() !== null) {
2619 $question_ids = $table_query->getRowIds($this->object);
2620 } elseif ($this->testrequest->isset('q_id') && is_array($this->testrequest->raw('q_id'))) {
2621 $question_ids = $this->testrequest->raw('q_id');
2622 }
2623
2624 foreach ($question_ids as $id) {
2625 $hidden = new ilHiddenInputGUI('q_id[]');
2626 $hidden->setValue((string) $id);
2627 $form->addItem($hidden);
2628 }
2629
2630 return $form;
2631 }
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 1354 of file class.ilObjTestGUI.php.

1354 : ilTestAccess
1355 {
1356 return $this->test_access;
1357 }
ilTestAccess $test_access

◆ getTestObject()

ilObjTestGUI::getTestObject ( )

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

1538 : ?ilObjTest
1539 {
1540 return $this->object;
1541 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getTestScreenGUIInstance()

ilObjTestGUI::getTestScreenGUIInstance ( )
private

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

2668 {
2669 return new TestScreenGUI(
2670 $this->getTestObject(),
2671 $this->user,
2672 $this->ui_factory,
2673 $this->ui_renderer,
2674 $this->lng,
2675 $this->refinery,
2676 $this->ctrl,
2677 $this->tpl,
2678 $this->content_style,
2679 $this->http,
2680 $this->tabs_manager,
2681 $this->access,
2682 $this->test_access,
2683 $this->db,
2684 $this->rbac_system
2685 );
2686 }

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

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

1393 : void
1394 {
1395 $this->import_session_repository->clear();
1396
1397 $session = (new ImportSession())->withFileToImport($file_to_import);
1398 $this->import_session_repository->setSession($session);
1399 $this->import_session_repository->setCurrentStageIndex(0);
1400
1401 $this->ctrl->redirectByClass(self::class, 'processImport');
1402 }
Immutable JSON-capable import session shared by question pool and test wizards.

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ infoScreenObject()

ilObjTestGUI::infoScreenObject ( )
private

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

2166 : void
2167 {
2168 $this->ctrl->redirectByClass(
2169 [ilRepositoryGUI::class, self::class, ilInfoScreenGUI::class]
2170 );
2171 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ insertQuestionsObject()

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

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

1642 : void
1643 {
1644 $this->protectByWritePermission();
1645
1646 if (($selected_array ?? $this->testrequest->getQuestionIds()) === []) {
1647 $this->tpl->setOnScreenMessage('info', $this->lng->txt('tst_insert_missing_question'), true);
1648 $this->ctrl->redirect($this, 'browseForQuestions');
1649 }
1650
1651 $this->getTestObject()->saveCompleteStatus($this->test_question_set_config_factory->getQuestionSetConfig());
1652 $this->tpl->setOnScreenMessage('success', $this->lng->txt('tst_questions_inserted'), true);
1653 $this->ctrl->redirect($this, self::SHOW_QUESTIONS_CMD);
1654 return;
1655 }

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

+ Here is the call graph for this function:

◆ isCommandClassAnyInfoScreenChild()

ilObjTestGUI::isCommandClassAnyInfoScreenChild ( )
private

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

2151 : bool
2152 {
2153 if (in_array(
2154 $this->ctrl->getCmdClass(),
2155 [
2156 strtolower(PublicProfileGUI::class),
2157 'ilobjportfoliogui'
2158 ]
2159 )) {
2160 return true;
2161 }
2162
2163 return false;
2164 }

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

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ populateQuestionBrowserToolbarButtons()

ilObjTestGUI::populateQuestionBrowserToolbarButtons ( ilToolbarGUI  $toolbar)
private

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

1895 : void
1896 {
1897 $this->ctrl->setParameterByClass(
1898 ilTestQuestionBrowserTableGUI::class,
1901 );
1902
1904 $this->lng->txt('tst_browse_for_qpl_questions'),
1905 $this->ctrl->getLinkTargetByClass(
1906 ilTestQuestionBrowserTableGUI::class,
1908 )
1909 );
1910
1911 $this->ctrl->setParameterByClass(
1912 ilTestQuestionBrowserTableGUI::class,
1915 );
1916
1918 $this->lng->txt('tst_browse_for_tst_questions'),
1919 $this->ctrl->getLinkTargetByClass(
1920 ilTestQuestionBrowserTableGUI::class,
1922 )
1923 );
1924 }
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 1380 of file class.ilObjTestGUI.php.

1381 {
1382 $this->tpl->loadStandardTemplate();
1383 $this->setLocator();
1384 $this->setTitleAndDescription();
1385 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ processImportObject()

ilObjTestGUI::processImportObject ( )

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

1404 : void
1405 {
1406 if (!$this->checkPermissionBool('write', '', $this->object->getType())) {
1408 return;
1409 }
1410
1411 $result = $this->buildImportWizard()->run();
1412
1413 switch ($result->type) {
1414 case StageResultType::RequiresUserInteraction:
1415 $this->tpl->setContent(
1416 $this->ui_renderer->render($result->components)
1417 );
1418 break;
1419
1421 $this->tpl->setOnScreenMessage(
1422 GlobalTemplate::MESSAGE_TYPE_FAILURE,
1423 $result->error_message,
1424 true
1425 );
1426 break;
1427
1429 $this->afterImportCompleted($result->session);
1430 break;
1431 }
1432 }
afterImportCompleted(ImportSession $session)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)

References ILIAS\TestQuestionPool\ExportImport\Foundation\Import\CompletedSuccessfully, and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ protectByWritePermission()

ilObjTestGUI::protectByWritePermission ( )
protected

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

2633 : void
2634 {
2635 if (!$this->access->checkAccess('write', '', $this->ref_id)) {
2636 $this->tpl->setOnScreenMessage('info', $this->lng->txt('cannot_edit_test'), true);
2637 $this->ctrl->redirectByClass([ilRepositoryGUI::class, self::class, ilInfoScreenGUI::class]);
2638 }
2639 }

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

1316 {
1317 if ($this->getTestObject()->isRandomTest()) {
1318 $this->ctrl->redirectByClass('ilTestRandomQuestionSetConfigGUI');
1319 }
1320
1321 $this->ctrl->redirectByClass('ilObjTestGUI', self::SHOW_QUESTIONS_CMD);
1322 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ redirectAfterMissingRead()

ilObjTestGUI::redirectAfterMissingRead ( )
protected

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

1037 : void
1038 {
1039 $this->tpl->setOnScreenMessage('failure', sprintf(
1040 $this->lng->txt("msg_no_perm_read_item"),
1041 $this->object->getTitle()
1042 ), true);
1043 $this->ctrl->setParameterByClass('ilrepositorygui', 'ref_id', ROOT_FOLDER_ID);
1044 $this->ctrl->redirectByClass('ilrepositorygui');
1045 }

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

1030 {
1031 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_permission'), true);
1032 $target_class = get_class($this->object) . 'GUI';
1033 $this->ctrl->setParameterByClass($target_class, 'ref_id', $this->ref_id);
1034 $this->ctrl->redirectByClass($target_class);
1035 }

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

1376 {
1377 $this->ctrl->redirectByClass(SettingsMainGUI::class, SettingsMainGUI::CMD_SHOW_FORM);
1378 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ runObject()

ilObjTestGUI::runObject ( )

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

1388 {
1389 $this->ctrl->redirectByClass([ilRepositoryGUI::class, self::class, ilInfoScreenGUI::class]);
1390 }

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

1360 {
1361 $this->test_access = $test_access;
1362 }

◆ setupToolBarAndMessage()

ilObjTestGUI::setupToolBarAndMessage ( bool  $has_started_test_runs)
private

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

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

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

+ Here is the call graph for this function:

◆ showEditTestPageGUI()

ilObjTestGUI::showEditTestPageGUI ( )
private

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

1324 : void
1325 {
1326 $this->prepareOutput();
1327 $this->tabs_manager->getSettingsSubTabs();
1328
1329 if ($this->request_wrapper->has('page_type')
1330 && $this->request_wrapper->retrieve(
1331 'page_type',
1332 $this->refinery->kindlyTo()->string()
1333 ) === 'introductionpage'
1334 ) {
1335 $page_type = 'IntroductionPage';
1336 $this->tabs_manager->activateSubTab(TabsManager::SETTINGS_SUBTAB_ID_EDIT_INTRODUCTION_PAGE);
1337 $page_id = $this->getTestObject()->getIntroductionPageId();
1338 } else {
1339 $page_type = 'ConcludingRemarksPage';
1340 $this->tabs_manager->activateSubTab(TabsManager::SETTINGS_SUBTAB_ID_EDIT_CONCLUSION_PAGE);
1341 $page_id = $this->getTestObject()->getConcludingRemarksPageId();
1342 }
1343 $this->ctrl->saveParameterByClass(ilTestPageGUI::class, 'page_type');
1344
1345 $gui = new ilTestPageGUI('tst', $page_id);
1346 $this->content_style->gui()->addCss($this->tpl, $this->ref_id);
1347 $this->tpl->setContent($this->ctrl->forwardCommand($gui));
1348
1349 if ($this->ctrl->getCmdClass() === strtolower(ilTestPageGUI::class)) {
1350 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
1351 }
1352 }

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

1259 : void
1260 {
1261 if ($target === 'return') {
1264 $question_gui
1265 );
1266 }
1267
1268 if ($target === 'stay') {
1269 $this->ctrl->setParameterByClass(ilAssQuestionPreviewGUI::class, 'q_id', $question_gui->getObject()->getId());
1270 $this->tabs_gui->setBackTarget(
1271 $this->lng->txt('backtocallingpage'),
1272 $this->ctrl->getLinkTargetByClass(
1273 ilAssQuestionPreviewGUI::class,
1275 )
1276 );
1277 $question_gui->editQuestion(false, false);
1278 }
1279 }
editQuestion(bool $checkonly=false, ?bool $is_save_cmd=null)

References ILIAS\Scripts\PHPStan\$target, 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 1809 of file class.ilObjTestGUI.php.

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

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

+ Here is the call graph for this function:

◆ showTemplatesObject()

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

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

2002 : void
2003 {
2004 $this->protectByWritePermission();
2005
2006 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
2007
2008 $create_input = $this->buildPersonalSettingsCreateAction()
2009 ->buildModal($this->ctrl->getLinkTargetByClass(self::class, 'createTemplate'));
2010 $import_input = $this->buildPersonalSettingsImportAction()
2011 ->buildModal($this->ctrl->getLinkTargetByClass(self::class, 'importTemplate'));
2012
2013 $this->toolbar->addComponent(
2014 $this->ui_factory->button()->standard(
2015 $this->lng->txt('personal_settings_create'),
2016 $create_input->getShowSignal()
2017 )
2018 );
2019 $this->toolbar->addComponent(
2020 $this->ui_factory->button()->standard(
2021 $this->lng->txt('personal_settings_import'),
2022 $import_input->getShowSignal()
2023 )
2024 );
2025
2026 $components = [
2027 $this->buildPersonalSettingsTable()->getComponent(),
2028 $modal,
2029 $create_input,
2030 $import_input
2031 ];
2032
2033 $this->tpl->setContent(
2034 $this->ui_renderer->render(array_filter($components))
2035 );
2036 }
$components

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

+ Here is the call graph for this function:

◆ statisticsObject()

ilObjTestGUI::statisticsObject ( )

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

2348 {
2349 }

◆ takenObject()

ilObjTestGUI::takenObject ( )

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

1926 : void
1927 {
1928 }

◆ trackTestObjectReadEvent()

ilObjTestGUI::trackTestObjectReadEvent ( )
protected

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

1282 {
1284 $this->getTestObject()->getType(),
1285 $this->getTestObject()->getRefId(),
1286 $this->getTestObject()->getId(),
1287 $this->user->getId()
1288 );
1289 }
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 2751 of file class.ilObjTestGUI.php.

2751 : bool
2752 {
2753 return $this->settings->get('obj_dis_creation_qpl') !== '1'
2754 && $this->checkPermissionBool('create', '', 'qpl', $this->tree->getParentId($this->ref_id));
2755 }

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

◆ $archives

Archives ilObjTestGUI::$archives
private

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

◆ $component_factory

ilComponentFactory ilObjTestGUI::$component_factory
protected

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

◆ $component_repository

ilComponentRepository ilObjTestGUI::$component_repository
protected

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

◆ $content_style

ContentStyle ilObjTestGUI::$content_style
private

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

◆ $create_question_mode

bool ilObjTestGUI::$create_question_mode
protected

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

◆ $data_factory

DataFactory ilObjTestGUI::$data_factory
protected

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

◆ $db

ilDBInterface ilObjTestGUI::$db
protected

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

◆ $export_factory

ExportImportFactory ilObjTestGUI::$export_factory
private

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

◆ $export_repository

ExportRepository ilObjTestGUI::$export_repository
private

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

◆ $global_screen

GlobalScreen ilObjTestGUI::$global_screen
protected

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

◆ $gui_factory

GUIFactory ilObjTestGUI::$gui_factory
protected

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

Referenced by executeCommand().

◆ $help

ilHelpGUI ilObjTestGUI::$help
protected

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

◆ $import_logger

LoggerInterface ilObjTestGUI::$import_logger
protected

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

◆ $import_session_repository

ImportSessionRepository ilObjTestGUI::$import_session_repository
protected

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

◆ $irss

IRSS ilObjTestGUI::$irss
protected

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

◆ $main_settings_repository

MainSettingsRepository ilObjTestGUI::$main_settings_repository
protected

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

◆ $mark_schema_factory

MarkSchemaFactory ilObjTestGUI::$mark_schema_factory
protected

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

◆ $marks_repository

MarksRepository ilObjTestGUI::$marks_repository
protected

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

◆ $navigation_history

ilNavigationHistory ilObjTestGUI::$navigation_history
protected

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

◆ $obj_data_cache

ilObjectDataCache ilObjTestGUI::$obj_data_cache
protected

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

◆ $objective_oriented_container

ilTestObjectiveOrientedContainer ilObjTestGUI::$objective_oriented_container
private

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

◆ $participant_access_filter_factory

ilTestParticipantAccessFilterFactory ilObjTestGUI::$participant_access_filter_factory
private

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

◆ $participant_repository

ParticipantRepository ilObjTestGUI::$participant_repository
protected

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

◆ $personal_settings_exporter

PersonalSettingsExporter ilObjTestGUI::$personal_settings_exporter
protected

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

◆ $personal_settings_templates_repository

PersonalSettingsRepository ilObjTestGUI::$personal_settings_templates_repository
protected

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

◆ $qplrequest

QPLRequestDataCollector ilObjTestGUI::$qplrequest
private

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

◆ $questionrepository

GeneralQuestionPropertiesRepository ilObjTestGUI::$questionrepository
private

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

◆ $response_handler

ResponseHandler ilObjTestGUI::$response_handler
protected

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

◆ $results_data_factory

ResultsDataFactory ilObjTestGUI::$results_data_factory
protected

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

◆ $results_presentation_factory

ResultsPresentationFactory ilObjTestGUI::$results_presentation_factory
protected

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

◆ $score_settings_repository

ScoreSettingsRepository ilObjTestGUI::$score_settings_repository
protected

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

◆ $settings_factory

SettingsFactory ilObjTestGUI::$settings_factory
protected

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

◆ $skill_usage_service

SkillUsageService ilObjTestGUI::$skill_usage_service
protected

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

◆ $skills_service

SkillService ilObjTestGUI::$skills_service
protected

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

◆ $table_actions

QuestionsTableActions ilObjTestGUI::$table_actions = null
protected

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

◆ $table_query

QuestionsTableQuery ilObjTestGUI::$table_query = null
protected

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

◆ $tabs_manager

TabsManager ilObjTestGUI::$tabs_manager = null
protected

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

◆ $taxonomy

TaxonomyService ilObjTestGUI::$taxonomy
protected

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

◆ $test_access

ilTestAccess ilObjTestGUI::$test_access
protected

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

◆ $test_pass_result_repository

TestResultRepository ilObjTestGUI::$test_pass_result_repository
protected

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

◆ $test_player_factory

ilTestPlayerFactory ilObjTestGUI::$test_player_factory
private

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

◆ $test_question_set_config_factory

ilTestQuestionSetConfigFactory ilObjTestGUI::$test_question_set_config_factory
private

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

◆ $test_questions_repository

TestQuestionsRepository ilObjTestGUI::$test_questions_repository
private

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

◆ $test_session_factory

ilTestSessionFactory ilObjTestGUI::$test_session_factory
private

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

◆ $testrequest

RequestDataCollector ilObjTestGUI::$testrequest
protected

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

◆ $title_builder

TitleColumnsBuilder ilObjTestGUI::$title_builder
private

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

◆ $ui_service

ilUIService ilObjTestGUI::$ui_service
protected

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

◆ QUESTION_CREATION_POOL_SELECTION_EXISTING_POOL

const ilObjTestGUI::QUESTION_CREATION_POOL_SELECTION_EXISTING_POOL = 3
private

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

◆ QUESTION_CREATION_POOL_SELECTION_NEW_POOL

const ilObjTestGUI::QUESTION_CREATION_POOL_SELECTION_NEW_POOL = 2
private

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

◆ QUESTION_CREATION_POOL_SELECTION_NO_POOL

const ilObjTestGUI::QUESTION_CREATION_POOL_SELECTION_NO_POOL = 1
private

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

◆ QUESTION_FUNCTIONS_NEEDING_WRITE

const array ilObjTestGUI::QUESTION_FUNCTIONS_NEEDING_WRITE
private
Initial value:
= [
'editQuestion',
'previewQuestion',
'save',
'saveReturn',
'uploadImage',
'removeImage',
'syncQuestion',
'syncQuestionReturn',
'suggestedsolution',
'uploadchoice',
'changeToPictures',
'uploadElementImage',
'uploadterms',
'uploaddefintions'
]

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

◆ SHOW_LOGS_CMD

const ilObjTestGUI::SHOW_LOGS_CMD = 'history'
private

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

◆ SHOW_QUESTIONS_CMD


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