ILIAS  trunk Revision v11.0_alpha-1846-g895b5f47236
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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)
 
 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 ()
 
 pasteObject ()
 
 copyQuestions (array $ids)
 
 moveQuestions (array $ids)
 
 createExportExcel ()
 
 editQuestionForTestObject ()
 
 addLocatorItems ()
 
 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)
 

Static Public Member Functions

static _goto ($a_target)
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Data Fields

const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::TEXT__XML]
 
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 ()
 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
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Private Member Functions

 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

HTTPServices $http
 
Archives $archives
 
ContentStyle $content_style
 

Detailed Description

Member Function Documentation

◆ _goto()

static ilObjQuestionPoolGUI::_goto (   $a_target)
static

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

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

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

1751  : void
1752  {
1753  global $DIC;
1754  $main_tpl = $DIC->ui()->mainTemplate();
1755  $ilAccess = $DIC['ilAccess'];
1756  $ilErr = $DIC['ilErr'];
1757  $lng = $DIC['lng'];
1758  $ctrl = $DIC['ilCtrl'];
1759 
1760  if ($ilAccess->checkAccess('write', '', (int) $a_target)
1761  || $ilAccess->checkAccess('read', '', (int) $a_target)
1762  ) {
1763  $ctrl->setParameterByClass(ilObjQuestionPoolGUI::class, 'ref_id', $a_target);
1764  $ctrl->redirectByClass([ilRepositoryGUI::class, ilObjQuestionPoolGUI::class], self::DEFAULT_CMD);
1765  return;
1766  }
1767  if ($ilAccess->checkAccess('visible', '', $a_target)) {
1768  $DIC->ctrl()->setParameterByClass(ilInfoScreenGUI::class, 'ref_id', $a_target);
1769  $DIC->ctrl()->redirectByClass(
1770  [
1771  ilRepositoryGUI::class,
1772  self::class,
1773  ilInfoScreenGUI::class
1774  ]
1775  );
1776  }
1777  if ($ilAccess->checkAccess('read', '', ROOT_FOLDER_ID)) {
1778  $main_tpl->setOnScreenMessage(
1779  'info',
1780  sprintf(
1781  $lng->txt('msg_no_perm_read_item'),
1783  ),
1784  true
1785  );
1787  return;
1788  }
1789  $ilErr->raiseError($lng->txt('msg_no_perm_read_lm'), $ilErr->FATAL);
1790  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
const ROOT_FOLDER_ID
Definition: constants.php:32
setParameterByClass(string $a_class, string $a_parameter, $a_value)
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
$ilErr
Definition: raiseError.php:33
static _lookupObjId(int $ref_id)
ilLanguage $lng
static _lookupTitle(int $obj_id)
global $DIC
Definition: shib_login.php:22
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addLocatorItems()

ilObjQuestionPoolGUI::addLocatorItems ( )

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

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

1411  : void
1412  {
1413  $ilLocator = $this->locator;
1414 
1415  switch ($this->ctrl->getCmd()) {
1416  case 'create':
1417  case 'importFile':
1418  case 'cancel':
1419  break;
1420  default:
1421  $this->ctrl->clearParameterByClass(self::class, 'q_id');
1422  $ilLocator->addItem(
1423  $this->object->getTitle(),
1424  $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], ''),
1425  '',
1426  $this->request_data_collector->getRefId()
1427  );
1428  $this->ctrl->setParameter($this, 'q_id', $this->request_data_collector->getQuestionId());
1429  break;
1430  }
1431 
1432  if (!is_array($this->request_data_collector->raw('q_id')) && $this->request_data_collector->raw('q_id') > 0 && $this->request_data_collector->raw(
1433  'cmd'
1434  ) !== self::DEFAULT_CMD) {
1435  $question_gui = assQuestionGUI::_getQuestionGUI('', $this->request_data_collector->getQuestionId());
1436  if ($question_gui !== null && $question_gui->getObject() instanceof assQuestion) {
1437  $question = $question_gui->getObject();
1438  $question->setObjId($this->object->getId());
1439  $question_gui->setObject($question);
1440  $title = $question_gui->getObject()->getTitleForHTMLOutput();
1441  if (!$title) {
1442  $title = $this->lng->txt('new') . ': ' . $this->questionrepository->getForQuestionId(
1443  $question_gui->getObject()->getId()
1444  )->getTypeName($this->lng);
1445  }
1446  $ilLocator->addItem($title, $this->ctrl->getLinkTargetByClass(get_class($question_gui), 'editQuestion'));
1447  } else {
1448  // Workaround for context issues: If no object was found, redirect without q_id parameter
1449  $this->ctrl->setParameter($this, 'q_id', '');
1450  $this->ctrl->redirect($this);
1451  }
1452  }
1453  }
static _getQuestionGUI(string $question_type='', int $question_id=-1)
Creates a question gui representation and returns the alias to the question gui.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
ilLocatorGUI $locator
+ Here is the call graph for this function:

◆ addSettingsSubTabs()

ilObjQuestionPoolGUI::addSettingsSubTabs ( ilTabsGUI  $tabs)
private

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

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

Referenced by getTabs().

1711  : void
1712  {
1713  $tabs->addSubTab(
1715  $this->lng->txt('qpl_settings_subtab_general'),
1716  $this->ctrl->getLinkTargetByClass(ilObjQuestionPoolSettingsGeneralGUI::class),
1717  );
1718 
1719  $tabs->addSubTab(
1720  'tax_settings',
1721  $this->lng->txt('qpl_settings_subtab_taxonomies'),
1722  $this->ctrl->getLinkTargetByClass(ilTaxonomySettingsGUI::class, ''),
1723  );
1724  }
addSubTab(string $a_id, string $a_text, string $a_link, string $a_frame="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterSave()

ilObjQuestionPoolGUI::afterSave ( ilObject  $new_object)

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

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

969  : void
970  {
971  // always send a message
972  $this->tpl->setOnScreenMessage('success', $this->lng->txt('object_added'), true);
973 
975  'ilias.php?ref_id=' . $new_object->getRefId() .
976  '&baseClass=ilObjQuestionPoolGUI'
977  );
978  }
static redirect(string $a_script)
+ Here is the call graph for this function:

◆ buildImportQuestionsModal()

ilObjQuestionPoolGUI::buildImportQuestionsModal ( )
private

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

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

Referenced by questionsObject(), and uploadQuestionsImportObject().

871  {
872  $constraint = $this->refinery->custom()->constraint(
873  function ($vs): bool {
874  if ($vs === []) {
875  return false;
876  }
877  return true;
878  },
879  $this->lng->txt('msg_no_files_selected')
880  );
881 
882  $file_upload_input = $this->ui_factory->input()->field()
883  ->file(new \QuestionPoolImportUploadHandlerGUI(), $this->lng->txt('import_file'))
884  ->withAcceptedMimeTypes(self::SUPPORTED_IMPORT_MIME_TYPES)
885  ->withMaxFiles(1)
886  ->withAdditionalTransformation($constraint);
887  return $this->ui_factory->modal()->roundtrip(
888  $this->lng->txt('import'),
889  [],
890  ['import_file' => $file_upload_input],
891  $this->ctrl->getFormActionByClass(self::class, 'uploadQuestionsImport')
892  )->withSubmitLabel($this->lng->txt('import'));
893  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildInputEditingType()

ilObjQuestionPoolGUI::buildInputEditingType ( )
private

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

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

Referenced by buildQuestionCreationForm().

1205  : Input
1206  {
1207  if (!$this->global_test_settings->isPageEditorEnabled()) {
1208  return $this->ui_factory->input()->field()->hidden()->withValue(
1210  );
1211  }
1212 
1213  return $this->ui_factory->input()->field()->radio($this->lng->txt('tst_add_quest_cont_edit_mode'))
1214  ->withOption(
1216  $this->lng->txt('tst_add_quest_cont_edit_mode_IPE'),
1217  $this->lng->txt('tst_add_quest_cont_edit_mode_IPE_info')
1218  )->withOption(
1220  $this->lng->txt('tst_add_quest_cont_edit_mode_RTE'),
1221  $this->lng->txt('tst_add_quest_cont_edit_mode_RTE_info')
1222  )
1224  }
const ADDITIONAL_CONTENT_EDITING_MODE_IPE
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
withValue($value)
Get an input like this with another value displayed on the client side.
const ADDITIONAL_CONTENT_EDITING_MODE_RTE
This describes commonalities between all inputs.
Definition: Input.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildInputQuestionType()

ilObjQuestionPoolGUI::buildInputQuestionType ( )
private

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

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

Referenced by buildQuestionCreationForm().

1191  : Select
1192  {
1193  $question_types = (new ilObjQuestionPool())->getQuestionTypes(false, true, false);
1194  $options = [];
1195  foreach ($question_types as $label => $data) {
1196  $options[$data['question_type_id']] = $label;
1197  }
1198 
1199  return $this->ui_factory->input()->field()->select(
1200  $this->lng->txt('question_type'),
1201  $options
1202  )->withRequired(true);
1203  }
This describes select field.
Definition: Select.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildQuestionCreationForm()

ilObjQuestionPoolGUI::buildQuestionCreationForm ( )
private

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

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

Referenced by cleanupAfterImport().

1174  : Form
1175  {
1176  $inputs['question_type'] = $this->buildInputQuestionType();
1177  $inputs['editing_type'] = $this->buildInputEditingType();
1178 
1179  $section = [
1180  $this->ui_factory->input()->field()->section($inputs, $this->lng->txt('ass_create_question'))
1181  ];
1182 
1183  $form = $this->ui_factory->input()->container()->form()->standard(
1184  $this->ctrl->getFormAction($this, 'createQuestion'),
1185  $section
1186  )->withSubmitLabel($this->lng->txt('create'));
1187 
1188  return $form;
1189  }
This describes commonalities between all forms.
Definition: Form.php:32
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancelDeleteQuestionsObject()

ilObjQuestionPoolGUI::cancelDeleteQuestionsObject ( )

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

References ILIAS\Repository\ctrl().

1051  : void
1052  {
1053  $this->ctrl->redirect($this, self::DEFAULT_CMD);
1054  }
+ Here is the call graph for this function:

◆ cleanupAfterImport()

ilObjQuestionPoolGUI::cleanupAfterImport ( string  $importdir)
private

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

References ilObjectGUI\$data, assQuestionGUI\_getQuestionGUI(), buildQuestionCreationForm(), ilSession\clear(), createQuestionFormObject(), ILIAS\Repository\ctrl(), ilFileUtils\delDir(), ilObjectGUI\deleteUploadedImportFile(), ilSession\get(), ilObjQuestionPool\getQuestionTypeByTypeId(), null, and ILIAS\Repository\object().

Referenced by importVerifiedFileObject(), and importVerifiedQuestionsFileObject().

937  : void
938  {
939  ilFileUtils::delDir($importdir);
940  $this->deleteUploadedImportFile(ilSession::get('path_to_uploaded_file_in_temp_dir'));
941  ilSession::clear('path_to_import_file');
942  ilSession::clear('path_to_uploaded_file_in_temp_dir');
943  }
static get(string $a_var)
deleteUploadedImportFile(string $path_to_uploaded_file_in_temp_dir)
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static clear(string $a_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmDeleteQuestions()

ilObjQuestionPoolGUI::confirmDeleteQuestions ( array  $ids)

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

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

980  : void
981  {
982  $rbacsystem = $this->rbac_system;
983 
984  $questionIdsToDelete = array_filter(array_map('intval', $ids));
985  if (0 === count($questionIdsToDelete)) {
986  $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_delete_select_none'), true);
987  $this->ctrl->redirect($this, self::DEFAULT_CMD);
988  }
989 
990  $this->tpl->setOnScreenMessage('question', $this->lng->txt('qpl_confirm_delete_questions'));
991  $deleteable_questions = $this->object->getDeleteableQuestionDetails($questionIdsToDelete);
992  $table_gui = new ilQuestionBrowserTableGUI($this, self::DEFAULT_CMD, (($rbacsystem->checkAccess('write', $this->request_data_collector->getRefId()) ? true : false)), true);
993  $table_gui->setShowRowsSelector(false);
994  $table_gui->setLimit(PHP_INT_MAX);
995  $table_gui->setEditable($rbacsystem->checkAccess('write', $this->request_data_collector->getRefId()));
996  $table_gui->setData($deleteable_questions);
997  $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
998  }
ilRbacSystem $rbac_system
+ Here is the call graph for this function:

◆ confirmDeleteQuestionsObject()

ilObjQuestionPoolGUI::confirmDeleteQuestionsObject ( )

delete questions after confirmation

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

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

1036  : void
1037  {
1038  $qst_ids = $this->request_data_collector->intArray('q_id');
1039  foreach ($qst_ids as $value) {
1040  $this->object->deleteQuestion((int) $value);
1041  $this->object->cleanupClipboard((int) $value);
1042  }
1043  if ($qst_ids !== []) {
1044  $this->tpl->setOnScreenMessage('success', $this->lng->txt('qpl_questions_deleted'), true);
1045  }
1046 
1047  $this->ctrl->setParameter($this, 'q_id', '');
1048  $this->ctrl->redirect($this, self::DEFAULT_CMD);
1049  }
+ Here is the call graph for this function:

◆ copyQuestions()

ilObjQuestionPoolGUI::copyQuestions ( array  $ids)

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

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

1276  : void
1277  {
1278  if ($ids) {
1279  foreach ($ids as $id) {
1280  $this->object->copyToClipboard($id);
1281  }
1282  $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_copy_insert_clipboard'), true);
1283  } else {
1284  $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_copy_select_none'), true);
1285  }
1286  }
+ Here is the call graph for this function:

◆ createExportExcel()

ilObjQuestionPoolGUI::createExportExcel ( )

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

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

1300  : void
1301  {
1302  $rbacsystem = $this->rbac_system;
1303  if ($rbacsystem->checkAccess('write', $this->request_data_collector->getRefId())) {
1304  $question_ids = &$this->object->getAllQuestionIds();
1305  $qpl_exp = new ilQuestionpoolExport($this->object, 'xlsx', $question_ids);
1306  $qpl_exp->buildExportFile();
1307  $this->ctrl->redirectByClass('ilquestionpoolexportgui', '');
1308  }
1309  }
ilRbacSystem $rbac_system
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ createQuestionFormObject()

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

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

References ILIAS\Repository\help().

Referenced by cleanupAfterImport().

1158  : void
1159  {
1160  $this->help->setScreenId('assQuestions');
1161  if ($this->global_test_settings->isPageEditorEnabled()) {
1162  $this->help->setSubScreenId('createQuestion_editMode');
1163  } else {
1164  $this->help->setSubScreenId('createQuestion');
1165  }
1166 
1167  $this->tpl->setContent(
1168  $this->ui_renderer->render(
1169  $form ?? $this->buildQuestionCreationForm()
1170  )
1171  );
1172  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteQuestionsObject()

ilObjQuestionPoolGUI::deleteQuestionsObject ( )

delete questions confirmation screen

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

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

1003  : void
1004  {
1005  $rbacsystem = $this->rbac_system;
1006 
1007  $questionIdsToDelete = $this->request_data_collector->isset('q_id') ? (array) $this->request_data_collector->raw('q_id') : [];
1008  if ($questionIdsToDelete === [] && $this->request_data_collector->isset('q_id')) {
1009  $questionIdsToDelete = [$this->request_data_collector->getQuestionId()];
1010  }
1011 
1012  $questionIdsToDelete = array_filter(array_map('intval', $questionIdsToDelete));
1013  if ($questionIdsToDelete === []) {
1014  $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_delete_select_none'), true);
1015  $this->ctrl->redirect($this, self::DEFAULT_CMD);
1016  }
1017 
1018  $this->tpl->setOnScreenMessage('question', $this->lng->txt('qpl_confirm_delete_questions'));
1019  $deleteable_questions = &$this->object->getDeleteableQuestionDetails($questionIdsToDelete);
1020  $table_gui = new ilQuestionBrowserTableGUI(
1021  $this,
1022  self::DEFAULT_CMD,
1023  (($rbacsystem->checkAccess('write', $this->request_data_collector->getRefId()) ? true : false)),
1024  true
1025  );
1026  $table_gui->setShowRowsSelector(false);
1027  $table_gui->setLimit(PHP_INT_MAX);
1028  $table_gui->setEditable($rbacsystem->checkAccess('write', $this->request_data_collector->getRefId()));
1029  $table_gui->setData($deleteable_questions);
1030  $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
1031  }
ilRbacSystem $rbac_system
+ Here is the call graph for this function:

◆ download_paragraphObject()

ilObjQuestionPoolGUI::download_paragraphObject ( )

download source code paragraph

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

References exit, and ilPageObject\sendParagraph().

745  : void
746  {
747  $pg_obj = new ilAssQuestionPage($this->request_data_collector->raw('pg_id'));
748  $pg_obj->sendParagraph($this->request_data_collector->raw('par_id'), $this->request_data_collector->raw('downloadtitle'));
749  exit;
750  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
sendParagraph(string $par_id, string $filename)
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ downloadFileObject()

ilObjQuestionPoolGUI::downloadFileObject ( )

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

References exit.

725  : void
726  {
727  $file = explode('_', $this->request_data_collector->raw('file_id'));
728  $fileObj = new ilObjFile((int) $file[count($file) - 1], false);
729  $fileObj->sendFile();
730  exit;
731  }
Class ilObjFile.
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ editQuestionForTestObject()

ilObjQuestionPoolGUI::editQuestionForTestObject ( )

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

References ILIAS\Repository\ctrl().

1311  : void
1312  {
1313  $this->ctrl->redirectByClass(ilAssQuestionPreviewGUI::class, 'show');
1314  }
+ 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 720 of file class.ilObjQuestionPoolGUI.php.

References ILIAS\Repository\ctrl().

720  : void
721  {
722  $this->ctrl->redirectByClass('ilQuestionPoolExportGUI');
723  }
+ Here is the call graph for this function:

◆ exportQuestions()

ilObjQuestionPoolGUI::exportQuestions ( array  $ids)

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

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

1056  : void
1057  {
1058  if ($ids !== []) {
1059  $qpl_exp = new ilQuestionpoolExport($this->object, 'xml', $ids);
1060  // @PHP8-CR: This seems to be a pointer to an issue with exports. I like to leave this open for now and
1061  // schedule a thorough examination / analysis for later, eventually involved T&A TechSquad
1062  $export_file = $qpl_exp->buildExportFile();
1063  $filename = $export_file;
1064  $filename = preg_replace('/.*\//', '', $filename);
1065  if ($export_file === '') {
1066  $export_file = 'StandIn';
1067  }
1069  exit();
1070  } else {
1071  $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_export_select_none'), true);
1072  }
1073  }
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$filename
Definition: buildRTE.php:78
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ fetchAuthoringQuestionIdParamater()

ilObjQuestionPoolGUI::fetchAuthoringQuestionIdParamater ( )
protected

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

References ILIAS\Repository\object().

1147  : int
1148  {
1149  $q_id = $this->request_data_collector->getQuestionId();
1150 
1151  if ($q_id === 0 || $this->object->checkQuestionParent($q_id)) {
1152  return $q_id;
1153  }
1154 
1155  throw new ilTestQuestionPoolException('question id does not relate to parent object!');
1156  }
+ Here is the call graph for this function:

◆ fullscreenObject()

ilObjQuestionPoolGUI::fullscreenObject ( )

show fullscreen view

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

References ilPageObjectGUI\showMediaFullscreen().

736  : void
737  {
738  $page_gui = new ilAssQuestionPageGUI($this->request_data_collector->raw('pg_id'));
739  $page_gui->showMediaFullscreen();
740  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
showMediaFullscreen(int $a_style_id=0)
show fullscreen view of media object
+ Here is the call graph for this function:

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

References Vendor\Package\$f, ilObjectGUI\$notes_service, $r, ilObjectGUI\$ui_factory, ilObjectGUI\$ui_renderer, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ILIAS\Repository\refinery(), and ILIAS\Repository\user().

Referenced by questionsObject().

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

◆ getTabs()

ilObjQuestionPoolGUI::getTabs ( )

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

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

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

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

◆ importFile()

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

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

References ILIAS\TestQuestionPool\Import\buildImportDirectoriesFromImportFile(), ILIAS\TestQuestionPool\Import\buildImportQuestionsSelectionForm(), ILIAS\Repository\ctrl(), ilFileUtils\delDir(), exit, ILIAS\TestQuestionPool\Import\getImportTempDirectory(), ILIAS\Repository\lng(), null, and ilSession\set().

1368  : void
1369  {
1370  list($subdir, $importdir, $xmlfile, $qtifile) = $this->buildImportDirectoriesFromImportFile($file_to_import);
1371 
1373  ->withZipOutputPath($this->getImportTempDirectory());
1374 
1375  $unzip = $this->archives->unzip(Streams::ofResource(fopen($file_to_import, 'r')), $options);
1376  $unzip->extract();
1377 
1378  if (!file_exists($qtifile)) {
1379  ilFileUtils::delDir($importdir);
1380  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('cannot_find_xml'), true);
1381  return;
1382  }
1383 
1384  ilSession::set('path_to_import_file', $file_to_import);
1385  ilSession::set('path_to_uploaded_file_in_temp_dir', $path_to_uploaded_file_in_temp_dir);
1386 
1387  $this->ctrl->setParameterByClass(self::class, 'new_type', $this->type);
1388  $form = $this->buildImportQuestionsSelectionForm(
1389  'importVerifiedFile',
1390  $importdir,
1391  $qtifile,
1392  $path_to_uploaded_file_in_temp_dir
1393  );
1394 
1395  if ($form === null) {
1396  return;
1397  }
1398 
1399  $panel = $this->ui_factory->panel()->standard(
1400  $this->lng->txt('import_qpl'),
1401  [
1402  $this->ui_factory->legacy()->content($this->lng->txt('qpl_import_verify_found_questions')),
1403  $form
1404  ]
1405  );
1406  $this->tpl->setContent($this->ui_renderer->render($panel));
1407  $this->tpl->printToStdout();
1408  exit;
1409  }
buildImportQuestionsSelectionForm(string $form_cmd, string $importdir, string $qtifile, ?string $path_to_uploaded_file_in_temp_dir=null)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
array buildImportDirectoriesFromImportFile(string $file_to_import)
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ importQuestionPoolWithValidManifest()

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

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

References ilObject\getId(), ilImport\getMapping(), ilImport\importObject(), and ilSession\set().

Referenced by importVerifiedFileObject(), and importVerifiedQuestionsFileObject().

899  : void {
900 
901  ilSession::set('qpl_import_selected_questions', $selected_questions);
902  $imp = new ilImport($this->request_data_collector->getRefId());
903  $map = $imp->getMapping();
904  $map->addMapping('components/ILIAS/TestQuestionPool', 'qpl', 'new_id', (string) $obj->getId());
905  $imp->importObject($obj, $file_to_import, basename($file_to_import), 'qpl', 'components/ILIAS/TestQuestionPool', true);
906  }
Import class.
importObject(?object $a_new_obj, string $a_tmp_file, string $a_filename, string $a_type, string $a_comp="", bool $a_copy_file=false)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importQuestionsFile()

ilObjQuestionPoolGUI::importQuestionsFile ( string  $path_to_uploaded_file_in_temp_dir)
protected

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

References ILIAS\TestQuestionPool\Import\buildImportDirectoriesFromImportFile(), ILIAS\TestQuestionPool\Import\buildImportQuestionsSelectionForm(), ilFileUtils\delDir(), exit, ILIAS\TestQuestionPool\Import\getImportTempDirectory(), ILIAS\Repository\lng(), null, questionsObject(), and ilSession\set().

Referenced by uploadQuestionsImportObject().

1316  : void
1317  {
1318  if (!$this->temp_file_system->hasDir($path_to_uploaded_file_in_temp_dir)
1319  || ($files = $this->temp_file_system->listContents($path_to_uploaded_file_in_temp_dir)) === []) {
1320  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('obj_import_file_error'));
1321  }
1322 
1323  $file_to_import = $this->import_temp_directory . DIRECTORY_SEPARATOR . $files[0]->getPath();
1324  $qtifile = $file_to_import;
1325  $importdir = dirname($file_to_import);
1326 
1327 
1328  if ($this->temp_file_system->getMimeType($files[0]->getPath()) === MimeType::APPLICATION__ZIP) {
1330  ->withZipOutputPath($this->getImportTempDirectory());
1331  $unzip = $this->archives->unzip($this->temp_file_system->readStream($files[0]->getPath()), $options);
1332  $unzip->extract();
1333  list($subdir, $importdir, $xmlfile, $qtifile) = $this->buildImportDirectoriesFromImportFile($file_to_import);
1334  }
1335  if (!file_exists($qtifile)) {
1336  ilFileUtils::delDir($importdir);
1337  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('cannot_find_xml'), true);
1338  $this->questionsObject();
1339  return;
1340  }
1341 
1342  ilSession::set('path_to_import_file', $file_to_import);
1343  ilSession::set('path_to_uploaded_file_in_temp_dir', $path_to_uploaded_file_in_temp_dir);
1344 
1345  $form = $this->buildImportQuestionsSelectionForm(
1346  'importVerifiedQuestionsFile',
1347  $importdir,
1348  $qtifile,
1349  $path_to_uploaded_file_in_temp_dir
1350  );
1351 
1352  if ($form === null) {
1353  return;
1354  }
1355 
1356  $panel = $this->ui_factory->panel()->standard(
1357  $this->lng->txt('import_question'),
1358  [
1359  $this->ui_factory->legacy()->content($this->lng->txt('qpl_import_verify_found_questions')),
1360  $form
1361  ]
1362  );
1363  $this->tpl->setContent($this->ui_renderer->render($panel));
1364  $this->tpl->printToStdout();
1365  exit;
1366  }
buildImportQuestionsSelectionForm(string $form_cmd, string $importdir, string $qtifile, ?string $path_to_uploaded_file_in_temp_dir=null)
questionsObject(?RoundTripModal $import_questions_modal=null)
list questions of question pool
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
array buildImportDirectoriesFromImportFile(string $file_to_import)
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ 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 908 of file class.ilObjQuestionPoolGUI.php.

References ilObject\getId(), ilQTIParser\IL_MO_PARSE_QTI, and ilQTIParser\startParsing().

Referenced by importVerifiedFileObject(), and importVerifiedQuestionsFileObject().

914  : void {
915  $qti_parser = new ilQTIParser(
916  $importdir,
917  $qtifile,
919  $obj->getId(),
920  $selected_questions
921  );
922  $qti_parser->startParsing();
923 
924  if ($xmlfile === '') {
925  return;
926  }
927 
928  $cont_parser = new ilQuestionPageParser(
929  $obj,
930  $xmlfile,
931  $importdir
932  );
933  $cont_parser->setQuestionMapping($qti_parser->getImportMapping());
934  $cont_parser->startParsing();
935  }
Legacy Content Object Parser.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importVerifiedFileObject()

ilObjQuestionPoolGUI::importVerifiedFileObject ( )

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

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

752  : void
753  {
754  if (!$this->checkPermissionBool('create', '', $this->request_data_collector->string('new_type'))) {
755  $this->redirectAfterMissingWrite();
756  return;
757  }
758 
759  $file_to_import = ilSession::get('path_to_import_file');
760  list($subdir, $importdir, $xmlfile, $qtifile) = $this->buildImportDirectoriesFromImportFile($file_to_import);
761 
762  $new_obj = new ilObjQuestionPool(0, true);
763  $new_obj->setType($this->request_data_collector->raw('new_type'));
764  $new_obj->setTitle('dummy');
765  $new_obj->setDescription('questionpool import');
766  $new_obj->create(true);
767  $new_obj->createReference();
768  $new_obj->putInTree($this->request_data_collector->getRefId());
769  $new_obj->setPermissions($this->request_data_collector->getRefId());
770 
772  'importVerifiedFile',
773  $importdir,
774  $qtifile,
775  $this->request
776  );
777 
778  if (is_file($importdir . DIRECTORY_SEPARATOR . 'manifest.xml')) {
780  $new_obj,
781  $selected_questions,
782  $file_to_import
783  );
784  } else {
786  $new_obj,
787  $selected_questions,
788  $qtifile,
789  $importdir,
790  $xmlfile
791  );
792 
793  $new_obj->fromXML($xmlfile);
794 
795  $new_obj->update();
796  $new_obj->saveToDb();
797  }
798  $this->cleanupAfterImport($importdir);
799 
800  $this->tpl->setOnScreenMessage('success', $this->lng->txt('object_imported'), true);
801  $this->ctrl->setParameterByClass(self::class, 'ref_id', $new_obj->getRefId());
802  $this->ctrl->redirectByClass(self::class);
803  }
static get(string $a_var)
importQuestionsFromQtiFile(ilObjQuestionPool $obj, array $selected_questions, string $qtifile, string $importdir, string $xmlfile='')
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)
array buildImportDirectoriesFromImportFile(string $file_to_import)
cleanupAfterImport(string $importdir)
+ Here is the call graph for this function:

◆ importVerifiedQuestionsFileObject()

ilObjQuestionPoolGUI::importVerifiedQuestionsFileObject ( )

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

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

805  : void
806  {
807  $file_to_import = ilSession::get('path_to_import_file');
808 
809  if (mb_substr($file_to_import, -3) === 'xml') {
810  $importdir = dirname($file_to_import);
812  'importVerifiedQuestionsFile',
813  $importdir,
814  $file_to_import,
815  $this->request
816  );
818  $this->getObject(),
819  $selected_questions,
820  $file_to_import,
821  $importdir
822  );
823  } else {
824  list($subdir, $importdir, $xmlfile, $qtifile) = $this->buildImportDirectoriesFromImportFile($file_to_import);
826  'importVerifiedQuestionsFile',
827  $importdir,
828  $qtifile,
829  $this->request
830  );
831  if (is_file($importdir . DIRECTORY_SEPARATOR . 'manifest.xml')) {
833  $this->getObject(),
834  $selected_questions,
835  $file_to_import
836  );
837  } else {
839  $this->getObject(),
840  $selected_questions,
841  $qtifile,
842  $importdir,
843  $xmlfile
844  );
845  }
846  }
847 
848  $this->cleanupAfterImport($importdir);
849 
850  $this->tpl->setOnScreenMessage('success', $this->lng->txt('object_imported'), true);
851  $this->questionsObject();
852  }
static get(string $a_var)
questionsObject(?RoundTripModal $import_questions_modal=null)
list questions of question pool
importQuestionsFromQtiFile(ilObjQuestionPool $obj, array $selected_questions, string $qtifile, string $importdir, string $xmlfile='')
importQuestionPoolWithValidManifest(ilObjQuestionPool $obj, array $selected_questions, string $file_to_import)
retrieveSelectedQuestionsFromImportQuestionsSelectionForm(string $form_cmd, string $importdir, string $qtifile, ServerRequestInterface $request)
array buildImportDirectoriesFromImportFile(string $file_to_import)
cleanupAfterImport(string $importdir)
+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjQuestionPoolGUI::infoScreenForward ( )

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

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

Referenced by questionsObject().

1737  : void
1738  {
1739  if (!$this->access->checkAccess('visible', '', $this->ref_id)) {
1740  $this->error->raiseError($this->lng->txt('msg_no_perm_read'));
1741  }
1742 
1743  $this->tabs_gui->activateTab('info_short');
1744  $info = new ilInfoScreenGUI($this);
1745  $info->enablePrivateNotes();
1746  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1747 
1748  $this->ctrl->forwardCommand($info);
1749  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreenObject()

ilObjQuestionPoolGUI::infoScreenObject ( )

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

References ILIAS\Repository\ctrl().

1726  : void
1727  {
1728  $this->ctrl->redirectByClass(
1729  [
1730  ilRepositoryGUI::class,
1731  self::class,
1732  ilInfoScreenGUI::class
1733  ]
1734  );
1735  }
+ Here is the call graph for this function:

◆ isSkillsTabRequired()

ilObjQuestionPoolGUI::isSkillsTabRequired ( )
private

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

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

Referenced by getTabs().

1694  : bool
1695  {
1696  if (!($this->object instanceof ilObjQuestionPool)) {
1697  return false;
1698  }
1699 
1700  if (!$this->object->isSkillServiceEnabled()) {
1701  return false;
1702  }
1703 
1705  return false;
1706  }
1707 
1708  return true;
1709  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ moveQuestions()

ilObjQuestionPoolGUI::moveQuestions ( array  $ids)

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

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

1288  : void
1289  {
1290  if ($ids) {
1291  foreach ($ids as $id) {
1292  $this->object->moveToClipboard($id);
1293  }
1294  $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_move_insert_clipboard'), true);
1295  } else {
1296  $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_move_select_none'), true);
1297  }
1298  }
+ Here is the call graph for this function:

◆ pasteObject()

ilObjQuestionPoolGUI::pasteObject ( )

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

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

1262  : void
1263  {
1264  if (ilSession::get('qpl_clipboard') != null) {
1265  if ($this->object->pasteFromClipboard()) {
1266  $this->tpl->setOnScreenMessage('success', $this->lng->txt('qpl_paste_success'), true);
1267  } else {
1268  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('qpl_paste_error'), true);
1269  }
1270  } else {
1271  $this->tpl->setOnScreenMessage('info', $this->lng->txt('qpl_paste_no_objects'), true);
1272  }
1273  $this->ctrl->redirect($this, self::DEFAULT_CMD);
1274  }
static get(string $a_var)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ printObject()

ilObjQuestionPoolGUI::printObject ( )

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

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

1226  : void
1227  {
1228  $this->tabs_gui->activateTab('print_view');
1229  $this->ctrl->setParameter($this, 'output', 'overview');
1230  $output_link = $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'print');
1231  $this->ctrl->setParameter($this, 'output', 'detailed_output_solutions');
1232  $output_link_detailed = $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'print');
1233  $this->ctrl->setParameter($this, 'output', 'detailed_output_printview');
1234  $output_link_printview = $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'print');
1235 
1236  $mode = $this->ui_factory->dropdown()->standard([
1237  $this->ui_factory->button()->shy($this->lng->txt('overview'), $output_link),
1238  $this->ui_factory->button()->shy($this->lng->txt('detailed_output_solutions'), $output_link_detailed),
1239  $this->ui_factory->button()->shy($this->lng->txt('detailed_output_printview'), $output_link_printview)
1240  ])->withLabel($this->lng->txt('output_mode'));
1241 
1242  $output = $this->request_data_collector->raw('output') ?? '';
1243 
1244  $table_gui = new ilQuestionPoolPrintViewTableGUI($this, 'print', $output);
1245  $data = $this->object->getPrintviewQuestions();
1246  $totalPoints = 0;
1247  foreach ($data as $d) {
1248  $totalPoints += $d['points'];
1249  }
1250  $table_gui->setTotalPoints($totalPoints);
1251  $table_gui->initColumns();
1252  $table_gui->setData($data);
1253  $this->tpl->setContent($this->ui_renderer->render($mode) . $table_gui->getHTML());
1254  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ questionsObject()

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

list questions of question pool

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

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

Referenced by importQuestionsFile(), importVerifiedQuestionsFileObject(), and uploadQuestionsImportObject().

1092  : void
1093  {
1094  if (!$this->access->checkAccess("read", "", $this->request_data_collector->getRefId())) {
1095  $this->infoScreenForward();
1096  return;
1097  }
1098 
1099  $this->object->purgeQuestions();
1100  $qsa_import_fails = new ilAssQuestionSkillAssignmentImportFails($this->object->getId());
1101  if ($qsa_import_fails->failedImportsRegistered()) {
1102  $button = $this->ui_factory->button()->standard(
1103  $this->lng->txt('ass_skl_import_fails_remove_btn'),
1104  $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'renoveImportFails')
1105  );
1106  $this->tpl->setOnScreenMessage(
1107  'failure',
1108  $qsa_import_fails->getFailedImportsMessage($this->lng) . '<br />' . $this->ui_renderer->render(
1109  $button
1110  )
1111  );
1112  }
1113 
1114  $out = [];
1115  if ($this->rbac_system->checkAccess('write', $this->request_data_collector->getRefId())) {
1116  $btn = $this->ui_factory->button()->primary(
1117  $this->lng->txt('ass_create_question'),
1118  $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'createQuestionForm')
1119  );
1120  $this->toolbar->addComponent($btn);
1121 
1122  if ($import_questions_modal === null) {
1123  $import_questions_modal = $this->buildImportQuestionsModal();
1124  }
1125 
1126  $btn_import = $this->ui_factory->button()->standard(
1127  $this->lng->txt('import'),
1128  $import_questions_modal->getShowSignal()
1129  );
1130  $this->toolbar->addComponent($btn_import);
1131  $out[] = $this->ui_renderer->render($import_questions_modal);
1132 
1133  if (ilSession::get('qpl_clipboard') != null && count(ilSession::get('qpl_clipboard'))) {
1134  $btn_paste = $this->ui_factory->button()->standard(
1135  $this->lng->txt('paste'),
1136  $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, self::class], 'paste')
1137  );
1138  $this->toolbar->addComponent($btn_paste);
1139  }
1140  }
1141 
1142  $this->tpl->setPermanentLink($this->object->getType(), $this->object->getRefId());
1143  $out[] = $this->getTable();
1144  $this->tpl->setContent(implode('', $out));
1145  }
static get(string $a_var)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$out
Definition: buildRTE.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redirectAfterMissingWrite()

ilObjQuestionPoolGUI::redirectAfterMissingWrite ( )
protected

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

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

Referenced by importVerifiedFileObject().

709  {
710  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_permission'), true);
711  $target_class = get_class($this->object) . 'GUI';
712  $this->ctrl->setParameterByClass($target_class, 'ref_id', $this->ref_id);
713  $this->ctrl->redirectByClass($target_class);
714  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renoveImportFailsObject()

ilObjQuestionPoolGUI::renoveImportFailsObject ( )
protected

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

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

1075  : void
1076  {
1077  $qsaImportFails = new ilAssQuestionSkillAssignmentImportFails($this->object->getId());
1078  $qsaImportFails->deleteRegisteredImportFails();
1079 
1080  $this->ctrl->redirectByClass(
1081  [
1082  ilRepositoryGUI::class,
1083  self::class,
1084  ilInfoScreenGUI::class
1085  ]
1086  );
1087  }
+ Here is the call graph for this function:

◆ setTitleAndDescription()

ilObjQuestionPoolGUI::setTitleAndDescription ( )

called by prepare output

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

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

1458  : void
1459  {
1460  parent::setTitleAndDescription();
1461 
1462  if (!is_array($this->request_data_collector->raw('q_id')) && $this->request_data_collector->raw('q_id') > 0 && $this->request_data_collector->raw(
1463  'cmd'
1464  ) !== self::DEFAULT_CMD) {
1465  $question_gui = assQuestionGUI::_getQuestionGUI('', $this->request_data_collector->getQuestionId());
1466  if ($question_gui->getObject() instanceof assQuestion) {
1467  $question = $question_gui->getObject();
1468  $question->setObjId($this->object->getId());
1469  $question_gui->setObject($question);
1470  $title = $this->object->getTitle() . ': ' . $question_gui->getObject()->getTitleForHTMLOutput();
1471  if (!$title) {
1472  $title = $this->lng->txt('new') . ': ' . $this->questionrepository->getForQuestionId(
1473  $question_gui->getObject()->getId()
1474  )->getTypeName($this->lng);
1475  }
1476  $this->tpl->setTitle(
1477  $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
1478  $title,
1479  )
1480  );
1481  $this->tpl->setDescription(
1482  $question_gui->getObject()->getDescriptionForHTMLOutput()
1483  );
1484  $this->tpl->setTitleIcon(ilObject2::_getIcon($this->object->getId(), 'big', $this->object->getType()));
1485  } else {
1486  // Workaround for context issues: If no object was found, redirect without q_id parameter
1487  $this->ctrl->setParameter($this, 'q_id', '');
1488  $this->ctrl->redirect($this);
1489  }
1490  } else {
1491  $this->tpl->setTitle(
1492  $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
1493  $this->object->getTitle()
1494  )
1495  );
1496  $this->tpl->setDescription(
1497  $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform(
1498  $this->object->getLongDescription()
1499  )
1500  );
1501  $this->tpl->setTitleIcon(ilObject2::_getIcon($this->object->getId(), 'big', $this->object->getType()));
1502  }
1503  }
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static _getQuestionGUI(string $question_type='', int $question_id=-1)
Creates a question gui representation and returns the alias to the question gui.
+ Here is the call graph for this function:

◆ updateObject()

ilObjQuestionPoolGUI::updateObject ( )

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

References ILIAS\Repository\lng().

1256  : void
1257  {
1258  $this->object->update();
1259  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
1260  }
+ Here is the call graph for this function:

◆ uploadQuestionsImportObject()

ilObjQuestionPoolGUI::uploadQuestionsImportObject ( )

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

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

854  : void
855  {
856  $import_questions_modal = $this->buildImportQuestionsModal()->withRequest($this->request);
857  $data = $import_questions_modal->getData();
858  if ($data === null) {
859  $this->questionsObject(
860  $import_questions_modal->withOnLoad(
861  $import_questions_modal->getShowSignal()
862  )
863  );
864  return;
865  }
866  $path_to_imported_file_in_temp_dir = $data['import_file'][0];
867  $this->importQuestionsFile($path_to_imported_file_in_temp_dir);
868  }
importQuestionsFile(string $path_to_uploaded_file_in_temp_dir)
questionsObject(?RoundTripModal $import_questions_modal=null)
list questions of question pool
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

Field Documentation

◆ $action_parameter_token

URLBuilderToken ilObjQuestionPoolGUI::$action_parameter_token
protected

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

◆ $archives

Archives ilObjQuestionPoolGUI::$archives
private

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

◆ $component_factory

ilComponentFactory ilObjQuestionPoolGUI::$component_factory
protected

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

◆ $component_repository

ilComponentRepository ilObjQuestionPoolGUI::$component_repository
protected

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

◆ $content_style

ContentStyle ilObjQuestionPoolGUI::$content_style
private

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

◆ $data_factory

DataFactory ilObjQuestionPoolGUI::$data_factory
protected

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

◆ $db

ilDBInterface ilObjQuestionPoolGUI::$db
protected

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

◆ $global_screen

GlobalScreen ilObjQuestionPoolGUI::$global_screen
protected

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

◆ $global_test_settings

GlobalTestSettings ilObjQuestionPoolGUI::$global_test_settings
protected

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

◆ $help

ilHelpGUI ilObjQuestionPoolGUI::$help
protected

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

◆ $http

HTTPServices ilObjQuestionPoolGUI::$http
private

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

◆ $log

ilComponentLogger ilObjQuestionPoolGUI::$log
protected

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

◆ $navigation_history

ilNavigationHistory ilObjQuestionPoolGUI::$navigation_history
protected

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

◆ $questionrepository

GeneralQuestionPropertiesRepository ilObjQuestionPoolGUI::$questionrepository
protected

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

◆ $request_data_collector

RequestDataCollector ilObjQuestionPoolGUI::$request_data_collector
protected

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

◆ $row_id_token

URLBuilderToken ilObjQuestionPoolGUI::$row_id_token
protected

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

◆ $taxonomy

Service ilObjQuestionPoolGUI::$taxonomy
protected

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

◆ $ui_service

ilUIService ilObjQuestionPoolGUI::$ui_service
protected

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

◆ $url_builder

URLBuilder ilObjQuestionPoolGUI::$url_builder
protected

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

◆ DEFAULT_CMD

const ilObjQuestionPoolGUI::DEFAULT_CMD = 'questions'

◆ SUPPORTED_IMPORT_MIME_TYPES

const ilObjQuestionPoolGUI::SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::TEXT__XML]

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