ILIAS  trunk Revision v11.0_alpha-1861-g09f3d197f78
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjTestGUI Class Reference

Class ilObjTestGUI. More...

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

Public Member Functions

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

Static Public Member Functions

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

Data Fields

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

Protected Member Functions

 redirectAfterMissingWrite ()
 
 redirectAfterMissingRead ()
 
 forwardCommandToQuestionPreview (string $cmd, ?assQuestionGUI $question_gui=null)
 
 forwardCommandToQuestion (string $cmd)
 
 trackTestObjectReadEvent ()
 
 exportObject ()
 Gateway for exports initiated from workspace, as there is a generic forward to {objTypeMainGUI}::export() More...
 
 fetchAuthoringQuestionIdParameter ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 removeImportFailsObject ()
 
 getTargetQuestionpoolForm ($questionpools, string $cmd)
 
 protectByWritePermission ()
 
 determineObjectiveOrientedContainer ()
 
 getObjectiveOrientedContainer ()
 
 getQuestionsTableQuery ()
 
 getQuestionsTableActions ()
 
 getTable ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 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
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
ilUIService $ui_service
 
HTTPServices $http
 
ilHelpGUI $help
 
GlobalScreen $global_screen
 
ilObjectDataCache $obj_data_cache
 
SkillService $skills_service
 
IRSS $irss
 
RequestDataCollector $testrequest
 
ResponseHandler $response_handler
 
ParticipantRepository $participant_repository
 
ResultsDataFactory $results_data_factory
 
ResultsPresentationFactory $results_presentation_factory
 
TestResultRepository $test_pass_result_repository
 
QuestionsTableQuery $table_query = null
 
QuestionsTableActions $table_actions = null
 
DataFactory $data_factory
 
TaxonomyService $taxonomy
 
bool $create_question_mode
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
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
 
ilObjectCustomIconFactory $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 (string $cmd)
 
 forwardToEvaluationGUI ()
 
 redirectTo_SettingsMainGUI_showForm_Object ()
 
 prepareSubGuiOutput ()
 
 getSelectedPersonalDefaultsSettingsFromForm ()
 
 insertQuestionsObject (?array $selected_array=null)
 
 buildQuestionCreationForm ()
 
 buildInputQuestionType ()
 
 buildInputPosition (array $questions)
 
 buildInputEditingType ()
 
 buildInputPoolSelection ()
 
 addQuestion ()
 
 setupToolBarAndMessage (bool $has_started_test_runs)
 
 populateQuestionBrowserToolbarButtons (ilToolbarGUI $toolbar)
 
 isCommandClassAnyInfoScreenChild ()
 
 infoScreenObject ()
 
 forwardToInfoScreen ()
 
 getTestScreenGUIInstance ()
 

Private Attributes

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

Detailed Description

Class ilObjTestGUI.

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

ilObjTestGUI: ilObjCourseGUI, ilObjectMetaDataGUI, ilCertificateGUI, ilPermissionGUI ilObjTestGUI: ilTestPlayerFixedQuestionSetGUI, ilTestPlayerRandomQuestionSetGUI ilObjTestGUI: ilTestExpresspageObjectGUI, ilAssQuestionPageGUI ilObjTestGUI: ilTestParticipantsGUI, ilTestResultsGUI ilObjTestGUI: ilLearningProgressGUI, ILIAS ilObjTestGUI: ilTestEvaluationGUI ilObjTestGUI: ilAssGenFeedbackPageGUI, ilAssSpecFeedbackPageGUI ilObjTestGUI: ilInfoScreenGUI, ilObjectCopyGUI ilObjTestGUI: ILIAS ilObjTestGUI: ilRepositorySearchGUI, ilTestExportGUI ilObjTestGUI: assMultipleChoiceGUI, assClozeTestGUI, assMatchingQuestionGUI ilObjTestGUI: assOrderingQuestionGUI, assImagemapQuestionGUI, assNumericGUI, assErrorTextGUI ilObjTestGUI: ILIAS, ILIAS ilObjTestGUI: assTextSubsetGUI, assOrderingHorizontalGUI ilObjTestGUI: assSingleChoiceGUI, assFileUploadGUI, assTextQuestionGUI ilObjTestGUI: assKprimChoiceGUI, assLongMenuGUI ilObjTestGUI: ilEditClipboardGUI ilObjTestGUI: ILIAS, ILIAS ilObjTestGUI: ilCommonActionDispatcherGUI ilObjTestGUI: ilTestFixedQuestionSetConfigGUI, ilTestRandomQuestionSetConfigGUI ilObjTestGUI: ilAssQuestionHintsGUI, ilAssQuestionFeedbackEditingGUI, ilLocalUnitConfigurationGUI, assFormulaQuestionGUI ilObjTestGUI: ilTestPassDetailsOverviewTableGUI ilObjTestGUI: ilTestCorrectionsGUI ilObjTestGUI: ilTestSettingsChangeConfirmationGUI ilObjTestGUI: ilTestSkillAdministrationGUI ilObjTestGUI: ilAssQuestionPreviewGUI ilObjTestGUI: ilTestQuestionBrowserTableGUI, ilTestInfoScreenToolbarGUI, ilLTIProviderObjectSettingGUI ilObjTestGUI: ilTestPageGUI

\

Definition at line 109 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 public

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

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

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

2470  {
2471  global $DIC;
2472  $main_tpl = $DIC->ui()->mainTemplate();
2473  $ilAccess = $DIC['ilAccess'];
2474  $ilErr = $DIC['ilErr'];
2475  $lng = $DIC['lng'];
2476 
2477  if ($ilAccess->checkAccess('read', '', (int) $target)
2478  || $ilAccess->checkAccess('visible', '', (int) $target)) {
2479  $DIC->ctrl()->setParameterByClass(self::class, 'ref_id', (int) $target);
2480  $DIC->ctrl()->redirectByClass(
2481  [
2482  ilRepositoryGUI::class,
2483  ilObjTestGUI::class,
2484  TestScreenGUI::class
2485  ],
2486  TestScreenGUI::DEFAULT_CMD
2487  );
2488  } elseif ($ilAccess->checkAccess('read', '', ROOT_FOLDER_ID)) {
2489  $main_tpl->setOnScreenMessage('info', sprintf(
2490  $lng->txt('msg_no_perm_read_item'),
2492  ), true);
2494  }
2495 
2496  $ilErr->raiseError($lng->txt('msg_no_perm_read_lm'), $ilErr->FATAL);
2497  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
const ROOT_FOLDER_ID
Definition: constants.php:32
$ilErr
Definition: raiseError.php:33
static _lookupObjId(int $ref_id)
ilLanguage $lng
static _lookupTitle(int $obj_id)
global $DIC
Definition: shib_login.php:22
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addDefaultsObject()

ilObjTestGUI::addDefaultsObject ( )

Adds the defaults of this test to the defaults.

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

References defaultsObject(), getTestObject(), ILIAS\Repository\lng(), and protectByWritePermission().

2176  : void
2177  {
2178  $this->protectByWritePermission();
2179 
2180  $name = $this->testrequest->strVal('name');
2181  if ($name !== '') {
2182  $this->getTestObject()->addDefaults($name);
2183  } else {
2184  $this->tpl->setOnScreenMessage('info', $this->lng->txt('tst_defaults_enter_name'));
2185  }
2186  $this->defaultsObject();
2187  }
defaultsObject()
Displays the settings page for test defaults.
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjTestGUI::addLocatorItems ( )

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

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

2344  : void
2345  {
2346  switch ($this->ctrl->getCmd()) {
2347  case "run":
2348  case "infoScreen":
2349  case "redirectToInfoScreen":
2350  case "start":
2351  case "resume":
2352  case "previous":
2353  case "next":
2354  case "summary":
2355  case "finishTest":
2356  case "outCorrectSolution":
2357  case "showAnswersOfUser":
2358  case "outUserResultsOverview":
2359  case "backFromSummary":
2360  case "show_answers":
2361  case "setsolved":
2362  case "resetsolved":
2363  case "outTestSummary":
2364  case "outQuestionSummary":
2365  case "gotoQuestion":
2366  case "selectImagemapRegion":
2367  case "confirmSubmitAnswers":
2368  case "finalSubmission":
2369  case "postpone":
2370  case "outUserPassDetails":
2371  case "checkPassword":
2372  $this->locator->addItem(
2373  $this->getTestObject()->getTitle(),
2374  $this->ctrl->getLinkTargetByClass(
2375  [self::class, TestScreenGUI::class],
2376  TestScreenGUI::DEFAULT_CMD
2377  ),
2378  '',
2379  $this->testrequest->getRefId()
2380  );
2381  break;
2382  case "eval_stat":
2383  case "evalAllUsers":
2384  case "evalUserDetail":
2385  $this->locator->addItem(
2386  $this->getTestObject()->getTitle(),
2387  $this->ctrl->getLinkTarget($this, 'eval_stat'),
2388  '',
2389  $this->testrequest->getRefId()
2390  );
2391  break;
2392  case "create":
2393  case "save":
2394  case "cancel":
2395  case "importFile":
2396  case "cloneAll":
2397  case "importVerifiedFile":
2398  case "cancelImport":
2399  break;
2400  default:
2401  $this->locator->addItem(
2402  $this->getTestObject()->getTitle(),
2403  $this->ctrl->getLinkTargetByClass(
2404  [self::class, TestScreenGUI::class],
2405  TestScreenGUI::DEFAULT_CMD
2406  ),
2407  '',
2408  $this->testrequest->getRefId()
2409  );
2410  break;
2411  }
2412  }
+ Here is the call graph for this function:

◆ addPostCreationTasksToQuestionGUI()

ilObjTestGUI::addPostCreationTasksToQuestionGUI ( assQuestionGUI  $question_gui)
private

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

References assQuestionGUI\setCopyToExistingPoolOnSave(), assQuestionGUI\setCopyToNewPoolOnSave(), and assQuestionGUI\setMoveAfterQuestionId().

Referenced by forwardCommandToQuestion().

1151  : assQuestionGUI {
1152  if ($this->testrequest->isset('move_after_question_with_id')) {
1153  $question_gui->setMoveAfterQuestionId(
1154  $this->testrequest->int('move_after_question_with_id')
1155  );
1156  }
1157 
1158  if ($this->testrequest->isset('pool_title')) {
1159  $question_gui->setCopyToNewPoolOnSave(
1160  $this->testrequest->strVal('pool_title')
1161  );
1162  }
1163 
1164  if ($this->testrequest->isset('pool_ref')) {
1165  $question_gui->setCopyToExistingPoolOnSave(
1166  $this->testrequest->int('pool_ref')
1167  );
1168  }
1169  return $question_gui;
1170  }
setCopyToExistingPoolOnSave(?int $pool_ref_id)
setMoveAfterQuestionId(?int $question_id)
setCopyToNewPoolOnSave(?string $pool_title)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addQuestion()

ilObjTestGUI::addQuestion ( )
private

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

References getTestObject(), insertQuestionsObject(), ILIAS\Repository\lng(), and showQuestionsObject().

Referenced by showQuestionsObject().

1885  : void
1886  {
1887  $selected_array = [$this->testrequest->int('add')];
1888  $total = $this->getTestObject()->evalTotalPersons();
1889  if ($total > 0) {
1890  // the test was executed previously
1891  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('test_has_datasets_warning_page_view'));
1892  $this->showQuestionsObject();
1893  return;
1894  }
1895  $this->tpl->setOnScreenMessage('info', $this->lng->txt('tst_insert_questions'));
1896  $this->insertQuestionsObject($selected_array);
1897  }
insertQuestionsObject(?array $selected_array=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addQuestionTitleToObjectTitle()

ilObjTestGUI::addQuestionTitleToObjectTitle ( string  $question_title)
private

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

References ILIAS\Repository\refinery().

Referenced by executeCommand(), forwardCommandToQuestion(), and forwardCommandToQuestionPreview().

1077  : void
1078  {
1079  $this->tpl->setTitle(
1080  $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
1081  "{$this->getTestObject()->getTitle()}: {$question_title}"
1082  )
1083  );
1084  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterSave()

ilObjTestGUI::afterSave ( ilObject  $new_object)

save object public

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

References ILIAS\Repository\ctrl(), ilObjectGUI\getRefId(), ilObject\getRefId(), getSelectedPersonalDefaultsSettingsFromForm(), ILIAS\Repository\lng(), null, and ILIAS\Repository\user().

1455  : void
1456  {
1457  $info = '';
1458  $new_object->saveToDb();
1459 
1460  $test_def_id = $this->getSelectedPersonalDefaultsSettingsFromForm();
1461  if ($test_def_id !== null
1462  && ($defaults = $new_object->getTestDefaults($test_def_id)) !== null) {
1463  $info = $new_object->applyDefaults($defaults);
1464  }
1465 
1466  $new_object->saveToDb();
1467 
1468  if ($new_object->getTestLogger()->isLoggingEnabled()) {
1469  $new_object->getTestLogger()->logTestAdministrationInteraction(
1470  $new_object->getTestLogger()->getInteractionFactory()->buildTestAdministrationInteraction(
1471  $this->getRefId(),
1472  $this->user->getId(),
1473  TestAdministrationInteractionTypes::NEW_TEST_CREATED,
1474  []
1475  )
1476  );
1477  }
1478 
1479  if ($info === '') {
1480  $this->tpl->setOnScreenMessage('success', $this->lng->txt('object_added'), true);
1481  } else {
1482  $this->tpl->setOnScreenMessage('info', $this->lng->txt($info), true);
1483  }
1484  $this->ctrl->setParameter($this, 'ref_id', $new_object->getRefId());
1485  $this->ctrl->redirectByClass(SettingsMainGUI::class);
1486  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getSelectedPersonalDefaultsSettingsFromForm()
+ Here is the call graph for this function:

◆ applyDefaultsObject()

ilObjTestGUI::applyDefaultsObject (   $confirmed = false)

Applies the selected test defaults.

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

References ILIAS\Repository\ctrl(), defaultsObject(), getTestObject(), ILIAS\Repository\lng(), null, protectByWritePermission(), ilObjTest\QUESTION_SET_TYPE_FIXED, and ilObjTest\QUESTION_SET_TYPE_RANDOM.

Referenced by confirmedApplyDefaultsObject().

2084  : void
2085  {
2086  $this->protectByWritePermission();
2087 
2088  $defaults_id = $this->testrequest->retrieveArrayOfIntsFromPost('chb_defaults');
2089  if ($defaults_id === []) {
2090  $this->tpl->setOnScreenMessage('info', $this->lng->txt('tst_defaults_apply_select_one'));
2091  $this->defaultsObject();
2092  return;
2093  }
2094 
2095  // do not apply if user datasets exist
2096  if ($this->getTestObject()->evalTotalPersons() > 0
2097  || ($defaults = $this->getTestObject()->getTestDefaults($defaults_id[0])) === null) {
2098  $this->tpl->setOnScreenMessage('info', $this->lng->txt('tst_defaults_apply_not_possible'));
2099  $this->defaultsObject();
2100  return;
2101  }
2102 
2103  $default_settings = unserialize(
2104  $defaults['defaults'],
2105  ['allowed_classes' => [DateTimeImmutable::class]]
2106  );
2107 
2108  if (isset($default_settings['isRandomTest'])) {
2109  if ($default_settings['isRandomTest']) {
2110  $new_question_set_type = ilObjTest::QUESTION_SET_TYPE_RANDOM;
2111  $this->getTestObject()->setQuestionSetType(ilObjTest::QUESTION_SET_TYPE_RANDOM);
2112  } else {
2113  $new_question_set_type = ilObjTest::QUESTION_SET_TYPE_FIXED;
2114  $this->getTestObject()->setQuestionSetType(ilObjTest::QUESTION_SET_TYPE_FIXED);
2115  }
2116  } elseif (isset($default_settings['questionSetType'])) {
2117  $new_question_set_type = $default_settings['questionSetType'];
2118  }
2119  $old_question_set_type = $this->getTestObject()->getQuestionSetType();
2120  $question_set_type_setting_switched = ($old_question_set_type != $new_question_set_type);
2121 
2122  $old_question_set_config = $this->test_question_set_config_factory->getQuestionSetConfig();
2123 
2124  switch (true) {
2125  case !$question_set_type_setting_switched:
2126  case !$old_question_set_config->doesQuestionSetRelatedDataExist():
2127  case $confirmed:
2128 
2129  break;
2130 
2131  default:
2132 
2133  $confirmation = new ilTestSettingsChangeConfirmationGUI($this->testrequest, $this->getTestObject());
2134 
2135  $confirmation->setFormAction($this->ctrl->getFormAction($this));
2136  $confirmation->setCancel($this->lng->txt('cancel'), 'defaults');
2137  $confirmation->setConfirm($this->lng->txt('confirm'), 'confirmedApplyDefaults');
2138 
2139  $confirmation->setOldQuestionSetType($this->getTestObject()->getQuestionSetType());
2140  $confirmation->setNewQuestionSetType($new_question_set_type);
2141  $confirmation->setQuestionLossInfoEnabled(false);
2142  $confirmation->build();
2143 
2144  $confirmation->populateParametersFromPost();
2145 
2146  $this->tpl->setContent($this->ctrl->getHTML($confirmation));
2147 
2148  return;
2149  }
2150 
2151  if ($question_set_type_setting_switched && !$this->getTestObject()->getOfflineStatus()) {
2152  $this->getTestObject()->setOfflineStatus(true);
2153  $info = $this->lng->txt('tst_set_offline_due_to_switched_question_set_type_setting');
2154  $this->tpl->setOnScreenMessage('info', $info, true);
2155  }
2156 
2157  $info = $this->getTestObject()->applyDefaults($defaults);
2158  if ($info === '') {
2159  $this->tpl->setOnScreenMessage('success', $this->lng->txt('tst_defaults_applied'), true);
2160  } else {
2161  $this->tpl->setOnScreenMessage('info', $this->lng->txt($info), true);
2162  }
2163 
2164 
2165 
2166  if ($question_set_type_setting_switched && $old_question_set_config->doesQuestionSetRelatedDataExist()) {
2167  $old_question_set_config->removeQuestionSetRelatedData();
2168  }
2169 
2170  $this->ctrl->redirect($this, 'defaults');
2171  }
const QUESTION_SET_TYPE_RANDOM
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
defaultsObject()
Displays the settings page for test defaults.
const QUESTION_SET_TYPE_FIXED
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ backToRepositoryObject()

ilObjTestGUI::backToRepositoryObject ( )

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

References $path, ilObjectGUI\getReturnLocation(), getTestObject(), and ilUtil\redirect().

1499  {
1500  $path = $this->tree->getPathFull($this->getTestObject()->getRefID());
1501  ilUtil::redirect($this->getReturnLocation("cancel", "./ilias.php?baseClass=ilRepositoryGUI&cmd=frameset&ref_id=" . $path[count($path) - 2]["child"]));
1502  }
$path
Definition: ltiservices.php:29
static redirect(string $a_script)
getReturnLocation(string $cmd, string $default_location="")
Get return location for command (command is method name without "Object", e.g.
+ Here is the call graph for this function:

◆ buildInputEditingType()

ilObjTestGUI::buildInputEditingType ( )
private

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

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

Referenced by buildQuestionCreationForm().

1780  : Input
1781  {
1782  if (!$this->getTestObject()->getGlobalSettings()->isPageEditorEnabled()) {
1783  return $this->ui_factory->input()->field()->hidden()->withValue(
1785  );
1786  }
1787 
1788  return $this->ui_factory->input()->field()->radio($this->lng->txt('tst_add_quest_cont_edit_mode'))
1789  ->withOption(
1791  $this->lng->txt('tst_add_quest_cont_edit_mode_IPE'),
1792  $this->lng->txt('tst_add_quest_cont_edit_mode_IPE_info')
1793  )->withOption(
1795  $this->lng->txt('tst_add_quest_cont_edit_mode_RTE'),
1796  $this->lng->txt('tst_add_quest_cont_edit_mode_RTE_info')
1797  )
1799  }
const ADDITIONAL_CONTENT_EDITING_MODE_IPE
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
withValue($value)
Get an input like this with another value displayed on the client side.
const ADDITIONAL_CONTENT_EDITING_MODE_RTE
This describes commonalities between all inputs.
Definition: Input.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildInputPoolSelection()

ilObjTestGUI::buildInputPoolSelection ( )
private

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

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

Referenced by buildQuestionCreationForm().

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

◆ buildInputPosition()

ilObjTestGUI::buildInputPosition ( array  $questions)
private

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

References ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\UI\Implementation\Component\Input\ViewControl\withAdditionalTransformation().

Referenced by buildQuestionCreationForm().

1767  : Select
1768  {
1769  $options = [0 => $this->lng->txt('first')];
1770  foreach ($questions as $key => $title) {
1771  $options[$key] = $this->lng->txt('behind') . ' ' . $title
1772  . ' [' . $this->lng->txt('question_id_short') . ': ' . $key . ']';
1773  }
1774  return $this->ui_factory->input()->field()->select(
1775  $this->lng->txt('position'),
1776  $options
1777  )->withAdditionalTransformation($this->refinery->kindlyTo()->int());
1778  }
This describes select field.
Definition: Select.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildInputQuestionType()

ilObjTestGUI::buildInputQuestionType ( )
private

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

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

Referenced by buildQuestionCreationForm().

1753  : Select
1754  {
1755  $question_types = (new ilObjQuestionPool())->getQuestionTypes(false, true, false);
1756  $options = [];
1757  foreach ($question_types as $label => $data) {
1758  $options[$data['question_type_id']] = $label;
1759  }
1760 
1761  return $this->ui_factory->input()->field()->select(
1762  $this->lng->txt('question_type'),
1763  $options
1764  )->withRequired(true);
1765  }
This describes select field.
Definition: Select.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildQuestionCreationForm()

ilObjTestGUI::buildQuestionCreationForm ( )
private

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

References ILIAS\UI\Implementation\Component\Input\$inputs, buildInputEditingType(), buildInputPoolSelection(), buildInputPosition(), buildInputQuestionType(), ILIAS\Repository\ctrl(), getTestObject(), and ILIAS\Repository\lng().

Referenced by createQuestionPool().

1723  : Form
1724  {
1725  $inputs['question_type'] = $this->buildInputQuestionType();
1726  $questions = $this->getTestObject()->getQuestionTitlesAndIndexes();
1727  if ($questions !== []) {
1728  $inputs['position'] = $this->buildInputPosition($questions);
1729  }
1730 
1731  $inputs['editing_type'] = $this->buildInputEditingType();
1732 
1733  if ($inputs['editing_type'] instanceof Radio) {
1734  $sub_screen_id[] = 'editMode';
1735  }
1736 
1737  $sub_screen_id[] = 'poolSelect';
1738 
1739  $inputs['pool_selection'] = $this->buildInputPoolSelection();
1740 
1741  $section = [
1742  $this->ui_factory->input()->field()->section($inputs, $this->lng->txt('ass_create_question'))
1743  ];
1744 
1745  $form = $this->ui_factory->input()->container()->form()->standard(
1746  $this->ctrl->getFormAction($this, 'createQuestion'),
1747  $section
1748  )->withSubmitLabel($this->lng->txt('create'));
1749 
1750  return $form;
1751  }
This describes commonalities between all forms.
Definition: Form.php:32
buildInputPosition(array $questions)
This is what a radio-input looks like.
Definition: Radio.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancelCreateQuestionObject()

ilObjTestGUI::cancelCreateQuestionObject ( )

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

References ILIAS\Repository\ctrl().

Referenced by ilObjTestGUITest\testCancelCreateQuestionObject().

1683  : void
1684  {
1685  $this->ctrl->redirect($this, self::SHOW_QUESTIONS_CMD);
1686  }
+ 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 2421 of file class.ilObjTestGUI.php.

References getTestObject().

2422  {
2423  $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
2424 
2425  $guiFactory = new ilCertificateGUIFactory();
2426  $output_gui = $guiFactory->create($this->getTestObject());
2427 
2428  $output_gui->certificateEditor();
2429  }
+ Here is the call graph for this function:

◆ confirmedApplyDefaultsObject()

ilObjTestGUI::confirmedApplyDefaultsObject ( )

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

References applyDefaultsObject(), and protectByWritePermission().

2074  {
2075  $this->protectByWritePermission();
2076 
2077  $this->applyDefaultsObject(true);
2078  return;
2079  }
applyDefaultsObject($confirmed=false)
Applies the selected test defaults.
+ Here is the call graph for this function:

◆ copyAndLinkQuestionsToPoolObject()

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

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

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

Referenced by createQuestionPoolAndCopyObject().

2537  {
2538 
2539  $ref_id = $ref_id ?? $this->testrequest->int('sel_qpl');
2540  if ($ref_id === null
2541  || $ref_id === 0) {
2542  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("questionpool_not_selected"));
2543  $this->showQuestionsObject();
2544  return;
2545  }
2546 
2547  $qpl_id = $this->obj_data_cache->lookupObjId($ref_id);
2548 
2549 
2550  if ($question_ids === []) {
2551  $question_ids = $this->testrequest->getQuestionIds();
2552  $question_id = $this->testrequest->getQuestionId();
2553  if ($question_ids === [] && $question_id !== 0) {
2554  $question_ids = [$question_id];
2555  }
2556  }
2557 
2558  if ($question_ids === []) {
2559  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("tst_no_question_selected_for_moving_to_qpl"));
2560  $this->ctrl->redirect($this, 'questions');
2561  }
2562 
2563  $result = $this->copyQuestionsToPool($question_ids, $qpl_id);
2564 
2565  foreach ($result->ids as $oldId => $newId) {
2566  $questionInstance = assQuestion::instantiateQuestion($oldId);
2567 
2568  $original_question_id = $questionInstance->getOriginalId();
2569  if ($original_question_id !== null
2570  && $this->test_questions_repository->originalQuestionExists($original_question_id)) {
2571  $oldOriginal = assQuestion::instantiateQuestion($original_question_id);
2572  $oldOriginal->delete($oldOriginal->getId());
2573  }
2574  assQuestion::saveOriginalId($questionInstance->getId(), $newId);
2575  }
2576 
2577  $this->tpl->setOnScreenMessage('success', $this->lng->txt('tst_qst_added_to_pool_' . (count($result->ids) > 1 ? 'p' : 's')), true);
2578  $this->ctrl->redirect($this, self::SHOW_QUESTIONS_CMD);
2579  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static instantiateQuestion(int $question_id)
copyQuestionsToPool(array $question_ids, int $qpl_id)
static saveOriginalId(int $questionId, int $originalId)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyQuestionsToPool()

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

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

References copyQuestionToPool().

Referenced by copyAndLinkQuestionsToPoolObject(), and copyQuestionsToPoolObject().

2509  : stdClass
2510  {
2511  $target_pool = new ilObjQuestionPool($qpl_id, false);
2512  $new_ids = [];
2513  foreach ($question_ids as $q_id) {
2514  $new_id = $this->copyQuestionToPool(assQuestion::instantiateQuestionGUI($q_id), $target_pool);
2515  $new_ids[$q_id] = $new_id;
2516  }
2517 
2518  $result = new stdClass();
2519  $result->ids = $new_ids;
2520  $result->qpoolid = $qpl_id;
2521 
2522  return $result;
2523  }
copyQuestionToPool(assQuestionGUI $source_question_gui, ilObjQuestionPool $target_pool)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyQuestionsToPoolObject()

ilObjTestGUI::copyQuestionsToPoolObject ( )

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

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

2500  {
2501  $this->copyQuestionsToPool($this->testrequest->raw('q_id'), $this->testrequest->raw('sel_qpl'));
2502  $this->ctrl->redirect($this, self::SHOW_QUESTIONS_CMD);
2503  }
copyQuestionsToPool(array $question_ids, int $qpl_id)
+ Here is the call graph for this function:

◆ copyQuestionToPool()

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

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

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

Referenced by copyQuestionsToPool(), and executeAfterQuestionCreationTasks().

2525  : int
2526  {
2527  $new_title = $target_pool->appendCounterToQuestionTitleIfNecessary(
2528  $source_question_gui->getObject()->getTitle()
2529  );
2530 
2531  return $source_question_gui->getObject()->createNewOriginalFromThisDuplicate($target_pool->getId(), $new_title);
2532  }
appendCounterToQuestionTitleIfNecessary(string $title)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyToQuestionpoolObject()

ilObjTestGUI::copyToQuestionpoolObject ( )

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

References createQuestionpoolTargetObject().

2582  {
2583  $this->createQuestionpoolTargetObject('copyQuestionsToPool');
2584  }
createQuestionpoolTargetObject(string $cmd)
Called when a new question should be created from a test Important: $cmd may be overwritten if no que...
+ Here is the call graph for this function:

◆ createQuestionFormObject()

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

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

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

Referenced by createQuestionPool().

1703  : void
1704  {
1705  $this->protectByWritePermission();
1706 
1707  $this->tabs_manager->getQuestionsSubTabs();
1708  $this->tabs_manager->activateSubTab(TabsManager::SUBTAB_ID_QST_LIST_VIEW);
1709 
1710  $sub_screen_id = ['createQuestion'];
1711 
1712  $this->tabs_manager->activateTab(TabsManager::TAB_ID_QUESTIONS);
1713  $this->help->setScreenId('assQuestions');
1714  $this->help->setSubScreenId(implode('_', $sub_screen_id));
1715 
1716  $this->tpl->setContent(
1717  $this->ui_renderer->render(
1718  $form ?? $this->buildQuestionCreationForm()
1719  )
1720  );
1721  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createQuestionPool()

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

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

References ilObjectGUI\$data, assQuestionGUI\_getQuestionGUI(), buildQuestionCreationForm(), createQuestionFormObject(), ILIAS\Repository\ctrl(), assQuestionGUI\EDIT_CONTEXT_AUTHORING, ILIAS\Survey\Mode\getId(), ilObjQuestionPool\getQuestionTypeByTypeId(), ilObjectGUI\getRefId(), getTestObject(), ILIAS\Repository\lng(), null, and protectByWritePermission().

Referenced by createQuestionPoolAndCopyObject(), and executeAfterQuestionCreationTasks().

1620  {
1621  $parent_ref = $this->tree->getParentId($this->getTestObject()->getRefId());
1622  $qpl = new ilObjQuestionPool();
1623  $qpl->setType("qpl");
1624  $qpl->setTitle($name);
1625  $qpl->setDescription($description);
1626  $qpl->create();
1627  $qpl->createReference();
1628  $qpl->putInTree($parent_ref);
1629  $qpl->setPermissions($parent_ref);
1630  $qpl->getObjectProperties()->storePropertyIsOnline($qpl->getObjectProperties()->getPropertyIsOnline()->withOnline()); // must be online to be available
1631  $qpl->saveToDb();
1632  return $qpl;
1633  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createQuestionPoolAndCopyObject()

ilObjTestGUI::createQuestionPoolAndCopyObject ( )

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

References ILIAS\Repository\access(), ilObjectGUI\checkPermissionBool(), copyAndLinkQuestionsToPoolObject(), createQuestionPool(), createQuestionpoolTargetObject(), ILIAS\Repository\lng(), and redirectAfterMissingWrite().

2587  {
2588  if (!$this->access->checkAccess('write', '', $this->object->getRefId())
2589  || !$this->checkPermissionBool('create', '', 'qpl')) {
2590  $this->redirectAfterMissingWrite();
2591  }
2592 
2593  if ($this->testrequest->raw('title')) {
2594  $title = $this->testrequest->raw('title');
2595  } else {
2596  $title = $this->testrequest->raw('txt_qpl');
2597  }
2598 
2599  if (!$title) {
2600  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('questionpool_not_entered'));
2601  $this->createQuestionpoolTargetObject('createQuestionPoolAndCopy');
2602  return;
2603  }
2604 
2605  $question_pool = $this->createQuestionPool($title, $this->testrequest->raw('description'));
2606  $_REQUEST['sel_qpl'] = $question_pool->getRefId();
2607 
2609  }
createQuestionpoolTargetObject(string $cmd)
Called when a new question should be created from a test Important: $cmd may be overwritten if no que...
createQuestionPool($name="dummy", $description="")
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
copyAndLinkQuestionsToPoolObject(?int $ref_id=null, array $question_ids=[])
+ 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 2615 of file class.ilObjTestGUI.php.

References getTargetQuestionpoolForm(), getTestObject(), and protectByWritePermission().

Referenced by copyToQuestionpoolObject(), createQuestionPoolAndCopyObject(), and showQuestionsObject().

2615  : void
2616  {
2617  $this->protectByWritePermission();
2618 
2619  $this->tabs_manager->getQuestionsSubTabs();
2620  $this->tabs_manager->activateSubTab(TabsManager::SUBTAB_ID_QST_LIST_VIEW);
2621 
2622  $questionpools = $this->getTestObject()->getAvailableQuestionpools(
2623  false,
2624  false,
2625  false,
2626  true,
2627  false,
2628  'write'
2629  );
2630 
2631  if ($questionpools === []) {
2632  $form = $this->getTargetQuestionpoolForm($questionpools, 'createQuestionPoolAndCopy');
2633  } else {
2634  $form = $this->getTargetQuestionpoolForm($questionpools, $cmd);
2635 
2636  switch ($cmd) {
2637  case 'copyQuestionsToPool':
2638  break;
2639 
2640  case 'copyAndLinkQuestionsToPool':
2641  $hidden = new ilHiddenInputGUI('link');
2642  $hidden->setValue('1');
2643  $form->addItem($hidden);
2644  break;
2645  }
2646  }
2647 
2648  $this->tpl->setContent($form->getHTML());
2649  }
This class represents a hidden form property in a property form.
getTargetQuestionpoolForm($questionpools, string $cmd)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ defaultsObject()

ilObjTestGUI::defaultsObject ( )

Displays the settings page for test defaults.

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

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

Referenced by addDefaultsObject(), applyDefaultsObject(), and deleteDefaultsObject().

2038  {
2039  $this->protectByWritePermission();
2040 
2041  $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
2042 
2043  $this->toolbar->setFormAction($this->ctrl->getFormAction($this, 'addDefaults'));
2044  $this->toolbar->addFormButton($this->lng->txt('add'), 'addDefaults');
2045  $this->toolbar->addInputItem(new ilTextInputGUI($this->lng->txt('tst_defaults_defaults_of_test'), 'name'), true);
2046  $table = new ilTestPersonalDefaultSettingsTableGUI($this, 'defaults');
2047  $defaults = $this->getTestObject()->getAvailableDefaults();
2048  $table->setData($defaults);
2049  $this->tpl->setContent($table->getHTML());
2050  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteDefaultsObject()

ilObjTestGUI::deleteDefaultsObject ( )

Deletes selected test defaults.

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

References defaultsObject(), getTestObject(), ILIAS\Repository\lng(), null, and protectByWritePermission().

2056  {
2057  $this->protectByWritePermission();
2058 
2059  $defaults_ids = $this->testrequest->retrieveArrayOfIntsFromPost('chb_defaults');
2060  if ($defaults_ids !== null && $defaults_ids !== []) {
2061  foreach ($defaults_ids as $test_default_id) {
2062  $this->getTestObject()->deleteDefaults($test_default_id);
2063  }
2064  } else {
2065  $this->tpl->setOnScreenMessage('info', $this->lng->txt('select_one'));
2066  }
2067  $this->defaultsObject();
2068  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
defaultsObject()
Displays the settings page for test defaults.
+ Here is the call graph for this function:

◆ determineObjectiveOrientedContainer()

ilObjTestGUI::determineObjectiveOrientedContainer ( )
protected

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

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

Referenced by executeCommand().

2710  {
2711  if (!ilLOSettings::isObjectiveTest($this->ref_id)) {
2712  return;
2713  }
2714 
2715  $path = $this->tree->getPathFull($this->ref_id);
2716 
2717  while ($parent = array_pop($path)) {
2718  if ($parent['type'] === 'crs') {
2719  $container_ref_id = $parent['ref_id'];
2720  break;
2721  }
2722  }
2723 
2724  $container_obj_id = ilObject2::_lookupObjId($container_ref_id);
2725 
2726  $this->objective_oriented_container->setObjId($container_obj_id);
2727  $this->objective_oriented_container->setRefId($container_ref_id);
2728  }
$path
Definition: ltiservices.php:29
static _lookupObjId(int $ref_id)
static isObjectiveTest(int $a_trst_ref_id)
Check if test ref_id is used in an objective course.
+ 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 1612 of file class.ilObjTestGUI.php.

References exit, and ilPageObject\sendParagraph().

1613  {
1614  $pg_obj = new ilAssQuestionPage($this->testrequest->raw("pg_id"));
1615  $pg_obj->sendParagraph($this->testrequest->raw("par_id"), $this->testrequest->raw("downloadtitle"));
1616  exit;
1617  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
sendParagraph(string $par_id, string $filename)
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ downloadFileObject()

ilObjTestGUI::downloadFileObject ( )

download file

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

References exit.

1593  {
1594  $file = explode("_", $this->testrequest->raw("file_id"));
1595  $fileObj = new ilObjFile((int) $file[count($file) - 1], false);
1596  $fileObj->sendFile();
1597  exit;
1598  }
Class ilObjFile.
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ executeAfterQuestionCreationTasks()

ilObjTestGUI::executeAfterQuestionCreationTasks ( assQuestionGUI  $question_gui)
private

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

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

Referenced by forwardCommandToQuestion().

1185  : void
1186  {
1187  if ($this->getTestObject()->getQuestionSetType() === ilObjTest::QUESTION_SET_TYPE_FIXED
1188  && !in_array($question_gui->getObject()->getId(), $this->getTestObject()->getQuestions())) {
1189  $this->getTestObject()->insertQuestion($question_gui->getObject()->getId(), true);
1190  }
1191 
1192  if ($question_gui->getMoveAfterQuestionId() !== null) {
1193  $this->getTestObject()->moveQuestions(
1194  [$question_gui->getObject()->getId()],
1195  $question_gui->getMoveAfterQuestionId() === 0
1196  ? $this->getTestObject()->getQuestions()[1]
1197  : $question_gui->getMoveAfterQuestionId(),
1198  $question_gui->getMoveAfterQuestionId() === 0 ? 0 : 1
1199  );
1200  $question_gui->setMoveAfterQuestionId(null);
1201  }
1202 
1203  if ($question_gui->getCopyToExistingPoolOnSave() !== null) {
1204  $original_id = $this->copyQuestionToPool(
1205  $question_gui,
1206  new ilObjQuestionPool($question_gui->getCopyToExistingPoolOnSave())
1207  );
1208  assQuestion::saveOriginalId($question_gui->getObject()->getId(), $original_id);
1209  $question_gui->setCopyToExistingPoolOnSave(null);
1210  }
1211 
1212  if ($question_gui->getCopyToNewPoolOnSave() !== null) {
1213  $question_pool = $this->createQuestionPool($question_gui->getCopyToNewPoolOnSave());
1214  $original_id = $this->copyQuestionToPool(
1215  $question_gui,
1216  $question_pool
1217  );
1218  assQuestion::saveOriginalId($question_gui->getObject()->getId(), $original_id);
1219  $question_gui->setCopyToNewPoolOnSave(null);
1220  }
1221  }
setCopyToExistingPoolOnSave(?int $pool_ref_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
createQuestionPool($name="dummy", $description="")
static saveOriginalId(int $questionId, int $originalId)
copyQuestionToPool(assQuestionGUI $source_question_gui, ilObjQuestionPool $target_pool)
setMoveAfterQuestionId(?int $question_id)
setCopyToNewPoolOnSave(?string $pool_title)
const QUESTION_SET_TYPE_FIXED
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeAfterQuestionSaveTasks()

ilObjTestGUI::executeAfterQuestionSaveTasks ( assQuestionGUI  $question_gui)
private

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

References assQuestionGUI\getObject(), ilObjectGUI\getRefId(), and getTestObject().

Referenced by forwardCommandToQuestion().

1172  : void
1173  {
1174  if ($this->getTestObject()->getTestLogger()->isLoggingEnabled()) {
1175  $this->getTestObject()->getTestLogger()->logQuestionAdministrationInteraction(
1176  $question_gui->getObject()->toQuestionAdministrationInteraction(
1177  $this->getTestObject()->getTestLogger()->getAdditionalInformationGenerator(),
1178  $this->getTestObject()->getRefId(),
1179  TestQuestionAdministrationInteractionTypes::QUESTION_MODIFIED
1180  )
1181  );
1182  }
1183  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjTestGUI::executeCommand ( )

execute command

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

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

References ilObjectGUI\$access, $component_factory, ilObjectGUI\$ctrl, $data_factory, $db, $export_factory, ilObjectGUI\$lng, $participant_repository, ilObjectGUI\$refinery, $response_handler, $results_data_factory, $results_presentation_factory, $tabs_manager, $test_access, $test_pass_result_repository, $testrequest, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, $ui_factory, $ui_renderer, $ui_service, assQuestionGUI\_getQuestionGUI(), ILIAS\Repository\access(), ilObjectGUI\addHeaderAction(), addQuestionTitleToObjectTitle(), ilObjectGUI\checkPermissionBool(), ilAssQuestionPreviewGUI\CMD_SHOW, ILIAS\Repository\ctrl(), determineObjectiveOrientedContainer(), fetchAuthoringQuestionIdParameter(), forwardCommandToQuestion(), forwardCommandToQuestionPreview(), forwardToEvaluationGUI(), forwardToInfoScreen(), ilObjectGUI\getCreationMode(), ILIAS\Survey\Mode\getId(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ilObjectGUI\getObject(), getObjectiveOrientedContainer(), ilObjectGUI\getRefId(), getTestAccess(), getTestObject(), getTestScreenGUIInstance(), ILIAS\Repository\help(), ILIAS\FileDelivery\http(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, ILIAS\Repository\object(), prepareOutput(), prepareSubGuiOutput(), protectByWritePermission(), redirectAfterMissingRead(), redirectAfterMissingWrite(), ILIAS\Repository\settings(), showEditTestPageGUI(), trackTestObjectReadEvent(), and ILIAS\Repository\user().

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

◆ exportLegacyLogsObject()

ilObjTestGUI::exportLegacyLogsObject ( )

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

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

2006  : void
2007  {
2008  $this->protectByWritePermission();
2009 
2010  $csv_output = $this->getTestObject()->getTestLogViewer()->getLegacyLogExportForObjId($this->getTestObject()->getId());
2011 
2013  $csv_output,
2014  "legacy_logs_for_{$this->getTestObject()->getRefId()}.csv"
2015  );
2016  }
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
+ 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 1259 of file class.ilObjTestGUI.php.

References ILIAS\Repository\ctrl().

1260  {
1261  $this->ctrl->redirectByClass('ilTestExportGUI');
1262  }
+ Here is the call graph for this function:

◆ fetchAuthoringQuestionIdParameter()

ilObjTestGUI::fetchAuthoringQuestionIdParameter ( )
protected
Returns
int
Exceptions
ilTestException

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

References getTestObject().

Referenced by executeCommand(), forwardCommandToQuestion(), and forwardCommandToQuestionPreview().

1268  : int
1269  {
1270  $qid = $this->testrequest->int('q_id');
1271 
1272  if ($qid === 0 || $this->getTestObject()->checkQuestionParent($qid)) {
1273  return $qid;
1274  }
1275 
1276  throw new ilTestException('question id does not relate to parent object!');
1277  }
Base Exception for all Exceptions relating to Modules/Test.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ forwardCommandToQuestion()

ilObjTestGUI::forwardCommandToQuestion ( string  $cmd)
protected

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

References Vendor\Package\$e, assQuestionGUI\_getQuestionGUI(), addPostCreationTasksToQuestionGUI(), addQuestionTitleToObjectTitle(), ILIAS\Repository\ctrl(), assQuestionGUI\EDIT_CONTEXT_AUTHORING, executeAfterQuestionCreationTasks(), executeAfterQuestionSaveTasks(), fetchAuthoringQuestionIdParameter(), ILIAS\Survey\Mode\getId(), getTestObject(), ILIAS\Repository\lng(), prepareOutput(), showNextViewAfterQuestionSave(), showQuestionsObject(), and ilUtil\stripSlashes().

Referenced by executeCommand().

1086  : void
1087  {
1088  $this->create_question_mode = true;
1089  $this->prepareOutput();
1090 
1091  try {
1092  $qid = $this->fetchAuthoringQuestionIdParameter();
1093 
1094  $this->ctrl->setReturnByClass(self::class, self::SHOW_QUESTIONS_CMD);
1095 
1096  $question_gui = assQuestionGUI::_getQuestionGUI(
1097  ilUtil::stripSlashes($this->testrequest->strVal('question_type')),
1098  $qid
1099  );
1100 
1101  $question_gui->setEditContext(assQuestionGUI::EDIT_CONTEXT_AUTHORING);
1102  $question = $question_gui->getObject();
1103  $question->setObjId($this->getTestObject()->getId());
1104  $question_gui->setObject($question);
1105  $question_gui->setContextAllowsSyncToPool(true);
1106  $question_gui->setQuestionTabs();
1107 
1108  $this->addQuestionTitleToObjectTitle($question->getTitleForHTMLOutput());
1109 
1110  $target = strpos($cmd, 'Return') === false ? 'stay' : 'return';
1111 
1112  if (in_array($cmd, ['syncQuestion', 'syncQuestionReturn'])) {
1113  $question_gui->syncQuestion();
1114  $this->showNextViewAfterQuestionSave($question_gui, $target);
1115  return;
1116  }
1117 
1118  if ($question_gui->isSaveCommand()
1119  || $question_gui->cmdNeedsExistingQuestion($cmd)) {
1120  $question_gui = $this->addPostCreationTasksToQuestionGUI($question_gui);
1121  }
1122 
1123  if ($qid === 0 && $question_gui->cmdNeedsExistingQuestion($cmd)) {
1124  $question_gui->getObject()->createNewQuestion();
1125  $question_gui->setQuestionTabs();
1126  $this->executeAfterQuestionCreationTasks($question_gui);
1127  }
1128 
1129  if (!$question_gui->isSaveCommand()) {
1130  $this->ctrl->forwardCommand($question_gui);
1131  return;
1132  }
1133 
1134  if (!$question_gui->saveQuestion()) {
1135  return;
1136  }
1137 
1138  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
1139  if ($qid === 0) {
1140  $this->executeAfterQuestionCreationTasks($question_gui);
1141  }
1142  $this->executeAfterQuestionSaveTasks($question_gui);
1143  $this->showNextViewAfterQuestionSave($question_gui, $target);
1144  } catch (ilTestException $e) {
1145  $this->showQuestionsObject();
1146  }
1147  }
showNextViewAfterQuestionSave(assQuestionGUI $question_gui, string $target)
addPostCreationTasksToQuestionGUI(assQuestionGUI $question_gui)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
executeAfterQuestionSaveTasks(assQuestionGUI $question_gui)
static _getQuestionGUI(string $question_type='', int $question_id=-1)
Creates a question gui representation and returns the alias to the question gui.
Base Exception for all Exceptions relating to Modules/Test.
executeAfterQuestionCreationTasks(assQuestionGUI $question_gui)
addQuestionTitleToObjectTitle(string $question_title)
prepareOutput(bool $show_subobjects=true)
+ 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 1007 of file class.ilObjTestGUI.php.

References $global_screen, $http, ilObjectGUI\$ref_id, ilObjectGUI\$refinery, addQuestionTitleToObjectTitle(), ILIAS\Repository\ctrl(), fetchAuthoringQuestionIdParameter(), ILIAS\Survey\Mode\getId(), ilObjectGUI\getRefId(), getTestObject(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ilAssQuestionPreviewGUI\setInfoMessage(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

Referenced by executeCommand(), and showNextViewAfterQuestionSave().

1010  : void {
1011  $nr_of_participants_with_results = $this->getTestObject()->evalTotalPersons();
1012 
1013  $this->ctrl->saveParameterByClass(self::class, 'q_id');
1014  $gui = new ilAssQuestionPreviewGUI(
1015  $this->ctrl,
1016  $this->rbac_system,
1017  $this->tabs_gui,
1018  $this->toolbar,
1019  $this->tpl,
1020  $this->ui_factory,
1021  $this->lng,
1022  $this->db,
1023  $this->refinery->random(),
1025  $this->http,
1028  );
1029 
1030  if ($this->getTestObject()->isRandomTest() && $nr_of_participants_with_results === 0) {
1031  $gui->setInfoMessage($this->lng->txt('question_is_part_of_running_test'));
1032  }
1033 
1034  if ($nr_of_participants_with_results > 0) {
1035  $gui->addAdditionalCmd(
1036  $this->lng->txt('tst_corrections_qst_form'),
1037  $this->ctrl->getLinkTargetByClass(ilTestCorrectionsGUI::class, 'showQuestion')
1038  );
1039  }
1040 
1041  $question_gui ??= assQuestion::instantiateQuestionGUI($this->fetchAuthoringQuestionIdParameter());
1042 
1043  $this->addQuestionTitleToObjectTitle($question_gui->getObject()->getTitleForHTMLOutput());
1044 
1045  if (!$this->getTestObject()->isRandomTest() && $nr_of_participants_with_results === 0) {
1046  $gui->setPrimaryCmd(
1047  $this->lng->txt('edit_question'),
1048  $this->ctrl->getLinkTargetByClass(
1049  get_class($question_gui),
1050  'editQuestion'
1051  )
1052  );
1053  $gui->addAdditionalCmd(
1054  $this->lng->txt('edit_page'),
1055  $this->ctrl->getLinkTargetByClass(
1056  ilAssQuestionPageGUI::class,
1057  'edit'
1058  )
1059  );
1060  }
1061 
1062  $gui->initQuestion($question_gui, $this->getTestObject()->getId());
1063  $gui->initPreviewSettings($this->getTestObject()->getRefId());
1064  $gui->initPreviewSession($this->user->getId(), $this->testrequest->getQuestionId());
1065  $gui->initHintTracking();
1066  $gui->initStyleSheets();
1067 
1068  $this->ctrl->clearParameterByClass(self::class, 'q_id');
1069  $this->tabs_gui->setBackTarget(
1070  $this->lng->txt('backtocallingtest'),
1071  $this->ctrl->getLinkTargetByClass(self::class, self::SHOW_QUESTIONS_CMD)
1072  );
1073  $this->ctrl->saveParameterByClass(self::class, 'q_id');
1074  $gui->{$cmd . 'Cmd'}();
1075  }
Refinery $refinery
HTTPServices $http
addQuestionTitleToObjectTitle(string $question_title)
GlobalScreen $global_screen
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ forwardToEvaluationGUI()

ilObjTestGUI::forwardToEvaluationGUI ( )
private

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

References ilObjectGUI\addHeaderAction(), ILIAS\Repository\ctrl(), getObjectiveOrientedContainer(), getTestAccess(), getTestObject(), and prepareOutput().

Referenced by executeCommand().

1339  {
1340  $this->prepareOutput();
1341  $this->addHeaderAction();
1342  $gui = new ilTestEvaluationGUI($this->getTestObject());
1343  $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
1344  $gui->setTestAccess($this->getTestAccess());
1345 
1346  $this->ctrl->forwardCommand($gui);
1347  }
Output class for assessment test evaluation.
prepareOutput(bool $show_subobjects=true)
addHeaderAction()
Add header action menu.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ forwardToInfoScreen()

ilObjTestGUI::forwardToInfoScreen ( )
private

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

References ilObjectGUI\$access, ilObjectGUI\$ctrl, $db, ilObjectGUI\$lng, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, $ui_factory, $ui_renderer, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilDatePresentation\formatDate(), ILIAS\Survey\Mode\getId(), getTestObject(), ILIAS\GlobalScreen\Scope\Footer\Factory\getTitle(), IL_CAL_UNIX, isCommandClassAnyInfoScreenChild(), null, redirectAfterMissingRead(), ILIAS\Repository\refinery(), ilObjTest\SCORE_BEST_PASS, ilToolbarGUI\setCloseFormTag(), trackTestObjectReadEvent(), and ILIAS\Repository\user().

Referenced by executeCommand().

2205  : void
2206  {
2207  if (!$this->access->checkAccess('visible', '', $this->ref_id)
2208  && !$this->access->checkAccess('read', '', $this->ref_id)) {
2209  $this->redirectAfterMissingRead();
2210  }
2211 
2212  if ($this->getTestObject()->getMainSettings()->getAdditionalSettings()->getHideInfoTab()) {
2213  $this->ctrl->redirectByClass([self::class, TestScreenGUI::class], TestScreenGUI::DEFAULT_CMD);
2214  }
2215 
2216  $this->tabs_manager->activateTab(TabsManager::TAB_ID_INFOSCREEN);
2217 
2218  if ($this->access->checkAccess('read', '', $this->ref_id)) {
2219  $this->trackTestObjectReadEvent();
2220  }
2221  $info = new ilInfoScreenGUI($this);
2222 
2223  if ($this->isCommandClassAnyInfoScreenChild()) {
2224  $this->ctrl->forwardCommand($info);
2225  }
2226 
2228  $this->getTestObject(),
2229  $this->test_player_factory->getPlayerGUI(),
2230  $this->test_question_set_config_factory->getQuestionSetConfig(),
2231  $this->test_session_factory->getSession(),
2232  $this->db,
2233  $this->access,
2234  $this->ctrl,
2235  $this->lng,
2238  $this->tpl,
2240  );
2241 
2242  $toolbar->setCloseFormTag(false);
2243 
2244  $toolbar->setSessionLockString('');
2245  $toolbar->build();
2246  $toolbar->sendMessages();
2247 
2248  $info->enablePrivateNotes();
2249 
2250  $info->addSection($this->lng->txt('tst_general_properties'));
2251  $info->addProperty(
2252  $this->lng->txt('author'),
2253  $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
2254  $this->getTestObject()->getAuthor()
2255  )
2256  );
2257  $info->addProperty(
2258  $this->lng->txt('title'),
2259  $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
2260  $this->getTestObject()->getTitle()
2261  )
2262  );
2263 
2264  if ($this->type !== 'tst') {
2265  $info->hideFurtherSections(false);
2266  }
2267 
2268  $info->addSection($this->lng->txt('tst_sequence_properties'));
2269  $info->addProperty(
2270  $this->lng->txt('tst_sequence'),
2271  $this->lng->txt(
2272  $this->getTestObject()->getMainSettings()->getParticipantFunctionalitySettings()->getPostponedQuestionsMoveToEnd()
2273  ? 'tst_sequence_postpone' : 'tst_sequence_fixed'
2274  )
2275  );
2276 
2277  $info->addSection($this->lng->txt('tst_heading_scoring'));
2278  $info->addProperty(
2279  $this->lng->txt('tst_text_count_system'),
2280  $this->lng->txt(
2281  ($this->getTestObject()->getCountSystem() == SettingsScoring::COUNT_PARTIAL_SOLUTIONS) ? 'tst_count_partial_solutions' : 'tst_count_correct_solutions'
2282  )
2283  );
2284  if ($this->getTestObject()->isRandomTest()) {
2285  $info->addProperty($this->lng->txt('tst_pass_scoring'), $this->lng->txt(($this->getTestObject()->getPassScoring() == ilObjTest::SCORE_BEST_PASS) ? 'tst_pass_best_pass' : 'tst_pass_last_pass'));
2286  }
2287 
2288  $info->addSection($this->lng->txt('tst_score_reporting'));
2289  $info->addProperty(
2290  $this->lng->txt('tst_score_reporting'),
2291  $this->getTestObject()->getScoreSettings()->getResultSummarySettings()
2292  ->getScoreReporting()->getTranslatedValue($this->lng)
2293  );
2294  $reporting_date = $this->getTestObject()
2295  ->getScoreSettings()
2296  ->getResultSummarySettings()
2297  ->getReportingDate();
2298  if ($reporting_date !== null) {
2299  $info->addProperty(
2300  $this->lng->txt('tst_score_reporting_date'),
2301  $reporting_date
2302  ->setTimezone(new DateTimeZone($this->user->getTimeZone()))
2303  ->format($this->user->getDateTimeFormat()->toString())
2304  );
2305  }
2306 
2307  $info->addSection($this->lng->txt('tst_session_settings'));
2308  $info->addProperty($this->lng->txt('tst_nr_of_tries'), $this->getTestObject()->getNrOfTries() === 0 ? $this->lng->txt('unlimited') : (string) $this->getTestObject()->getNrOfTries());
2309  if ($this->getTestObject()->getNrOfTries() != 1) {
2310  $info->addProperty(
2311  $this->lng->txt('tst_nr_of_tries_of_user'),
2312  ($this->test_session_factory->getSession()->getPass() === 0) ?
2313  $this->lng->txt('tst_no_tries') : (string) $this->test_session_factory->getSession()->getPass()
2314  );
2315  }
2316 
2317  if ($this->getTestObject()->getEnableProcessingTime()) {
2318  $info->addProperty($this->lng->txt('tst_processing_time'), $this->getTestObject()->getProcessingTime());
2319  }
2320 
2321  $starting_time = $this->getTestObject()->getStartingTime();
2322  if ($this->getTestObject()->isStartingTimeEnabled() && $starting_time !== 0) {
2323  $info->addProperty($this->lng->txt('tst_starting_time'), ilDatePresentation::formatDate(new ilDateTime($starting_time, IL_CAL_UNIX)));
2324  }
2325  $ending_time = $this->getTestObject()->getEndingTime();
2326  if ($this->getTestObject()->isEndingTimeEnabled() && $ending_time != 0) {
2327  $info->addProperty($this->lng->txt('tst_ending_time'), ilDatePresentation::formatDate(new ilDateTime($ending_time, IL_CAL_UNIX)));
2328  }
2329  $info->addMetaDataSections($this->getTestObject()->getId(), 0, $this->getTestObject()->getType());
2330 
2331  $this->ctrl->forwardCommand($info);
2332  }
setCloseFormTag(bool $a_val)
ilDBInterface $db
const IL_CAL_UNIX
UIRenderer $ui_renderer
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
ilLanguage $lng
ilGlobalTemplateInterface $tpl
ilToolbarGUI $toolbar
ilAccessHandler $access
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
const SCORE_BEST_PASS
+ 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 1603 of file class.ilObjTestGUI.php.

References ilPageObjectGUI\showMediaFullscreen().

1604  {
1605  $page_gui = new ilAssQuestionPageGUI($this->testrequest->raw("pg_id"));
1606  $page_gui->showMediaFullscreen();
1607  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
showMediaFullscreen(int $a_style_id=0)
show fullscreen view of media object
+ Here is the call graph for this function:

◆ getObjectiveOrientedContainer()

ilObjTestGUI::getObjectiveOrientedContainer ( )
protected

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

References $objective_oriented_container.

Referenced by executeCommand(), forwardToEvaluationGUI(), and getTabs().

+ Here is the caller graph for this function:

◆ getQuestionsTableActions()

ilObjTestGUI::getQuestionsTableActions ( )
protected

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

References $table_actions, ILIAS\Repository\ctrl(), getQuestionsTableQuery(), getTestObject(), ILIAS\Repository\lng(), null, ILIAS\Repository\refinery(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

Referenced by getTable(), and showQuestionsObject().

2771  {
2772  if ($this->table_actions === null) {
2773  $this->table_actions = new QuestionsTableActions(
2774  $this->ui_factory,
2775  $this->ui_renderer,
2776  $this->tpl,
2777  $this->request,
2778  $this->getQuestionsTableQuery(),
2779  $this->lng,
2780  $this->ctrl,
2781  $this->test_questions_repository,
2782  new QuestionPrinter(
2783  $this->ui_factory,
2784  $this->tpl,
2785  $this->tabs_manager,
2786  $this->toolbar,
2787  $this->refinery,
2788  $this->lng,
2789  $this->ctrl,
2790  $this->user,
2792  $this->getTestObject()
2793  ),
2794  $this->object,
2795  $this->getTestObject()->getGlobalSettings()->isAdjustingQuestionsWithResultsAllowed(),
2796  $this->getTestObject()->evalTotalPersons() !== 0,
2797  $this->getTestObject()->isRandomTest(),
2798  $this->test_question_set_config_factory
2799  );
2800  }
2801  return $this->table_actions;
2802  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
QuestionsTableActions $table_actions
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getQuestionsTableQuery()

ilObjTestGUI::getQuestionsTableQuery ( )
protected

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

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

Referenced by getQuestionsTableActions(), getTargetQuestionpoolForm(), and showQuestionsObject().

2757  {
2758  if ($this->table_query === null) {
2759  $id = $this->object ? $this->object->getId() : '';
2760  $this->table_query = new QuestionsTableQuery(
2761  $this->http,
2762  $this->refinery,
2763  $this->data_factory,
2764  ['qlist', $id]
2765  );
2766  }
2767  return $this->table_query;
2768  }
QuestionsTableQuery $table_query
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectedPersonalDefaultsSettingsFromForm()

ilObjTestGUI::getSelectedPersonalDefaultsSettingsFromForm ( )
private

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

References ilObjectGUI\$data, ilObjectGUI\initCreateForm(), null, and ilObjectGUI\parseDidacticTemplateVar().

Referenced by afterSave().

1488  : ?int
1489  {
1490  $data = $this->initCreateForm($this->type)
1491  ->withRequest($this->request)
1492  ->getData();
1493  return isset($data['didactic_templates'])
1494  ? $this->parseDidacticTemplateVar($data['didactic_templates'], 'tstdef')
1495  : null;
1496  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
initCreateForm(string $new_type)
parseDidacticTemplateVar(string $var, string $type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTable()

ilObjTestGUI::getTable ( )
protected

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

References ilObjectGUI\$lng, ilObjectGUI\$object, $test_questions_repository, $title_builder, getQuestionsTableActions(), ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by showQuestionsObject().

2804  : QuestionsTable
2805  {
2806  return new QuestionsTable(
2807  $this->ui_factory,
2808  $this->refinery,
2809  $this->http->request(),
2810  $this->getQuestionsTableActions(),
2811  $this->lng,
2812  $this->object,
2815  );
2816  }
TestQuestionsRepository $test_questions_repository
TitleColumnsBuilder $title_builder
ilLanguage $lng
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTabs()

ilObjTestGUI::getTabs ( )

adds tabs to tab gui object

Parameters
ilTabsGUI$tabs_gui

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

References $DIC, getObjectiveOrientedContainer(), ilObjectGUI\getRefId(), ILIAS\Repository\help(), ILIAS\Repository\lng(), and null.

2436  : void
2437  {
2438  $this->help->setScreenIdComponent("tst");
2439 
2440  if ($this->tabs_manager === null) {
2441  return;
2442  }
2443 
2444  if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
2445  $courseLink = ilLink::_getLink($this->getObjectiveOrientedContainer()->getRefId());
2446  $this->tabs_manager->setParentBackLabel($this->lng->txt('back_to_objective_container'));
2447  $this->tabs_manager->setParentBackHref($courseLink);
2448  }
2449 
2450  $this->tabs_manager->perform();
2451  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getTargetQuestionpoolForm()

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

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

References ilObjectGUI\$id, $table_query, ILIAS\Repository\ctrl(), getQuestionsTableQuery(), ILIAS\Test\Questions\Presentation\QuestionsTableQuery\getRowIds(), ILIAS\Test\Questions\Presentation\QuestionsTableQuery\getTableAction(), ILIAS\Repository\lng(), null, ilFormPropertyGUI\setRequired(), and ilFormPropertyGUI\setTitle().

Referenced by createQuestionpoolTargetObject().

2652  {
2653  $form = new ilPropertyFormGUI();
2654  $form->setFormAction($this->ctrl->getFormAction($this));
2655  $form->addCommandButton($cmd, $this->lng->txt('submit'));
2656  $form->addCommandButton('cancelCreateQuestion', $this->lng->txt('cancel'));
2657 
2658  if (count($questionpools) == 0) {
2659  $form->setTitle($this->lng->txt("tst_enter_questionpool"));
2660 
2661  $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
2662  $title->setRequired(true);
2663  $form->addItem($title);
2664 
2665  $description = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
2666  $form->addItem($description);
2667  } else {
2668  $form->setTitle($this->lng->txt("tst_select_questionpool"));
2669 
2670  $selectOptions = [
2671  '' => $this->lng->txt('please_select')
2672  ];
2673 
2674  foreach ($questionpools as $key => $value) {
2675  $selectOptions[$key] = $value["title"];
2676  }
2677 
2678  $select = new ilSelectInputGUI($this->lng->txt('tst_source_question_pool'), 'sel_qpl');
2679  $select->setRequired(true);
2680  $select->setOptions($selectOptions);
2681 
2682  $form->addItem($select);
2683  }
2684 
2686  if ($table_query->getTableAction() !== null) {
2687  $question_ids = $table_query->getRowIds($this->object);
2688  } elseif ($this->testrequest->isset('q_id') && is_array($this->testrequest->raw('q_id'))) {
2689  $question_ids = $this->testrequest->raw('q_id');
2690  }
2691 
2692  foreach ($question_ids as $id) {
2693  $hidden = new ilHiddenInputGUI('q_id[]');
2694  $hidden->setValue((string) $id);
2695  $form->addItem($hidden);
2696  }
2697 
2698  return $form;
2699  }
QuestionsTableQuery $table_query
This class represents a selection list property in a property form.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This class represents a hidden form property in a property form.
setRequired(bool $a_required)
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTestAccess()

ilObjTestGUI::getTestAccess ( )

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

References $test_access.

Referenced by executeCommand(), and forwardToEvaluationGUI().

1328  : ilTestAccess
1329  {
1330  return $this->test_access;
1331  }
ilTestAccess $test_access
+ Here is the caller graph for this function:

◆ getTestObject()

◆ getTestScreenGUIInstance()

ilObjTestGUI::getTestScreenGUIInstance ( )
private

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

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

Referenced by executeCommand().

2735  : TestScreenGUI
2736  {
2737  return new TestScreenGUI(
2738  $this->getTestObject(),
2739  $this->user,
2740  $this->ui_factory,
2741  $this->ui_renderer,
2742  $this->lng,
2743  $this->refinery,
2744  $this->ctrl,
2745  $this->tpl,
2746  $this->content_style,
2747  $this->http,
2748  $this->tabs_manager,
2749  $this->access,
2750  $this->test_access,
2751  $this->db,
2752  $this->rbac_system
2753  );
2754  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ historyObject()

ilObjTestGUI::historyObject ( )

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

References ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilObjectGUI\getRefId(), getTestObject(), ILIAS\Repository\lng(), redirectAfterMissingWrite(), SYSTEM_ROLE_ID, and ILIAS\Repository\toolbar().

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

◆ importFile()

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

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

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

1366  : void
1367  {
1368  list($subdir, $importdir, $xmlfile, $qtifile) = $this->buildImportDirectoriesFromImportFile($file_to_import);
1369 
1371  ->withZipOutputPath($this->getImportTempDirectory());
1372 
1373  $unzip = $this->archives->unzip(Streams::ofResource(fopen($file_to_import, 'r')), $options);
1374  $unzip->extract();
1375 
1376  if (!is_file($qtifile)) {
1377  ilFileUtils::delDir($importdir);
1378  $this->deleteUploadedImportFile($path_to_uploaded_file_in_temp_dir);
1379  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('tst_import_non_ilias_zip'), true);
1380  }
1381  $qtiParser = new ilQTIParser($importdir, $qtifile, ilQTIParser::IL_MO_VERIFY_QTI, 0, []);
1382  $qtiParser->startParsing();
1383  $founditems = $qtiParser->getFoundItems();
1384 
1385  $complete = 0;
1386  $incomplete = 0;
1387  foreach ($founditems as $item) {
1388  if ($item["type"] !== '') {
1389  $complete++;
1390  } else {
1391  $incomplete++;
1392  }
1393  }
1394 
1395  if (count($founditems) && $complete == 0) {
1396  ilFileUtils::delDir($importdir);
1397  $this->deleteUploadedImportFile($path_to_uploaded_file_in_temp_dir);
1398  $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_import_non_ilias_files'));
1399  return;
1400  }
1401 
1402  ilSession::set('path_to_import_file', $file_to_import);
1403  ilSession::set('path_to_uploaded_file_in_temp_dir', $path_to_uploaded_file_in_temp_dir);
1404 
1405  if ($qtiParser->getQuestionSetType() !== ilObjTest::QUESTION_SET_TYPE_FIXED
1406  || file_exists($this->buildResultsFilePath($importdir, $subdir))) {
1407  $this->importVerifiedFileObject(true);
1408  return;
1409  }
1410 
1411  $form = $this->buildImportQuestionsSelectionForm(
1412  'importVerifiedFile',
1413  $importdir,
1414  $qtifile,
1415  $file_to_import,
1416  $path_to_uploaded_file_in_temp_dir
1417  );
1418 
1419  if ($form === null) {
1420  return;
1421  }
1422 
1423  $panel = $this->ui_factory->panel()->standard(
1424  $this->lng->txt('import_tst'),
1425  [
1426  $this->ui_factory->legacy()->content($this->lng->txt('qpl_import_verify_found_questions')),
1427  $form
1428  ]
1429  );
1430  $this->tpl->setContent($this->ui_renderer->render($panel));
1431  $this->tpl->printToStdout();
1432  exit;
1433  }
buildImportQuestionsSelectionForm(string $form_cmd, string $importdir, string $qtifile, ?string $path_to_uploaded_file_in_temp_dir=null)
importVerifiedFileObject(bool $skip_retrieve_selected_questions=false)
imports question(s) into the questionpool (after verification)
buildResultsFilePath(string $importdir, string $subdir)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
deleteUploadedImportFile(string $path_to_uploaded_file_in_temp_dir)
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
const QUESTION_SET_TYPE_FIXED
array buildImportDirectoriesFromImportFile(string $file_to_import)
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ importVerifiedFileObject()

ilObjTestGUI::importVerifiedFileObject ( bool  $skip_retrieve_selected_questions = false)

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

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

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

References ILIAS\TestQuestionPool\Import\buildImportDirectoriesFromImportFile(), ilObjectGUI\checkPermissionBool(), ilSession\clear(), ILIAS\Repository\ctrl(), ilFileUtils\delDir(), ilObjectGUI\deleteUploadedImportFile(), ilSession\get(), ilImport\getMapping(), IL_INST_ID, ilImport\importObject(), ILIAS\Repository\lng(), redirectAfterMissingWrite(), ILIAS\TestQuestionPool\Import\retrieveSelectedQuestionsFromImportQuestionsSelectionForm(), ilSession\set(), and ILIAS\Repository\user().

Referenced by importFile().

1514  : void {
1515  if (!$this->checkPermissionBool('create', '', $this->testrequest->strVal('new_type'))) {
1516  $this->redirectAfterMissingWrite();
1517  }
1518  $file_to_import = ilSession::get('path_to_import_file');
1519  $path_to_uploaded_file_in_temp_dir = ilSession::get('path_to_uploaded_file_in_temp_dir');
1520  list($subdir, $importdir, $xmlfile, $qtifile) = $this->buildImportDirectoriesFromImportFile($file_to_import);
1521 
1522  $new_obj = new ilObjTest(0, true);
1523  $new_obj->setTitle('dummy');
1524  $new_obj->setDescription('test import');
1525  $new_obj->create(true);
1526  $new_obj->createReference();
1527  $new_obj->putInTree($this->testrequest->getRefId());
1528  $new_obj->setPermissions($this->testrequest->getRefId());
1529  $new_obj->saveToDb();
1530 
1531  $selected_questions = [];
1532  if (!$skip_retrieve_selected_questions) {
1533  $selected_questions = $this->retrieveSelectedQuestionsFromImportQuestionsSelectionForm(
1534  'importVerifiedFile',
1535  $importdir,
1536  $qtifile,
1537  $this->request
1538  );
1539  }
1540 
1541  ilSession::set('tst_import_selected_questions', $selected_questions);
1542 
1543  $imp = new ilImport($this->testrequest->getRefId());
1544  $map = $imp->getMapping();
1545  $map->addMapping('components/ILIAS/Test', 'tst', 'new_id', (string) $new_obj->getId());
1546 
1551  if (is_file($importdir . DIRECTORY_SEPARATOR . '/manifest.xml')) {
1552  $imp->importObject($new_obj, $file_to_import, basename($file_to_import), 'tst', 'components/ILIAS/Test', true);
1553  } else {
1554  $test_importer = new ilTestImporter();
1555  $test_importer->setImport($imp);
1556  $test_importer->setInstallId(IL_INST_ID);
1557  $test_importer->setImportDirectory($importdir . '/' . $subdir);
1558  $test_importer->init();
1559 
1560  $test_importer->importXmlRepresentation(
1561  '',
1562  '',
1563  '',
1564  $map,
1565  );
1566  }
1567 
1568  if ($new_obj->getTestLogger()->isLoggingEnabled()) {
1569  $new_obj->getTestLogger()->logTestAdministrationInteraction(
1570  $new_obj->getTestLogger()->getInteractionFactory()->buildTestAdministrationInteraction(
1571  $new_obj->getRefId(),
1572  $this->user->getId(),
1573  TestAdministrationInteractionTypes::NEW_TEST_CREATED,
1574  []
1575  )
1576  );
1577  }
1578 
1579  ilFileUtils::delDir($importdir);
1580  $this->deleteUploadedImportFile($path_to_uploaded_file_in_temp_dir);
1581  ilSession::clear('path_to_import_file');
1582  ilSession::clear('path_to_uploaded_file_in_temp_dir');
1583 
1584  $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_imported"), true);
1585  $this->ctrl->setParameterByClass(ilObjTestGUI::class, 'ref_id', $new_obj->getRefId());
1586  $this->ctrl->redirectByClass(ilObjTestGUI::class);
1587  }
static get(string $a_var)
const IL_INST_ID
Definition: constants.php:40
Import class.
importObject(?object $a_new_obj, string $a_tmp_file, string $a_filename, string $a_type, string $a_comp="", bool $a_copy_file=false)
deleteUploadedImportFile(string $path_to_uploaded_file_in_temp_dir)
Importer class for files.
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
retrieveSelectedQuestionsFromImportQuestionsSelectionForm(string $form_cmd, string $importdir, string $qtifile, ServerRequestInterface $request)
array buildImportDirectoriesFromImportFile(string $file_to_import)
static clear(string $a_var)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreenObject()

ilObjTestGUI::infoScreenObject ( )
private

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

References ILIAS\Repository\ctrl().

2198  : void
2199  {
2200  $this->ctrl->redirectByClass(
2201  [ilRepositoryGUI::class, self::class, ilInfoScreenGUI::class]
2202  );
2203  }
+ Here is the call graph for this function:

◆ insertQuestionsObject()

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

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

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

Referenced by addQuestion().

1688  : void
1689  {
1690  $this->protectByWritePermission();
1691 
1692  if (($selected_array ?? $this->testrequest->getQuestionIds()) === []) {
1693  $this->tpl->setOnScreenMessage('info', $this->lng->txt('tst_insert_missing_question'), true);
1694  $this->ctrl->redirect($this, 'browseForQuestions');
1695  }
1696 
1697  $this->getTestObject()->saveCompleteStatus($this->test_question_set_config_factory->getQuestionSetConfig());
1698  $this->tpl->setOnScreenMessage('success', $this->lng->txt('tst_questions_inserted'), true);
1699  $this->ctrl->redirect($this, self::SHOW_QUESTIONS_CMD);
1700  return;
1701  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isCommandClassAnyInfoScreenChild()

ilObjTestGUI::isCommandClassAnyInfoScreenChild ( )
private

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

References ILIAS\Repository\ctrl().

Referenced by forwardToInfoScreen().

2189  : bool
2190  {
2191  if (in_array($this->ctrl->getCmdClass(), self::INFO_SCREEN_CHILD_CLASSES)) {
2192  return true;
2193  }
2194 
2195  return false;
2196  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ participantsActionObject()

ilObjTestGUI::participantsActionObject ( )

Evaluates the actions on the participants page.

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

References ILIAS\Repository\ctrl().

2021  : void
2022  {
2023  $command = $this->testrequest->strVal('command');
2024  if ($command === '') {
2025  $method = $command . 'Object';
2026  if (method_exists($this, $method)) {
2027  $this->$method();
2028  return;
2029  }
2030  }
2031  $this->ctrl->redirect($this, 'participants');
2032  }
+ Here is the call graph for this function:

◆ populateQuestionBrowserToolbarButtons()

ilObjTestGUI::populateQuestionBrowserToolbarButtons ( ilToolbarGUI  $toolbar)
private

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

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.

Referenced by setupToolBarAndMessage().

1928  : void
1929  {
1930  $this->ctrl->setParameterByClass(
1931  ilTestQuestionBrowserTableGUI::class,
1934  );
1935 
1936  $toolbar->addButton(
1937  $this->lng->txt('tst_browse_for_qpl_questions'),
1938  $this->ctrl->getLinkTargetByClass(
1939  ilTestQuestionBrowserTableGUI::class,
1941  )
1942  );
1943 
1944  $this->ctrl->setParameterByClass(
1945  ilTestQuestionBrowserTableGUI::class,
1948  );
1949 
1950  $toolbar->addButton(
1951  $this->lng->txt('tst_browse_for_tst_questions'),
1952  $this->ctrl->getLinkTargetByClass(
1953  ilTestQuestionBrowserTableGUI::class,
1955  )
1956  );
1957  }
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')
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareOutput()

ilObjTestGUI::prepareOutput ( bool  $show_subobjects = true)

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

References ilObjectGUI\$settings, ilObjectGUI\getCreationMode(), ilMemberViewSettings\getInstance(), ilObjectGUI\getRefId(), and getTestObject().

Referenced by executeCommand(), forwardCommandToQuestion(), forwardToEvaluationGUI(), and showEditTestPageGUI().

1288  : bool
1289  {
1290  if (!$this->getCreationMode()) {
1292  if ($settings->isActive() && $settings->getContainer() != $this->getTestObject()->getRefId()) {
1293  $settings->setContainer($this->getTestObject()->getRefId());
1294  $this->rbac_system->initMemberView();
1295  }
1296  }
1297  return parent::prepareOutput($show_subobjects);
1298  }
ilSetting $settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareSubGuiOutput()

ilObjTestGUI::prepareSubGuiOutput ( )
private

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

References ilObjectGUI\setLocator(), and ilObjectGUI\setTitleAndDescription().

Referenced by executeCommand().

1355  {
1356  $this->tpl->loadStandardTemplate();
1357  $this->setLocator();
1358  $this->setTitleAndDescription();
1359  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ protectByWritePermission()

ilObjTestGUI::protectByWritePermission ( )
protected

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

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

Referenced by addDefaultsObject(), applyDefaultsObject(), confirmedApplyDefaultsObject(), createQuestionFormObject(), createQuestionPool(), createQuestionpoolTargetObject(), defaultsObject(), deleteDefaultsObject(), executeCommand(), exportLegacyLogsObject(), insertQuestionsObject(), and showQuestionsObject().

2701  : void
2702  {
2703  if (!$this->access->checkAccess('write', '', $this->ref_id)) {
2704  $this->tpl->setOnScreenMessage('info', $this->lng->txt('cannot_edit_test'), true);
2705  $this->ctrl->redirectByClass([ilRepositoryGUI::class, self::class, ilInfoScreenGUI::class]);
2706  }
2707  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ questionsTabGatewayObject()

ilObjTestGUI::questionsTabGatewayObject ( )
private

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

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

1280  {
1281  if ($this->getTestObject()->isRandomTest()) {
1282  $this->ctrl->redirectByClass('ilTestRandomQuestionSetConfigGUI');
1283  }
1284 
1285  $this->ctrl->redirectByClass('ilObjTestGUI', self::SHOW_QUESTIONS_CMD);
1286  }
+ Here is the call graph for this function:

◆ redirectAfterMissingRead()

ilObjTestGUI::redirectAfterMissingRead ( )
protected

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

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

Referenced by executeCommand(), and forwardToInfoScreen().

997  : void
998  {
999  $this->tpl->setOnScreenMessage('failure', sprintf(
1000  $this->lng->txt("msg_no_perm_read_item"),
1001  $this->object->getTitle()
1002  ), true);
1003  $this->ctrl->setParameterByClass('ilrepositorygui', 'ref_id', ROOT_FOLDER_ID);
1004  $this->ctrl->redirectByClass('ilrepositorygui');
1005  }
const ROOT_FOLDER_ID
Definition: constants.php:32
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redirectAfterMissingWrite()

ilObjTestGUI::redirectAfterMissingWrite ( )
protected

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

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

Referenced by createQuestionPoolAndCopyObject(), executeCommand(), historyObject(), and importVerifiedFileObject().

990  {
991  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_permission"), true);
992  $target_class = get_class($this->object) . "GUI";
993  $this->ctrl->setParameterByClass($target_class, 'ref_id', $this->ref_id);
994  $this->ctrl->redirectByClass($target_class);
995  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redirectTo_SettingsMainGUI_showForm_Object()

ilObjTestGUI::redirectTo_SettingsMainGUI_showForm_Object ( )
private

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

References ILIAS\Repository\ctrl().

1350  {
1351  $this->ctrl->redirectByClass(SettingsMainGUI::class, SettingsMainGUI::CMD_SHOW_FORM);
1352  }
+ Here is the call graph for this function:

◆ removeImportFailsObject()

ilObjTestGUI::removeImportFailsObject ( )
protected

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

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

2335  {
2336  $qsaImportFails = new ilAssQuestionSkillAssignmentImportFails($this->getTestObject()->getId());
2337  $qsaImportFails->deleteRegisteredImportFails();
2338  $sltImportFails = new ilTestSkillLevelThresholdImportFails($this->getTestObject()->getId());
2339  $sltImportFails->deleteRegisteredImportFails();
2340 
2341  $this->ctrl->redirectByClass([ilRepositoryGUI::class, self::class, ilInfoScreenGUI::class]);
2342  }
+ Here is the call graph for this function:

◆ retrieveAdditionalDidacticTemplateOptions()

ilObjTestGUI::retrieveAdditionalDidacticTemplateOptions ( )

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

References ILIAS\Repository\lng().

1435  : array
1436  {
1437  $tst = new ilObjTest();
1438  $defaults = $tst->getAvailableDefaults();
1439  if ($defaults === []) {
1440  return [];
1441  }
1442 
1443  $additional_options = [];
1444  foreach ($defaults as $row) {
1445  $additional_options["tstdef_" . $row["test_defaults_id"]] = [$row["name"],
1446  $this->lng->txt("tst_default_settings")];
1447  }
1448  return $additional_options;
1449  }
+ Here is the call graph for this function:

◆ runObject()

ilObjTestGUI::runObject ( )

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

References ILIAS\Repository\ctrl().

Referenced by ilObjTestGUITest\testRunObject().

1362  {
1363  $this->ctrl->redirectByClass([ilRepositoryGUI::class, self::class, ilInfoScreenGUI::class]);
1364  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTestAccess()

ilObjTestGUI::setTestAccess ( ilTestAccess  $test_access)

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

References $test_access.

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

◆ setupToolBarAndMessage()

ilObjTestGUI::setupToolBarAndMessage ( bool  $has_started_test_runs)
private

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

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

Referenced by showQuestionsObject().

1899  : void
1900  {
1901  if (!$this->access->checkAccess('write', '', $this->ref_id)
1902  || $this->getTestObject()->isRandomTest()) {
1903  return;
1904  }
1905 
1906  if ($has_started_test_runs) {
1907  $link = $this->ui_factory->link()->standard(
1908  $this->lng->txt('test_has_datasets_warning_page_view_link'),
1909  $this->ctrl->getLinkTargetByClass([\ilTestParticipantsGUI::class])
1910  );
1911 
1912  $message = $this->lng->txt('test_has_datasets_warning_page_view');
1913  $massage_box = $this->ui_factory->messageBox()->info($message)->withLinks([$link]);
1914  $this->tpl->setCurrentBlock('mess');
1915  $this->tpl->setVariable(
1916  'MESSAGE',
1917  $this->ui_renderer->render($massage_box)
1918  );
1919  $this->tpl->parseCurrentBlock();
1920  return;
1921  }
1922 
1923  $this->toolbar->addButton($this->lng->txt('ass_create_question'), $this->ctrl->getLinkTarget($this, 'createQuestionForm'));
1924  $this->toolbar->addSeparator();
1926  }
populateQuestionBrowserToolbarButtons(ilToolbarGUI $toolbar)
$message
Definition: xapiexit.php:31
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showEditTestPageGUI()

ilObjTestGUI::showEditTestPageGUI ( string  $cmd)
private

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

References ILIAS\Repository\ctrl(), getTestObject(), prepareOutput(), and ILIAS\Repository\refinery().

Referenced by executeCommand().

1300  : void
1301  {
1302  $this->prepareOutput();
1303  $this->tabs_manager->getSettingsSubTabs();
1304 
1305  if ($this->request_wrapper->has('page_type')
1306  && $this->request_wrapper->retrieve(
1307  'page_type',
1308  $this->refinery->kindlyTo()->string()
1309  ) === 'introductionpage'
1310  ) {
1311  $page_type = 'IntroductionPage';
1312  $this->tabs_manager->activateSubTab(TabsManager::SETTINGS_SUBTAB_ID_EDIT_INTRODUCTION_PAGE);
1313  $page_id = $this->getTestObject()->getIntroductionPageId();
1314  } else {
1315  $page_type = 'ConcludingRemarksPage';
1316  $this->tabs_manager->activateSubTab(TabsManager::SETTINGS_SUBTAB_ID_EDIT_CONCLUSION_PAGE);
1317  $page_id = $this->getTestObject()->getConcludingRemarksPageId();
1318  }
1319  $this->ctrl->saveParameterByClass(ilTestPageGUI::class, 'page_type');
1320 
1321  $gui = new ilTestPageGUI('tst', $page_id);
1322  $this->content_style->gui()->addCss($this->tpl, $this->ref_id);
1323  $this->tpl->setContent($this->ctrl->forwardCommand($gui));
1324 
1325  $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
1326  }
ilTestPageGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMDEditorGUI ilTestPageGUI: ilPublicUserProfile...
prepareOutput(bool $show_subobjects=true)
+ 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 1223 of file class.ilObjTestGUI.php.

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

Referenced by forwardCommandToQuestion().

1223  : void
1224  {
1225  if ($target === 'return') {
1228  $question_gui
1229  );
1230  }
1231 
1232  if ($target === 'stay') {
1233  $this->ctrl->setParameterByClass(ilAssQuestionPreviewGUI::class, 'q_id', $question_gui->getObject()->getId());
1234  $this->tabs_gui->setBackTarget(
1235  $this->lng->txt('backtocallingpage'),
1236  $this->ctrl->getLinkTargetByClass(
1237  ilAssQuestionPreviewGUI::class,
1239  )
1240  );
1241  $question_gui->editQuestion(false, false);
1242  }
1243  }
editQuestion(bool $checkonly=false, ?bool $is_save_cmd=null)
forwardCommandToQuestionPreview(string $cmd, ?assQuestionGUI $question_gui=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showQuestionsObject()

ilObjTestGUI::showQuestionsObject ( )

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

References $table_query, addQuestion(), createQuestionpoolTargetObject(), ILIAS\Repository\ctrl(), getQuestionsTableActions(), getQuestionsTableQuery(), ILIAS\Test\Questions\Presentation\QuestionsTableQuery\getRowIds(), getTable(), ILIAS\Test\Questions\Presentation\QuestionsTableQuery\getTableAction(), getTestObject(), null, protectByWritePermission(), and setupToolBarAndMessage().

Referenced by addQuestion(), copyAndLinkQuestionsToPoolObject(), and forwardCommandToQuestion().

1846  {
1847  $this->protectByWritePermission();
1848 
1849  if ($this->testrequest->raw('add')) {
1850  $this->addQuestion();
1851  return;
1852  }
1853 
1855  if (($table_cmd = $table_query->getTableAction()) !== null) {
1856  if (!$this->getQuestionsTableActions()->handleCommand(
1857  $table_cmd,
1858  $table_query->getRowIds($this->object),
1859  fn() => $this->protectByWritePermission(),
1860  fn() => $this->createQuestionpoolTargetObject('copyAndLinkQuestionsToPool'),
1861  fn() => $this->getTable()
1862  )) {
1863  return;
1864  }
1865  }
1866 
1867  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.il_as_tst_questions.html', 'components/ILIAS/Test');
1868 
1869  $this->setupToolBarAndMessage($this->getTestObject()->evalTotalPersons() !== 0);
1870 
1871  $this->tabs_manager->getQuestionsSubTabs();
1872  $this->tabs_manager->activateSubTab(TabsManager::SUBTAB_ID_QST_LIST_VIEW);
1873 
1874  $this->tpl->setCurrentBlock('adm_content');
1875  $this->tpl->setVariable('ACTION_QUESTION_FORM', $this->ctrl->getFormAction($this));
1876  $this->tpl->setVariable(
1877  'QUESTIONBROWSER',
1878  $this->ui_renderer->render(
1879  $this->getTable()->getTableComponent()
1880  )
1881  );
1882  $this->tpl->parseCurrentBlock();
1883  }
QuestionsTableQuery $table_query
createQuestionpoolTargetObject(string $cmd)
Called when a new question should be created from a test Important: $cmd may be overwritten if no que...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setupToolBarAndMessage(bool $has_started_test_runs)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ statisticsObject()

ilObjTestGUI::statisticsObject ( )

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

2415  {
2416  }

◆ takenObject()

ilObjTestGUI::takenObject ( )

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

1959  : void
1960  {
1961  }

◆ trackTestObjectReadEvent()

ilObjTestGUI::trackTestObjectReadEvent ( )
protected

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

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

Referenced by executeCommand(), and forwardToInfoScreen().

1246  {
1248  $this->getTestObject()->getType(),
1249  $this->getTestObject()->getRefId(),
1250  $this->getTestObject()->getId(),
1251  $this->user->getId()
1252  );
1253  }
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $archives

Archives ilObjTestGUI::$archives
private

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

◆ $component_factory

ilComponentFactory ilObjTestGUI::$component_factory
protected

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

Referenced by executeCommand().

◆ $component_repository

ilComponentRepository ilObjTestGUI::$component_repository
protected

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

◆ $content_style

ContentStyle ilObjTestGUI::$content_style
private

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

◆ $create_question_mode

bool ilObjTestGUI::$create_question_mode
protected

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

◆ $data_factory

DataFactory ilObjTestGUI::$data_factory
protected

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

Referenced by executeCommand().

◆ $db

ilDBInterface ilObjTestGUI::$db
protected

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

Referenced by executeCommand(), and forwardToInfoScreen().

◆ $export_factory

ExportImportFactory ilObjTestGUI::$export_factory
private

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

Referenced by executeCommand().

◆ $export_repository

ExportRepository ilObjTestGUI::$export_repository
private

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

◆ $global_screen

GlobalScreen ilObjTestGUI::$global_screen
protected

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

Referenced by forwardCommandToQuestionPreview().

◆ $help

ilHelpGUI ilObjTestGUI::$help
protected

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

◆ $http

HTTPServices ilObjTestGUI::$http
protected

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

Referenced by forwardCommandToQuestionPreview().

◆ $irss

IRSS ilObjTestGUI::$irss
protected

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

◆ $navigation_history

ilNavigationHistory ilObjTestGUI::$navigation_history
protected

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

◆ $obj_data_cache

ilObjectDataCache ilObjTestGUI::$obj_data_cache
protected

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

◆ $objective_oriented_container

ilTestObjectiveOrientedContainer ilObjTestGUI::$objective_oriented_container
private

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

Referenced by getObjectiveOrientedContainer().

◆ $participant_access_filter_factory

ilTestParticipantAccessFilterFactory ilObjTestGUI::$participant_access_filter_factory
private

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

◆ $participant_repository

ParticipantRepository ilObjTestGUI::$participant_repository
protected

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

Referenced by executeCommand().

◆ $qplrequest

QPLRequestDataCollector ilObjTestGUI::$qplrequest
private

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

◆ $questionrepository

GeneralQuestionPropertiesRepository ilObjTestGUI::$questionrepository
private

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

◆ $response_handler

ResponseHandler ilObjTestGUI::$response_handler
protected

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

Referenced by executeCommand().

◆ $results_data_factory

ResultsDataFactory ilObjTestGUI::$results_data_factory
protected

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

Referenced by executeCommand().

◆ $results_presentation_factory

ResultsPresentationFactory ilObjTestGUI::$results_presentation_factory
protected

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

Referenced by executeCommand().

◆ $skills_service

SkillService ilObjTestGUI::$skills_service
protected

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

◆ $table_actions

QuestionsTableActions ilObjTestGUI::$table_actions = null
protected

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

Referenced by getQuestionsTableActions().

◆ $table_query

QuestionsTableQuery ilObjTestGUI::$table_query = null
protected

◆ $tabs_manager

TabsManager ilObjTestGUI::$tabs_manager = null
protected

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

Referenced by executeCommand().

◆ $taxonomy

TaxonomyService ilObjTestGUI::$taxonomy
protected

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

◆ $test_access

ilTestAccess ilObjTestGUI::$test_access
protected

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

Referenced by executeCommand(), getTestAccess(), and setTestAccess().

◆ $test_pass_result_repository

TestResultRepository ilObjTestGUI::$test_pass_result_repository
protected

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

Referenced by executeCommand().

◆ $test_player_factory

ilTestPlayerFactory ilObjTestGUI::$test_player_factory
private

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

◆ $test_question_set_config_factory

ilTestQuestionSetConfigFactory ilObjTestGUI::$test_question_set_config_factory
private

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

◆ $test_questions_repository

TestQuestionsRepository ilObjTestGUI::$test_questions_repository
private

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

Referenced by getTable().

◆ $test_session_factory

ilTestSessionFactory ilObjTestGUI::$test_session_factory
private

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

◆ $testrequest

RequestDataCollector ilObjTestGUI::$testrequest
protected

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

Referenced by executeCommand().

◆ $title_builder

TitleColumnsBuilder ilObjTestGUI::$title_builder
private

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

Referenced by getTable().

◆ $toplist_repository

TestTopListRepository ilObjTestGUI::$toplist_repository
private

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

◆ $ui_factory

UIFactory ilObjTestGUI::$ui_factory
protected

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

Referenced by executeCommand(), and forwardToInfoScreen().

◆ $ui_renderer

UIRenderer ilObjTestGUI::$ui_renderer
protected

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

Referenced by executeCommand(), and forwardToInfoScreen().

◆ $ui_service

ilUIService ilObjTestGUI::$ui_service
protected

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

Referenced by executeCommand().

◆ INFO_SCREEN_CHILD_CLASSES

const ilObjTestGUI::INFO_SCREEN_CHILD_CLASSES
private
Initial value:
= [
'ilpublicuserprofilegui', 'ilobjportfoliogui'
]

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

◆ QUESTION_CREATION_POOL_SELECTION_EXISTING_POOL

const ilObjTestGUI::QUESTION_CREATION_POOL_SELECTION_EXISTING_POOL = 3
private

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

◆ QUESTION_CREATION_POOL_SELECTION_NEW_POOL

const ilObjTestGUI::QUESTION_CREATION_POOL_SELECTION_NEW_POOL = 2
private

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

◆ QUESTION_CREATION_POOL_SELECTION_NO_POOL

const ilObjTestGUI::QUESTION_CREATION_POOL_SELECTION_NO_POOL = 1
private

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

◆ SHOW_LOGS_CMD

const ilObjTestGUI::SHOW_LOGS_CMD = 'history'
private

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

◆ SHOW_QUESTIONS_CMD


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