ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
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...
 
 importVerifiedFileObject ()
 
 importVerifiedQuestionsFileObject ()
 
 uploadQuestionsImportObject ()
 
 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 (?RoundTripModal $import_questions_modal=null)
 list questions of question pool More...
 
 printObject ()
 
 updateObject ()
 updates object entry in object_data More...
 
 pasteObject ()
 
 copyQuestions (array $ids)
 
 moveQuestions (array $ids)
 
 createExportExcel ()
 
 editQuestionForTestObject ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 setTitleAndDescription ()
 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...
 
 renoveImportFailsObject ()
 
 fetchAuthoringQuestionIdParamater ()
 
 importQuestionsFile (string $path_to_uploaded_file_in_temp_dir)
 
 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
 
- 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

 buildImportQuestionsModal ()
 
 importQuestionPoolWithValidManifest (ilObjQuestionPool $obj, array $selected_questions, string $file_to_import)
 
 importQuestionsFromQtiFile (ilObjQuestionPool $obj, array $selected_questions, string $qtifile, string $importdir, string $xmlfile='')
 
 cleanupAfterImport (string $importdir)
 
 createQuestionFormObject (?Form $form=null)
 
 buildQuestionCreationForm ()
 
 buildInputQuestionType ()
 
 buildInputEditingType ()
 
 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 1403 of file class.ilObjQuestionPoolGUI.php.

1403 : void
1404 {
1405 $ilLocator = $this->locator;
1406
1407 switch ($this->ctrl->getCmd()) {
1408 case 'create':
1409 case 'importFile':
1410 case 'cancel':
1411 break;
1412 default:
1413 $this->ctrl->clearParameterByClass(self::class, 'q_id');
1414 $ilLocator->addItem(
1415 $this->object->getTitle(),
1416 $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], ''),
1417 '',
1418 $this->request_data_collector->getRefId()
1419 );
1420 $this->ctrl->setParameter($this, 'q_id', $this->request_data_collector->getQuestionId());
1421 break;
1422 }
1423
1424 if (!is_array($this->request_data_collector->raw('q_id')) && $this->request_data_collector->raw('q_id') > 0 && $this->request_data_collector->raw(
1425 'cmd'
1426 ) !== self::DEFAULT_CMD) {
1427 $question_gui = assQuestionGUI::_getQuestionGUI('', $this->request_data_collector->getQuestionId());
1428 if ($question_gui !== null && $question_gui->getObject() instanceof assQuestion) {
1429 $question = $question_gui->getObject();
1430 $question->setObjId($this->object->getId());
1431 $question_gui->setObject($question);
1432 $title = $question_gui->getObject()->getTitleForHTMLOutput();
1433 if (!$title) {
1434 $title = $this->lng->txt('new') . ': ' . $this->questionrepository->getForQuestionId(
1435 $question_gui->getObject()->getId()
1436 )->getTypeName($this->lng);
1437 }
1438 $ilLocator->addItem($title, $this->ctrl->getLinkTargetByClass(get_class($question_gui), 'editQuestion'));
1439 } else {
1440 // Workaround for context issues: If no object was found, redirect without q_id parameter
1441 $this->ctrl->setParameter($this, 'q_id', '');
1442 $this->ctrl->redirect($this);
1443 }
1444 }
1445 }
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 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 1703 of file class.ilObjQuestionPoolGUI.php.

1703 : void
1704 {
1705 $tabs->addSubTab(
1707 $this->lng->txt('qpl_settings_subtab_general'),
1708 $this->ctrl->getLinkTargetByClass(ilObjQuestionPoolSettingsGeneralGUI::class),
1709 );
1710
1711 $tabs->addSubTab(
1712 'tax_settings',
1713 $this->lng->txt('qpl_settings_subtab_taxonomies'),
1714 $this->ctrl->getLinkTargetByClass(ilTaxonomySettingsGUI::class, ''),
1715 );
1716 }
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 953 of file class.ilObjQuestionPoolGUI.php.

953 : void
954 {
955 // always send a message
956 $this->tpl->setOnScreenMessage('success', $this->lng->txt('object_added'), true);
957
959 'ilias.php?ref_id=' . $new_object->getRefId() .
960 '&baseClass=ilObjQuestionPoolGUI'
961 );
962 }
static redirect(string $a_script)

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

+ Here is the call graph for this function:

◆ buildImportQuestionsModal()

ilObjQuestionPoolGUI::buildImportQuestionsModal ( )
private

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

855 : RoundTripModal
856 {
857 $constraint = $this->refinery->custom()->constraint(
858 function ($vs): bool {
859 if ($vs === []) {
860 return false;
861 }
862 return true;
863 },
864 $this->lng->txt('msg_no_files_selected')
865 );
866
867 $file_upload_input = $this->ui_factory->input()->field()
868 ->file(new \QuestionPoolImportUploadHandlerGUI(), $this->lng->txt('import_file'))
869 ->withAcceptedMimeTypes(self::SUPPORTED_IMPORT_MIME_TYPES)
870 ->withMaxFiles(1)
871 ->withAdditionalTransformation($constraint);
872 return $this->ui_factory->modal()->roundtrip(
873 $this->lng->txt('import'),
874 [],
875 ['import_file' => $file_upload_input],
876 $this->ctrl->getFormActionByClass(self::class, 'uploadQuestionsImport')
877 )->withSubmitLabel($this->lng->txt('import'));
878 }

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

Referenced by uploadQuestionsImportObject().

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

◆ buildInputEditingType()

ilObjQuestionPoolGUI::buildInputEditingType ( )
private

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

1189 : Input
1190 {
1191 if (!$this->global_test_settings->isPageEditorEnabled()) {
1192 return $this->ui_factory->input()->field()->hidden()->withValue(
1194 );
1195 }
1196
1197 return $this->ui_factory->input()->field()->radio($this->lng->txt('tst_add_quest_cont_edit_mode'))
1198 ->withOption(
1200 $this->lng->txt('tst_add_quest_cont_edit_mode_IPE'),
1201 $this->lng->txt('tst_add_quest_cont_edit_mode_IPE_info')
1202 )->withOption(
1204 $this->lng->txt('tst_add_quest_cont_edit_mode_RTE'),
1205 $this->lng->txt('tst_add_quest_cont_edit_mode_RTE_info')
1206 )
1208 }
const ADDITIONAL_CONTENT_EDITING_MODE_RTE
const ADDITIONAL_CONTENT_EDITING_MODE_IPE
This describes commonalities between all inputs.
Definition: Input.php:47
withValue($value)
Get an input like this with another value displayed on the client side.

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

+ Here is the call graph for this function:

◆ buildInputQuestionType()

ilObjQuestionPoolGUI::buildInputQuestionType ( )
private

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

1175 : Select
1176 {
1177 $question_types = (new ilObjQuestionPool())->getQuestionTypes(false, true, false);
1178 $options = [];
1179 foreach ($question_types as $label => $data) {
1180 $options[$data['question_type_id']] = $label;
1181 }
1182
1183 return $this->ui_factory->input()->field()->select(
1184 $this->lng->txt('question_type'),
1185 $options
1186 )->withRequired(true);
1187 }
This describes select field.
Definition: Select.php:29

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

+ Here is the call graph for this function:

◆ buildQuestionCreationForm()

ilObjQuestionPoolGUI::buildQuestionCreationForm ( )
private

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

1158 : Form
1159 {
1160 $inputs['question_type'] = $this->buildInputQuestionType();
1161 $inputs['editing_type'] = $this->buildInputEditingType();
1162
1163 $section = [
1164 $this->ui_factory->input()->field()->section($inputs, $this->lng->txt('ass_create_question'))
1165 ];
1166
1167 $form = $this->ui_factory->input()->container()->form()->standard(
1168 $this->ctrl->getFormAction($this, 'createQuestion'),
1169 $section
1170 )->withSubmitLabel($this->lng->txt('create'));
1171
1172 return $form;
1173 }
This describes commonalities between all forms.
Definition: Form.php:34

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

+ Here is the call graph for this function:

◆ cancelDeleteQuestionsObject()

ilObjQuestionPoolGUI::cancelDeleteQuestionsObject ( )

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

1035 : void
1036 {
1037 $this->ctrl->redirect($this, self::DEFAULT_CMD);
1038 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cleanupAfterImport()

ilObjQuestionPoolGUI::cleanupAfterImport ( string  $importdir)
private

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

921 : void
922 {
923 ilFileUtils::delDir($importdir);
924 $this->deleteUploadedImportFile(ilSession::get('path_to_uploaded_file_in_temp_dir'));
925 ilSession::clear('path_to_import_file');
926 ilSession::clear('path_to_uploaded_file_in_temp_dir');
927 }
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
deleteUploadedImportFile(string $path_to_uploaded_file_in_temp_dir)
static get(string $a_var)
static clear(string $a_var)

References ilSession\clear(), ilFileUtils\delDir(), and ilSession\get().

Referenced by importVerifiedFileObject(), and importVerifiedQuestionsFileObject().

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

◆ confirmDeleteQuestions()

ilObjQuestionPoolGUI::confirmDeleteQuestions ( array  $ids)

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

964 : void
965 {
966 $rbacsystem = $this->rbac_system;
967
968 $questionIdsToDelete = array_filter(array_map('intval', $ids));
969 if (0 === count($questionIdsToDelete)) {
970 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_delete_select_none'), true);
971 $this->ctrl->redirect($this, self::DEFAULT_CMD);
972 }
973
974 $this->tpl->setOnScreenMessage('question', $this->lng->txt('qpl_confirm_delete_questions'));
975 $deleteable_questions = $this->object->getDeleteableQuestionDetails($questionIdsToDelete);
976 $table_gui = new ilQuestionBrowserTableGUI($this, self::DEFAULT_CMD, (($rbacsystem->checkAccess('write', $this->request_data_collector->getRefId()) ? true : false)), true);
977 $table_gui->setShowRowsSelector(false);
978 $table_gui->setLimit(PHP_INT_MAX);
979 $table_gui->setEditable($rbacsystem->checkAccess('write', $this->request_data_collector->getRefId()));
980 $table_gui->setData($deleteable_questions);
981 $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
982 }
ilRbacSystem $rbac_system

References 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 1020 of file class.ilObjQuestionPoolGUI.php.

1020 : void
1021 {
1022 $qst_ids = $this->request_data_collector->intArray('q_id');
1023 foreach ($qst_ids as $value) {
1024 $this->object->deleteQuestion((int) $value);
1025 $this->object->cleanupClipboard((int) $value);
1026 }
1027 if ($qst_ids !== []) {
1028 $this->tpl->setOnScreenMessage('success', $this->lng->txt('qpl_questions_deleted'), true);
1029 }
1030
1031 $this->ctrl->setParameter($this, 'q_id', '');
1032 $this->ctrl->redirect($this, self::DEFAULT_CMD);
1033 }

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

+ Here is the call graph for this function:

◆ copyQuestions()

ilObjQuestionPoolGUI::copyQuestions ( array  $ids)

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

1260 : void
1261 {
1262 if ($ids) {
1263 foreach ($ids as $id) {
1264 $this->object->copyToClipboard($id);
1265 }
1266 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_copy_insert_clipboard'), true);
1267 } else {
1268 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_copy_select_none'), true);
1269 }
1270 }

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

+ Here is the call graph for this function:

◆ createExportExcel()

ilObjQuestionPoolGUI::createExportExcel ( )

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

1290 : void
1291 {
1292 $rbacsystem = $this->rbac_system;
1293 if ($rbacsystem->checkAccess('write', $this->request_data_collector->getRefId())) {
1294 $question_ids = &$this->object->getAllQuestionIds();
1295 $qpl_exp = new ilQuestionpoolExport($this->object, 'xlsx', $question_ids);
1296 $qpl_exp->buildExportFile();
1297 $this->ctrl->redirectByClass('ilquestionpoolexportgui', '');
1298 }
1299 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ createQuestionFormObject()

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

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

1142 : void
1143 {
1144 $this->help->setScreenId('assQuestions');
1145 if ($this->global_test_settings->isPageEditorEnabled()) {
1146 $this->help->setSubScreenId('createQuestion_editMode');
1147 } else {
1148 $this->help->setSubScreenId('createQuestion');
1149 }
1150
1151 $this->tpl->setContent(
1152 $this->ui_renderer->render(
1153 $form ?? $this->buildQuestionCreationForm()
1154 )
1155 );
1156 }

References ILIAS\Repository\help().

+ Here is the call graph for this function:

◆ deleteQuestionsObject()

ilObjQuestionPoolGUI::deleteQuestionsObject ( )

delete questions confirmation screen

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

987 : void
988 {
989 $rbacsystem = $this->rbac_system;
990
991 $questionIdsToDelete = $this->request_data_collector->isset('q_id') ? (array) $this->request_data_collector->raw('q_id') : [];
992 if ($questionIdsToDelete === [] && $this->request_data_collector->isset('q_id')) {
993 $questionIdsToDelete = [$this->request_data_collector->getQuestionId()];
994 }
995
996 $questionIdsToDelete = array_filter(array_map('intval', $questionIdsToDelete));
997 if ($questionIdsToDelete === []) {
998 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_delete_select_none'), true);
999 $this->ctrl->redirect($this, self::DEFAULT_CMD);
1000 }
1001
1002 $this->tpl->setOnScreenMessage('question', $this->lng->txt('qpl_confirm_delete_questions'));
1003 $deleteable_questions = &$this->object->getDeleteableQuestionDetails($questionIdsToDelete);
1004 $table_gui = new ilQuestionBrowserTableGUI(
1005 $this,
1006 self::DEFAULT_CMD,
1007 (($rbacsystem->checkAccess('write', $this->request_data_collector->getRefId()) ? true : false)),
1008 true
1009 );
1010 $table_gui->setShowRowsSelector(false);
1011 $table_gui->setLimit(PHP_INT_MAX);
1012 $table_gui->setEditable($rbacsystem->checkAccess('write', $this->request_data_collector->getRefId()));
1013 $table_gui->setData($deleteable_questions);
1014 $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
1015 }

References 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 727 of file class.ilObjQuestionPoolGUI.php.

727 : void
728 {
729 $pg_obj = new ilAssQuestionPage($this->request_data_collector->raw('pg_id'));
730 $pg_obj->sendParagraph($this->request_data_collector->raw('par_id'), $this->request_data_collector->raw('downloadtitle'));
731 exit;
732 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
exit

References exit.

◆ downloadFileObject()

ilObjQuestionPoolGUI::downloadFileObject ( )

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

704 : void
705 {
706 $file = explode('_', $this->request_data_collector->raw('file_id'));
707 $fileObj = new ilObjFile((int) $file[count($file) - 1], false);
708 $fileObj->sendFile();
709 exit;
710 }
Class ilObjFile.

References exit.

◆ editQuestionForTestObject()

ilObjQuestionPoolGUI::editQuestionForTestObject ( )

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

1301 : void
1302 {
1303 $this->ctrl->redirectByClass(ilAssQuestionPreviewGUI::class, 'show');
1304 }

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 699 of file class.ilObjQuestionPoolGUI.php.

699 : void
700 {
701 $this->ctrl->redirectByClass('ilQuestionPoolExportGUI');
702 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ exportQuestions()

ilObjQuestionPoolGUI::exportQuestions ( array  $ids)

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

1040 : void
1041 {
1042 if ($ids !== []) {
1043 $qpl_exp = new ilQuestionpoolExport($this->object, 'xml', $ids);
1044 // @PHP8-CR: This seems to be a pointer to an issue with exports. I like to leave this open for now and
1045 // schedule a thorough examination / analysis for later, eventually involved T&A TechSquad
1046 $export_file = $qpl_exp->buildExportFile();
1047 $filename = $export_file;
1048 $filename = preg_replace('/.*\//', '', $filename);
1049 if ($export_file === '') {
1050 $export_file = 'StandIn';
1051 }
1053 exit();
1054 } else {
1055 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_export_select_none'), true);
1056 }
1057 }
$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 1131 of file class.ilObjQuestionPoolGUI.php.

1131 : int
1132 {
1133 $q_id = $this->request_data_collector->getQuestionId();
1134
1135 if ($q_id === 0 || $this->object->checkQuestionParent($q_id)) {
1136 return $q_id;
1137 }
1138
1139 throw new ilTestQuestionPoolException('question id does not relate to parent object!');
1140 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ fullscreenObject()

ilObjQuestionPoolGUI::fullscreenObject ( )

show fullscreen view

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

715 : void
716 {
717 $page_gui = new ilAssQuestionPageGUI($this->request_data_collector->raw('pg_id'));
718 $page_gui->setFileDownloadLink(
719 $this->ctrl->getLinkTargetByClass(ilObjQuestionPoolGUI::class, 'downloadFile')
720 );
721 $page_gui->showMediaFullscreen();
722 }
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 1787 of file class.ilObjQuestionPoolGUI.php.

1787 : string
1788 {
1790 $r = $this->ui_renderer;
1791
1792 $table = new QuestionTable(
1793 $f,
1794 $r,
1795 $this->data_factory,
1796 $this->refinery,
1797 $this->url_builder,
1798 $this->action_parameter_token,
1799 $this->row_id_token,
1800 $this->db,
1801 $this->lng,
1802 $this->component_repository,
1803 $this->rbac_system,
1804 $this->user,
1805 $this->taxonomy->domain(),
1806 $this->notes_service,
1807 $this->object->getId(),
1808 $this->request_data_collector->getRefId()
1809 );
1810
1815 $filter_action = $this->ctrl->getLinkTarget($this, self::DEFAULT_CMD);
1816 $filter = $table->getFilter($this->ui_service, $filter_action);
1817
1818 $filter_params = $this->ui_service->filter()->getData($filter);
1819
1820 if ($filter_params) {
1821 foreach (array_filter($filter_params) as $item => $value) {
1822 switch ($item) {
1823 case 'taxonomies':
1824 foreach ($value as $tax_value) {
1825 if ($tax_value === 'null') {
1826 $table->addTaxonomyFilterNoTaxonomySet(true);
1827 } else {
1828 $tax_nodes = explode('-', $tax_value);
1829 $tax_id = array_shift($tax_nodes);
1830 $table->addTaxonomyFilter(
1831 $tax_id,
1832 $tax_nodes,
1833 $this->object->getId(),
1834 $this->object->getType()
1835 );
1836 }
1837 }
1838 break;
1839 case 'commented':
1840 $table->setCommentFilter((int) $value);
1841 break;
1842 default:
1843 $table->addFieldFilter($item, $value);
1844 }
1845 }
1846 }
1847
1848 return $r->render([
1849 $filter,
1850 $table->getTable()
1851 ->withRequest($this->request)
1852 ]);
1853 }
UIFactory $ui_factory
UIRenderer $ui_renderer

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

+ Here is the call graph for this function:

◆ getTabs()

ilObjQuestionPoolGUI::getTabs ( )

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

Reimplemented from ilObjectGUI.

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

1502 : void
1503 {
1504 $with_write_access = $this->access->checkAccess('write', '', $this->object->getRefId());
1505 $with_read_access = $this->access->checkAccess('read', '', $this->object->getRefId());
1506
1507 $this->help->setScreenIdComponent('qpl');
1508
1509 switch ($this->ctrl->getNextClass()) {
1510 case '':
1511 case strtolower(ilInfoScreenGUI::class):
1512 case strtolower(ilPermissionGUI::class):
1513 case strtolower(ilObjectMetaDataGUI::class):
1514 case strtolower(ilExportGUI::class):
1515 case strtolower(ilQuestionPoolSkillAdministrationGUI::class):
1516 break;
1517
1518 case strtolower(ilTaxonomySettingsGUI::class):
1519 case strtolower(ilObjQuestionPoolSettingsGeneralGUI::class):
1520 if ($with_write_access) {
1521 $this->addSettingsSubTabs($this->tabs_gui);
1522 }
1523
1524 break;
1525
1526 default:
1527 return;
1528 }
1529 // questions
1530 $force_active = false;
1531 $commands = $this->request_data_collector->raw('cmd');
1532 if (is_array($commands)) {
1533 foreach ($commands as $key => $value) {
1534 if (preg_match('/^delete_.*/', $key, $matches) ||
1535 preg_match('/^addSelectGap_.*/', $key, $matches) ||
1536 preg_match('/^addTextGap_.*/', $key, $matches) ||
1537 preg_match('/^deleteImage_.*/', $key, $matches) ||
1538 preg_match('/^upload_.*/', $key, $matches) ||
1539 preg_match('/^addSuggestedSolution_.*/', $key, $matches)
1540 ) {
1541 $force_active = true;
1542 }
1543 }
1544 }
1545
1546 $force_active = $force_active || $this->request_data_collector->isset('imagemap_x');
1547 if (!$force_active) {
1548 $force_active = strtolower($this->ctrl->getCmdClass()) === strtolower(self::class)
1549 || $this->ctrl->getCmdClass() === '' && $this->ctrl->getCmd() === ''
1550 ? true
1551 : false;
1552 }
1553 if ($with_read_access) {
1554 $this->tabs_gui->addTarget(
1555 'assQuestions',
1556 $this->ctrl->getLinkTargetByClass(
1557 [ilRepositoryGUI::class, self::class],
1558 self::DEFAULT_CMD
1559 ),
1560 [
1561 self::DEFAULT_CMD,
1562 'filter',
1563 'resetFilter',
1564 'createQuestion',
1565 'importQuestions',
1566 'deleteQuestions',
1567 'filterQuestionBrowser',
1568 'view',
1569 'preview',
1570 'editQuestion',
1571 'exec_pg',
1572 'addItem',
1573 'upload',
1574 'save',
1575 'cancel',
1576 'addSuggestedSolution',
1577 'cancelExplorer',
1578 'linkChilds',
1579 'removeSuggestedSolution',
1580 'add',
1581 'addYesNo',
1582 'addTrueFalse',
1583 'createGaps',
1584 'setMediaMode',
1585 'uploadingImage',
1586 'uploadingImagemap',
1587 'addArea',
1588 'deletearea',
1589 'saveShape',
1590 'back',
1591 'addPair',
1592 'uploadingJavaapplet',
1593 'addParameter',
1594 'assessment',
1595 'addGIT',
1596 'addST',
1597 'addPG',
1598 'delete',
1599 'toggleGraphicalAnswers',
1600 'deleteAnswer',
1601 'deleteImage',
1602 'removeJavaapplet'
1603 ],
1604 '',
1605 '',
1606 $force_active
1607 );
1608 }
1609 if ($with_read_access) {
1610 $this->tabs_gui->addTab(
1611 'info_short',
1612 $this->lng->txt('info_short'),
1613 $this->ctrl->getLinkTargetByClass(
1614 [
1615 ilRepositoryGUI::class,
1616 self::class,
1617 ilInfoScreenGUI::class
1618 ]
1619 )
1620 );
1621 }
1622
1623 if ($with_write_access) {
1624 // properties
1625 $this->tabs_gui->addTarget(
1626 'settings',
1627 $this->ctrl->getLinkTargetByClass(ilObjQuestionPoolSettingsGeneralGUI::class),
1628 [],
1629 [ilObjQuestionPoolSettingsGeneralGUI::class, ilObjTaxonomyGUI::class]
1630 );
1631
1632 // skill service
1633 if ($this->isSkillsTabRequired()) {
1634 $link = $this->ctrl->getLinkTargetByClass(
1635 [ilQuestionPoolSkillAdministrationGUI::class, ilAssQuestionSkillAssignmentsGUI::class],
1637 );
1638
1639 $this->tabs_gui->addTarget('qpl_tab_competences', $link, [], []);
1640 }
1641 }
1642
1643 if ($with_read_access) {
1644 // print view
1645 $this->tabs_gui->addTarget(
1646 'print_view',
1647 $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'print'),
1648 ['print'],
1649 '',
1650 ''
1651 );
1652 }
1653
1654 if ($with_write_access) {
1655 $mdgui = new ilObjectMetaDataGUI($this->object);
1656 $mdtab = $mdgui->getTab();
1657 if ($mdtab) {
1658 $this->tabs_gui->addTarget(
1659 'meta_data',
1660 $mdtab,
1661 '',
1662 'ilmdeditorgui'
1663 );
1664 }
1665 }
1666
1667 if ($with_write_access) {
1668 $this->tabs_gui->addTarget(
1669 'export',
1670 $this->ctrl->getLinkTargetByClass(ilExportGUI::class, ''),
1671 '',
1672 'ilexportgui'
1673 );
1674 }
1675
1676 if ($this->access->checkAccess('edit_permission', '', $this->object->getRefId())) {
1677 $this->tabs_gui->addTarget(
1678 'perm_settings',
1679 $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class, ilPermissionGUI::class], 'perm'),
1680 ['perm', 'info', 'owner'],
1681 'ilpermissiongui'
1682 );
1683 }
1684 }
return true
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(), ILIAS\Repository\object(), and true.

+ 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 1360 of file class.ilObjQuestionPoolGUI.php.

1360 : void
1361 {
1362 list($subdir, $importdir, $xmlfile, $qtifile) = $this->buildImportDirectoriesFromImportFile($file_to_import);
1363
1365 ->withZipOutputPath($this->getImportTempDirectory());
1366
1367 $unzip = $this->archives->unzip(Streams::ofResource(fopen($file_to_import, 'r')), $options);
1368 $unzip->extract();
1369
1370 if (!file_exists($qtifile)) {
1371 ilFileUtils::delDir($importdir);
1372 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('cannot_find_xml'), true);
1373 return;
1374 }
1375
1376 ilSession::set('path_to_import_file', $file_to_import);
1377 ilSession::set('path_to_uploaded_file_in_temp_dir', $path_to_uploaded_file_in_temp_dir);
1378
1379 $this->ctrl->setParameterByClass(self::class, 'new_type', $this->type);
1380 $form = $this->buildImportQuestionsSelectionForm(
1381 'importVerifiedFile',
1382 $importdir,
1383 $qtifile,
1384 $path_to_uploaded_file_in_temp_dir
1385 );
1386
1387 if ($form === null) {
1388 return;
1389 }
1390
1391 $panel = $this->ui_factory->panel()->standard(
1392 $this->lng->txt('import_qpl'),
1393 [
1394 $this->ui_factory->legacy()->content($this->lng->txt('qpl_import_verify_found_questions')),
1395 $form
1396 ]
1397 );
1398 $this->tpl->setContent($this->ui_renderer->render($panel));
1399 $this->tpl->printToStdout();
1400 exit;
1401 }
static set(string $a_var, $a_val)
Set a value.
buildImportQuestionsSelectionForm(string $form_cmd, string $importdir, string $qtifile, ?string $path_to_uploaded_file_in_temp_dir=null)
buildImportDirectoriesFromImportFile(string $file_to_import)

References ILIAS\UI\Implementation\Component\Input\Field\$options, ILIAS\TestQuestionPool\Import\buildImportDirectoriesFromImportFile(), ILIAS\TestQuestionPool\Import\buildImportQuestionsSelectionForm(), ILIAS\Repository\ctrl(), ilFileUtils\delDir(), exit, ILIAS\TestQuestionPool\Import\getImportTempDirectory(), ILIAS\Repository\lng(), and ilSession\set().

+ Here is the call graph for this function:

◆ importQuestionPoolWithValidManifest()

ilObjQuestionPoolGUI::importQuestionPoolWithValidManifest ( ilObjQuestionPool  $obj,
array  $selected_questions,
string  $file_to_import 
)
private

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

884 : void {
885 ilSession::set('qpl_import_selected_questions', $selected_questions);
886 $imp = new ilImport($this->request_data_collector->getRefId());
887 $map = $imp->getMapping();
888 $map->addMapping('components/ILIAS/TestQuestionPool', 'qpl', 'new_id', (string) $obj->getId());
889 $imp->importObject($obj, $file_to_import, basename($file_to_import), 'qpl', 'components/ILIAS/TestQuestionPool', true);
890 }
Import class.

Referenced by importVerifiedFileObject(), and importVerifiedQuestionsFileObject().

+ Here is the caller graph for this function:

◆ importQuestionsFile()

ilObjQuestionPoolGUI::importQuestionsFile ( string  $path_to_uploaded_file_in_temp_dir)
protected

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

1306 : void
1307 {
1308 if (!$this->temp_file_system->hasDir($path_to_uploaded_file_in_temp_dir)
1309 || ($files = $this->temp_file_system->listContents($path_to_uploaded_file_in_temp_dir)) === []
1310 || mb_stripos($files[0]->getPath(), 'tst') !== false) {
1311 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('obj_import_file_error'), true);
1312 $this->ctrl->redirectByClass(self::class, self::DEFAULT_CMD);
1313 }
1314
1315 $file_to_import = $this->import_temp_directory . DIRECTORY_SEPARATOR . $files[0]->getPath();
1316 $qtifile = $file_to_import;
1317 $importdir = dirname($file_to_import);
1318
1319
1320 if ($this->temp_file_system->getMimeType($files[0]->getPath()) === MimeType::APPLICATION__ZIP) {
1322 ->withZipOutputPath($this->getImportTempDirectory());
1323 $unzip = $this->archives->unzip($this->temp_file_system->readStream($files[0]->getPath()), $options);
1324 $unzip->extract();
1325 list($subdir, $importdir, $xmlfile, $qtifile) = $this->buildImportDirectoriesFromImportFile($file_to_import);
1326 }
1327 if (!file_exists($qtifile)) {
1328 ilFileUtils::delDir($importdir);
1329 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('cannot_find_xml'), true);
1330 $this->questionsObject();
1331 return;
1332 }
1333
1334 ilSession::set('path_to_import_file', $file_to_import);
1335 ilSession::set('path_to_uploaded_file_in_temp_dir', $path_to_uploaded_file_in_temp_dir);
1336
1337 $form = $this->buildImportQuestionsSelectionForm(
1338 'importVerifiedQuestionsFile',
1339 $importdir,
1340 $qtifile,
1341 $path_to_uploaded_file_in_temp_dir
1342 );
1343
1344 if ($form === null) {
1345 return;
1346 }
1347
1348 $panel = $this->ui_factory->panel()->standard(
1349 $this->lng->txt('import_question'),
1350 [
1351 $this->ui_factory->legacy()->content($this->lng->txt('qpl_import_verify_found_questions')),
1352 $form
1353 ]
1354 );
1355 $this->tpl->setContent($this->ui_renderer->render($panel));
1356 $this->tpl->printToStdout();
1357 exit;
1358 }
questionsObject(?RoundTripModal $import_questions_modal=null)
list questions of question pool

References ILIAS\UI\Implementation\Component\Input\Field\$options, ILIAS\TestQuestionPool\Import\buildImportDirectoriesFromImportFile(), ILIAS\TestQuestionPool\Import\buildImportQuestionsSelectionForm(), ILIAS\Repository\ctrl(), ilFileUtils\delDir(), exit, ILIAS\TestQuestionPool\Import\getImportTempDirectory(), ILIAS\Repository\lng(), and ilSession\set().

Referenced by uploadQuestionsImportObject().

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

◆ importQuestionsFromQtiFile()

ilObjQuestionPoolGUI::importQuestionsFromQtiFile ( ilObjQuestionPool  $obj,
array  $selected_questions,
string  $qtifile,
string  $importdir,
string  $xmlfile = '' 
)
private

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

898 : void {
899 $qti_parser = new ilQTIParser(
900 $importdir,
901 $qtifile,
903 $obj->getId(),
904 $selected_questions
905 );
906 $qti_parser->startParsing();
907
908 if ($xmlfile === '') {
909 return;
910 }
911
912 $cont_parser = new ilQuestionPageParser(
913 $obj,
914 $xmlfile,
915 $importdir
916 );
917 $cont_parser->setQuestionMapping($qti_parser->getImportMapping());
918 $cont_parser->startParsing();
919 }
Legacy Content Object Parser.

Referenced by importVerifiedFileObject(), and importVerifiedQuestionsFileObject().

+ Here is the caller graph for this function:

◆ importVerifiedFileObject()

ilObjQuestionPoolGUI::importVerifiedFileObject ( )

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

734 : void
735 {
736 if ($this->creation_mode
737 && !$this->checkPermissionBool('create', '', $this->request_data_collector->string('new_type'))
738 || !$this->creation_mode
739 && !$this->checkPermissionBool('read', '', $this->object->getType())) {
741 return;
742 }
743
744 $file_to_import = ilSession::get('path_to_import_file');
745 list($subdir, $importdir, $xmlfile, $qtifile) = $this->buildImportDirectoriesFromImportFile($file_to_import);
746
747 $new_obj = new ilObjQuestionPool(0, true);
748 $new_obj->setType($this->request_data_collector->raw('new_type'));
749 $new_obj->setTitle('dummy');
750 $new_obj->setDescription('questionpool import');
751 $new_obj->create(true);
752 $new_obj->createReference();
753 $new_obj->putInTree($this->request_data_collector->getRefId());
754 $new_obj->setPermissions($this->request_data_collector->getRefId());
755
757 'importVerifiedFile',
758 $importdir,
759 $qtifile,
760 $this->request
761 );
762
763 if (is_file($importdir . DIRECTORY_SEPARATOR . 'manifest.xml')) {
765 $new_obj,
766 $selected_questions,
767 $file_to_import
768 );
769 } else {
771 $new_obj,
772 $selected_questions,
773 $qtifile,
774 $importdir,
775 $xmlfile
776 );
777
778 $new_obj->fromXML($xmlfile);
779
780 $new_obj->update();
781 $new_obj->saveToDb();
782 }
783 $this->cleanupAfterImport($importdir);
784
785 $this->tpl->setOnScreenMessage('success', $this->lng->txt('object_imported'), true);
786 $this->ctrl->setParameterByClass(self::class, 'ref_id', $new_obj->getRefId());
787 $this->ctrl->redirectByClass(self::class);
788 }
importQuestionsFromQtiFile(ilObjQuestionPool $obj, array $selected_questions, string $qtifile, string $importdir, string $xmlfile='')
cleanupAfterImport(string $importdir)
importQuestionPoolWithValidManifest(ilObjQuestionPool $obj, array $selected_questions, string $file_to_import)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
retrieveSelectedQuestionsFromImportQuestionsSelectionForm(string $form_cmd, string $importdir, string $qtifile, ServerRequestInterface $request)

References ILIAS\TestQuestionPool\Import\buildImportDirectoriesFromImportFile(), ilObjectGUI\checkPermissionBool(), cleanupAfterImport(), ILIAS\Repository\ctrl(), ilSession\get(), importQuestionPoolWithValidManifest(), importQuestionsFromQtiFile(), ILIAS\Repository\lng(), redirectAfterMissingWrite(), and ILIAS\TestQuestionPool\Import\retrieveSelectedQuestionsFromImportQuestionsSelectionForm().

+ Here is the call graph for this function:

◆ importVerifiedQuestionsFileObject()

ilObjQuestionPoolGUI::importVerifiedQuestionsFileObject ( )

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

790 : void
791 {
792 $file_to_import = ilSession::get('path_to_import_file');
793
794 if (mb_substr($file_to_import, -3) === 'xml') {
795 $importdir = dirname($file_to_import);
797 'importVerifiedQuestionsFile',
798 $importdir,
799 $file_to_import,
800 $this->request
801 );
803 $this->getObject(),
804 $selected_questions,
805 $file_to_import,
806 $importdir
807 );
808 } else {
809 list($subdir, $importdir, $xmlfile, $qtifile) = $this->buildImportDirectoriesFromImportFile($file_to_import);
811 'importVerifiedQuestionsFile',
812 $importdir,
813 $qtifile,
814 $this->request
815 );
816 if (is_file($importdir . DIRECTORY_SEPARATOR . 'manifest.xml')) {
818 $this->getObject(),
819 $selected_questions,
820 $file_to_import
821 );
822 } else {
824 $this->getObject(),
825 $selected_questions,
826 $qtifile,
827 $importdir,
828 $xmlfile
829 );
830 }
831 }
832
833 $this->cleanupAfterImport($importdir);
834
835 $this->tpl->setOnScreenMessage('success', $this->lng->txt('object_imported'), true);
836 $this->questionsObject();
837 }

References ILIAS\TestQuestionPool\Import\buildImportDirectoriesFromImportFile(), cleanupAfterImport(), ilSession\get(), ilObjectGUI\getObject(), importQuestionPoolWithValidManifest(), importQuestionsFromQtiFile(), ILIAS\Repository\lng(), questionsObject(), and ILIAS\TestQuestionPool\Import\retrieveSelectedQuestionsFromImportQuestionsSelectionForm().

+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjQuestionPoolGUI::infoScreenForward ( )

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

1729 : void
1730 {
1731 if (!$this->access->checkAccess('visible', '', $this->ref_id)) {
1732 $this->error->raiseError($this->lng->txt('msg_no_perm_read'));
1733 }
1734
1735 $this->tabs_gui->activateTab('info_short');
1736 $info = new ilInfoScreenGUI($this);
1737 $info->enablePrivateNotes();
1738 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1739
1740 $this->ctrl->forwardCommand($info);
1741 }
error(string $a_errmsg)
Class ilInfoScreenGUI.
$info
Definition: entry_point.php:21

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

+ Here is the call graph for this function:

◆ infoScreenObject()

ilObjQuestionPoolGUI::infoScreenObject ( )

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

1718 : void
1719 {
1720 $this->ctrl->redirectByClass(
1721 [
1722 ilRepositoryGUI::class,
1723 self::class,
1724 ilInfoScreenGUI::class
1725 ]
1726 );
1727 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ isSkillsTabRequired()

ilObjQuestionPoolGUI::isSkillsTabRequired ( )
private

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

1686 : bool
1687 {
1688 if (!($this->object instanceof ilObjQuestionPool)) {
1689 return false;
1690 }
1691
1692 if (!$this->object->isSkillServiceEnabled()) {
1693 return false;
1694 }
1695
1697 return false;
1698 }
1699
1700 return true;
1701 }

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

+ Here is the call graph for this function:

◆ moveQuestions()

ilObjQuestionPoolGUI::moveQuestions ( array  $ids)

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

1272 : void
1273 {
1274 if ($this->checkPermission('write')) {
1275 $this->tpl->setOnScreenMessage('failure', 'permission_denied');
1276 return;
1277 }
1278
1279 if ($ids === []) {
1280 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_move_select_none'), true);
1281 return;
1282 }
1283
1284 foreach ($ids as $id) {
1285 $this->object->moveToClipboard($id);
1286 }
1287 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_move_insert_clipboard'), true);
1288 }
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)

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

+ Here is the call graph for this function:

◆ pasteObject()

ilObjQuestionPoolGUI::pasteObject ( )

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

1246 : void
1247 {
1248 if (ilSession::get('qpl_clipboard') != null) {
1249 if ($this->object->pasteFromClipboard()) {
1250 $this->tpl->setOnScreenMessage('success', $this->lng->txt('qpl_paste_success'), true);
1251 } else {
1252 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('qpl_paste_error'), true);
1253 }
1254 } else {
1255 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_paste_no_objects'), true);
1256 }
1257 $this->ctrl->redirect($this, self::DEFAULT_CMD);
1258 }

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 1210 of file class.ilObjQuestionPoolGUI.php.

1210 : void
1211 {
1212 $this->tabs_gui->activateTab('print_view');
1213 $this->ctrl->setParameter($this, 'output', 'overview');
1214 $output_link = $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'print');
1215 $this->ctrl->setParameter($this, 'output', 'detailed_output_solutions');
1216 $output_link_detailed = $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'print');
1217 $this->ctrl->setParameter($this, 'output', 'detailed_output_printview');
1218 $output_link_printview = $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'print');
1219
1220 $mode = $this->ui_factory->dropdown()->standard([
1221 $this->ui_factory->button()->shy($this->lng->txt('overview'), $output_link),
1222 $this->ui_factory->button()->shy($this->lng->txt('detailed_output_solutions'), $output_link_detailed),
1223 $this->ui_factory->button()->shy($this->lng->txt('detailed_output_printview'), $output_link_printview)
1224 ])->withLabel($this->lng->txt('output_mode'));
1225
1226 $output = $this->request_data_collector->raw('output') ?? '';
1227
1228 $table_gui = new ilQuestionPoolPrintViewTableGUI($this, 'print', $output);
1229 $data = $this->object->getPrintviewQuestions();
1230 $totalPoints = 0;
1231 foreach ($data as $d) {
1232 $totalPoints += $d['points'];
1233 }
1234 $table_gui->setTotalPoints($totalPoints);
1235 $table_gui->initColumns();
1236 $table_gui->setData($data);
1237 $this->tpl->setContent($this->ui_renderer->render($mode) . $table_gui->getHTML());
1238 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

+ Here is the call graph for this function:

◆ questionsObject()

ilObjQuestionPoolGUI::questionsObject ( ?RoundTripModal  $import_questions_modal = null)

list questions of question pool

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

1076 : void
1077 {
1078 if (!$this->access->checkAccess("read", "", $this->request_data_collector->getRefId())) {
1079 $this->infoScreenForward();
1080 return;
1081 }
1082
1083 $this->object->purgeQuestions();
1084 $qsa_import_fails = new ilAssQuestionSkillAssignmentImportFails($this->object->getId());
1085 if ($qsa_import_fails->failedImportsRegistered()) {
1086 $button = $this->ui_factory->button()->standard(
1087 $this->lng->txt('ass_skl_import_fails_remove_btn'),
1088 $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'renoveImportFails')
1089 );
1090 $this->tpl->setOnScreenMessage(
1091 'failure',
1092 $qsa_import_fails->getFailedImportsMessage($this->lng) . '<br />' . $this->ui_renderer->render(
1093 $button
1094 )
1095 );
1096 }
1097
1098 $out = [];
1099 if ($this->rbac_system->checkAccess('write', $this->request_data_collector->getRefId())) {
1100 $btn = $this->ui_factory->button()->primary(
1101 $this->lng->txt('ass_create_question'),
1102 $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'createQuestionForm')
1103 );
1104 $this->toolbar->addComponent($btn);
1105
1106 if ($import_questions_modal === null) {
1107 $import_questions_modal = $this->buildImportQuestionsModal();
1108 }
1109
1110 $btn_import = $this->ui_factory->button()->standard(
1111 $this->lng->txt('import'),
1112 $import_questions_modal->getShowSignal()
1113 );
1114 $this->toolbar->addComponent($btn_import);
1115 $out[] = $this->ui_renderer->render($import_questions_modal);
1116
1117 if (ilSession::get('qpl_clipboard') != null && count(ilSession::get('qpl_clipboard'))) {
1118 $btn_paste = $this->ui_factory->button()->standard(
1119 $this->lng->txt('paste'),
1120 $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'paste')
1121 );
1122 $this->toolbar->addComponent($btn_paste);
1123 }
1124 }
1125
1126 $this->tpl->setPermanentLink($this->object->getType(), $this->object->getRefId());
1127 $out[] = $this->getTable();
1128 $this->tpl->setContent(implode('', $out));
1129 }
$out
Definition: buildRTE.php:24

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

Referenced by importVerifiedQuestionsFileObject(), and uploadQuestionsImportObject().

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

◆ redirectAfterMissingWrite()

ilObjQuestionPoolGUI::redirectAfterMissingWrite ( )
protected

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

688 {
689 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_permission'), true);
690 $target_class = get_class($this->object) . 'GUI';
691 $this->ctrl->setParameterByClass($target_class, 'ref_id', $this->ref_id);
692 $this->ctrl->redirectByClass($target_class);
693 }

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

Referenced by importVerifiedFileObject().

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

◆ renoveImportFailsObject()

ilObjQuestionPoolGUI::renoveImportFailsObject ( )
protected

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

1059 : void
1060 {
1061 $qsaImportFails = new ilAssQuestionSkillAssignmentImportFails($this->object->getId());
1062 $qsaImportFails->deleteRegisteredImportFails();
1063
1064 $this->ctrl->redirectByClass(
1065 [
1066 ilRepositoryGUI::class,
1067 self::class,
1068 ilInfoScreenGUI::class
1069 ]
1070 );
1071 }

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

+ Here is the call graph for this function:

◆ setTitleAndDescription()

ilObjQuestionPoolGUI::setTitleAndDescription ( )

called by prepare output

Reimplemented from ilObjectGUI.

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

1450 : void
1451 {
1452 parent::setTitleAndDescription();
1453
1454 if (!is_array($this->request_data_collector->raw('q_id')) && $this->request_data_collector->raw('q_id') > 0 && $this->request_data_collector->raw(
1455 'cmd'
1456 ) !== self::DEFAULT_CMD) {
1457 $question_gui = assQuestionGUI::_getQuestionGUI('', $this->request_data_collector->getQuestionId());
1458 if ($question_gui->getObject() instanceof assQuestion) {
1459 $question = $question_gui->getObject();
1460 $question->setObjId($this->object->getId());
1461 $question_gui->setObject($question);
1462 $title = $this->object->getTitle() . ': ' . $question_gui->getObject()->getTitleForHTMLOutput();
1463 if (!$title) {
1464 $title = $this->lng->txt('new') . ': ' . $this->questionrepository->getForQuestionId(
1465 $question_gui->getObject()->getId()
1466 )->getTypeName($this->lng);
1467 }
1468 $this->tpl->setTitle(
1469 $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
1470 $title,
1471 )
1472 );
1473 $this->tpl->setDescription(
1474 $question_gui->getObject()->getDescriptionForHTMLOutput()
1475 );
1476 $this->tpl->setTitleIcon(ilObject2::_getIcon($this->object->getId(), 'big', $this->object->getType()));
1477 } else {
1478 // Workaround for context issues: If no object was found, redirect without q_id parameter
1479 $this->ctrl->setParameter($this, 'q_id', '');
1480 $this->ctrl->redirect($this);
1481 }
1482 } else {
1483 $this->tpl->setTitle(
1484 $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
1485 $this->object->getTitle()
1486 )
1487 );
1488 $this->tpl->setDescription(
1489 $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
1490 $this->object->getLongDescription()
1491 )
1492 );
1493 $this->tpl->setTitleIcon(ilObject2::_getIcon($this->object->getId(), 'big', $this->object->getType()));
1494 }
1495 }
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 1240 of file class.ilObjQuestionPoolGUI.php.

1240 : void
1241 {
1242 $this->object->update();
1243 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
1244 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ uploadQuestionsImportObject()

ilObjQuestionPoolGUI::uploadQuestionsImportObject ( )

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

839 : void
840 {
841 $import_questions_modal = $this->buildImportQuestionsModal()->withRequest($this->request);
842 $data = $import_questions_modal->getData();
843 if ($data === null) {
844 $this->questionsObject(
845 $import_questions_modal->withOnLoad(
846 $import_questions_modal->getShowSignal()
847 )
848 );
849 return;
850 }
851 $path_to_imported_file_in_temp_dir = $data['import_file'][0];
852 $this->importQuestionsFile($path_to_imported_file_in_temp_dir);
853 }
importQuestionsFile(string $path_to_uploaded_file_in_temp_dir)

References ilObjectGUI\$data, buildImportQuestionsModal(), importQuestionsFile(), and questionsObject().

+ Here is the call graph for this function:

Field Documentation

◆ $action_parameter_token

URLBuilderToken ilObjQuestionPoolGUI::$action_parameter_token
protected

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

◆ $archives

Archives ilObjQuestionPoolGUI::$archives
private

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

◆ $component_factory

ilComponentFactory ilObjQuestionPoolGUI::$component_factory
protected

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

◆ $component_repository

ilComponentRepository ilObjQuestionPoolGUI::$component_repository
protected

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

◆ $content_style

ContentStyle ilObjQuestionPoolGUI::$content_style
private

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

◆ $data_factory

DataFactory ilObjQuestionPoolGUI::$data_factory
protected

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

◆ $db

ilDBInterface ilObjQuestionPoolGUI::$db
protected

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

◆ $global_screen

GlobalScreen ilObjQuestionPoolGUI::$global_screen
protected

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

◆ $global_test_settings

GlobalTestSettings ilObjQuestionPoolGUI::$global_test_settings
protected

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

◆ $help

ilHelpGUI ilObjQuestionPoolGUI::$help
protected

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

◆ $log

ilComponentLogger ilObjQuestionPoolGUI::$log
protected

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

◆ $navigation_history

ilNavigationHistory ilObjQuestionPoolGUI::$navigation_history
protected

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

◆ $questionrepository

GeneralQuestionPropertiesRepository ilObjQuestionPoolGUI::$questionrepository
protected

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

◆ $request_data_collector

RequestDataCollector ilObjQuestionPoolGUI::$request_data_collector
protected

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

◆ $row_id_token

URLBuilderToken ilObjQuestionPoolGUI::$row_id_token
protected

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

◆ $skill_usage_service

SkillUsageService ilObjQuestionPoolGUI::$skill_usage_service
protected

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

◆ $taxonomy

Service ilObjQuestionPoolGUI::$taxonomy
protected

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

◆ $ui_service

ilUIService ilObjQuestionPoolGUI::$ui_service
protected

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

◆ $url_builder

URLBuilder ilObjQuestionPoolGUI::$url_builder
protected

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

◆ DEFAULT_CMD

const ilObjQuestionPoolGUI::DEFAULT_CMD = 'questions'

◆ 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 71 of file class.ilObjQuestionPoolGUI.php.

Referenced by QuestionPoolImportUploadHandlerGUI\__construct().


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