ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilObjQuestionPoolGUI Class Reference

Class ilObjQuestionPoolGUI. More...

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

Public Member Functions

 __construct ()
 Constructor @access public. More...
 
 executeCommand ()
 execute command More...
 
 downloadFileObject ()
 download file More...
 
 fullscreenObject ()
 show fullscreen view More...
 
 filterObject ()
 set question list filter More...
 
 resetFilterObject ()
 resets filter More...
 
 download_paragraphObject ()
 download source code paragraph More...
 
 uploadQplObject ($questions_only=false)
 imports question(s) into the questionpool More...
 
 importVerifiedFileObject ()
 imports question(s) into the questionpool (after verification) More...
 
 cancelImportObject ()
 
 uploadObject ()
 imports question(s) into the questionpool More...
 
 importQuestionsObject (ilPropertyFormGUI $form=null)
 display the import form to import questions into the questionpool More...
 
createQuestionObject ()
 create new question More...
 
createQuestionForTestObject ()
 create new question More...
 
 afterSave (ilObject $a_new_object)
 save object @access public More...
 
 questionObject ()
 
 deleteQuestionsObject ()
 delete questions confirmation screen More...
 
 confirmDeleteQuestionsObject ()
 delete questions More...
 
 cancelDeleteQuestionsObject ()
 Cancel question deletion. More...
 
 exportQuestionObject ()
 export question More...
 
 filterQuestionBrowserObject ()
 
 resetQuestionBrowserObject ()
 
 questionsObject ()
 list questions of question pool More...
 
 updateObject ()
 updates object entry in object_data More...
 
 pasteObject ()
 paste questios from the clipboard into the question pool More...
 
 copyObject ()
 copy one or more question objects to the clipboard More...
 
 moveObject ()
 mark one or more question objects for moving More...
 
 createExportExcel ()
 
editQuestionForTestObject ()
 edit question More...
 
 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 ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 infoScreenForward ()
 show information screen More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 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...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Static Public Member Functions

static _goto ($a_target)
 Redirect script to call a test with the question pool reference id. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Data Fields

 $object
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 exportObject ()
 Gateway for exports initiated from workspace, as there is a generic forward to {objTypeMainGUI}::export() More...
 
 getImportQuestionsForm ()
 
 renoveImportFailsObject ()
 
 fetchAuthoringQuestionIdParamater ()
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 form for new questionpool object import More...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_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 $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Private Member Functions

 createQuestionFormObject ()
 
 buildCreateQuestionForm ()
 
 isSkillsTabRequired ()
 
 addSettingsSubTabs (ilTabsGUI $tabs)
 
 buildQuestionBrowserTableGUI ($taxIds)
 

Additional Inherited Members

- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $rbacsystem
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjQuestionPoolGUI::__construct ( )

Constructor @access public.

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

47 {
48 global $lng, $ilCtrl, $rbacsystem;
49 $lng->loadLanguageModule("assessment");
50 $this->type = "qpl";
51 $this->ctrl =&$ilCtrl;
52
53 $this->ctrl->saveParameter($this, array(
54 "ref_id", "test_ref_id", "calling_test", "test_express_mode", "q_id", 'tax_node', 'calling_consumer', 'consumer_context'
55 ));
56 $this->ctrl->saveParameter($this, "calling_consumer");
57 $this->ctrl->saveParameterByClass('ilAssQuestionPageGUI', 'calling_consumer');
58 $this->ctrl->saveParameterByClass('ilAssQuestionPageGUI', 'consumer_context');
59 $this->ctrl->saveParameterByClass('ilobjquestionpoolgui', 'calling_consumer');
60 $this->ctrl->saveParameterByClass('ilobjquestionpoolgui', 'consumer_context');
61
62 parent::__construct("", $_GET["ref_id"], true, false);
63 }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18

References $_GET, $ilCtrl, ilObjectGUI\$lng, and ilObjectGUI\$rbacsystem.

Member Function Documentation

◆ _goto()

static ilObjQuestionPoolGUI::_goto (   $a_target)
static

Redirect script to call a test with the question pool reference id.

Redirect script to call a test with the question pool reference id

Parameters
integer$a_targetThe reference id of the question pool @access public

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

1602 {
1603 global $ilAccess, $ilErr, $lng;
1604
1605 if ($ilAccess->checkAccess("write", "", $a_target) || $ilAccess->checkAccess('read', '', $a_target)) {
1606 $_GET['cmdClass'] = 'ilObjQuestionPoolGUI';
1607 $_GET['cmd'] = 'questions';
1608 $_GET['baseClass'] = 'ilRepositoryGUI';
1609 $_GET["ref_id"] = $a_target;
1610 include_once("ilias.php");
1611 exit;
1612 } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1614 $lng->txt("msg_no_perm_read_item"),
1616 ), true);
1618 }
1619 $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
1620 }
sprintf('%.4f', $callTime)
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $_GET, ilObjectGUI\$ilErr, ilObjectGUI\$lng, ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), exit, ilUtil\sendInfo(), and sprintf.

+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjQuestionPoolGUI::addLocatorItems ( )

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

Reimplemented from ilObjectGUI.

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

1311 {
1312 global $ilLocator;
1313 switch ($this->ctrl->getCmd()) {
1314 case "create":
1315 case "importFile":
1316 case "cancel":
1317 break;
1318 default:
1319 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $_GET["ref_id"]);
1320 break;
1321 }
1322 if ($_GET["q_id"] > 0) {
1323 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1324 $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
1325 if ($q_gui->object instanceof assQuestion) {
1326 $q_gui->object->setObjId($this->object->getId());
1327 $title = $q_gui->object->getTitle();
1328 if (!$title) {
1329 $title = $this->lng->txt('new') . ': ' . assQuestion::_getQuestionTypeName($q_gui->object->getQuestionType());
1330 }
1331 $ilLocator->addItem($title, $this->ctrl->getLinkTargetByClass(get_class($q_gui), "editQuestion"));
1332 } else {
1333 // Workaround for context issues: If no object was found, redirect without q_id parameter
1334 $this->ctrl->setParameter($this, 'q_id', '');
1335 $this->ctrl->redirect($this);
1336 }
1337 }
1338 }
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
Abstract basic class which is to be extended by the concrete assessment question type classes.
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.

References $_GET, $title, assQuestionGUI\_getQuestionGUI(), and assQuestion\_getQuestionTypeName().

+ Here is the call graph for this function:

◆ addSettingsSubTabs()

ilObjQuestionPoolGUI::addSettingsSubTabs ( ilTabsGUI  $tabs)
private

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

1544 {
1545 $tabs->addSubTabTarget(
1546 'qpl_settings_subtab_general',
1547 $this->ctrl->getLinkTargetByClass('ilObjQuestionPoolSettingsGeneralGUI'),
1548 '',
1549 'ilObjQuestionPoolSettingsGeneralGUI'
1550 );
1551
1552 $tabs->addSubTabTarget(
1553 'qpl_settings_subtab_taxonomies',
1554 $this->ctrl->getLinkTargetByClass('ilObjTaxonomyGUI', 'editAOTaxonomySettings'),
1555 '',
1556 'ilObjTaxonomyGUI'
1557 );
1558 }
if(!empty($this->data['faventry'])) $tabs
Definition: disco.tpl.php:124

References $tabs.

Referenced by getTabs().

+ Here is the caller graph for this function:

◆ afterSave()

ilObjQuestionPoolGUI::afterSave ( ilObject  $a_new_object)

save object @access public

Reimplemented from ilObjectGUI.

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

830 {
831 // always send a message
832 ilUtil::sendSuccess($this->lng->txt("object_added"), true);
833
834 ilUtil::redirect("ilias.php?ref_id=" . $a_new_object->getRefId() .
835 "&baseClass=ilObjQuestionPoolGUI");
836 }
getRefId()
get reference id @access public
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)

References ilObject\getRefId(), ilUtil\redirect(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ buildCreateQuestionForm()

ilObjQuestionPoolGUI::buildCreateQuestionForm ( )
private

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

1099 {
1100 global $ilUser;
1101
1102 // form
1103
1104 require_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1105 $form = new ilPropertyFormGUI();
1106 $form->setTitle($this->lng->txt('ass_create_question'));
1107 $form->setFormAction($this->ctrl->getFormAction($this));
1108
1109 // question type
1110
1111 $options = array();
1112 foreach ($this->object->getQuestionTypes(false, true) as $translation => $data) {
1113 $options[$data['type_tag']] = $translation;
1114 }
1115
1116 require_once("Services/Form/classes/class.ilSelectInputGUI.php");
1117 $si = new ilSelectInputGUI($this->lng->txt('question_type'), 'sel_question_types');
1118 $si->setOptions($options);
1119 //$si->setValue($ilUser->getPref("tst_lastquestiontype"));
1120
1121 $form->addItem($si);
1122
1123 // content editing mode
1124
1126 $ri = new ilRadioGroupInputGUI($this->lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
1127
1128 $ri->addOption(new ilRadioOption(
1129 $this->lng->txt('tst_add_quest_cont_edit_mode_default'),
1131 ));
1132
1133 $ri->addOption(new ilRadioOption(
1134 $this->lng->txt('tst_add_quest_cont_edit_mode_page_object'),
1136 ));
1137
1139
1140 $form->addItem($ri, true);
1141 } else {
1142 $hi = new ilHiddenInputGUI("question_content_editing_type");
1144 $form->addItem($hi, true);
1145 }
1146
1147 // commands
1148
1149 $form->addCommandButton('createQuestion', $this->lng->txt('create'));
1150 $form->addCommandButton('questions', $this->lng->txt('cancel'));
1151
1152 return $form;
1153 }
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
const ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT
constant for additional content editing mode "default"
const ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT
constant for additional content editing mode "pageobject"
This class represents a hidden form property in a property form.
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a selection list property in a property form.
if(isset($_POST['submit'])) $form
$ilUser
Definition: imgupload.php:18

References ilObjectGUI\$data, $form, $ilUser, $options, $si, assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT, assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT, and ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled().

Referenced by createQuestionFormObject().

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

◆ buildQuestionBrowserTableGUI()

ilObjQuestionPoolGUI::buildQuestionBrowserTableGUI (   $taxIds)
private
Parameters
array$taxIds@global ilRbacSystem $rbacsystem @global ilDBInterface $ilDB @global ilLanguage $lng @global ilPluginAdmin $ilPluginAdmin
Returns
ilQuestionBrowserTableGUI

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

1631 {
1632 global $rbacsystem, $ilDB, $lng, $ilPluginAdmin;
1633
1634 include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
1635 $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', (($rbacsystem->checkAccess('write', $_GET['ref_id']) ? true : false)), false, $taxIds);
1636 $table_gui->setEditable($rbacsystem->checkAccess('write', $_GET['ref_id']));
1637
1638 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
1639 $questionList = new ilAssQuestionList($ilDB, $lng, $ilPluginAdmin);
1640 $questionList->setParentObjId($this->object->getId());
1641
1642 foreach ($table_gui->getFilterItems() as $item) {
1643 if (substr($item->getPostVar(), 0, strlen('tax_')) == 'tax_') {
1644 $v = $item->getValue();
1645
1646 if (is_array($v) && count($v) && !(int) $v[0]) {
1647 continue;
1648 }
1649
1650 $taxId = substr($item->getPostVar(), strlen('tax_'));
1651
1652 $questionList->addTaxonomyFilter(
1653 $taxId,
1654 $item->getValue(),
1655 $this->object->getId(),
1656 $this->object->getType()
1657 );
1658 } elseif ($item->getValue() !== false) {
1659 $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
1660 }
1661 }
1662
1663 if ($this->object->isNavTaxonomyActive() && (int) $_GET['tax_node']) {
1664 require_once 'Services/Taxonomy/classes/class.ilTaxonomyTree.php';
1665 $taxTree = new ilTaxonomyTree($this->object->getNavTaxonomyId());
1666 $rootNodeId = $taxTree->readRootId();
1667
1668 if ((int) $_GET['tax_node'] != $rootNodeId) {
1669 $questionList->addTaxonomyFilter(
1670 $this->object->getNavTaxonomyId(),
1671 array((int) $_GET['tax_node']),
1672 $this->object->getId(),
1673 $this->object->getType()
1674 );
1675 }
1676 }
1677
1678 $questionList->load();
1679 $data = $questionList->getQuestionDataArray();
1680
1681 $table_gui->setData($data);
1682
1683 return $table_gui;
1684 }
global $ilDB

References $_GET, ilObjectGUI\$data, $ilDB, ilObjectGUI\$lng, and ilObjectGUI\$rbacsystem.

Referenced by executeCommand(), and questionsObject().

+ Here is the caller graph for this function:

◆ cancelDeleteQuestionsObject()

ilObjQuestionPoolGUI::cancelDeleteQuestionsObject ( )

Cancel question deletion.

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

898 {
899 $this->ctrl->redirect($this, "questions");
900 }

◆ cancelImportObject()

ilObjQuestionPoolGUI::cancelImportObject ( )

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

712 {
713 if ($_POST["questions_only"] == 1) {
714 $this->ctrl->redirect($this, "questions");
715 } else {
716 $this->ctrl->redirect($this, "cancel");
717 }
718 }
$_POST["username"]

References $_POST.

◆ confirmDeleteQuestionsObject()

ilObjQuestionPoolGUI::confirmDeleteQuestionsObject ( )

delete questions

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

879 {
880 // delete questions after confirmation
881 foreach ($_POST["q_id"] as $key => $value) {
882 $this->object->deleteQuestion($value);
883 $this->object->cleanupClipboard($value);
884 }
885 if (count($_POST["q_id"])) {
886 ilUtil::sendSuccess($this->lng->txt("qpl_questions_deleted"), true);
887 }
888
889 $this->ctrl->setParameter($this, 'q_id', '');
890
891 $this->ctrl->redirect($this, "questions");
892 }
$key
Definition: croninfo.php:18

References $_POST, $key, and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ copyObject()

ilObjQuestionPoolGUI::copyObject ( )

copy one or more question objects to the clipboard

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

1220 {
1221 if (isset($_POST["q_id"]) && is_array($_POST["q_id"]) && count($_POST["q_id"]) > 0) {
1222 foreach ($_POST["q_id"] as $key => $value) {
1223 $this->object->copyToClipboard($value);
1224 }
1225 ilUtil::sendInfo($this->lng->txt("qpl_copy_insert_clipboard"), true);
1226 } elseif (isset($_GET['q_id']) && $_GET['q_id'] > 0) {
1227 $this->object->copyToClipboard((int) $_GET['q_id']);
1228 ilUtil::sendInfo($this->lng->txt("qpl_copy_insert_clipboard"), true);
1229 } else {
1230 ilUtil::sendInfo($this->lng->txt("qpl_copy_select_none"), true);
1231 }
1232 $this->ctrl->redirect($this, "questions");
1233 }

References $_GET, $_POST, $key, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ createExportExcel()

ilObjQuestionPoolGUI::createExportExcel ( )

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

1255 {
1256 global $rbacsystem;
1257 if ($rbacsystem->checkAccess("write", $_GET['ref_id'])) {
1258 include_once("./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
1259 $question_ids =&$this->object->getAllQuestionIds();
1260 $qpl_exp = new ilQuestionpoolExport($this->object, 'xls', $question_ids);
1261 $qpl_exp->buildExportFile();
1262 $this->ctrl->redirectByClass("ilquestionpoolexportgui", "");
1263 }
1264 }
Export class for questionpools.

References $_GET, and ilObjectGUI\$rbacsystem.

◆ createQuestionFormObject()

ilObjQuestionPoolGUI::createQuestionFormObject ( )
private

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

1081 {
1082 global $DIC; /* @var \ILIAS\DI\Container $DIC */
1083 $ilHelp = $DIC['ilHelp']; /* @var ilHelpGUI $ilHelp */
1084
1085 $ilHelp->setScreenId('assQuestions');
1086
1088 $ilHelp->setSubScreenId('createQuestion_editMode');
1089 } else {
1090 $ilHelp->setSubScreenId('createQuestion');
1091 }
1092
1093 $form = $this->buildCreateQuestionForm();
1094
1095 $this->tpl->setContent($this->ctrl->getHTML($form));
1096 }
global $DIC
Definition: saml.php:7

References $DIC, $form, buildCreateQuestionForm(), and ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled().

+ Here is the call graph for this function:

◆ createQuestionForTestObject()

& ilObjQuestionPoolGUI::createQuestionForTestObject ( )

create new question

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

796 {
797 if (!$_REQUEST['q_id']) {
798 require_once 'Modules/Test/classes/class.ilObjAssessmentFolder.php';
800 $addContEditMode = $_REQUEST['add_quest_cont_edit_mode'];
801 } else {
803 }
804
805 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
806 $q_gui =&assQuestionGUI::_getQuestionGUI($_GET["sel_question_types"]);
807 $q_gui->object->setObjId($this->object->getId());
808 $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
809 $q_gui->object->createNewQuestion();
810
811 $class = get_class($q_gui);
812 $qId = $q_gui->object->getId();
813 } else {
814 $class = $_GET["sel_question_types"] . 'gui';
815 $qId = $_REQUEST['q_id'];
816 }
817
818 $this->ctrl->setParameterByClass($class, "q_id", $qId);
819 $this->ctrl->setParameterByClass($class, "sel_question_types", $_REQUEST["sel_question_types"]);
820 $this->ctrl->setParameterByClass($class, "prev_qid", $_REQUEST["prev_qid"]);
821
822 $this->ctrl->redirectByClass($class, "editQuestion");
823 }

References $_GET, assQuestionGUI\_getQuestionGUI(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT, and ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled().

+ Here is the call graph for this function:

◆ createQuestionObject()

& ilObjQuestionPoolGUI::createQuestionObject ( )

create new question

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

774 {
776 $addContEditMode = $_POST['add_quest_cont_edit_mode'];
777 } else {
779 }
780
781 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
782 $q_gui =&assQuestionGUI::_getQuestionGUI($_POST["sel_question_types"]);
783 $this->object->addQuestionChangeListeners($q_gui->object);
784 $q_gui->object->setObjId($this->object->getId());
785 $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
786 $q_gui->object->createNewQuestion();
787 $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
788 $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $_POST["sel_question_types"]);
789 $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
790 }

References $_POST, assQuestionGUI\_getQuestionGUI(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT, and ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled().

+ Here is the call graph for this function:

◆ deleteQuestionsObject()

ilObjQuestionPoolGUI::deleteQuestionsObject ( )

delete questions confirmation screen

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

849 {
850 global $rbacsystem;
851
852 $questionIdsToDelete = isset($_POST['q_id']) ? (array) $_POST['q_id'] : array();
853 if (0 === count($questionIdsToDelete) && isset($_GET['q_id'])) {
854 $questionIdsToDelete = array($_GET['q_id']);
855 }
856
857 $questionIdsToDelete = array_filter(array_map('intval', $questionIdsToDelete));
858 if (0 === count($questionIdsToDelete)) {
859 ilUtil::sendInfo($this->lng->txt("qpl_delete_select_none"), true);
860 $this->ctrl->redirect($this, "questions");
861 }
862
863 ilUtil::sendQuestion($this->lng->txt("qpl_confirm_delete_questions"));
864 $deleteable_questions =&$this->object->getDeleteableQuestionDetails($questionIdsToDelete);
865 include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
866 $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', (($rbacsystem->checkAccess('write', (int) $_GET['ref_id']) ? true : false)), true);
867 $table_gui->setShowRowsSelector(false);
868 $table_gui->setLimit(PHP_INT_MAX);
869 $table_gui->setEditable($rbacsystem->checkAccess('write', (int) $_GET['ref_id']));
870 $table_gui->setData($deleteable_questions);
871 $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
872 }
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.

References $_GET, $_POST, ilObjectGUI\$rbacsystem, ilUtil\sendInfo(), and ilUtil\sendQuestion().

+ Here is the call graph for this function:

◆ download_paragraphObject()

ilObjQuestionPoolGUI::download_paragraphObject ( )

download source code paragraph

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

436 {
437 include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php");
438 $pg_obj = new ilAssQuestionPage($_GET["pg_id"]);
439 $pg_obj->send_paragraph($_GET["par_id"], $_GET["downloadtitle"]);
440 exit;
441 }
Question page object.

References $_GET, and exit.

◆ downloadFileObject()

ilObjQuestionPoolGUI::downloadFileObject ( )

download file

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

395 {
396 $file = explode("_", $_GET["file_id"]);
397 include_once("./Modules/File/classes/class.ilObjFile.php");
398 $fileObj = new ilObjFile($file[count($file) - 1], false);
399 $fileObj->sendFile();
400 exit;
401 }
Class ilObjFile.
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file

References $_GET, $file, and exit.

◆ editQuestionForTestObject()

& ilObjQuestionPoolGUI::editQuestionForTestObject ( )

edit question

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

1270 {
1271 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1272 $q_gui =&assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
1273 $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
1274 }

References $_GET, and assQuestionGUI\_getQuestionGUI().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjQuestionPoolGUI::executeCommand ( )

execute command

@global ilLocatorGUI $ilLocator @global ilAccessHandler $ilAccess @global ilNavigationHistory $ilNavigationHistory @global ilTemplate $tpl @global ilCtrl $ilCtrl @global ilTabsGUI $ilTabs @global ilLanguage $lng @global ILIAS $ilias

Reimplemented from ilObjectGUI.

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

78 {
79 global $ilUser, $ilLocator, $ilAccess, $ilNavigationHistory, $tpl, $ilCtrl, $ilErr, $ilTabs, $lng, $ilDB, $ilPluginAdmin, $ilias;
80
81 if ((!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) && (!$ilAccess->checkAccess("visible", "", $_GET["ref_id"]))) {
82 global $ilias;
83 $ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE);
84 }
85
86 // add entry to navigation history
87 if (!$this->getCreationMode() &&
88 $ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
89 if ('qpl' == $this->object->getType()) {
90 $ilNavigationHistory->addItem(
91 $_GET["ref_id"],
92 "ilias.php?baseClass=ilObjQuestionPoolGUI&cmd=questions&ref_id=" . $_GET["ref_id"],
93 "qpl"
94 );
95 }
96 }
97
98 $cmd = $this->ctrl->getCmd("questions");
99 $next_class = $this->ctrl->getNextClass($this);
100
101 if (in_array($next_class, array('', 'ilobjquestionpoolgui')) && $cmd == 'questions') {
102 $_GET['q_id'] = '';
103 }
104
105 $this->prepareOutput();
106
107 $this->ctrl->setReturn($this, "questions");
108
109 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
110 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "ta.css", "Modules/Test"), "screen");
111
112 if ($_GET["q_id"] < 1) {
113 $q_type = ($_POST["sel_question_types"] != "")
114 ? $_POST["sel_question_types"]
115 : $_GET["sel_question_types"];
116 }
117 if ($cmd != "createQuestion" && $cmd != "createQuestionForTest"
118 && $next_class != "ilassquestionpagegui") {
119 if (($_GET["test_ref_id"] != "") or ($_GET["calling_test"])) {
120 $ref_id = $_GET["test_ref_id"];
121 if (!$ref_id) {
122 $ref_id = $_GET["calling_test"];
123 }
124 }
125 }
126 switch ($next_class) {
127 case "ilcommonactiondispatchergui":
128 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
130 $this->ctrl->forwardCommand($gui);
131 break;
132
133 case 'ilobjectmetadatagui':
134 if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
135 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
136 }
137 include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
138 $md_gui = new ilObjectMetaDataGUI($this->object);
139 $this->ctrl->forwardCommand($md_gui);
140 break;
141
142 case 'ilassquestionpreviewgui':
143
144 $this->ctrl->saveParameter($this, "q_id");
145
146 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewGUI.php';
147 $gui = new ilAssQuestionPreviewGUI($this->ctrl, $this->tabs_gui, $this->tpl, $this->lng, $ilDB, $ilUser);
148
149 $gui->initQuestion((int) $_GET['q_id'], $this->object->getId());
150 $gui->initPreviewSettings($this->object->getRefId());
151 $gui->initPreviewSession($ilUser->getId(), $this->fetchAuthoringQuestionIdParamater());
152 $gui->initHintTracking();
153 $gui->initStyleSheets();
154
155 global $ilHelp;
156 $ilHelp->setScreenIdComponent("qpl");
157
158 $this->ctrl->forwardCommand($gui);
159 break;
160
161 case "ilassquestionpagegui":
162 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
163 $this->tpl->setCurrentBlock("ContentStyle");
164 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
165 $this->tpl->parseCurrentBlock();
166
167 // syntax style
168 $this->tpl->setCurrentBlock("SyntaxStyle");
169 $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
170 $this->tpl->parseCurrentBlock();
171
172 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
174 $q_gui->setRenderPurpose(assQuestionGUI::RENDER_PURPOSE_PREVIEW);
175 $q_gui->setQuestionTabs();
176 $q_gui->outAdditionalOutput();
177 $q_gui->object->setObjId($this->object->getId());
178
179 $q_gui->setTargetGuiClass(null);
180 $q_gui->setQuestionActionCmd(null);
181
182 $question = $q_gui->object;
183 $this->ctrl->saveParameter($this, "q_id");
184 include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
185 $this->lng->loadLanguageModule("content");
186 $this->ctrl->setReturnByClass("ilAssQuestionPageGUI", "view");
187 $this->ctrl->setReturn($this, "questions");
188 $page_gui = new ilAssQuestionPageGUI($_GET["q_id"]);
189 $page_gui->obj->addUpdateListener(
190 $question,
191 'updateTimestamp'
192 );
193 $page_gui->setEditPreview(true);
194 $page_gui->setEnabledTabs(false);
195 if (strlen($this->ctrl->getCmd()) == 0 && !isset($_POST["editImagemapForward_x"])) { // workaround for page edit imagemaps, keep in mind
196 $this->ctrl->setCmdClass(get_class($page_gui));
197 $this->ctrl->setCmd("preview");
198 }
199 $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(true)));
200 $page_gui->setTemplateTargetVar("ADM_CONTENT");
201 $page_gui->setOutputMode("edit");
202 $page_gui->setHeader($question->getTitle());
203 $page_gui->setPresentationTitle($question->getTitle());
204 $ret = $this->ctrl->forwardCommand($page_gui);
205 $tpl->setContent($ret);
206 break;
207
208 case 'ilpermissiongui':
209 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
210 $perm_gui = new ilPermissionGUI($this);
211 $ret = $this->ctrl->forwardCommand($perm_gui);
212 break;
213
214 case 'ilobjectcopygui':
215 include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
216 $cp = new ilObjectCopyGUI($this);
217 $cp->setType('qpl');
218 $this->ctrl->forwardCommand($cp);
219 break;
220
221 case "ilquestionpoolexportgui":
222 require_once 'Modules/TestQuestionPool/classes/class.ilQuestionPoolExportGUI.php';
223 $exp_gui = new ilQuestionPoolExportGUI($this);
224 $exp_gui->addFormat('xml', $this->lng->txt('qpl_export_xml'));
225 $exp_gui->addFormat('xls', $this->lng->txt('qpl_export_excel'), $this, 'createExportExcel');
226 $ret = $this->ctrl->forwardCommand($exp_gui);
227 break;
228
229 case "ilinfoscreengui":
230 $this->infoScreenForward();
231 break;
232
233 case 'ilassquestionhintsgui':
234
235 // set return target
236 $this->ctrl->setReturn($this, "questions");
237
238 // set context tabs
239 require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
241 $questionGUI->object->setObjId($this->object->getId());
242 $questionGUI->setQuestionTabs();
243 global $ilHelp;
244 $ilHelp->setScreenIdComponent("qpl");
245
246 // forward to ilAssQuestionHintsGUI
247 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
248 $gui = new ilAssQuestionHintsGUI($questionGUI);
249
250 global $DIC; /* @var ILIAS\DI\Container $DIC */
251
252 $gui->setEditingEnabled(
253 $DIC->access()->checkAccess('write', '', $this->object->getRefId())
254 );
255
256 $ilCtrl->forwardCommand($gui);
257
258 break;
259
260 case 'illocalunitconfigurationgui':
261 if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
262 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
263 }
264
265 require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
267 $questionGUI->object->setObjId($this->object->getId());
268 $questionGUI->setQuestionTabs();
269
270 $this->ctrl->setReturn($this, 'questions');
271
272 require_once 'Modules/TestQuestionPool/classes/class.ilLocalUnitConfigurationGUI.php';
273 require_once 'Modules/TestQuestionPool/classes/class.ilUnitConfigurationRepository.php';
275 new ilUnitConfigurationRepository((int) $_GET['q_id'])
276 );
277 $ilCtrl->forwardCommand($gui);
278 break;
279
280 case 'ilassquestionfeedbackeditinggui':
281
282 // set return target
283 $this->ctrl->setReturn($this, "questions");
284
285 // set context tabs
286 require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
288 $questionGUI->object->setObjId($this->object->getId());
289 $questionGUI->setQuestionTabs();
290 global $ilHelp;
291 $ilHelp->setScreenIdComponent("qpl");
292
293 // forward to ilAssQuestionFeedbackGUI
294 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
295 $gui = new ilAssQuestionFeedbackEditingGUI($questionGUI, $ilCtrl, $ilAccess, $tpl, $ilTabs, $lng);
296 $ilCtrl->forwardCommand($gui);
297
298 break;
299
300 case 'ilobjquestionpoolsettingsgeneralgui':
301 require_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPoolSettingsGeneralGUI.php';
302 $gui = new ilObjQuestionPoolSettingsGeneralGUI($ilCtrl, $ilAccess, $lng, $tpl, $ilTabs, $this);
303 $this->ctrl->forwardCommand($gui);
304 break;
305
306 case "ilobjtaxonomygui":
307
308 require_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPoolTaxonomyEditingCommandForwarder.php';
310 $this->object,
311 $ilDB,
312 $ilPluginAdmin,
313 $ilCtrl,
314 $ilTabs,
315 $lng
316 );
317
318 $forwarder->forward();
319
320 break;
321
322 case 'ilquestionpoolskilladministrationgui':
323
324 require_once 'Modules/TestQuestionPool/classes/class.ilQuestionPoolSkillAdministrationGUI.php';
326 $ilias,
327 $ilCtrl,
328 $ilAccess,
329 $ilTabs,
330 $tpl,
331 $lng,
332 $ilDB,
333 $ilPluginAdmin,
334 $this->object,
335 $this->ref_id
336 );
337
338 $this->ctrl->forwardCommand($gui);
339
340 break;
341
342 case 'ilquestionbrowsertablegui':
343 $this->ctrl->forwardCommand($this->buildQuestionBrowserTableGUI($taxIds = array())); // no tax ids required
344 break;
345
346 case "ilobjquestionpoolgui":
347 case "":
348
349 if ($cmd == 'questions') {
350 $this->ctrl->setParameter($this, 'q_id', '');
351 }
352
353 $cmd.= "Object";
354 $ret = $this->$cmd();
355 break;
356
357 default:
358 $this->ctrl->setReturn($this, "questions");
359 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
361 $q_gui->setEditContext(assQuestionGUI::EDIT_CONTEXT_AUTHORING);
362 $q_gui->object->setObjId($this->object->getId());
363 if ($this->object->getType() == 'qpl') {
364 $q_gui->setTaxonomyIds($this->object->getTaxonomyIds());
365 $this->object->addQuestionChangeListeners($q_gui->object);
366 }
367 $q_gui->setQuestionTabs();
368 global $ilHelp;
369 $ilHelp->setScreenIdComponent("qpl");
370 $ret = $this->ctrl->forwardCommand($q_gui);
371 break;
372 }
373
374 if (!(strtolower($_GET["baseClass"]) == "iladministrationgui"
375 || strtolower($_GET['baseClass']) == 'ilrepositorygui')
376 && $this->getCreationMode() != true) {
377 $this->tpl->show();
378 }
379 }
Question page GUI class.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Class ilLocalUnitConfigurationGUI.
infoScreenForward()
show information screen
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true)
get content style path
GUI class for the workflow of copying objects.
prepareOutput($a_show_subobjects=true)
prepare output
getCreationMode()
get creation mode
Class ilObjectMetaDataGUI.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
Export User Interface Class.
Class ilUnitConfigurationRepository.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$ret
Definition: parser.php:6

References $_GET, $_POST, $DIC, $ilCtrl, $ilDB, ilObjectGUI\$ilErr, $ilUser, ilObjectGUI\$lng, ilObjectGUI\$ref_id, $ret, ilObjectGUI\$tpl, assQuestionGUI\_getQuestionGUI(), buildQuestionBrowserTableGUI(), assQuestionGUI\EDIT_CONTEXT_AUTHORING, fetchAuthoringQuestionIdParamater(), ilObjStyleSheet\getContentStylePath(), ilObjectGUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ilUtil\getStyleSheetLocation(), ilObjStyleSheet\getSyntaxStylePath(), infoScreenForward(), ilObjectGUI\prepareOutput(), and assQuestionGUI\RENDER_PURPOSE_PREVIEW.

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

386 {
387 global $DIC; /* @var ILIAS\DI\Container $DIC */
388 $DIC->ctrl()->redirectByClass('ilQuestionPoolExportGUI');
389 }

References $DIC.

◆ exportQuestionObject()

ilObjQuestionPoolGUI::exportQuestionObject ( )

export question

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

906 {
907 // export button was pressed
908 if (count($_POST["q_id"]) > 0) {
909 include_once("./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
910 $qpl_exp = new ilQuestionpoolExport($this->object, "xml", $_POST["q_id"]);
911 $export_file = $qpl_exp->buildExportFile();
912 $filename = $export_file;
913 $filename = preg_replace("/.*\//", "", $filename);
914 include_once "./Services/Utilities/classes/class.ilUtil.php";
915 ilUtil::deliverFile($export_file, $filename);
916 exit();
917 } else {
918 ilUtil::sendInfo($this->lng->txt("qpl_export_select_none"), true);
919 }
920 $this->ctrl->redirect($this, "questions");
921 }
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.

References $_POST, $filename, ilUtil\deliverFile(), exit, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ fetchAuthoringQuestionIdParamater()

ilObjQuestionPoolGUI::fetchAuthoringQuestionIdParamater ( )
protected
Returns
mixed

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

1070 {
1071 $qId = (int) $_GET['q_id'];
1072
1073 if ($this->object->checkQuestionParent($qId)) {
1074 return $qId;
1075 }
1076
1077 throw new ilTestQuestionPoolException('question id does not relate to parent object!');
1078 }

References $_GET.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ filterObject()

ilObjQuestionPoolGUI::filterObject ( )

set question list filter

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

418 {
419 $this->questionsObject();
420 }
questionsObject()
list questions of question pool

References questionsObject().

+ Here is the call graph for this function:

◆ filterQuestionBrowserObject()

ilObjQuestionPoolGUI::filterQuestionBrowserObject ( )

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

924 {
925 require_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
926 $taxIds = ilObjTaxonomy::getUsageOfObject($this->object->getId());
927
928 include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
929 $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', false, false, $taxIds);
930 $table_gui->resetOffset();
931 $table_gui->writeFilterToSession();
932 $this->questionsObject();
933 }
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.

References ilObjTaxonomy\getUsageOfObject(), and questionsObject().

+ Here is the call graph for this function:

◆ fullscreenObject()

ilObjQuestionPoolGUI::fullscreenObject ( )

show fullscreen view

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

407 {
408 include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
409 $page_gui = new ilAssQuestionPageGUI($_GET["pg_id"]);
410 $page_gui->showMediaFullscreen();
411 }

References $_GET.

◆ getImportQuestionsForm()

ilObjQuestionPoolGUI::getImportQuestionsForm ( )
protected
Returns
ilPropertyFormGUI

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

754 {
755 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
756 $form = new ilPropertyFormGUI();
757 $form->setTitle($this->lng->txt('import_question'));
758 $form->setFormAction($this->ctrl->getFormAction($this, 'upload'));
759
760 $file = new ilFileInputGUI($this->lng->txt('select_file'), 'xmldoc');
761 $file->setRequired(true);
762 $form->addItem($file);
763
764 $form->addCommandButton('upload', $this->lng->txt('upload'));
765 $form->addCommandButton('questions', $this->lng->txt('cancel'));
766
767 return $form;
768 }
This class represents a file property in a property form.

References $file, and $form.

Referenced by importQuestionsObject(), and uploadObject().

+ Here is the caller graph for this function:

◆ getTabs()

ilObjQuestionPoolGUI::getTabs ( )

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

Reimplemented from ilObjectGUI.

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

1376 {
1377 global $ilAccess, $ilHelp;
1378
1379 $currentUserHasWriteAccess = $ilAccess->checkAccess("write", "", $this->object->getRefId());
1380
1381 $ilHelp->setScreenIdComponent("qpl");
1382
1383 $next_class = strtolower($this->ctrl->getNextClass());
1384 switch ($next_class) {
1385 case "":
1386 case "ilpermissiongui":
1387 case "ilobjectmetadatagui":
1388 case "ilquestionpoolexportgui":
1389 case "ilquestionpoolskilladministrationgui":
1390 break;
1391
1392 case 'ilobjtaxonomygui':
1393 case 'ilobjquestionpoolsettingsgeneralgui':
1394
1395 if ($currentUserHasWriteAccess) {
1396 $this->addSettingsSubTabs($this->tabs_gui);
1397 }
1398
1399 break;
1400
1401 default:
1402 return;
1403 break;
1404 }
1405 // questions
1406 $force_active = false;
1407 $commands = $_POST["cmd"];
1408 if (is_array($commands)) {
1409 foreach ($commands as $key => $value) {
1410 if (preg_match("/^delete_.*/", $key, $matches) ||
1411 preg_match("/^addSelectGap_.*/", $key, $matches) ||
1412 preg_match("/^addTextGap_.*/", $key, $matches) ||
1413 preg_match("/^deleteImage_.*/", $key, $matches) ||
1414 preg_match("/^upload_.*/", $key, $matches) ||
1415 preg_match("/^addSuggestedSolution_.*/", $key, $matches)
1416 ) {
1417 $force_active = true;
1418 }
1419 }
1420 }
1421 if (array_key_exists("imagemap_x", $_POST)) {
1422 $force_active = true;
1423 }
1424 if (!$force_active) {
1425 $force_active = ((strtolower($this->ctrl->getCmdClass()) == strtolower(get_class($this)) || strlen($this->ctrl->getCmdClass()) == 0) &&
1426 $this->ctrl->getCmd() == "")
1427 ? true
1428 : false;
1429 }
1430 $this->tabs_gui->addTarget(
1431 "assQuestions",
1432 $this->ctrl->getLinkTarget($this, "questions"),
1433 array("questions", "filter", "resetFilter", "createQuestion",
1434 "importQuestions", "deleteQuestions", "filterQuestionBrowser",
1435 "view", "preview", "editQuestion", "exec_pg",
1436 "addItem", "upload", "save", "cancel", "addSuggestedSolution",
1437 "cancelExplorer", "linkChilds", "removeSuggestedSolution",
1438 "add", "addYesNo", "addTrueFalse", "createGaps", "saveEdit",
1439 "setMediaMode", "uploadingImage", "uploadingImagemap", "addArea",
1440 "deletearea", "saveShape", "back", "addPair", "uploadingJavaapplet",
1441 "addParameter", "assessment", "addGIT", "addST", "addPG", "delete",
1442 "toggleGraphicalAnswers", "deleteAnswer", "deleteImage", "removeJavaapplet"),
1443 "",
1444 "",
1445 $force_active
1446 );
1447
1448 if ($ilAccess->checkAccess("read", "", $this->ref_id) || $ilAccess->checkAccess("visible", "", $this->ref_id)) {
1449 $this->tabs_gui->addTarget(
1450 "info_short",
1451 $this->ctrl->getLinkTarget($this, "infoScreen"),
1452 array("infoScreen", "showSummary")
1453 );
1454 }
1455
1456 if ($ilAccess->checkAccess("write", "", $_GET['ref_id'])) {
1457 // properties
1458 $this->tabs_gui->addTarget(
1459 'settings',
1460 $this->ctrl->getLinkTargetByClass('ilObjQuestionPoolSettingsGeneralGUI'),
1461 array(),
1462 array('ilObjQuestionPoolSettingsGeneralGUI', 'ilObjTaxonomyGUI')
1463 );
1464
1465 // skill service
1466 if ($this->isSkillsTabRequired()) {
1467 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentsGUI.php';
1468
1469 $link = $this->ctrl->getLinkTargetByClass(
1470 array('ilQuestionPoolSkillAdministrationGUI', 'ilAssQuestionSkillAssignmentsGUI'),
1472 );
1473
1474 $this->tabs_gui->addTarget('qpl_tab_competences', $link, array(), array());
1475 }
1476 }
1477
1478 // print view
1479 $this->tabs_gui->addTarget(
1480 "print_view",
1481 $this->ctrl->getLinkTarget($this, 'print'),
1482 array("print"),
1483 "",
1484 ""
1485 );
1486
1487 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1488 // meta data
1489 include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
1490 $mdgui = new ilObjectMetaDataGUI($this->object);
1491 $mdtab = $mdgui->getTab();
1492 if ($mdtab) {
1493 $this->tabs_gui->addTarget(
1494 "meta_data",
1495 $mdtab,
1496 "",
1497 "ilmdeditorgui"
1498 );
1499 }
1500
1501 // $this->tabs_gui->addTarget("export",
1502// $this->ctrl->getLinkTarget($this,'export'),
1503// array("export", "createExportFile", "confirmDeleteExportFile", "downloadExportFile"),
1504// "", "");
1505 }
1506
1507 if ($currentUserHasWriteAccess) {
1508 $this->tabs_gui->addTarget(
1509 "export",
1510 $this->ctrl->getLinkTargetByClass("ilquestionpoolexportgui", ""),
1511 "",
1512 "ilquestionpoolexportgui"
1513 );
1514 }
1515
1516 if ($ilAccess->checkAccess("edit_permission", "", $this->object->getRefId())) {
1517 $this->tabs_gui->addTarget(
1518 "perm_settings",
1519 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
1520 array("perm","info","owner"),
1521 'ilpermissiongui'
1522 );
1523 }
1524 }

References $_GET, $_POST, $key, addSettingsSubTabs(), ilAssQuestionSkillAssignmentsGUI\CMD_SHOW_SKILL_QUEST_ASSIGNS, and isSkillsTabRequired().

+ Here is the call graph for this function:

◆ importFileObject()

ilObjQuestionPoolGUI::importFileObject (   $parent_id = null,
  $a_catch_errors = true 
)
protected

form for new questionpool object import

Reimplemented from ilObjectGUI.

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

1300 {
1301 $form = $this->initImportForm($_REQUEST["new_type"]);
1302 if ($form->checkInput()) {
1303 $this->uploadQplObject();
1304 }
1305
1306 // display form to correct errors
1307 $this->tpl->setContent($form->getHTML());
1308 }
uploadQplObject($questions_only=false)
imports question(s) into the questionpool
initImportForm($a_new_type)
Init object import form.

References $form, initImportForm(), and uploadQplObject().

+ Here is the call graph for this function:

◆ importQuestionsObject()

ilObjQuestionPoolGUI::importQuestionsObject ( ilPropertyFormGUI  $form = null)

display the import form to import questions into the questionpool

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

742 {
743 if (!$form instanceof ilPropertyFormGUI) {
744 $form = $this->getImportQuestionsForm();
745 }
746
747 $this->tpl->setContent($form->getHtml());
748 }

References $form, and getImportQuestionsForm().

Referenced by uploadObject().

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

◆ importVerifiedFileObject()

ilObjQuestionPoolGUI::importVerifiedFileObject ( )

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

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

638 {
639 if ($_POST["questions_only"] == 1) {
640 $newObj =&$this->object;
641 } else {
642 include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
643 // create new questionpool object
644 $newObj = new ilObjQuestionPool(0, true);
645 // set type of questionpool object
646 $newObj->setType($_GET["new_type"]);
647 // set title of questionpool object to "dummy"
648 $newObj->setTitle("dummy");
649 // set description of questionpool object
650 $newObj->setDescription("questionpool import");
651 // create the questionpool class in the ILIAS database (object_data table)
652 $newObj->create(true);
653 // create a reference for the questionpool object in the ILIAS database (object_reference table)
654 $newObj->createReference();
655 // put the questionpool object in the administration tree
656 $newObj->putInTree($_GET["ref_id"]);
657 // get default permissions and set the permissions for the questionpool object
658 $newObj->setPermissions($_GET["ref_id"]);
659 }
660
661 if (is_file($_SESSION["qpl_import_dir"] . '/' . $_SESSION["qpl_import_subdir"] . "/manifest.xml")) {
662 $_SESSION["qpl_import_idents"] = $_POST["ident"];
663
664 $fileName = $_SESSION["qpl_import_subdir"] . '.zip';
665 $fullPath = $_SESSION["qpl_import_dir"] . '/' . $fileName;
666
667 include_once("./Services/Export/classes/class.ilImport.php");
668 $imp = new ilImport((int) $_GET["ref_id"]);
669 $map = $imp->getMapping();
670 $map->addMapping("Modules/TestQuestionPool", "qpl", "new_id", $newObj->getId());
671 $imp->importObject($newObj, $fullPath, $fileName, "qpl", "Modules/TestQuestionPool", true);
672 } else {
673 // start parsing of QTI files
674 include_once "./Services/QTI/classes/class.ilQTIParser.php";
675 $qtiParser = new ilQTIParser($_SESSION["qpl_import_qti_file"], IL_MO_PARSE_QTI, $newObj->getId(), $_POST["ident"]);
676 $result = $qtiParser->startParsing();
677
678 // import page data
679 if (strlen($_SESSION["qpl_import_xml_file"])) {
680 include_once("./Modules/LearningModule/classes/class.ilContObjParser.php");
681 $contParser = new ilContObjParser($newObj, $_SESSION["qpl_import_xml_file"], $_SESSION["qpl_import_subdir"]);
682 $contParser->setQuestionMapping($qtiParser->getImportMapping());
683 $contParser->startParsing();
684
685 // #20494
686 $newObj->fromXML($_SESSION["qpl_import_xml_file"]);
687 }
688
689 // set another question pool name (if possible)
690 if (isset($_POST["qpl_new"]) && strlen($_POST["qpl_new"])) {
691 $newObj->setTitle($_POST["qpl_new"]);
692 }
693
694 $newObj->update();
695 $newObj->saveToDb();
696 }
697
698 // delete import directory
699 include_once "./Services/Utilities/classes/class.ilUtil.php";
701
702 if ($_POST["questions_only"] == 1) {
703 $this->ctrl->redirect($this, "questions");
704 } else {
705 ilUtil::sendSuccess($this->lng->txt("object_imported"), true);
706 ilUtil::redirect("ilias.php?ref_id=" . $newObj->getRefId() .
707 "&baseClass=ilObjQuestionPoolGUI");
708 }
709 }
$result
$_SESSION["AccountId"]
const IL_MO_PARSE_QTI
Content Object Parser.
Import class.
static _getImportDirectory()
get import directory of lm
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively

References $_GET, $_POST, $_SESSION, $object, $result, ilObjQuestionPool\_getImportDirectory(), ilUtil\delDir(), IL_MO_PARSE_QTI, ilUtil\redirect(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjQuestionPoolGUI::infoScreenForward ( )

show information screen

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

1576 {
1577 global $ilErr, $ilAccess;
1578
1579 if (!$ilAccess->checkAccess("visible", "", $this->ref_id)) {
1580 $ilErr->raiseError($this->lng->txt("msg_no_perm_read"));
1581 }
1582
1583 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1584 $info = new ilInfoScreenGUI($this);
1585 $info->enablePrivateNotes();
1586
1587 // standard meta data
1588 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1589
1590 $this->ctrl->forwardCommand($info);
1591 }
Class ilInfoScreenGUI.
$info
Definition: index.php:5

References ilObjectGUI\$ilErr, and $info.

Referenced by executeCommand(), and infoScreenObject().

+ Here is the caller graph for this function:

◆ infoScreenObject()

ilObjQuestionPoolGUI::infoScreenObject ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

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

1566 {
1567 $this->ctrl->setCmd("showSummary");
1568 $this->ctrl->setCmdClass("ilinfoscreengui");
1569 $this->infoScreenForward();
1570 }

References infoScreenForward().

+ Here is the call graph for this function:

◆ initImportForm()

ilObjQuestionPoolGUI::initImportForm (   $a_new_type)
protected

Init object import form.

Parameters
stringnew type
Returns
ilPropertyFormGUI

Reimplemented from ilObjectGUI.

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

1277 {
1278 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1279 $form = new ilPropertyFormGUI();
1280 $form->setTarget("_top");
1281 $form->setFormAction($this->ctrl->getFormAction($this));
1282 $form->setTitle($this->lng->txt("import_qpl"));
1283
1284 include_once("./Services/Form/classes/class.ilFileInputGUI.php");
1285 $fi = new ilFileInputGUI($this->lng->txt("import_file"), "xmldoc");
1286 $fi->setSuffixes(array("zip"));
1287 $fi->setRequired(true);
1288 $form->addItem($fi);
1289
1290 $form->addCommandButton("importFile", $this->lng->txt("import"));
1291 $form->addCommandButton("cancel", $this->lng->txt("cancel"));
1292
1293 return $form;
1294 }

References $form.

Referenced by importFileObject().

+ Here is the caller graph for this function:

◆ isSkillsTabRequired()

ilObjQuestionPoolGUI::isSkillsTabRequired ( )
private

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

1527 {
1528 if (!($this->object instanceof ilObjQuestionPool)) {
1529 return false;
1530 }
1531
1532 if (!$this->object->isSkillServiceEnabled()) {
1533 return false;
1534 }
1535
1537 return false;
1538 }
1539
1540 return true;
1541 }

References ilObjQuestionPool\isSkillManagementGloballyActivated().

Referenced by getTabs().

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

◆ moveObject()

ilObjQuestionPoolGUI::moveObject ( )

mark one or more question objects for moving

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

1239 {
1240 if (isset($_POST["q_id"]) && is_array($_POST["q_id"]) && count($_POST["q_id"]) > 0) {
1241 foreach ($_POST["q_id"] as $key => $value) {
1242 $this->object->moveToClipboard($value);
1243 }
1244 ilUtil::sendInfo($this->lng->txt("qpl_move_insert_clipboard"), true);
1245 } elseif (isset($_GET['q_id']) && $_GET['q_id'] > 0) {
1246 $this->object->moveToClipboard((int) $_GET['q_id']);
1247 ilUtil::sendInfo($this->lng->txt("qpl_copy_insert_clipboard"), true);
1248 } else {
1249 ilUtil::sendInfo($this->lng->txt("qpl_move_select_none"), true);
1250 }
1251 $this->ctrl->redirect($this, "questions");
1252 }

References $_GET, $_POST, $key, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ pasteObject()

ilObjQuestionPoolGUI::pasteObject ( )

paste questios from the clipboard into the question pool

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

1203 {
1204 if (array_key_exists("qpl_clipboard", $_SESSION)) {
1205 if ($this->object->pasteFromClipboard()) {
1206 ilUtil::sendSuccess($this->lng->txt("qpl_paste_success"), true);
1207 } else {
1208 ilUtil::sendFailure($this->lng->txt("qpl_paste_error"), true);
1209 }
1210 } else {
1211 ilUtil::sendInfo($this->lng->txt("qpl_paste_no_objects"), true);
1212 }
1213 $this->ctrl->redirect($this, "questions");
1214 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $_SESSION, ilUtil\sendFailure(), ilUtil\sendInfo(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ questionObject()

ilObjQuestionPoolGUI::questionObject ( )

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

839 {
840 //echo "<br>ilObjQuestionPoolGUI->questionObject()";
841 $type = $_GET["sel_question_types"];
842 $this->editQuestionForm($type);
843 }
$type

References $_GET, and $type.

◆ questionsObject()

ilObjQuestionPoolGUI::questionsObject ( )

list questions of question pool

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

960 {
961 global $rbacsystem, $ilUser, $ilCtrl, $ilDB, $lng, $ilPluginAdmin;
962
963 if (get_class($this->object) == "ilObjTest") {
964 if ($_GET["calling_test"] > 0) {
965 $ref_id = $_GET["calling_test"];
966 $q_id = $_GET["q_id"];
967
968 if ($_REQUEST['test_express_mode']) {
969 if ($q_id) {
970 ilUtil::redirect("ilias.php?ref_id=" . $ref_id . "&q_id=" . $q_id . "&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
971 } else {
972 ilUtil::redirect("ilias.php?ref_id=" . $ref_id . "&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
973 }
974 } else {
975 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&ref_id=" . $ref_id . "&cmd=questions");
976 }
977 }
978 } elseif (isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer']) {
979 $ref_id = (int) $_GET['calling_consumer'];
982 ilUtil::redirect($consumer->getQuestionEditingFormBackTarget($_GET['consumer_context']));
983 }
984 require_once 'Services/Link/classes/class.ilLink.php';
986 }
987
988 $this->object->purgeQuestions();
989 // reset test_id SESSION variable
990 $_SESSION["test_id"] = "";
991
992 require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssQuestionSkillAssignmentImportFails.php';
993 $qsaImportFails = new ilAssQuestionSkillAssignmentImportFails($this->object->getId());
994 if ($qsaImportFails->failedImportsRegistered()) {
995 require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
996 $button = ilLinkButton::getInstance();
997 $button->setUrl($this->ctrl->getLinkTarget($this, 'renoveImportFails'));
998 $button->setCaption('ass_skl_import_fails_remove_btn');
999
1000 ilUtil::sendFailure($qsaImportFails->getFailedImportsMessage($this->lng) . '<br />' . $button->render());
1001 }
1002
1003 require_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
1004 $taxIds = ilObjTaxonomy::getUsageOfObject($this->object->getId());
1005
1006 $table_gui = $this->buildQuestionBrowserTableGUI($taxIds);
1007 $table_gui->setPreventDoubleSubmission(false);
1008
1009 if ($rbacsystem->checkAccess('write', $_GET['ref_id'])) {
1010 $toolbar = new ilToolbarGUI();
1011
1012 require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
1014 $btn->setCaption('ass_create_question');
1015 $btn->setUrl($this->ctrl->getLinkTarget($this, 'createQuestionForm'));
1016 $btn->setPrimary(true);
1017 $toolbar->addButtonInstance($btn);
1018
1019
1020 $btnImport = ilLinkButton::getInstance();
1021 $btnImport->setCaption('import');
1022 $btnImport->setUrl($this->ctrl->getLinkTarget($this, 'importQuestions'));
1023 $toolbar->addButtonInstance($btnImport);
1024
1025 if (array_key_exists("qpl_clipboard", $_SESSION) && count($_SESSION['qpl_clipboard'])) {
1026 $btnPaste = ilLinkButton::getInstance();
1027 $btnPaste->setCaption('paste');
1028 $btnPaste->setUrl($this->ctrl->getLinkTarget($this, 'paste'));
1029 $toolbar->addButtonInstance($btnPaste);
1030 }
1031
1032 $this->tpl->setContent(
1033 $this->ctrl->getHTML($toolbar) . $this->ctrl->getHTML($table_gui)
1034 );
1035 } else {
1036 $this->tpl->setContent($this->ctrl->getHTML($table_gui));
1037 }
1038
1039 if ($this->object->getShowTaxonomies()) {
1040 $this->lng->loadLanguageModule('tax');
1041
1042 require_once 'Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php';
1043
1044 foreach ($taxIds as $taxId) {
1045 if ($taxId != $this->object->getNavTaxonomyId()) {
1046 continue;
1047 }
1048
1049 $taxExp = new ilTaxonomyExplorerGUI(
1050 $this,
1051 'showNavTaxonomy',
1052 $taxId,
1053 'ilobjquestionpoolgui',
1054 'questions'
1055 );
1056
1057 if (!$taxExp->handleCommand()) {
1058 $this->tpl->setLeftContent($taxExp->getHTML() . "&nbsp;");
1059 }
1060
1061 break;
1062 }
1063 }
1064 }
static getInstance()
Factory.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Taxonomy explorer GUI class.
$consumer
Definition: demo.php:30

References $_GET, $_SESSION, $consumer, $ilCtrl, $ilDB, $ilUser, ilObjectGUI\$lng, ilObjectGUI\$rbacsystem, ilObjectGUI\$ref_id, ilObjectGUI\$toolbar, ilLink\_getLink(), buildQuestionBrowserTableGUI(), ilLinkButton\getInstance(), ilObjectFactory\getInstanceByRefId(), ilObjTaxonomy\getUsageOfObject(), ilUtil\redirect(), and ilUtil\sendFailure().

Referenced by filterObject(), filterQuestionBrowserObject(), resetFilterObject(), and resetQuestionBrowserObject().

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

◆ renoveImportFailsObject()

ilObjQuestionPoolGUI::renoveImportFailsObject ( )
protected

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

948 {
949 require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssQuestionSkillAssignmentImportFails.php';
950 $qsaImportFails = new ilAssQuestionSkillAssignmentImportFails($this->object->getId());
951 $qsaImportFails->deleteRegisteredImportFails();
952
953 $this->ctrl->redirect($this, 'infoScreen');
954 }

◆ resetFilterObject()

ilObjQuestionPoolGUI::resetFilterObject ( )

resets filter

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

426 {
427 $_POST["filter_text"] = "";
428 $_POST["sel_filter_type"] = "";
429 $this->questionsObject();
430 }

References $_POST, and questionsObject().

+ Here is the call graph for this function:

◆ resetQuestionBrowserObject()

ilObjQuestionPoolGUI::resetQuestionBrowserObject ( )

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

936 {
937 require_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
938 $taxIds = ilObjTaxonomy::getUsageOfObject($this->object->getId());
939
940 include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
941 $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', false, false, $taxIds);
942 $table_gui->resetOffset();
943 $table_gui->resetFilter();
944 $this->questionsObject();
945 }

References ilObjTaxonomy\getUsageOfObject(), and questionsObject().

+ Here is the call graph for this function:

◆ setTitleAndDescription()

ilObjQuestionPoolGUI::setTitleAndDescription ( )

called by prepare output

Reimplemented from ilObjectGUI.

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

1344 {
1345 parent::setTitleAndDescription();
1346 if ($_GET["q_id"] > 0) {
1347 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1348 $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
1349 if ($q_gui->object instanceof assQuestion) {
1350 $q_gui->object->setObjId($this->object->getId());
1351 $title = $q_gui->object->getTitle();
1352 if (!$title) {
1353 $title = $this->lng->txt('new') . ': ' . assQuestion::_getQuestionTypeName($q_gui->object->getQuestionType());
1354 }
1355 $this->tpl->setTitle($title);
1356 $this->tpl->setDescription($q_gui->object->getComment());
1357 $this->tpl->setTitleIcon(ilObject2::_getIcon("", "big", $this->object->getType()));
1358 } else {
1359 // Workaround for context issues: If no object was found, redirect without q_id parameter
1360 $this->ctrl->setParameter($this, 'q_id', '');
1361 $this->ctrl->redirect($this);
1362 }
1363 } else {
1364 $this->tpl->setTitle($this->object->getTitle());
1365 $this->tpl->setDescription($this->object->getLongDescription());
1366 $this->tpl->setTitleIcon(ilObject2::_getIcon("", "big", $this->object->getType()));
1367 }
1368 }
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.

References $_GET, $title, ilObject2\_getIcon(), assQuestionGUI\_getQuestionGUI(), and assQuestion\_getQuestionTypeName().

+ Here is the call graph for this function:

◆ updateObject()

ilObjQuestionPoolGUI::updateObject ( )

updates object entry in object_data

Reimplemented from ilObjectGUI.

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

1193 {
1194 // $this->update = $this->object->updateMetaData();
1195 $this->update = $this->object->update();
1196 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1197 }
update($pash, $contents, Config $config)

References ilUtil\sendSuccess(), and League\Flysystem\Adapter\Polyfill\update().

+ Here is the call graph for this function:

◆ uploadObject()

ilObjQuestionPoolGUI::uploadObject ( )

imports question(s) into the questionpool

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

724 {
725 $upload_valid = true;
726 $form = $this->getImportQuestionsForm();
727 if ($form->checkInput()) {
728 if (!$this->uploadQplObject(true)) {
729 $form->setValuesByPost();
731 }
732 } else {
733 $form->setValuesByPost();
735 }
736 }
importQuestionsObject(ilPropertyFormGUI $form=null)
display the import form to import questions into the questionpool

References $form, getImportQuestionsForm(), importQuestionsObject(), and uploadQplObject().

+ Here is the call graph for this function:

◆ uploadQplObject()

ilObjQuestionPoolGUI::uploadQplObject (   $questions_only = false)

imports question(s) into the questionpool

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

447 {
448 $this->ctrl->setParameter($this, 'new_type', $_REQUEST['new_type']);
449 if ($_FILES["xmldoc"]["error"] > UPLOAD_ERR_OK) {
450 ilUtil::sendFailure($this->lng->txt("error_upload"), true);
451 if (!$questions_only) {
452 $this->ctrl->redirect($this, 'create');
453 }
454 return false;
455 }
456 // create import directory
457 include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
459
460 // copy uploaded file to import directory
461 $file = pathinfo($_FILES["xmldoc"]["name"]);
462 $full_path = $basedir . "/" . $_FILES["xmldoc"]["name"];
463 $GLOBALS['ilLog']->write(__METHOD__ . ": full path " . $full_path);
464 include_once "./Services/Utilities/classes/class.ilUtil.php";
465 ilUtil::moveUploadedFile($_FILES["xmldoc"]["tmp_name"], $_FILES["xmldoc"]["name"], $full_path);
466 $GLOBALS['ilLog']->write(__METHOD__ . ": full path " . $full_path);
467 if (strcmp($_FILES["xmldoc"]["type"], "text/xml") == 0) {
468 $qti_file = $full_path;
470 } else {
471 // unzip file
472 ilUtil::unzip($full_path);
473
474 // determine filenames of xml files
475 $subdir = basename($file["basename"], "." . $file["extension"]);
477 $xml_file = ilObjQuestionPool::_getImportDirectory() . '/' . $subdir . '/' . $subdir . ".xml";
478 $qti_file = ilObjQuestionPool::_getImportDirectory() . '/' . $subdir . '/' . str_replace("qpl", "qti", $subdir) . ".xml";
479 }
480
481 // start verification of QTI files
482 include_once "./Services/QTI/classes/class.ilQTIParser.php";
483 $qtiParser = new ilQTIParser($qti_file, IL_MO_VERIFY_QTI, 0, "");
484 $result = $qtiParser->startParsing();
485 $founditems =&$qtiParser->getFoundItems();
486 if (count($founditems) == 0) {
487 // nothing found
488
489 // delete import directory
490 ilUtil::delDir($basedir);
491
492 ilUtil::sendFailure($this->lng->txt("qpl_import_no_items"), true);
493 if (!$questions_only) {
494 $this->ctrl->redirect($this, 'create');
495 }
496 return false;
497 }
498
499 $complete = 0;
500 $incomplete = 0;
501 foreach ($founditems as $item) {
502 if (strlen($item["type"])) {
503 $complete++;
504 } else {
505 $incomplete++;
506 }
507 }
508
509 if ($complete == 0) {
510 // delete import directory
511 ilUtil::delDir($basedir);
512
513 ilUtil::sendFailure($this->lng->txt("qpl_import_non_ilias_files"), true);
514 if (!$questions_only) {
515 $this->ctrl->redirect($this, 'create');
516 }
517 return false;
518 }
519
520 $_SESSION["qpl_import_xml_file"] = $xml_file;
521 $_SESSION["qpl_import_qti_file"] = $qti_file;
522 $_SESSION["qpl_import_subdir"] = $subdir;
523
524 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.qpl_import_verification.html", "Modules/TestQuestionPool");
525
526 require_once 'Modules/TestQuestionPool/classes/tables/class.ilQuestionPoolImportVerificationTableGUI.php';
527 $table = new ilQuestionPoolImportVerificationTableGUI($this, 'uploadQplObject');
528 $rows = array();
529
530 foreach ($founditems as $item) {
531 $row = array(
532 'title' => $item['title'],
533 'ident' => $item['ident'],
534 );
535
536 include_once "./Services/QTI/classes/class.ilQTIItem.php";
537 switch ($item["type"]) {
539 $type = $this->lng->txt("assClozeTest");
540 break;
542 $type = $this->lng->txt("assImagemapQuestion");
543 break;
545 $type = $this->lng->txt("assJavaApplet");
546 break;
548 $type = $this->lng->txt("assMatchingQuestion");
549 break;
551 $type = $this->lng->txt("assMultipleChoice");
552 break;
554 $type = $this->lng->txt("assKprimChoice");
555 break;
557 $type = $this->lng->txt("assLongMenu");
558 break;
560 $type = $this->lng->txt("assSingleChoice");
561 break;
563 $type = $this->lng->txt("assOrderingQuestion");
564 break;
566 $type = $this->lng->txt("assTextQuestion");
567 break;
569 $type = $this->lng->txt("assNumeric");
570 break;
572 $type = $this->lng->txt("assTextSubset");
573 break;
574 default:
575 $type = $this->lng->txt($item["type"]);
576 break;
577 }
578
579 if (strcmp($type, "-" . $item["type"] . "-") == 0) {
580 global $ilPluginAdmin;
581 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, "TestQuestionPool", "qst");
582 foreach ($pl_names as $pl_name) {
583 $pl = ilPlugin::getPluginObject(IL_COMP_MODULE, "TestQuestionPool", "qst", $pl_name);
584 if (strcmp($pl->getQuestionType(), $item["type"]) == 0) {
585 $type = $pl->getQuestionTypeTranslation();
586 }
587 }
588 }
589
590 $row['type'] = $type;
591
592 $rows[] = $row;
593 }
594 $table->setData($rows);
595
596 $this->tpl->setCurrentBlock("import_qpl");
597 if (is_file($xml_file)) {
598 // read file into a string
599 $fh = @fopen($xml_file, "r") or die("");
600 $xml = @fread($fh, filesize($xml_file));
601 @fclose($fh);
602 if (preg_match("/<ContentObject.*?MetaData.*?General.*?Title[^>]*?>([^<]*?)</", $xml, $matches)) {
603 $this->tpl->setVariable("VALUE_NEW_QUESTIONPOOL", $matches[1]);
604 }
605 }
606 $this->tpl->setVariable("TEXT_CREATE_NEW_QUESTIONPOOL", $this->lng->txt("qpl_import_create_new_qpl"));
607 $this->tpl->parseCurrentBlock();
608
609 $this->tpl->setCurrentBlock("adm_content");
610 $this->tpl->setVariable("FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt("qpl_import_verify_found_questions"));
611 if ($questions_only) {
612 $this->tpl->setVariable("VERIFICATION_HEADING", $this->lng->txt("import_questions_into_qpl"));
613 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
614 } else {
615 $this->tpl->setVariable("VERIFICATION_HEADING", $this->lng->txt("import_qpl"));
616
617 $this->ctrl->setParameter($this, "new_type", $this->type);
618 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
619 }
620
621 $value_questions_only = 0;
622 if ($questions_only) {
623 $value_questions_only = 1;
624 }
625 $this->tpl->setVariable("VALUE_QUESTIONS_ONLY", $value_questions_only);
626 $this->tpl->setVariable("VERIFICATION_TABLE", $table->getHtml());
627 $this->tpl->setVariable("VERIFICATION_FORM_NAME", $table->getFormName());
628
629 $this->tpl->parseCurrentBlock();
630
631 return true;
632 }
PHPExcel root directory.
Definition: PHPExcel.php:30
Title class.
Definition: Title.php:37
const IL_COMP_MODULE
const IL_MO_VERIFY_QTI
static _createImportDirectory()
creates data directory for import files (data_dir/qpl_data/qpl_<id>/import, depending on data directo...
static _setImportDirectory($a_import_dir=null)
set import directory
static _setImportDirectory($a_import_dir=null)
set import directory
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin object.
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
const CLOZE_TEST_IDENTIFIER
Question identifier constants.
const IMAGEMAP_QUESTION_IDENTIFIER
const SINGLE_CHOICE_QUESTION_IDENTIFIER
const TEXTSUBSET_QUESTION_IDENTIFIER
const NUMERIC_QUESTION_IDENTIFIER
const JAVAAPPLET_QUESTION_IDENTIFIER
const TEXT_QUESTION_IDENTIFIER
const LONG_MENU_QUESTION_IDENTIFIER
const KPRIM_CHOICE_QUESTION_IDENTIFIER
const MATCHING_QUESTION_IDENTIFIER
const MULTIPLE_CHOICE_QUESTION_IDENTIFIER
const ORDERING_QUESTION_IDENTIFIER
$xml
Definition: metadata.php:240
if(empty($password)) $table
Definition: pwgen.php:24
$rows
Definition: xhr_table.php:10

References $_SESSION, $fh, $file, $GLOBALS, $result, $row, $rows, $table, $type, $xml, ilObjQuestionPool\_createImportDirectory(), ilObjQuestionPool\_getImportDirectory(), ilObjTest\_setImportDirectory(), ilObjQuestionPool\_setImportDirectory(), CLOZE_TEST_IDENTIFIER, ilUtil\delDir(), ilPlugin\getPluginObject(), IL_COMP_MODULE, IL_MO_VERIFY_QTI, IMAGEMAP_QUESTION_IDENTIFIER, JAVAAPPLET_QUESTION_IDENTIFIER, KPRIM_CHOICE_QUESTION_IDENTIFIER, LONG_MENU_QUESTION_IDENTIFIER, MATCHING_QUESTION_IDENTIFIER, MULTIPLE_CHOICE_QUESTION_IDENTIFIER, NUMERIC_QUESTION_IDENTIFIER, ORDERING_QUESTION_IDENTIFIER, ilUtil\sendFailure(), SINGLE_CHOICE_QUESTION_IDENTIFIER, TEXT_QUESTION_IDENTIFIER, TEXTSUBSET_QUESTION_IDENTIFIER, and ilUtil\unzip().

Referenced by importFileObject(), and uploadObject().

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

Field Documentation

◆ $object

ilObjQuestionPoolGUI::$object

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

Referenced by importVerifiedFileObject().


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