ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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
 
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 1392 of file class.ilObjQuestionPoolGUI.php.

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

1692 : void
1693 {
1694 $tabs->addSubTab(
1696 $this->lng->txt('qpl_settings_subtab_general'),
1697 $this->ctrl->getLinkTargetByClass(ilObjQuestionPoolSettingsGeneralGUI::class),
1698 );
1699
1700 $tabs->addSubTab(
1701 'tax_settings',
1702 $this->lng->txt('qpl_settings_subtab_taxonomies'),
1703 $this->ctrl->getLinkTargetByClass(ilTaxonomySettingsGUI::class, ''),
1704 );
1705 }
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 944 of file class.ilObjQuestionPoolGUI.php.

944 : void
945 {
946 // always send a message
947 $this->tpl->setOnScreenMessage('success', $this->lng->txt('object_added'), true);
948
950 'ilias.php?ref_id=' . $new_object->getRefId() .
951 '&baseClass=ilObjQuestionPoolGUI'
952 );
953 }
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 845 of file class.ilObjQuestionPoolGUI.php.

845 : RoundTripModal
846 {
847 $constraint = $this->refinery->custom()->constraint(
848 function ($vs): bool {
849 if ($vs === []) {
850 return false;
851 }
852 return true;
853 },
854 $this->lng->txt('msg_no_files_selected')
855 );
856
857 $file_upload_input = $this->ui_factory->input()->field()
858 ->file(new \QuestionPoolImportUploadHandlerGUI(), $this->lng->txt('import_file'))
859 ->withAcceptedMimeTypes(self::SUPPORTED_IMPORT_MIME_TYPES)
860 ->withMaxFiles(1)
861 ->withAdditionalTransformation($constraint);
862 return $this->ui_factory->modal()->roundtrip(
863 $this->lng->txt('import'),
864 [],
865 ['import_file' => $file_upload_input],
866 $this->ctrl->getFormActionByClass(self::class, 'uploadQuestionsImport')
867 )->withSubmitLabel($this->lng->txt('import'));
868 }

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

1180 : Input
1181 {
1182 if (!$this->global_test_settings->isPageEditorEnabled()) {
1183 return $this->ui_factory->input()->field()->hidden()->withValue(
1185 );
1186 }
1187
1188 return $this->ui_factory->input()->field()->radio($this->lng->txt('tst_add_quest_cont_edit_mode'))
1189 ->withOption(
1191 $this->lng->txt('tst_add_quest_cont_edit_mode_IPE'),
1192 $this->lng->txt('tst_add_quest_cont_edit_mode_IPE_info')
1193 )->withOption(
1195 $this->lng->txt('tst_add_quest_cont_edit_mode_RTE'),
1196 $this->lng->txt('tst_add_quest_cont_edit_mode_RTE_info')
1197 )
1199 }
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 1166 of file class.ilObjQuestionPoolGUI.php.

1166 : Select
1167 {
1168 $question_types = (new ilObjQuestionPool())->getQuestionTypes(false, true, false);
1169 $options = [];
1170 foreach ($question_types as $label => $data) {
1171 $options[$data['question_type_id']] = $label;
1172 }
1173
1174 return $this->ui_factory->input()->field()->select(
1175 $this->lng->txt('question_type'),
1176 $options
1177 )->withRequired(true);
1178 }
This describes select field.
Definition: Select.php:29

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

+ Here is the call graph for this function:

◆ buildQuestionCreationForm()

ilObjQuestionPoolGUI::buildQuestionCreationForm ( )
private

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

1149 : Form
1150 {
1151 $inputs['question_type'] = $this->buildInputQuestionType();
1152 $inputs['editing_type'] = $this->buildInputEditingType();
1153
1154 $section = [
1155 $this->ui_factory->input()->field()->section($inputs, $this->lng->txt('ass_create_question'))
1156 ];
1157
1158 $form = $this->ui_factory->input()->container()->form()->standard(
1159 $this->ctrl->getFormAction($this, 'createQuestion'),
1160 $section
1161 )->withSubmitLabel($this->lng->txt('create'));
1162
1163 return $form;
1164 }
This describes commonalities between all forms.
Definition: Form.php:33

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

1026 : void
1027 {
1028 $this->ctrl->redirect($this, self::DEFAULT_CMD);
1029 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cleanupAfterImport()

ilObjQuestionPoolGUI::cleanupAfterImport ( string  $importdir)
private

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

912 : void
913 {
914 ilFileUtils::delDir($importdir);
915 $this->deleteUploadedImportFile(ilSession::get('path_to_uploaded_file_in_temp_dir'));
916 ilSession::clear('path_to_import_file');
917 ilSession::clear('path_to_uploaded_file_in_temp_dir');
918 }
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 955 of file class.ilObjQuestionPoolGUI.php.

955 : void
956 {
957 $rbacsystem = $this->rbac_system;
958
959 $questionIdsToDelete = array_filter(array_map('intval', $ids));
960 if (0 === count($questionIdsToDelete)) {
961 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_delete_select_none'), true);
962 $this->ctrl->redirect($this, self::DEFAULT_CMD);
963 }
964
965 $this->tpl->setOnScreenMessage('question', $this->lng->txt('qpl_confirm_delete_questions'));
966 $deleteable_questions = $this->object->getDeleteableQuestionDetails($questionIdsToDelete);
967 $table_gui = new ilQuestionBrowserTableGUI($this, self::DEFAULT_CMD, (($rbacsystem->checkAccess('write', $this->request_data_collector->getRefId()) ? true : false)), true);
968 $table_gui->setShowRowsSelector(false);
969 $table_gui->setLimit(PHP_INT_MAX);
970 $table_gui->setEditable($rbacsystem->checkAccess('write', $this->request_data_collector->getRefId()));
971 $table_gui->setData($deleteable_questions);
972 $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
973 }
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 1011 of file class.ilObjQuestionPoolGUI.php.

1011 : void
1012 {
1013 $qst_ids = $this->request_data_collector->intArray('q_id');
1014 foreach ($qst_ids as $value) {
1015 $this->object->deleteQuestion((int) $value);
1016 $this->object->cleanupClipboard((int) $value);
1017 }
1018 if ($qst_ids !== []) {
1019 $this->tpl->setOnScreenMessage('success', $this->lng->txt('qpl_questions_deleted'), true);
1020 }
1021
1022 $this->ctrl->setParameter($this, 'q_id', '');
1023 $this->ctrl->redirect($this, self::DEFAULT_CMD);
1024 }

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

+ Here is the call graph for this function:

◆ copyQuestions()

ilObjQuestionPoolGUI::copyQuestions ( array  $ids)

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

1251 : void
1252 {
1253 if ($ids) {
1254 foreach ($ids as $id) {
1255 $this->object->copyToClipboard($id);
1256 }
1257 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_copy_insert_clipboard'), true);
1258 } else {
1259 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_copy_select_none'), true);
1260 }
1261 }

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

+ Here is the call graph for this function:

◆ createExportExcel()

ilObjQuestionPoolGUI::createExportExcel ( )

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

1281 : void
1282 {
1283 $rbacsystem = $this->rbac_system;
1284 if ($rbacsystem->checkAccess('write', $this->request_data_collector->getRefId())) {
1285 $question_ids = &$this->object->getAllQuestionIds();
1286 $qpl_exp = new ilQuestionpoolExport($this->object, 'xlsx', $question_ids);
1287 $qpl_exp->buildExportFile();
1288 $this->ctrl->redirectByClass('ilquestionpoolexportgui', '');
1289 }
1290 }
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 1133 of file class.ilObjQuestionPoolGUI.php.

1133 : void
1134 {
1135 $this->help->setScreenId('assQuestions');
1136 if ($this->global_test_settings->isPageEditorEnabled()) {
1137 $this->help->setSubScreenId('createQuestion_editMode');
1138 } else {
1139 $this->help->setSubScreenId('createQuestion');
1140 }
1141
1142 $this->tpl->setContent(
1143 $this->ui_renderer->render(
1144 $form ?? $this->buildQuestionCreationForm()
1145 )
1146 );
1147 }

References ILIAS\Repository\help().

+ Here is the call graph for this function:

◆ deleteQuestionsObject()

ilObjQuestionPoolGUI::deleteQuestionsObject ( )

delete questions confirmation screen

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

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

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

717 : void
718 {
719 $pg_obj = new ilAssQuestionPage($this->request_data_collector->raw('pg_id'));
720 $pg_obj->sendParagraph($this->request_data_collector->raw('par_id'), $this->request_data_collector->raw('downloadtitle'));
721 exit;
722 }
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 694 of file class.ilObjQuestionPoolGUI.php.

694 : void
695 {
696 $file = explode('_', $this->request_data_collector->raw('file_id'));
697 $fileObj = new ilObjFile((int) $file[count($file) - 1], false);
698 $fileObj->sendFile();
699 exit;
700 }
Class ilObjFile.

References exit.

◆ editQuestionForTestObject()

ilObjQuestionPoolGUI::editQuestionForTestObject ( )

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

1292 : void
1293 {
1294 $this->ctrl->redirectByClass(ilAssQuestionPreviewGUI::class, 'show');
1295 }

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

689 : void
690 {
691 $this->ctrl->redirectByClass('ilQuestionPoolExportGUI');
692 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ exportQuestions()

ilObjQuestionPoolGUI::exportQuestions ( array  $ids)

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

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

1122 : int
1123 {
1124 $q_id = $this->request_data_collector->getQuestionId();
1125
1126 if ($q_id === 0 || $this->object->checkQuestionParent($q_id)) {
1127 return $q_id;
1128 }
1129
1130 throw new ilTestQuestionPoolException('question id does not relate to parent object!');
1131 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ fullscreenObject()

ilObjQuestionPoolGUI::fullscreenObject ( )

show fullscreen view

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

705 : void
706 {
707 $page_gui = new ilAssQuestionPageGUI($this->request_data_collector->raw('pg_id'));
708 $page_gui->setFileDownloadLink(
709 $this->ctrl->getLinkTargetByClass(ilObjQuestionPoolGUI::class, 'downloadFile')
710 );
711 $page_gui->showMediaFullscreen();
712 }
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 1776 of file class.ilObjQuestionPoolGUI.php.

1776 : string
1777 {
1779 $r = $this->ui_renderer;
1780
1781 $table = new QuestionTable(
1782 $f,
1783 $r,
1784 $this->data_factory,
1785 $this->refinery,
1786 $this->url_builder,
1787 $this->action_parameter_token,
1788 $this->row_id_token,
1789 $this->db,
1790 $this->lng,
1791 $this->component_repository,
1792 $this->rbac_system,
1793 $this->user,
1794 $this->taxonomy->domain(),
1795 $this->notes_service,
1796 $this->object->getId(),
1797 $this->request_data_collector->getRefId()
1798 );
1799
1804 $filter_action = $this->ctrl->getLinkTarget($this, self::DEFAULT_CMD);
1805 $filter = $table->getFilter($this->ui_service, $filter_action);
1806
1807 $filter_params = $this->ui_service->filter()->getData($filter);
1808
1809 if ($filter_params) {
1810 foreach (array_filter($filter_params) as $item => $value) {
1811 switch ($item) {
1812 case 'taxonomies':
1813 foreach ($value as $tax_value) {
1814 if ($tax_value === 'null') {
1815 $table->addTaxonomyFilterNoTaxonomySet(true);
1816 } else {
1817 $tax_nodes = explode('-', $tax_value);
1818 $tax_id = array_shift($tax_nodes);
1819 $table->addTaxonomyFilter(
1820 $tax_id,
1821 $tax_nodes,
1822 $this->object->getId(),
1823 $this->object->getType()
1824 );
1825 }
1826 }
1827 break;
1828 case 'commented':
1829 $table->setCommentFilter((int) $value);
1830 break;
1831 default:
1832 $table->addFieldFilter($item, $value);
1833 }
1834 }
1835 }
1836
1837 return $r->render([
1838 $filter,
1839 $table->getTable()
1840 ->withRequest($this->request)
1841 ]);
1842 }
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 1491 of file class.ilObjQuestionPoolGUI.php.

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

1349 : void
1350 {
1351 list($subdir, $importdir, $xmlfile, $qtifile) = $this->buildImportDirectoriesFromImportFile($file_to_import);
1352
1354 ->withZipOutputPath($this->getImportTempDirectory());
1355
1356 $unzip = $this->archives->unzip(Streams::ofResource(fopen($file_to_import, 'r')), $options);
1357 $unzip->extract();
1358
1359 if (!file_exists($qtifile)) {
1360 ilFileUtils::delDir($importdir);
1361 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('cannot_find_xml'), true);
1362 return;
1363 }
1364
1365 ilSession::set('path_to_import_file', $file_to_import);
1366 ilSession::set('path_to_uploaded_file_in_temp_dir', $path_to_uploaded_file_in_temp_dir);
1367
1368 $this->ctrl->setParameterByClass(self::class, 'new_type', $this->type);
1369 $form = $this->buildImportQuestionsSelectionForm(
1370 'importVerifiedFile',
1371 $importdir,
1372 $qtifile,
1373 $path_to_uploaded_file_in_temp_dir
1374 );
1375
1376 if ($form === null) {
1377 return;
1378 }
1379
1380 $panel = $this->ui_factory->panel()->standard(
1381 $this->lng->txt('import_qpl'),
1382 [
1383 $this->ui_factory->legacy()->content($this->lng->txt('qpl_import_verify_found_questions')),
1384 $form
1385 ]
1386 );
1387 $this->tpl->setContent($this->ui_renderer->render($panel));
1388 $this->tpl->printToStdout();
1389 exit;
1390 }
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\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 870 of file class.ilObjQuestionPoolGUI.php.

874 : void {
875
876 ilSession::set('qpl_import_selected_questions', $selected_questions);
877 $imp = new ilImport($this->request_data_collector->getRefId());
878 $map = $imp->getMapping();
879 $map->addMapping('components/ILIAS/TestQuestionPool', 'qpl', 'new_id', (string) $obj->getId());
880 $imp->importObject($obj, $file_to_import, basename($file_to_import), 'qpl', 'components/ILIAS/TestQuestionPool', true);
881 }
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 1297 of file class.ilObjQuestionPoolGUI.php.

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

References ILIAS\TestQuestionPool\Import\buildImportDirectoriesFromImportFile(), ILIAS\TestQuestionPool\Import\buildImportQuestionsSelectionForm(), 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 883 of file class.ilObjQuestionPoolGUI.php.

889 : void {
890 $qti_parser = new ilQTIParser(
891 $importdir,
892 $qtifile,
894 $obj->getId(),
895 $selected_questions
896 );
897 $qti_parser->startParsing();
898
899 if ($xmlfile === '') {
900 return;
901 }
902
903 $cont_parser = new ilQuestionPageParser(
904 $obj,
905 $xmlfile,
906 $importdir
907 );
908 $cont_parser->setQuestionMapping($qti_parser->getImportMapping());
909 $cont_parser->startParsing();
910 }
Legacy Content Object Parser.

Referenced by importVerifiedFileObject(), and importVerifiedQuestionsFileObject().

+ Here is the caller graph for this function:

◆ importVerifiedFileObject()

ilObjQuestionPoolGUI::importVerifiedFileObject ( )

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

724 : void
725 {
726 if ($this->creation_mode
727 && !$this->checkPermissionBool('create', '', $this->request_data_collector->string('new_type'))
728 || !$this->creation_mode
729 && !$this->checkPermissionBool('read', '', $this->object->getType())) {
731 return;
732 }
733
734 $file_to_import = ilSession::get('path_to_import_file');
735 list($subdir, $importdir, $xmlfile, $qtifile) = $this->buildImportDirectoriesFromImportFile($file_to_import);
736
737 $new_obj = new ilObjQuestionPool(0, true);
738 $new_obj->setType($this->request_data_collector->raw('new_type'));
739 $new_obj->setTitle('dummy');
740 $new_obj->setDescription('questionpool import');
741 $new_obj->create(true);
742 $new_obj->createReference();
743 $new_obj->putInTree($this->request_data_collector->getRefId());
744 $new_obj->setPermissions($this->request_data_collector->getRefId());
745
747 'importVerifiedFile',
748 $importdir,
749 $qtifile,
750 $this->request
751 );
752
753 if (is_file($importdir . DIRECTORY_SEPARATOR . 'manifest.xml')) {
755 $new_obj,
756 $selected_questions,
757 $file_to_import
758 );
759 } else {
761 $new_obj,
762 $selected_questions,
763 $qtifile,
764 $importdir,
765 $xmlfile
766 );
767
768 $new_obj->fromXML($xmlfile);
769
770 $new_obj->update();
771 $new_obj->saveToDb();
772 }
773 $this->cleanupAfterImport($importdir);
774
775 $this->tpl->setOnScreenMessage('success', $this->lng->txt('object_imported'), true);
776 $this->ctrl->setParameterByClass(self::class, 'ref_id', $new_obj->getRefId());
777 $this->ctrl->redirectByClass(self::class);
778 }
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 780 of file class.ilObjQuestionPoolGUI.php.

780 : void
781 {
782 $file_to_import = ilSession::get('path_to_import_file');
783
784 if (mb_substr($file_to_import, -3) === 'xml') {
785 $importdir = dirname($file_to_import);
787 'importVerifiedQuestionsFile',
788 $importdir,
789 $file_to_import,
790 $this->request
791 );
793 $this->getObject(),
794 $selected_questions,
795 $file_to_import,
796 $importdir
797 );
798 } else {
799 list($subdir, $importdir, $xmlfile, $qtifile) = $this->buildImportDirectoriesFromImportFile($file_to_import);
801 'importVerifiedQuestionsFile',
802 $importdir,
803 $qtifile,
804 $this->request
805 );
806 if (is_file($importdir . DIRECTORY_SEPARATOR . 'manifest.xml')) {
808 $this->getObject(),
809 $selected_questions,
810 $file_to_import
811 );
812 } else {
814 $this->getObject(),
815 $selected_questions,
816 $qtifile,
817 $importdir,
818 $xmlfile
819 );
820 }
821 }
822
823 $this->cleanupAfterImport($importdir);
824
825 $this->tpl->setOnScreenMessage('success', $this->lng->txt('object_imported'), true);
826 $this->questionsObject();
827 }

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

1718 : void
1719 {
1720 if (!$this->access->checkAccess('visible', '', $this->ref_id)) {
1721 $this->error->raiseError($this->lng->txt('msg_no_perm_read'));
1722 }
1723
1724 $this->tabs_gui->activateTab('info_short');
1725 $info = new ilInfoScreenGUI($this);
1726 $info->enablePrivateNotes();
1727 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1728
1729 $this->ctrl->forwardCommand($info);
1730 }
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 1707 of file class.ilObjQuestionPoolGUI.php.

1707 : void
1708 {
1709 $this->ctrl->redirectByClass(
1710 [
1711 ilRepositoryGUI::class,
1712 self::class,
1713 ilInfoScreenGUI::class
1714 ]
1715 );
1716 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ isSkillsTabRequired()

ilObjQuestionPoolGUI::isSkillsTabRequired ( )
private

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

1675 : bool
1676 {
1677 if (!($this->object instanceof ilObjQuestionPool)) {
1678 return false;
1679 }
1680
1681 if (!$this->object->isSkillServiceEnabled()) {
1682 return false;
1683 }
1684
1686 return false;
1687 }
1688
1689 return true;
1690 }

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

+ Here is the call graph for this function:

◆ moveQuestions()

ilObjQuestionPoolGUI::moveQuestions ( array  $ids)

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

1263 : void
1264 {
1265 if ($this->checkPermission('write')) {
1266 $this->tpl->setOnScreenMessage('failure', 'permission_denied');
1267 return;
1268 }
1269
1270 if ($ids === []) {
1271 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_move_select_none'), true);
1272 return;
1273 }
1274
1275 foreach ($ids as $id) {
1276 $this->object->moveToClipboard($id);
1277 }
1278 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_move_insert_clipboard'), true);
1279 }
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 1237 of file class.ilObjQuestionPoolGUI.php.

1237 : void
1238 {
1239 if (ilSession::get('qpl_clipboard') != null) {
1240 if ($this->object->pasteFromClipboard()) {
1241 $this->tpl->setOnScreenMessage('success', $this->lng->txt('qpl_paste_success'), true);
1242 } else {
1243 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('qpl_paste_error'), true);
1244 }
1245 } else {
1246 $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_paste_no_objects'), true);
1247 }
1248 $this->ctrl->redirect($this, self::DEFAULT_CMD);
1249 }

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

1201 : void
1202 {
1203 $this->tabs_gui->activateTab('print_view');
1204 $this->ctrl->setParameter($this, 'output', 'overview');
1205 $output_link = $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'print');
1206 $this->ctrl->setParameter($this, 'output', 'detailed_output_solutions');
1207 $output_link_detailed = $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'print');
1208 $this->ctrl->setParameter($this, 'output', 'detailed_output_printview');
1209 $output_link_printview = $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'print');
1210
1211 $mode = $this->ui_factory->dropdown()->standard([
1212 $this->ui_factory->button()->shy($this->lng->txt('overview'), $output_link),
1213 $this->ui_factory->button()->shy($this->lng->txt('detailed_output_solutions'), $output_link_detailed),
1214 $this->ui_factory->button()->shy($this->lng->txt('detailed_output_printview'), $output_link_printview)
1215 ])->withLabel($this->lng->txt('output_mode'));
1216
1217 $output = $this->request_data_collector->raw('output') ?? '';
1218
1219 $table_gui = new ilQuestionPoolPrintViewTableGUI($this, 'print', $output);
1220 $data = $this->object->getPrintviewQuestions();
1221 $totalPoints = 0;
1222 foreach ($data as $d) {
1223 $totalPoints += $d['points'];
1224 }
1225 $table_gui->setTotalPoints($totalPoints);
1226 $table_gui->initColumns();
1227 $table_gui->setData($data);
1228 $this->tpl->setContent($this->ui_renderer->render($mode) . $table_gui->getHTML());
1229 }
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 1067 of file class.ilObjQuestionPoolGUI.php.

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

678 {
679 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_permission'), true);
680 $target_class = get_class($this->object) . 'GUI';
681 $this->ctrl->setParameterByClass($target_class, 'ref_id', $this->ref_id);
682 $this->ctrl->redirectByClass($target_class);
683 }

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

1050 : void
1051 {
1052 $qsaImportFails = new ilAssQuestionSkillAssignmentImportFails($this->object->getId());
1053 $qsaImportFails->deleteRegisteredImportFails();
1054
1055 $this->ctrl->redirectByClass(
1056 [
1057 ilRepositoryGUI::class,
1058 self::class,
1059 ilInfoScreenGUI::class
1060 ]
1061 );
1062 }

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

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

1231 : void
1232 {
1233 $this->object->update();
1234 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
1235 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ uploadQuestionsImportObject()

ilObjQuestionPoolGUI::uploadQuestionsImportObject ( )

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

829 : void
830 {
831 $import_questions_modal = $this->buildImportQuestionsModal()->withRequest($this->request);
832 $data = $import_questions_modal->getData();
833 if ($data === null) {
834 $this->questionsObject(
835 $import_questions_modal->withOnLoad(
836 $import_questions_modal->getShowSignal()
837 )
838 );
839 return;
840 }
841 $path_to_imported_file_in_temp_dir = $data['import_file'][0];
842 $this->importQuestionsFile($path_to_imported_file_in_temp_dir);
843 }
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 96 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 95 of file class.ilObjQuestionPoolGUI.php.

◆ $request_data_collector

RequestDataCollector ilObjQuestionPoolGUI::$request_data_collector
protected

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

◆ $row_id_token

URLBuilderToken ilObjQuestionPoolGUI::$row_id_token
protected

Definition at line 90 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: