ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilObjQuestionPoolGUI Class Reference

Class ilObjQuestionPoolGUI. More...

+ Inheritance diagram for ilObjQuestionPoolGUI:
+ Collaboration diagram for ilObjQuestionPoolGUI:

Public Member Functions

 downloadFileObject ()
 
 fullscreenObject ()
 show fullscreen view More...
 
 download_paragraphObject ()
 download source code paragraph More...
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 confirmDeleteQuestions (array $ids)
 
 deleteQuestionsObject ()
 delete questions confirmation screen More...
 
 confirmDeleteQuestionsObject ()
 delete questions after confirmation More...
 
 cancelDeleteQuestionsObject ()
 
 exportQuestions (array $ids)
 
 questionsObject ()
 list questions of question pool More...
 
 printObject ()
 
 updateObject ()
 updates object entry in object_data More...
 
 pasteObject ()
 
 copyQuestions (array $ids)
 
 moveQuestions (array $ids)
 
 createExportExcel ()
 
 editQuestionForTestObject ()
 
 processImportObject ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 setTitleAndDescription (?assQuestionGUI $question_gui=null)
 called by prepare output More...
 
 getTabs ()
 adds tabs to tab gui object More...
 
 infoScreenObject ()
 
 infoScreenForward ()
 
- 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)
 

Data Fields

const SUPPORTED_IMPORT_MIME_TYPES
 
const DEFAULT_CMD = 'questions'
 
- 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 ()
 
 exportObject ()
 Gateway for exports initiated from workspace, as there is a generic forward to {objTypeMainGUI}::export() More...
 
 fetchAuthoringQuestionIdParamater ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 getTable ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Protected Attributes

Service $taxonomy
 
ilDBInterface $db
 
ilComponentLogger $log
 
ilHelpGUI $help
 
GlobalScreen $global_screen
 
ilComponentFactory $component_factory
 
ilComponentRepository $component_repository
 
ilNavigationHistory $navigation_history
 
ilUIService $ui_service
 
DataFactory $data_factory
 
URLBuilder $url_builder
 
URLBuilderToken $action_parameter_token
 
URLBuilderToken $row_id_token
 
SkillUsageService $skill_usage_service
 
RequestDataCollector $request_data_collector
 
GeneralQuestionPropertiesRepository $questionrepository
 
GlobalTestSettings $global_test_settings
 
ImportSessionRepository $import_session_repository
 
LoggerInterface $import_logger
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
GlobalHttpState $http
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
CustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Private Member Functions

 createQuestionFormObject (?Form $form=null)
 
 buildQuestionCreationForm ()
 
 buildInputQuestionType ()
 
 buildInputEditingType ()
 
 buildImportWizard ()
 
 renderImportStage (StageResult $result)
 
 renderImportError (StageResult $result)
 
 renderImportSuccess (StageResult $result)
 
 isSkillsTabRequired ()
 
 addSettingsSubTabs (ilTabsGUI $tabs)
 

Private Attributes

Archives $archives
 
ContentStyle $content_style
 

Additional Inherited Members

- 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)
 

Detailed Description

Member Function Documentation

◆ addLocatorItems()

ilObjQuestionPoolGUI::addLocatorItems ( )

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

Reimplemented from ilObjectGUI.

Definition at line 1203 of file class.ilObjQuestionPoolGUI.php.

1203 : void
1204 {
1205 $ilLocator = $this->locator;
1206
1207 switch ($this->ctrl->getCmd()) {
1208 case 'create':
1209 case 'importFile':
1210 case 'cancel':
1211 break;
1212 default:
1213 $this->ctrl->clearParameterByClass(self::class, 'q_id');
1214 $ilLocator->addItem(
1215 $this->object->getTitle(),
1216 $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], ''),
1217 '',
1218 $this->request_data_collector->getRefId()
1219 );
1220 $this->ctrl->setParameter($this, 'q_id', $this->request_data_collector->getQuestionId());
1221 break;
1222 }
1223
1224 if (!is_array($this->request_data_collector->raw('q_id')) && $this->request_data_collector->raw('q_id') > 0 && $this->request_data_collector->raw(
1225 'cmd'
1226 ) !== self::DEFAULT_CMD) {
1227 $question_gui = assQuestionGUI::_getQuestionGUI('', $this->request_data_collector->getQuestionId());
1228 if ($question_gui !== null && $question_gui->getObject() instanceof assQuestion) {
1229 $question = $question_gui->getObject();
1230 $question->setObjId($this->object->getId());
1231 $question_gui->setObject($question);
1232 $title = $question_gui->getObject()->getTitle();
1233 if (!$title) {
1234 $title = $this->lng->txt('new') . ': ' . $this->questionrepository->getForQuestionId(
1235 $question_gui->getObject()->getId()
1236 )->getTypeName($this->lng);
1237 }
1238 $ilLocator->addItem($title, $this->ctrl->getLinkTargetByClass(get_class($question_gui), 'editQuestion'));
1239 } else {
1240 // Workaround for context issues: If no object was found, redirect without q_id parameter
1241 $this->ctrl->setParameter($this, 'q_id', '');
1242 $this->ctrl->redirect($this);
1243 }
1244 }
1245 }
static _getQuestionGUI(string $question_type='', int $question_id=-1)
Creates a question gui representation and returns the alias to the question gui.
ilLocatorGUI $locator

References ilObjectGUI\$locator, assQuestionGUI\_getQuestionGUI(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ addSettingsSubTabs()

ilObjQuestionPoolGUI::addSettingsSubTabs ( ilTabsGUI  $tabs)
private

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

1506 : void
1507 {
1508 $tabs->addSubTab(
1510 $this->lng->txt('qpl_settings_subtab_general'),
1511 $this->ctrl->getLinkTargetByClass(ilObjQuestionPoolSettingsGeneralGUI::class),
1512 );
1513
1514 $tabs->addSubTab(
1515 'tax_settings',
1516 $this->lng->txt('qpl_settings_subtab_taxonomies'),
1517 $this->ctrl->getLinkTargetByClass(ilTaxonomySettingsGUI::class, ''),
1518 );
1519 }
addSubTab(string $a_id, string $a_text, string $a_link, string $a_frame="")

References ilTabsGUI\addSubTab(), ILIAS\Repository\lng(), and ilObjQuestionPoolSettingsGeneralGUI\TAB_COMMON_SETTINGS.

+ Here is the call graph for this function:

◆ afterSave()

ilObjQuestionPoolGUI::afterSave ( ilObject  $new_object)

Post (successful) object creation hook.

Reimplemented from ilObjectGUI.

Definition at line 766 of file class.ilObjQuestionPoolGUI.php.

766 : void
767 {
768 // always send a message
769 $this->tpl->setOnScreenMessage('success', $this->lng->txt('object_added'), true);
770
772 'ilias.php?ref_id=' . $new_object->getRefId() .
773 '&baseClass=ilObjQuestionPoolGUI'
774 );
775 }
static redirect(string $a_script)

References ilObject\getRefId(), ILIAS\Repository\lng(), and ilUtil\redirect().

+ Here is the call graph for this function:

◆ buildImportWizard()

ilObjQuestionPoolGUI::buildImportWizard ( )
private

Definition at line 1139 of file class.ilObjQuestionPoolGUI.php.

1139 : ImportWizard
1140 {
1141 $form_action = $this->ctrl->getFormActionByClass(self::class, 'processImport');
1142
1143 return new ImportWizard(
1144 [
1146 $this->archives,
1147 $this->lng,
1148 $this->import_logger,
1149 'components/ILIAS/TestQuestionPool'
1150 ),
1151 new DetectLegacyImportStage($this->import_logger),
1153 $this->lng,
1154 $this->import_logger,
1155 $this->component_factory,
1156 $this->ui_factory,
1157 $this->request,
1159 $this->lng->txt('import_qpl')
1160 ),
1161 new PersistStage(
1162 $this->lng,
1163 $this->request_data_collector,
1164 $this->import_session_repository
1165 ),
1166 ],
1167 $this->import_session_repository,
1168 new CleanupStage($this->import_logger)
1169 );
1170 }
Runs import stages until one needs user interaction, reports an error, or every stage has finished.
Final import stage that cleans up the temporary files and directories after successful import or erro...
Final stage of the question pool import process.

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

Referenced by processImportObject().

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

◆ buildInputEditingType()

ilObjQuestionPoolGUI::buildInputEditingType ( )
private

Definition at line 990 of file class.ilObjQuestionPoolGUI.php.

990 : Input
991 {
992 if (!$this->global_test_settings->isPageEditorEnabled()) {
993 return $this->ui_factory->input()->field()->hidden()->withValue(
995 );
996 }
997
998 return $this->ui_factory->input()->field()->radio($this->lng->txt('tst_add_quest_cont_edit_mode'))
999 ->withOption(
1001 $this->lng->txt('tst_add_quest_cont_edit_mode_IPE'),
1002 $this->lng->txt('tst_add_quest_cont_edit_mode_IPE_info')
1003 )->withOption(
1005 $this->lng->txt('tst_add_quest_cont_edit_mode_RTE'),
1006 $this->lng->txt('tst_add_quest_cont_edit_mode_RTE_info')
1007 )
1009 }
const ADDITIONAL_CONTENT_EDITING_MODE_RTE
const ADDITIONAL_CONTENT_EDITING_MODE_IPE
This describes commonalities between all inputs.
Definition: Input.php:47
withValue($value)
Get an input like this with another value displayed on the client side.

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

Referenced by buildQuestionCreationForm().

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

◆ buildInputQuestionType()

ilObjQuestionPoolGUI::buildInputQuestionType ( )
private

Definition at line 976 of file class.ilObjQuestionPoolGUI.php.

976 : Select
977 {
978 $question_types = (new ilObjQuestionPool())->getQuestionTypes(false, true, false);
979 $options = [];
980 foreach ($question_types as $label => $data) {
981 $options[$data['question_type_id']] = $label;
982 }
983
984 return $this->ui_factory->input()->field()->select(
985 $this->lng->txt('question_type'),
987 )->withRequired(true);
988 }
This describes select field.
Definition: Select.php:29

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

Referenced by buildQuestionCreationForm().

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

◆ buildQuestionCreationForm()

ilObjQuestionPoolGUI::buildQuestionCreationForm ( )
private

Definition at line 959 of file class.ilObjQuestionPoolGUI.php.

959 : Form
960 {
961 $inputs['question_type'] = $this->buildInputQuestionType();
962 $inputs['editing_type'] = $this->buildInputEditingType();
963
964 $section = [
965 $this->ui_factory->input()->field()->section($inputs, $this->lng->txt('create_question'))
966 ];
967
968 $form = $this->ui_factory->input()->container()->form()->standard(
969 $this->ctrl->getFormAction($this, 'createQuestion'),
970 $section
971 )->withSubmitLabel($this->lng->txt('create'));
972
973 return $form;
974 }
This describes commonalities between all forms.
Definition: Form.php:34

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

+ Here is the call graph for this function:

◆ cancelDeleteQuestionsObject()

ilObjQuestionPoolGUI::cancelDeleteQuestionsObject ( )

Definition at line 848 of file class.ilObjQuestionPoolGUI.php.

848 : void
849 {
850 $this->ctrl->redirect($this, self::DEFAULT_CMD);
851 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ confirmDeleteQuestions()

ilObjQuestionPoolGUI::confirmDeleteQuestions ( array  $ids)

Definition at line 777 of file class.ilObjQuestionPoolGUI.php.

777 : void
778 {
779 $rbacsystem = $this->rbac_system;
780
781 $questionIdsToDelete = array_filter(array_map('intval', $ids));
782 if (0 === count($questionIdsToDelete)) {
783 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_delete_select_none'), true);
784 $this->ctrl->redirect($this, self::DEFAULT_CMD);
785 }
786
787 $this->tpl->setOnScreenMessage('question', $this->lng->txt('confirm_delete_questions'));
788 $deleteable_questions = $this->object->getDeleteableQuestionDetails($questionIdsToDelete);
789 $table_gui = new ilQuestionBrowserTableGUI($this, self::DEFAULT_CMD, (($rbacsystem->checkAccess('write', $this->request_data_collector->getRefId()) ? true : false)), true);
790 $table_gui->setShowRowsSelector(false);
791 $table_gui->setLimit(PHP_INT_MAX);
792 $table_gui->setEditable($rbacsystem->checkAccess('write', $this->request_data_collector->getRefId()));
793 $table_gui->setData($deleteable_questions);
794 $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
795 }
ilRbacSystem $rbac_system

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

+ Here is the call graph for this function:

◆ confirmDeleteQuestionsObject()

ilObjQuestionPoolGUI::confirmDeleteQuestionsObject ( )

delete questions after confirmation

Definition at line 833 of file class.ilObjQuestionPoolGUI.php.

833 : void
834 {
835 $qst_ids = $this->request_data_collector->intArray('q_id');
836 foreach ($qst_ids as $value) {
837 $this->object->deleteQuestion((int) $value);
838 $this->object->cleanupClipboard((int) $value);
839 }
840 if ($qst_ids !== []) {
841 $this->tpl->setOnScreenMessage('success', $this->lng->txt('qpl_questions_deleted'), true);
842 }
843
844 $this->ctrl->setParameter($this, 'q_id', '');
845 $this->ctrl->redirect($this, self::DEFAULT_CMD);
846 }

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

+ Here is the call graph for this function:

◆ copyQuestions()

ilObjQuestionPoolGUI::copyQuestions ( array  $ids)

Definition at line 1061 of file class.ilObjQuestionPoolGUI.php.

1061 : void
1062 {
1063 if ($ids) {
1064 foreach ($ids as $id) {
1065 $this->object->copyToClipboard($id);
1066 }
1067 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_copy_insert_clipboard'), true);
1068 } else {
1069 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_copy_select_none'), true);
1070 }
1071 }

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

+ Here is the call graph for this function:

◆ createExportExcel()

ilObjQuestionPoolGUI::createExportExcel ( )
Deprecated:
12: excel export is not longer supported

Definition at line 1094 of file class.ilObjQuestionPoolGUI.php.

1094 : void
1095 {
1096 $rbacsystem = $this->rbac_system;
1097 if ($rbacsystem->checkAccess('write', $this->request_data_collector->getRefId())) {
1098 $question_ids = &$this->object->getAllQuestionIds();
1099 $qpl_exp = new ilQuestionpoolExport($this->object, 'xlsx', $question_ids);
1100 $qpl_exp->buildExportFile();
1101 $this->ctrl->redirectByClass('ilquestionpoolexportgui', '');
1102 }
1103 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilObjectGUI\$rbac_system, and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ createQuestionFormObject()

ilObjQuestionPoolGUI::createQuestionFormObject ( ?Form  $form = null)
private

Definition at line 943 of file class.ilObjQuestionPoolGUI.php.

943 : void
944 {
945 $this->help->setScreenId('assQuestions');
946 if ($this->global_test_settings->isPageEditorEnabled()) {
947 $this->help->setSubScreenId('createQuestion_editMode');
948 } else {
949 $this->help->setSubScreenId('createQuestion');
950 }
951
952 $this->tpl->setContent(
953 $this->ui_renderer->render(
954 $form ?? $this->buildQuestionCreationForm()
955 )
956 );
957 }

References ILIAS\Repository\help().

+ Here is the call graph for this function:

◆ deleteQuestionsObject()

ilObjQuestionPoolGUI::deleteQuestionsObject ( )

delete questions confirmation screen

Definition at line 800 of file class.ilObjQuestionPoolGUI.php.

800 : void
801 {
802 $rbacsystem = $this->rbac_system;
803
804 $questionIdsToDelete = $this->request_data_collector->isset('q_id') ? (array) $this->request_data_collector->raw('q_id') : [];
805 if ($questionIdsToDelete === [] && $this->request_data_collector->isset('q_id')) {
806 $questionIdsToDelete = [$this->request_data_collector->getQuestionId()];
807 }
808
809 $questionIdsToDelete = array_filter(array_map('intval', $questionIdsToDelete));
810 if ($questionIdsToDelete === []) {
811 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_delete_select_none'), true);
812 $this->ctrl->redirect($this, self::DEFAULT_CMD);
813 }
814
815 $this->tpl->setOnScreenMessage('question', $this->lng->txt('confirm_delete_questions'));
816 $deleteable_questions = &$this->object->getDeleteableQuestionDetails($questionIdsToDelete);
817 $table_gui = new ilQuestionBrowserTableGUI(
818 $this,
819 self::DEFAULT_CMD,
820 (($rbacsystem->checkAccess('write', $this->request_data_collector->getRefId()) ? true : false)),
821 true
822 );
823 $table_gui->setShowRowsSelector(false);
824 $table_gui->setLimit(PHP_INT_MAX);
825 $table_gui->setEditable($rbacsystem->checkAccess('write', $this->request_data_collector->getRefId()));
826 $table_gui->setData($deleteable_questions);
827 $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
828 }

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

+ Here is the call graph for this function:

◆ download_paragraphObject()

ilObjQuestionPoolGUI::download_paragraphObject ( )

download source code paragraph

Definition at line 735 of file class.ilObjQuestionPoolGUI.php.

735 : void
736 {
737 $pg_obj = new ilAssQuestionPage($this->request_data_collector->raw('pg_id'));
738 $pg_obj->sendParagraph($this->request_data_collector->raw('par_id'), $this->request_data_collector->raw('downloadtitle'));
739 exit;
740 }
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References exit.

◆ downloadFileObject()

ilObjQuestionPoolGUI::downloadFileObject ( )

Definition at line 712 of file class.ilObjQuestionPoolGUI.php.

712 : void
713 {
714 $file = explode('_', $this->request_data_collector->raw('file_id'));
715 $fileObj = new ilObjFile((int) $file[count($file) - 1], false);
716 $fileObj->sendFile();
717 exit;
718 }
Class ilObjFile.

References exit.

◆ editQuestionForTestObject()

ilObjQuestionPoolGUI::editQuestionForTestObject ( )

Definition at line 1105 of file class.ilObjQuestionPoolGUI.php.

1105 : void
1106 {
1107 $this->ctrl->redirectByClass(ilAssQuestionPreviewGUI::class, 'show');
1108 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ exportObject()

ilObjQuestionPoolGUI::exportObject ( )
protected

Gateway for exports initiated from workspace, as there is a generic forward to {objTypeMainGUI}::export()

Definition at line 707 of file class.ilObjQuestionPoolGUI.php.

707 : void
708 {
709 $this->ctrl->redirectByClass('ilQuestionPoolExportGUI');
710 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ exportQuestions()

ilObjQuestionPoolGUI::exportQuestions ( array  $ids)
Deprecated:
12: Use ILIAS\Test\ExportImport\TestExporter instead

Definition at line 856 of file class.ilObjQuestionPoolGUI.php.

856 : void
857 {
858 if ($ids !== []) {
859 $qpl_exp = new ilQuestionpoolExport($this->object, 'xml', $ids);
860 // @PHP8-CR: This seems to be a pointer to an issue with exports. I like to leave this open for now and
861 // schedule a thorough examination / analysis for later, eventually involved T&A TechSquad
862 $export_file = $qpl_exp->buildExportFile();
863 $filename = $export_file;
864 $filename = preg_replace('/.*\//', '', $filename);
865 if ($export_file === '') {
866 $export_file = 'StandIn';
867 }
869 exit();
870 } else {
871 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_export_select_none'), true);
872 }
873 }
$filename
Definition: buildRTE.php:78
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)

References $filename, ilFileDelivery\deliverFileLegacy(), exit, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ fetchAuthoringQuestionIdParamater()

ilObjQuestionPoolGUI::fetchAuthoringQuestionIdParamater ( )
protected

Definition at line 932 of file class.ilObjQuestionPoolGUI.php.

932 : int
933 {
934 $q_id = $this->request_data_collector->getQuestionId();
935
936 if ($q_id === 0 || $this->object->checkQuestionParent($q_id)) {
937 return $q_id;
938 }
939
940 throw new ilTestQuestionPoolException('question id does not relate to parent object!');
941 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ fullscreenObject()

ilObjQuestionPoolGUI::fullscreenObject ( )

show fullscreen view

Definition at line 723 of file class.ilObjQuestionPoolGUI.php.

723 : void
724 {
725 $page_gui = new ilAssQuestionPageGUI($this->request_data_collector->raw('pg_id'));
726 $page_gui->setFileDownloadLink(
727 $this->ctrl->getLinkTargetByClass(ilObjQuestionPoolGUI::class, 'downloadFile')
728 );
729 $page_gui->showMediaFullscreen();
730 }
Question page GUI class.

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getTable()

ilObjQuestionPoolGUI::getTable ( )
protected

Filters should be part of the Table; for now, since they are not fully integrated, they are rendered and applied seperately

Definition at line 1590 of file class.ilObjQuestionPoolGUI.php.

1590 : string
1591 {
1593 $r = $this->ui_renderer;
1594
1595 $table = new QuestionTable(
1596 $f,
1597 $r,
1598 $this->data_factory,
1599 $this->refinery,
1600 $this->url_builder,
1601 $this->action_parameter_token,
1602 $this->row_id_token,
1603 $this->db,
1604 $this->lng,
1605 $this->component_repository,
1606 $this->component_factory,
1607 $this->rbac_system,
1608 $this->user,
1609 $this->taxonomy->domain(),
1610 $this->notes_service,
1611 $this->object->getId(),
1612 $this->request_data_collector->getRefId()
1613 );
1614
1619 $filter_action = $this->ctrl->getLinkTarget($this, self::DEFAULT_CMD);
1620 $filter = $table->getFilter($this->ui_service, $filter_action);
1621
1622 $filter_params = $this->ui_service->filter()->getData($filter);
1623
1624 if ($filter_params) {
1625 foreach (array_filter($filter_params) as $item => $value) {
1626 switch ($item) {
1627 case 'taxonomies':
1628 foreach ($value as $tax_value) {
1629 if ($tax_value === 'null') {
1630 $table->addTaxonomyFilterNoTaxonomySet(true);
1631 } else {
1632 $tax_nodes = explode('-', $tax_value);
1633 $tax_id = array_shift($tax_nodes);
1634 $table->addTaxonomyFilter(
1635 $tax_id,
1636 $tax_nodes,
1637 $this->object->getId(),
1638 $this->object->getType()
1639 );
1640 }
1641 }
1642 break;
1643 case 'commented':
1644 $table->setCommentFilter((int) $value);
1645 break;
1646 default:
1647 $table->addFieldFilter($item, $value);
1648 }
1649 }
1650 }
1651
1652 return $r->render([
1653 $table->getSummary(),
1654 $filter,
1655 $table->getTable()
1656 ->withRequest($this->request)
1657 ]);
1658 }
UIFactory $ui_factory
UIRenderer $ui_renderer

References Vendor\Package\$f, ILIAS\BookingManager\Common\Table\$ui_renderer, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ILIAS\Repository\refinery(), and ILIAS\Repository\user().

Referenced by questionsObject().

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

◆ getTabs()

ilObjQuestionPoolGUI::getTabs ( )

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

Reimplemented from ilObjectGUI.

Definition at line 1305 of file class.ilObjQuestionPoolGUI.php.

1305 : void
1306 {
1307 $with_write_access = $this->access->checkAccess('write', '', $this->object->getRefId());
1308 $with_read_access = $this->access->checkAccess('read', '', $this->object->getRefId());
1309
1310 $this->help->setScreenIdComponent('qpl');
1311
1312 switch ($this->ctrl->getNextClass()) {
1313 case '':
1314 case strtolower(ilInfoScreenGUI::class):
1315 case strtolower(ilPermissionGUI::class):
1316 case strtolower(ilObjectMetaDataGUI::class):
1317 case strtolower(ilExportGUI::class):
1318 case strtolower(ilQuestionPoolSkillAdministrationGUI::class):
1319 break;
1320
1321 case strtolower(ilTaxonomySettingsGUI::class):
1322 case strtolower(ilObjQuestionPoolSettingsGeneralGUI::class):
1323 if ($with_write_access) {
1324 $this->addSettingsSubTabs($this->tabs_gui);
1325 }
1326
1327 break;
1328
1329 default:
1330 return;
1331 }
1332 // questions
1333 $force_active = false;
1334 $commands = $this->request_data_collector->raw('cmd');
1335 if (is_array($commands)) {
1336 foreach ($commands as $key => $value) {
1337 if (preg_match('/^delete_.*/', $key, $matches) ||
1338 preg_match('/^addSelectGap_.*/', $key, $matches) ||
1339 preg_match('/^addTextGap_.*/', $key, $matches) ||
1340 preg_match('/^deleteImage_.*/', $key, $matches) ||
1341 preg_match('/^upload_.*/', $key, $matches) ||
1342 preg_match('/^addSuggestedSolution_.*/', $key, $matches)
1343 ) {
1344 $force_active = true;
1345 }
1346 }
1347 }
1348
1349 $force_active = $force_active || $this->request_data_collector->isset('imagemap_x');
1350 if (!$force_active) {
1351 $force_active = strtolower($this->ctrl->getCmdClass()) === strtolower(self::class)
1352 || $this->ctrl->getCmdClass() === '' && $this->ctrl->getCmd() === ''
1353 ? true
1354 : false;
1355 }
1356 if ($with_read_access) {
1357 $this->tabs_gui->addTarget(
1358 'assQuestions',
1359 $this->ctrl->getLinkTargetByClass(
1360 [ilRepositoryGUI::class, self::class],
1361 self::DEFAULT_CMD
1362 ),
1363 [
1364 self::DEFAULT_CMD,
1365 'filter',
1366 'resetFilter',
1367 'createQuestion',
1368 'importQuestions',
1369 'deleteQuestions',
1370 'filterQuestionBrowser',
1371 'view',
1372 'preview',
1373 'editQuestion',
1374 'exec_pg',
1375 'addItem',
1376 'upload',
1377 'save',
1378 'cancel',
1379 'addSuggestedSolution',
1380 'cancelExplorer',
1381 'linkChilds',
1382 'removeSuggestedSolution',
1383 'add',
1384 'addYesNo',
1385 'addTrueFalse',
1386 'createGaps',
1387 'setMediaMode',
1388 'uploadingImage',
1389 'uploadingImagemap',
1390 'addArea',
1391 'deletearea',
1392 'saveShape',
1393 'back',
1394 'addPair',
1395 'uploadingJavaapplet',
1396 'addParameter',
1397 'assessment',
1398 'addGIT',
1399 'addST',
1400 'addPG',
1401 'delete',
1402 'toggleGraphicalAnswers',
1403 'deleteAnswer',
1404 'deleteImage',
1405 'removeJavaapplet'
1406 ],
1407 '',
1408 '',
1409 $force_active
1410 );
1411 }
1412 if ($with_read_access) {
1413 $this->tabs_gui->addTab(
1414 'info_short',
1415 $this->lng->txt('info_short'),
1416 $this->ctrl->getLinkTargetByClass(
1417 [
1418 ilRepositoryGUI::class,
1419 self::class,
1420 ilInfoScreenGUI::class
1421 ]
1422 )
1423 );
1424 }
1425
1426 if ($with_write_access) {
1427 // properties
1428 $this->tabs_gui->addTarget(
1429 'settings',
1430 $this->ctrl->getLinkTargetByClass(ilObjQuestionPoolSettingsGeneralGUI::class),
1431 [],
1432 [ilObjQuestionPoolSettingsGeneralGUI::class, ilObjTaxonomyGUI::class]
1433 );
1434
1435 // skill service
1436 if ($this->isSkillsTabRequired()) {
1437 $link = $this->ctrl->getLinkTargetByClass(
1438 [ilQuestionPoolSkillAdministrationGUI::class, ilAssQuestionSkillAssignmentsGUI::class],
1440 );
1441
1442 $this->tabs_gui->addTarget('qpl_tab_competences', $link, [], []);
1443 }
1444 }
1445
1446 if ($with_read_access) {
1447 // print view
1448 $this->tabs_gui->addTarget(
1449 'print_view',
1450 $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'print'),
1451 ['print'],
1452 '',
1453 ''
1454 );
1455 }
1456
1457 if ($with_write_access) {
1458 $mdgui = new ilObjectMetaDataGUI($this->object);
1459 $mdtab = $mdgui->getTab();
1460 if ($mdtab) {
1461 $this->tabs_gui->addTarget(
1462 'meta_data',
1463 $mdtab,
1464 '',
1465 'ilmdeditorgui'
1466 );
1467 }
1468 }
1469
1470 if ($with_write_access) {
1471 $this->tabs_gui->addTarget(
1472 'export',
1473 $this->ctrl->getLinkTargetByClass(ilExportGUI::class, ''),
1474 '',
1475 'ilexportgui'
1476 );
1477 }
1478
1479 if ($this->access->checkAccess('edit_permission', '', $this->object->getRefId())) {
1480 $this->tabs_gui->addTarget(
1481 'perm_settings',
1482 $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class, ilPermissionGUI::class], 'perm'),
1483 ['perm', 'info', 'owner'],
1484 'ilpermissiongui'
1485 );
1486 }
1487 }
Export User Interface Class.
Class ilObjectMetaDataGUI.
if(!file_exists('../ilias.ini.php'))

References ILIAS\Repository\access(), ilAssQuestionSkillAssignmentsGUI\CMD_SHOW_SKILL_QUEST_ASSIGNS, ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ importFile()

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

Reimplemented from ilObjectGUI.

Definition at line 1111 of file class.ilObjQuestionPoolGUI.php.

1111 : void
1112 {
1113 $this->import_session_repository->clear();
1114
1115 $session = (new ImportSession())->withFileToImport($file_to_import);
1116 $this->import_session_repository->setSession($session);
1117 $this->import_session_repository->setCurrentStageIndex(0);
1118
1119 $this->ctrl->redirectByClass(self::class, 'processImport');
1120 }
Immutable JSON-capable import session shared by question pool and test wizards.

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjQuestionPoolGUI::infoScreenForward ( )

Definition at line 1532 of file class.ilObjQuestionPoolGUI.php.

1532 : void
1533 {
1534 if (!$this->access->checkAccess('visible', '', $this->ref_id)) {
1535 $this->error->raiseError($this->lng->txt('msg_no_perm_read'));
1536 }
1537
1538 $this->tabs_gui->activateTab('info_short');
1539 $info = new ilInfoScreenGUI($this);
1540 $info->enablePrivateNotes();
1541 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1542
1543 $this->ctrl->forwardCommand($info);
1544 }
Class ilInfoScreenGUI.
$info
Definition: entry_point.php:21

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

Referenced by questionsObject().

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

◆ infoScreenObject()

ilObjQuestionPoolGUI::infoScreenObject ( )

Definition at line 1521 of file class.ilObjQuestionPoolGUI.php.

1521 : void
1522 {
1523 $this->ctrl->redirectByClass(
1524 [
1525 ilRepositoryGUI::class,
1526 self::class,
1527 ilInfoScreenGUI::class
1528 ]
1529 );
1530 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ isSkillsTabRequired()

ilObjQuestionPoolGUI::isSkillsTabRequired ( )
private

Definition at line 1489 of file class.ilObjQuestionPoolGUI.php.

1489 : bool
1490 {
1491 if (!($this->object instanceof ilObjQuestionPool)) {
1492 return false;
1493 }
1494
1495 if (!$this->object->isSkillServiceEnabled()) {
1496 return false;
1497 }
1498
1500 return false;
1501 }
1502
1503 return true;
1504 }

References ilObjQuestionPool\isSkillManagementGloballyActivated(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ moveQuestions()

ilObjQuestionPoolGUI::moveQuestions ( array  $ids)

Definition at line 1073 of file class.ilObjQuestionPoolGUI.php.

1073 : void
1074 {
1075 if ($this->checkPermission('write')) {
1076 $this->tpl->setOnScreenMessage('failure', 'permission_denied');
1077 return;
1078 }
1079
1080 if ($ids === []) {
1081 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_move_select_none'), true);
1082 return;
1083 }
1084
1085 foreach ($ids as $id) {
1086 $this->object->moveToClipboard($id);
1087 }
1088 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_move_insert_clipboard'), true);
1089 }
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)

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

+ Here is the call graph for this function:

◆ pasteObject()

ilObjQuestionPoolGUI::pasteObject ( )

Definition at line 1047 of file class.ilObjQuestionPoolGUI.php.

1047 : void
1048 {
1049 if (ilSession::get('qpl_clipboard') != null) {
1050 if ($this->object->pasteFromClipboard()) {
1051 $this->tpl->setOnScreenMessage('success', $this->lng->txt('qpl_paste_success'), true);
1052 } else {
1053 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('qpl_paste_error'), true);
1054 }
1055 } else {
1056 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_paste_no_objects'), true);
1057 }
1058 $this->ctrl->redirect($this, self::DEFAULT_CMD);
1059 }
static get(string $a_var)

References ILIAS\Repository\ctrl(), ilSession\get(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ printObject()

ilObjQuestionPoolGUI::printObject ( )

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

1011 : void
1012 {
1013 $this->tabs_gui->activateTab('print_view');
1014 $this->ctrl->setParameter($this, 'output', 'overview');
1015 $output_link = $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'print');
1016 $this->ctrl->setParameter($this, 'output', 'detailed_output_solutions');
1017 $output_link_detailed = $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'print');
1018 $this->ctrl->setParameter($this, 'output', 'detailed_output_printview');
1019 $output_link_printview = $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'print');
1020
1021 $mode = $this->ui_factory->dropdown()->standard([
1022 $this->ui_factory->button()->shy($this->lng->txt('overview'), $output_link),
1023 $this->ui_factory->button()->shy($this->lng->txt('detailed_output_solutions'), $output_link_detailed),
1024 $this->ui_factory->button()->shy($this->lng->txt('detailed_output_printview'), $output_link_printview)
1025 ])->withLabel($this->lng->txt('output_mode'));
1026
1027 $output = $this->request_data_collector->raw('output') ?? '';
1028
1029 $table_gui = new ilQuestionPoolPrintViewTableGUI($this, 'print', $output);
1030 $data = $this->object->getPrintviewQuestions();
1031 $totalPoints = 0;
1032 foreach ($data as $d) {
1033 $totalPoints += $d['points'];
1034 }
1035 $table_gui->setTotalPoints($totalPoints);
1036 $table_gui->initColumns();
1037 $table_gui->setData($data);
1038 $this->tpl->setContent($this->ui_renderer->render($mode) . $table_gui->getHTML());
1039 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References Vendor\Package\$d, ilObjectGUI\$data, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ processImportObject()

ilObjQuestionPoolGUI::processImportObject ( )

Definition at line 1122 of file class.ilObjQuestionPoolGUI.php.

1122 : void
1123 {
1124 $permission = $this->creation_mode ? 'create' : 'read';
1125 if (!$this->checkPermissionBool($permission, '', $this->object->getType())) {
1127 return;
1128 }
1129
1130 $result = $this->buildImportWizard()->run();
1131
1132 match ($result->type) {
1133 StageResultType::RequiresUserInteraction => $this->renderImportStage($result),
1134 StageResultType::Error => $this->renderImportError($result),
1136 };
1137 }
renderImportStage(StageResult $result)
renderImportError(StageResult $result)
renderImportSuccess(StageResult $result)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)

References buildImportWizard(), ilObjectGUI\checkPermissionBool(), ILIAS\TestQuestionPool\ExportImport\Foundation\Import\CompletedSuccessfully, ILIAS\Repository\object(), redirectAfterMissingWrite(), renderImportError(), renderImportStage(), and renderImportSuccess().

+ Here is the call graph for this function:

◆ questionsObject()

ilObjQuestionPoolGUI::questionsObject ( )

list questions of question pool

Definition at line 878 of file class.ilObjQuestionPoolGUI.php.

878 : void
879 {
880 if (!$this->access->checkAccess("read", "", $this->request_data_collector->getRefId())) {
881 $this->infoScreenForward();
882 return;
883 }
884
885 $this->object->purgeQuestions();
886 $qsa_import_fails = new ilAssQuestionSkillAssignmentImportFails($this->object->getId());
887 if ($qsa_import_fails->failedImportsRegistered()) {
888 $button = $this->ui_factory->button()->standard(
889 $this->lng->txt('ass_skl_import_fails_remove_btn'),
890 $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'renoveImportFails')
891 );
892 $this->tpl->setOnScreenMessage(
893 'failure',
894 $qsa_import_fails->getFailedImportsMessage($this->lng) . '<br />' . $this->ui_renderer->render(
895 $button
896 )
897 );
898 }
899
900 $out = [];
901 if ($this->rbac_system->checkAccess('write', $this->request_data_collector->getRefId())) {
902 $btn = $this->ui_factory->button()->primary(
903 $this->lng->txt('create_question'),
904 $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'createQuestionForm')
905 );
906 $this->toolbar->addComponent($btn);
907
908 if (ilSession::get('qpl_clipboard') != null && count(ilSession::get('qpl_clipboard'))) {
909 $btn_paste = $this->ui_factory->button()->standard(
910 $this->lng->txt('paste'),
911 $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'paste')
912 );
913 $this->toolbar->addComponent($btn_paste);
914 }
915 }
916
917 $this->tpl->setPermanentLink($this->object->getType(), $this->object->getRefId());
918 $out[] = $this->getTable();
919 $content_tpl = new ilTemplate(
920 'tpl.il_as_qpl_questions.html',
921 true,
922 true,
923 'components/ILIAS/TestQuestionPool'
924 );
925
926 $content_tpl->setVariable('TITLE', $this->lng->txt('questions'));
927 $content_tpl->setVariable('QUESTIONBROWSER', implode('', $out));
928
929 $this->tpl->setContent($content_tpl->get());
930 }
$out
Definition: buildRTE.php:24
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR

References $out, ILIAS\Repository\access(), ilSession\get(), getTable(), infoScreenForward(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

◆ redirectAfterMissingWrite()

ilObjQuestionPoolGUI::redirectAfterMissingWrite ( )
protected

Definition at line 695 of file class.ilObjQuestionPoolGUI.php.

696 {
697 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_permission'), true);
698 $target_class = get_class($this->object) . 'GUI';
699 $this->ctrl->setParameterByClass($target_class, 'ref_id', $this->ref_id);
700 $this->ctrl->redirectByClass($target_class);
701 }

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

Referenced by processImportObject().

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

◆ renderImportError()

ilObjQuestionPoolGUI::renderImportError ( StageResult  $result)
private

Definition at line 1179 of file class.ilObjQuestionPoolGUI.php.

1179 : void
1180 {
1181 $this->tpl->setOnScreenMessage(
1182 GlobalTemplate::MESSAGE_TYPE_FAILURE,
1183 $result->error_message,
1184 true
1185 );
1186 }

Referenced by processImportObject().

+ Here is the caller graph for this function:

◆ renderImportStage()

ilObjQuestionPoolGUI::renderImportStage ( StageResult  $result)
private

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

1172 : void
1173 {
1174 $this->tpl->setContent(
1175 $this->ui_renderer->render($result->components)
1176 );
1177 }

Referenced by processImportObject().

+ Here is the caller graph for this function:

◆ renderImportSuccess()

ilObjQuestionPoolGUI::renderImportSuccess ( StageResult  $result)
private

Definition at line 1188 of file class.ilObjQuestionPoolGUI.php.

1188 : void
1189 {
1190 $pool_obj_id = $this->data_factory->objId($result->session->poolObjId());
1191 $pool_ref_id = $pool_obj_id->toReferenceIds()[0]->toInt();
1192
1193 $this->tpl->setOnScreenMessage(
1194 GlobalTemplate::MESSAGE_TYPE_SUCCESS,
1195 $this->lng->txt('object_imported'),
1196 true
1197 );
1198 $this->ctrl->setParameter($this, 'ref_id', $pool_ref_id);
1199 $this->ctrl->redirectByClass(self::class, self::DEFAULT_CMD);
1200 }

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

Referenced by processImportObject().

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

◆ setTitleAndDescription()

ilObjQuestionPoolGUI::setTitleAndDescription ( ?assQuestionGUI  $question_gui = null)

called by prepare output

Definition at line 1250 of file class.ilObjQuestionPoolGUI.php.

1252 : void {
1253 parent::setTitleAndDescription();
1254
1255 if ($question_gui !== null
1256 || !is_array($this->request_data_collector->raw('q_id'))
1257 && $this->request_data_collector->raw('q_id') > 0
1258 && $this->request_data_collector->raw('cmd') !== self::DEFAULT_CMD
1259 ) {
1260 $question_gui ??= assQuestionGUI::_getQuestionGUI('', $this->request_data_collector->getQuestionId());
1261 if ($question_gui->getObject() instanceof assQuestion) {
1262 $question = $question_gui->getObject();
1263 $question->setObjId($this->object->getId());
1264 $question_gui->setObject($question);
1265 $title = $this->object->getTitle() . ': ' . $question_gui->getObject()->getTitle();
1266 if (!$title) {
1267 $title = $this->lng->txt('new') . ': ' . $this->questionrepository->getForQuestionId(
1268 $question_gui->getObject()->getId()
1269 )->getTypeName($this->lng);
1270 }
1271 $this->tpl->setTitle(
1272 $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
1273 $title,
1274 )
1275 );
1276 $this->tpl->setDescription(
1277 $question_gui->getObject()->getDescriptionForHTMLOutput()
1278 );
1279 $this->tpl->setTitleIcon(ilObject2::_getIcon($this->object->getId(), 'big', $this->object->getType()));
1280 } else {
1281 // Workaround for context issues: If no object was found, redirect without q_id parameter
1282 $this->ctrl->setParameter($this, 'q_id', '');
1283 $this->ctrl->redirect($this);
1284 }
1285 } else {
1286 $this->tpl->setTitle(
1287 $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
1288 $this->object->getTitle()
1289 )
1290 );
1291 $this->tpl->setDescription(
1292 $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
1293 $this->object->getLongDescription()
1294 )
1295 );
1296 $this->tpl->setTitleIcon(ilObject2::_getIcon($this->object->getId(), 'big', $this->object->getType()));
1297 }
1298 }
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.

References ilObject\_getIcon(), assQuestionGUI\_getQuestionGUI(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ updateObject()

ilObjQuestionPoolGUI::updateObject ( )

updates object entry in object_data

Reimplemented from ilObjectGUI.

Definition at line 1041 of file class.ilObjQuestionPoolGUI.php.

1041 : void
1042 {
1043 $this->object->update();
1044 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
1045 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

Field Documentation

◆ $action_parameter_token

URLBuilderToken ilObjQuestionPoolGUI::$action_parameter_token
protected

Definition at line 99 of file class.ilObjQuestionPoolGUI.php.

◆ $archives

Archives ilObjQuestionPoolGUI::$archives
private

Definition at line 101 of file class.ilObjQuestionPoolGUI.php.

◆ $component_factory

ilComponentFactory ilObjQuestionPoolGUI::$component_factory
protected

Definition at line 93 of file class.ilObjQuestionPoolGUI.php.

◆ $component_repository

ilComponentRepository ilObjQuestionPoolGUI::$component_repository
protected

Definition at line 94 of file class.ilObjQuestionPoolGUI.php.

◆ $content_style

ContentStyle ilObjQuestionPoolGUI::$content_style
private

Definition at line 102 of file class.ilObjQuestionPoolGUI.php.

◆ $data_factory

DataFactory ilObjQuestionPoolGUI::$data_factory
protected

Definition at line 97 of file class.ilObjQuestionPoolGUI.php.

◆ $db

ilDBInterface ilObjQuestionPoolGUI::$db
protected

Definition at line 89 of file class.ilObjQuestionPoolGUI.php.

◆ $global_screen

GlobalScreen ilObjQuestionPoolGUI::$global_screen
protected

Definition at line 92 of file class.ilObjQuestionPoolGUI.php.

◆ $global_test_settings

GlobalTestSettings ilObjQuestionPoolGUI::$global_test_settings
protected

Definition at line 107 of file class.ilObjQuestionPoolGUI.php.

◆ $help

ilHelpGUI ilObjQuestionPoolGUI::$help
protected

Definition at line 91 of file class.ilObjQuestionPoolGUI.php.

◆ $import_logger

LoggerInterface ilObjQuestionPoolGUI::$import_logger
protected

Definition at line 109 of file class.ilObjQuestionPoolGUI.php.

◆ $import_session_repository

ImportSessionRepository ilObjQuestionPoolGUI::$import_session_repository
protected

Definition at line 108 of file class.ilObjQuestionPoolGUI.php.

◆ $log

ilComponentLogger ilObjQuestionPoolGUI::$log
protected

Definition at line 90 of file class.ilObjQuestionPoolGUI.php.

◆ $navigation_history

ilNavigationHistory ilObjQuestionPoolGUI::$navigation_history
protected

Definition at line 95 of file class.ilObjQuestionPoolGUI.php.

◆ $questionrepository

GeneralQuestionPropertiesRepository ilObjQuestionPoolGUI::$questionrepository
protected

Definition at line 106 of file class.ilObjQuestionPoolGUI.php.

◆ $request_data_collector

RequestDataCollector ilObjQuestionPoolGUI::$request_data_collector
protected

Definition at line 105 of file class.ilObjQuestionPoolGUI.php.

◆ $row_id_token

URLBuilderToken ilObjQuestionPoolGUI::$row_id_token
protected

Definition at line 100 of file class.ilObjQuestionPoolGUI.php.

◆ $skill_usage_service

SkillUsageService ilObjQuestionPoolGUI::$skill_usage_service
protected

Definition at line 103 of file class.ilObjQuestionPoolGUI.php.

◆ $taxonomy

Service ilObjQuestionPoolGUI::$taxonomy
protected

Definition at line 88 of file class.ilObjQuestionPoolGUI.php.

◆ $ui_service

ilUIService ilObjQuestionPoolGUI::$ui_service
protected

Definition at line 96 of file class.ilObjQuestionPoolGUI.php.

◆ $url_builder

URLBuilder ilObjQuestionPoolGUI::$url_builder
protected

Definition at line 98 of file class.ilObjQuestionPoolGUI.php.

◆ DEFAULT_CMD

◆ SUPPORTED_IMPORT_MIME_TYPES

const ilObjQuestionPoolGUI::SUPPORTED_IMPORT_MIME_TYPES
Initial value:
= [
MimeType::APPLICATION__X_ZIP_COMPRESSED,
MimeType::APPLICATION__ZIP,
MimeType::TEXT__XML
]

Definition at line 81 of file class.ilObjQuestionPoolGUI.php.

Referenced by QuestionPoolImportUploadHandlerGUI\__construct().


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