ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjQuestionPoolGUI Class Reference

Class ilObjQuestionPoolGUI. More...

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

Public Member Functions

 ilObjQuestionPoolGUI ()
 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...
 
 importFileObject ()
 form for new questionpool object import More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 getTabs (&$tabs_gui)
 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
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor @access public. More...
 
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...
 
 getAdminTabs (&$tabs_gui)
 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 ($in_rep=false)
 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...
 
 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
 
 $ilias
 
 $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 ()
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 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...
 
 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...
 
 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...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 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 ($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
 $tmp_import_dir
 

Detailed Description

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

1615 {
1616 global $ilAccess, $ilErr, $lng;
1617
1618 if ($ilAccess->checkAccess("write", "", $a_target) || $ilAccess->checkAccess('read', '', $a_target))
1619 {
1620 $_GET["baseClass"] = "ilObjQuestionPoolGUI";
1621 $_GET["cmd"] = "questions";
1622 $_GET["ref_id"] = $a_target;
1623 include_once("ilias.php");
1624 exit;
1625 }
1626 else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
1627 {
1628 ilUtil::sendInfo(sprintf($lng->txt("msg_no_perm_read_item"),
1631 }
1632 $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
1633 }
$_GET["client_id"]
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.
exit
Definition: login.php:54

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

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

1309 {
1310 global $ilLocator;
1311 switch ($this->ctrl->getCmd())
1312 {
1313 case "create":
1314 case "importFile":
1315 case "cancel":
1316 break;
1317 default:
1318 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $_GET["ref_id"]);
1319 break;
1320 }
1321 if ($_GET["q_id"] > 0)
1322 {
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 {
1327 $q_gui->object->setObjId($this->object->getId());
1328 $title = $q_gui->object->getTitle();
1329 if(!$title)
1330 {
1331 $title = $this->lng->txt('new').': '.assQuestion::_getQuestionTypeName($q_gui->object->getQuestionType());
1332 }
1333 $ilLocator->addItem($title, $this->ctrl->getLinkTargetByClass(get_class($q_gui), "editQuestion"));
1334 }
1335 else
1336 {
1337 // Workaround for context issues: If no object was found, redirect without q_id parameter
1338 $this->ctrl->setParameter($this, 'q_id', '');
1339 $this->ctrl->redirect($this);
1340 }
1341 }
1342 }
& _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, assQuestionGUI\_getQuestionGUI(), and assQuestion\_getQuestionTypeName().

+ Here is the call graph for this function:

◆ addSettingsSubTabs()

ilObjQuestionPoolGUI::addSettingsSubTabs ( ilTabsGUI  $tabs)
private

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

1558 {
1559 $tabs->addSubTabTarget(
1560 'qpl_settings_subtab_general',
1561 $this->ctrl->getLinkTargetByClass('ilObjQuestionPoolSettingsGeneralGUI'),
1562 '', 'ilObjQuestionPoolSettingsGeneralGUI'
1563 );
1564
1565 $tabs->addSubTabTarget(
1566 'qpl_settings_subtab_taxonomies',
1567 $this->ctrl->getLinkTargetByClass('ilObjTaxonomyGUI', 'editAOTaxonomySettings'),
1568 '', 'ilObjTaxonomyGUI'
1569 );
1570 }
addSubTabTarget($a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
DEPRECATED.

References ilTabsGUI\addSubTabTarget().

Referenced by getTabs().

+ Here is the call graph for this function:
+ 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 867 of file class.ilObjQuestionPoolGUI.php.

868 {
869 // always send a message
870 ilUtil::sendSuccess($this->lng->txt("object_added"),true);
871
872 ilUtil::redirect("ilias.php?ref_id=".$a_new_object->getRefId().
873 "&baseClass=ilObjQuestionPoolGUI");
874 }
getRefId()
get reference id @access public
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
http redirect to other script

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

+ Here is the call graph for this function:

◆ buildCreateQuestionForm()

ilObjQuestionPoolGUI::buildCreateQuestionForm ( )
private

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

1082 {
1083 global $ilUser;
1084
1085 // form
1086
1087 require_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1088 $form = new ilPropertyFormGUI();
1089 $form->setTitle($this->lng->txt('ass_create_question'));
1090 $form->setFormAction($this->ctrl->getFormAction($this));
1091
1092 // question type
1093
1094 $options = array();
1095 foreach( $this->object->getQuestionTypes(false, true) as $translation => $data )
1096 {
1097 $options[$data['type_tag']] = $translation;
1098 }
1099
1100 require_once("Services/Form/classes/class.ilSelectInputGUI.php");
1101 $si = new ilSelectInputGUI($this->lng->txt('question_type'), 'sel_question_types');
1102 $si->setOptions($options);
1103 //$si->setValue($ilUser->getPref("tst_lastquestiontype"));
1104
1105 $form->addItem($si);
1106
1107 // content editing mode
1108
1110 {
1111 $ri = new ilRadioGroupInputGUI($this->lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
1112
1113 $ri->addOption(new ilRadioOption(
1114 $this->lng->txt('tst_add_quest_cont_edit_mode_default'),
1116 ));
1117
1118 $ri->addOption(new ilRadioOption(
1119 $this->lng->txt('tst_add_quest_cont_edit_mode_page_object'),
1121 ));
1122
1124
1125 $form->addItem($ri, true);
1126 }
1127 else
1128 {
1129 $hi = new ilHiddenInputGUI("question_content_editing_type");
1131 $form->addItem($hi, true);
1132 }
1133
1134 // commands
1135
1136 $form->addCommandButton('createQuestion', $this->lng->txt('create'));
1137 $form->addCommandButton('questions', $this->lng->txt('cancel'));
1138
1139 return $form;
1140 }
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(!is_array($argv)) $options
global $ilUser
Definition: imgupload.php:15

References ilObjectGUI\$data, $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 ilDB $ilDB @global ilLanguage $lng @global ilPluginAdmin $ilPluginAdmin
Returns
ilQuestionBrowserTableGUI

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

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

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

Referenced by executeCommand(), and questionsObject().

+ Here is the caller graph for this function:

◆ cancelDeleteQuestionsObject()

ilObjQuestionPoolGUI::cancelDeleteQuestionsObject ( )

Cancel question deletion.

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

928 {
929 $this->ctrl->redirect($this, "questions");
930 }

◆ cancelImportObject()

ilObjQuestionPoolGUI::cancelImportObject ( )

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

733 {
734 if ($_POST["questions_only"] == 1)
735 {
736 $this->ctrl->redirect($this, "questions");
737 }
738 else
739 {
740 $this->ctrl->redirect($this, "cancel");
741 }
742 }
$_POST['username']
Definition: cron.php:12

References $_POST.

◆ confirmDeleteQuestionsObject()

ilObjQuestionPoolGUI::confirmDeleteQuestionsObject ( )

delete questions

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

910 {
911 // delete questions after confirmation
912 foreach ($_POST["q_id"] as $key => $value)
913 {
914 $this->object->deleteQuestion($value);
915 $this->object->cleanupClipboard($value);
916 }
917 if (count($_POST["q_id"])) ilUtil::sendSuccess($this->lng->txt("qpl_questions_deleted"), true);
918
919 $this->ctrl->setParameter($this, 'q_id', '');
920
921 $this->ctrl->redirect($this, "questions");
922 }

References $_POST, 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 1213 of file class.ilObjQuestionPoolGUI.php.

1214 {
1215 if (count($_POST["q_id"]) > 0)
1216 {
1217 foreach ($_POST["q_id"] as $key => $value)
1218 {
1219 $this->object->copyToClipboard($value);
1220 }
1221 ilUtil::sendInfo($this->lng->txt("qpl_copy_insert_clipboard"), true);
1222 }
1223 else
1224 {
1225 ilUtil::sendInfo($this->lng->txt("qpl_copy_select_none"), true);
1226 }
1227 $this->ctrl->redirect($this, "questions");
1228 }

References $_POST, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ createExportExcel()

ilObjQuestionPoolGUI::createExportExcel ( )

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

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

References $_GET.

◆ createQuestionFormObject()

ilObjQuestionPoolGUI::createQuestionFormObject ( )
private

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

1075 {
1076 $form = $this->buildCreateQuestionForm();
1077
1078 $this->tpl->setContent( $this->ctrl->getHTML($form) );
1079 }

References buildCreateQuestionForm().

+ Here is the call graph for this function:

◆ createQuestionForTestObject()

& ilObjQuestionPoolGUI::createQuestionForTestObject ( )

create new question

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

828 {
829 if( !$_REQUEST['q_id'] )
830 {
831 require_once 'Modules/Test/classes/class.ilObjAssessmentFolder.php';
833 {
834 $addContEditMode = $_REQUEST['add_quest_cont_edit_mode'];
835 }
836 else
837 {
839 }
840
841 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
842 $q_gui =& assQuestionGUI::_getQuestionGUI($_GET["sel_question_types"]);
843 $q_gui->object->setObjId($this->object->getId());
844 $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
845 $q_gui->object->createNewQuestion();
846
847 $class = get_class($q_gui);
848 $qId = $q_gui->object->getId();
849 }
850 else
851 {
852 $class = $_GET["sel_question_types"] . 'gui';
853 $qId = $_REQUEST['q_id'];
854 }
855
856 $this->ctrl->setParameterByClass($class, "q_id", $qId);
857 $this->ctrl->setParameterByClass($class, "sel_question_types", $_REQUEST["sel_question_types"]);
858 $this->ctrl->setParameterByClass($class, "prev_qid", $_REQUEST["prev_qid"]);
859
860 $this->ctrl->redirectByClass($class, "editQuestion");
861 }
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7

References $_GET, $_REQUEST, 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 802 of file class.ilObjQuestionPoolGUI.php.

803 {
805 {
806 $addContEditMode = $_POST['add_quest_cont_edit_mode'];
807 }
808 else
809 {
811 }
812
813 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
814 $q_gui =& assQuestionGUI::_getQuestionGUI($_POST["sel_question_types"]);
815 $this->object->addQuestionChangeListeners($q_gui->object);
816 $q_gui->object->setObjId($this->object->getId());
817 $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
818 $q_gui->object->createNewQuestion();
819 $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
820 $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $_POST["sel_question_types"]);
821 $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
822 }

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

887 {
888 global $rbacsystem;
889
890 if (count($_POST["q_id"]) < 1)
891 {
892 ilUtil::sendInfo($this->lng->txt("qpl_delete_select_none"), true);
893 $this->ctrl->redirect($this, "questions");
894 }
895
896 ilUtil::sendQuestion($this->lng->txt("qpl_confirm_delete_questions"));
897 $deleteable_questions =& $this->object->getDeleteableQuestionDetails($_POST["q_id"]);
898 include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
899 $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', (($rbacsystem->checkAccess('write', $_GET['ref_id']) ? true : false)), true);
900 $table_gui->setEditable($rbacsystem->checkAccess('write', $_GET['ref_id']));
901 $table_gui->setData($deleteable_questions);
902 $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
903 }
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.

References $_GET, $_POST, 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 424 of file class.ilObjQuestionPoolGUI.php.

425 {
426 include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php");
427 $pg_obj = new ilAssQuestionPage($_GET["pg_id"]);
428 $pg_obj->send_paragraph ($_GET["par_id"], $_GET["downloadtitle"]);
429 exit;
430 }
Question page object.

References $_GET, and exit.

◆ downloadFileObject()

ilObjQuestionPoolGUI::downloadFileObject ( )

download file

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

384 {
385 $file = explode("_", $_GET["file_id"]);
386 include_once("./Modules/File/classes/class.ilObjFile.php");
387 $fileObj =& new ilObjFile($file[count($file) - 1], false);
388 $fileObj->sendFile();
389 exit;
390 }
print $file
Class ilObjFile.

References $_GET, $file, and exit.

◆ editQuestionForTestObject()

& ilObjQuestionPoolGUI::editQuestionForTestObject ( )

edit question

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

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

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

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

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

375 {
376 global $DIC; /* @var ILIAS\DI\Container $DIC */
377 $DIC->ctrl()->redirectByClass('ilQuestionPoolExportGUI');
378 }

◆ exportQuestionObject()

ilObjQuestionPoolGUI::exportQuestionObject ( )

export question

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

936 {
937 // export button was pressed
938 if (count($_POST["q_id"]) > 0)
939 {
940 include_once("./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
941 $qpl_exp = new ilQuestionpoolExport($this->object, "xml", $_POST["q_id"]);
942 $export_file = $qpl_exp->buildExportFile();
943 $filename = $export_file;
944 $filename = preg_replace("/.*\//", "", $filename);
945 include_once "./Services/Utilities/classes/class.ilUtil.php";
946 ilUtil::deliverFile($export_file, $filename);
947 exit();
948 }
949 else
950 {
951 ilUtil::sendInfo($this->lng->txt("qpl_export_select_none"), true);
952 }
953 $this->ctrl->redirect($this, "questions");
954 }
$filename
Definition: buildRTE.php:89
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:

◆ filterObject()

ilObjQuestionPoolGUI::filterObject ( )

set question list filter

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

407 {
408 $this->questionsObject();
409 }
questionsObject()
list questions of question pool

References questionsObject().

+ Here is the call graph for this function:

◆ filterQuestionBrowserObject()

ilObjQuestionPoolGUI::filterQuestionBrowserObject ( )

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

957 {
958 require_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
959 $taxIds = ilObjTaxonomy::getUsageOfObject($this->object->getId());
960
961 include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
962 $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', false, false, $taxIds);
963 $table_gui->resetOffset();
964 $table_gui->writeFilterToSession();
965 $this->questionsObject();
966 }
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 395 of file class.ilObjQuestionPoolGUI.php.

396 {
397 include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
398 $page_gui = new ilAssQuestionPageGUI($_GET["pg_id"]);
399 $page_gui->showMediaFullscreen();
400 }

References $_GET.

◆ getImportQuestionsForm()

ilObjQuestionPoolGUI::getImportQuestionsForm ( )
protected
Returns
ilPropertyFormGUI

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

783 {
784 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
785 $form = new ilPropertyFormGUI();
786 $form->setTitle($this->lng->txt('import_question'));
787 $form->setFormAction($this->ctrl->getFormAction($this, 'upload'));
788
789 $file = new ilFileInputGUI($this->lng->txt('select_file'), 'xmldoc');
790 $file->setRequired(true);
791 $form->addItem($file);
792
793 $form->addCommandButton('upload', $this->lng->txt('upload'));
794 $form->addCommandButton('questions', $this->lng->txt('cancel'));
795
796 return $form;
797 }
This class represents a file property in a property form.

References $file.

Referenced by importQuestionsObject(), and uploadObject().

+ Here is the caller graph for this function:

◆ getTabs()

ilObjQuestionPoolGUI::getTabs ( $tabs_gui)

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

Reimplemented from ilObjectGUI.

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

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

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

+ Here is the call graph for this function:

◆ ilObjQuestionPoolGUI()

ilObjQuestionPoolGUI::ilObjQuestionPoolGUI ( )

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 $this->ilObjectGUI("",$_GET["ref_id"], true, false);
63 }
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor @access public.

References $_GET, $ilCtrl, ilObjectGUI\$lng, and ilObjectGUI\ilObjectGUI().

+ Here is the call graph for this function:

◆ importFileObject()

ilObjQuestionPoolGUI::importFileObject ( )

form for new questionpool object import

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

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

References $_REQUEST, 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 769 of file class.ilObjQuestionPoolGUI.php.

770 {
771 if(!$form instanceof ilPropertyFormGUI)
772 {
773 $form = $this->getImportQuestionsForm();
774 }
775
776 $this->tpl->setContent($form->getHtml());
777 }

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

646 {
647 if ($_POST["questions_only"] == 1)
648 {
649 $newObj =& $this->object;
650 }
651 else
652 {
653 include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
654 // create new questionpool object
655 $newObj = new ilObjQuestionPool(0, true);
656 // set type of questionpool object
657 $newObj->setType($_GET["new_type"]);
658 // set title of questionpool object to "dummy"
659 $newObj->setTitle("dummy");
660 // set description of questionpool object
661 $newObj->setDescription("questionpool import");
662 // create the questionpool class in the ILIAS database (object_data table)
663 $newObj->create(true);
664 // create a reference for the questionpool object in the ILIAS database (object_reference table)
665 $newObj->createReference();
666 // put the questionpool object in the administration tree
667 $newObj->putInTree($_GET["ref_id"]);
668 // get default permissions and set the permissions for the questionpool object
669 $newObj->setPermissions($_GET["ref_id"]);
670 // notify the questionpool object and all its parent objects that a "new" object was created
671 $newObj->notify("new",$_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$newObj->getRefId());
672 }
673
674 if (is_file($_SESSION["qpl_import_dir"].'/'.$_SESSION["qpl_import_subdir"]."/manifest.xml"))
675 {
676 $_SESSION["qpl_import_idents"] = $_POST["ident"];
677
678 $fileName = $_SESSION["qpl_import_subdir"].'.zip';
679 $fullPath = $_SESSION["qpl_import_dir"].'/'.$fileName;
680
681 include_once("./Services/Export/classes/class.ilImport.php");
682 $imp = new ilImport((int) $_GET["ref_id"]);
683 $map = $imp->getMapping();
684 $map->addMapping("Modules/TestQuestionPool", "qpl", "new_id", $newObj->getId());
685 $imp->importObject($newObj, $fullPath, $fileName, "qpl", "Modules/TestQuestionPool", true);
686 }
687 else
688 {
689 // start parsing of QTI files
690 include_once "./Services/QTI/classes/class.ilQTIParser.php";
691 $qtiParser = new ilQTIParser($_SESSION["qpl_import_qti_file"], IL_MO_PARSE_QTI, $newObj->getId(), $_POST["ident"]);
692 $result = $qtiParser->startParsing();
693
694 // import page data
695 if (strlen($_SESSION["qpl_import_xml_file"]))
696 {
697 include_once ("./Modules/LearningModule/classes/class.ilContObjParser.php");
698 $contParser = new ilContObjParser($newObj, $_SESSION["qpl_import_xml_file"], $_SESSION["qpl_import_subdir"]);
699 $contParser->setQuestionMapping($qtiParser->getImportMapping());
700 $contParser->startParsing();
701
702 // #20494
703 $newObj->fromXML($_SESSION["qpl_import_xml_file"]);
704 }
705
706 // set another question pool name (if possible)
707 if( isset($_POST["qpl_new"]) && strlen($_POST["qpl_new"]) )
708 {
709 $newObj->setTitle($_POST["qpl_new"]);
710 }
711
712 $newObj->update();
713 $newObj->saveToDb();
714 }
715
716 // delete import directory
717 include_once "./Services/Utilities/classes/class.ilUtil.php";
719
720 if ($_POST["questions_only"] == 1)
721 {
722 $this->ctrl->redirect($this, "questions");
723 }
724 else
725 {
726 ilUtil::sendSuccess($this->lng->txt("object_imported"),true);
727 ilUtil::redirect("ilias.php?ref_id=".$newObj->getRefId().
728 "&baseClass=ilObjQuestionPoolGUI");
729 }
730 }
$result
$_SESSION["AccountId"]
const IL_MO_PARSE_QTI
Content Object Parser.
Import class.
_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 1587 of file class.ilObjQuestionPoolGUI.php.

1588 {
1589 global $ilErr, $ilAccess;
1590
1591 if(!$ilAccess->checkAccess("visible", "", $this->ref_id))
1592 {
1593 $ilErr->raiseError($this->lng->txt("msg_no_perm_read"));
1594 }
1595
1596 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1597 $info = new ilInfoScreenGUI($this);
1598 $info->enablePrivateNotes();
1599
1600 // standard meta data
1601 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1602
1603 $this->ctrl->forwardCommand($info);
1604 }
Class ilInfoScreenGUI.
$info
Definition: example_052.php:80

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

1578 {
1579 $this->ctrl->setCmd("showSummary");
1580 $this->ctrl->setCmdClass("ilinfoscreengui");
1581 $this->infoScreenForward();
1582 }

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

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

Referenced by importFileObject().

+ Here is the caller graph for this function:

◆ isSkillsTabRequired()

ilObjQuestionPoolGUI::isSkillsTabRequired ( )
private

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

1538 {
1539 if( !($this->object instanceof ilObjQuestionPool) )
1540 {
1541 return false;
1542 }
1543
1544 if( !$this->object->isSkillServiceEnabled() )
1545 {
1546 return false;
1547 }
1548
1550 {
1551 return false;
1552 }
1553
1554 return true;
1555 }

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

1234 {
1235 if (count($_POST["q_id"]) > 0)
1236 {
1237 foreach ($_POST["q_id"] as $key => $value)
1238 {
1239 $this->object->moveToClipboard($value);
1240 }
1241 ilUtil::sendInfo($this->lng->txt("qpl_move_insert_clipboard"), true);
1242 }
1243 else
1244 {
1245 ilUtil::sendInfo($this->lng->txt("qpl_move_select_none"), true);
1246 }
1247 $this->ctrl->redirect($this, "questions");
1248 }

References $_POST, 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 1190 of file class.ilObjQuestionPoolGUI.php.

1191 {
1192 if (array_key_exists("qpl_clipboard", $_SESSION))
1193 {
1194 if($this->object->pasteFromClipboard())
1195 {
1196 ilUtil::sendSuccess($this->lng->txt("qpl_paste_success"), true);
1197 }
1198 else
1199 {
1200 ilUtil::sendFailure($this->lng->txt("qpl_paste_error"), true);
1201 }
1202 }
1203 else
1204 {
1205 ilUtil::sendInfo($this->lng->txt("qpl_paste_no_objects"), true);
1206 }
1207 $this->ctrl->redirect($this, "questions");
1208 }
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 876 of file class.ilObjQuestionPoolGUI.php.

877 {
878//echo "<br>ilObjQuestionPoolGUI->questionObject()";
879 $type = $_GET["sel_question_types"];
880 $this->editQuestionForm($type);
881 }

References $_GET.

◆ questionsObject()

ilObjQuestionPoolGUI::questionsObject ( )

list questions of question pool

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

984 {
985 global $rbacsystem, $ilUser, $ilCtrl, $ilDB, $lng, $ilPluginAdmin;
986
987 if(get_class($this->object) == "ilObjTest")
988 {
989 if ($_GET["calling_test"] > 0)
990 {
991 $ref_id = $_GET["calling_test"];
992 $q_id = $_GET["q_id"];
993
994 if ($_REQUEST['test_express_mode']) {
995 if ($q_id)
996 ilUtil::redirect("ilias.php?ref_id=".$ref_id."&q_id=".$q_id."&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
997 else
998 ilUtil::redirect("ilias.php?ref_id=".$ref_id."&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
999 }
1000 else
1001 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&ref_id=".$ref_id."&cmd=questions");
1002
1003 }
1004 }
1005 else if(isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])
1006 {
1007 $ref_id = (int)$_GET['calling_consumer'];
1009 if($consumer instanceof ilQuestionEditingFormConsumer)
1010 {
1011 ilUtil::redirect($consumer->getQuestionEditingFormBackTarget($_GET['consumer_context']));
1012 }
1013 require_once 'Services/Link/classes/class.ilLink.php';
1015 }
1016
1017 $this->object->purgeQuestions();
1018 // reset test_id SESSION variable
1019 $_SESSION["test_id"] = "";
1020
1021 require_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
1022 $taxIds = ilObjTaxonomy::getUsageOfObject($this->object->getId());
1023
1024 $table_gui = $this->buildQuestionBrowserTableGUI($taxIds);
1025 $table_gui->setPreventDoubleSubmission(false);
1026
1027 if( $rbacsystem->checkAccess('write', $_GET['ref_id']) )
1028 {
1029 $toolbar = new ilToolbarGUI();
1030
1031 require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
1033 $btn->setCaption('ass_create_question');
1034 $btn->setUrl($this->ctrl->getLinkTarget($this, 'createQuestionForm'));
1035 $btn->setPrimary(true);
1036 $toolbar->addButtonInstance($btn);
1037
1038 $this->tpl->setContent(
1039 $this->ctrl->getHTML($toolbar) . $this->ctrl->getHTML($table_gui)
1040 );
1041 }
1042 else
1043 {
1044 $this->tpl->setContent( $this->ctrl->getHTML($table_gui) );
1045 }
1046
1047 if( $this->object->getShowTaxonomies() )
1048 {
1049 $this->lng->loadLanguageModule('tax');
1050
1051 require_once 'Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php';
1052
1053 foreach($taxIds as $taxId)
1054 {
1055 if( $taxId != $this->object->getNavTaxonomyId() )
1056 {
1057 continue;
1058 }
1059
1060 $taxExp = new ilTaxonomyExplorerGUI(
1061 $this, 'showNavTaxonomy', $taxId, 'ilobjquestionpoolgui', 'questions'
1062 );
1063
1064 if( !$taxExp->handleCommand() )
1065 {
1066 $this->tpl->setLeftContent($taxExp->getHTML()."&nbsp;");
1067 }
1068
1069 break;
1070 }
1071 }
1072 }
static getInstance()
Factory.
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Taxonomy explorer GUI class.

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

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

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

◆ resetFilterObject()

ilObjQuestionPoolGUI::resetFilterObject ( )

resets filter

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

415 {
416 $_POST["filter_text"] = "";
417 $_POST["sel_filter_type"] = "";
418 $this->questionsObject();
419 }

References $_POST, and questionsObject().

+ Here is the call graph for this function:

◆ resetQuestionBrowserObject()

ilObjQuestionPoolGUI::resetQuestionBrowserObject ( )

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

969 {
970 require_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
971 $taxIds = ilObjTaxonomy::getUsageOfObject($this->object->getId());
972
973 include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
974 $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', false, false, $taxIds);
975 $table_gui->resetOffset();
976 $table_gui->resetFilter();
977 $this->questionsObject();
978 }

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

1348 {
1349 parent::setTitleAndDescription();
1350 if ($_GET["q_id"] > 0)
1351 {
1352 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1353 $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
1354 if($q_gui->object instanceof assQuestion)
1355 {
1356 $q_gui->object->setObjId($this->object->getId());
1357 $title = $q_gui->object->getTitle();
1358 if(!$title)
1359 {
1360 $title = $this->lng->txt('new').': '.assQuestion::_getQuestionTypeName($q_gui->object->getQuestionType());
1361 }
1362 $this->tpl->setTitle($title);
1363 $this->tpl->setDescription($q_gui->object->getComment());
1364 if($this->object instanceof ilObjectPlugin)
1365 {
1366 $this->tpl->setTitleIcon($this->object->plugin->getImagePath("icon_".$this->object->getType().".svg"), $this->lng->txt("obj_" . $this->object->getType()));
1367 }
1368 else
1369 {
1370 $this->tpl->setTitleIcon(ilObject::_getIcon("", "big", $this->object->getType()));
1371 }
1372 }
1373 else
1374 {
1375 // Workaround for context issues: If no object was found, redirect without q_id parameter
1376 $this->ctrl->setParameter($this, 'q_id', '');
1377 $this->ctrl->redirect($this);
1378 }
1379 }
1380 else
1381 {
1382 $this->tpl->setTitle($this->object->getTitle());
1383 $this->tpl->setDescription($this->object->getLongDescription());
1384 $this->tpl->setTitleIcon(ilObject::_getIcon("", "big", $this->object->getType()));
1385 }
1386 }
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.

References $_GET, ilObject\_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 1180 of file class.ilObjQuestionPoolGUI.php.

1181 {
1182// $this->update = $this->object->updateMetaData();
1183 $this->update = $this->object->update();
1184 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1185 }

References ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ uploadObject()

ilObjQuestionPoolGUI::uploadObject ( )

imports question(s) into the questionpool

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

748 {
749 $upload_valid = true;
750 $form = $this->getImportQuestionsForm();
751 if($form->checkInput())
752 {
753 if(!$this->uploadQplObject(true))
754 {
755 $form->setValuesByPost();
756 $this->importQuestionsObject($form);
757 }
758 }
759 else
760 {
761 $form->setValuesByPost();
762 $this->importQuestionsObject($form);
763 }
764 }
importQuestionsObject(ilPropertyFormGUI $form=null)
display the import form to import questions into the questionpool

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

436 {
437 $this->ctrl->setParameter($this, 'new_type', $_REQUEST['new_type']);
438 if ($_FILES["xmldoc"]["error"] > UPLOAD_ERR_OK)
439 {
440 ilUtil::sendFailure($this->lng->txt("error_upload"), true);
441 if(!$questions_only)
442 {
443 $this->ctrl->redirect($this, 'create');
444 }
445 return false;
446 }
447 // create import directory
448 include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
450
451 // copy uploaded file to import directory
452 $file = pathinfo($_FILES["xmldoc"]["name"]);
453 $full_path = $basedir."/".$_FILES["xmldoc"]["name"];
454 $GLOBALS['ilLog']->write(__METHOD__.": full path " . $full_path);
455 include_once "./Services/Utilities/classes/class.ilUtil.php";
456 ilUtil::moveUploadedFile($_FILES["xmldoc"]["tmp_name"], $_FILES["xmldoc"]["name"], $full_path);
457 $GLOBALS['ilLog']->write(__METHOD__.": full path " . $full_path);
458 if (strcmp($_FILES["xmldoc"]["type"], "text/xml") == 0)
459 {
460 $qti_file = $full_path;
462 }
463 else
464 {
465 // unzip file
466 ilUtil::unzip($full_path);
467
468 // determine filenames of xml files
469 $subdir = basename($file["basename"],".".$file["extension"]);
471 $xml_file = ilObjQuestionPool::_getImportDirectory().'/'.$subdir.'/'.$subdir.".xml";
472 $qti_file = ilObjQuestionPool::_getImportDirectory().'/'.$subdir.'/'. str_replace("qpl", "qti", $subdir).".xml";
473 }
474
475 // start verification of QTI files
476 include_once "./Services/QTI/classes/class.ilQTIParser.php";
477 $qtiParser = new ilQTIParser($qti_file, IL_MO_VERIFY_QTI, 0, "");
478 $result = $qtiParser->startParsing();
479 $founditems =& $qtiParser->getFoundItems();
480 if (count($founditems) == 0)
481 {
482 // nothing found
483
484 // delete import directory
485 ilUtil::delDir($basedir);
486
487 ilUtil::sendFailure($this->lng->txt("qpl_import_no_items"), true);
488 if(!$questions_only)
489 {
490 $this->ctrl->redirect($this, 'create');
491 }
492 return false;
493 }
494
495 $complete = 0;
496 $incomplete = 0;
497 foreach ($founditems as $item)
498 {
499 if (strlen($item["type"]))
500 {
501 $complete++;
502 }
503 else
504 {
505 $incomplete++;
506 }
507 }
508
509 if ($complete == 0)
510 {
511 // delete import directory
512 ilUtil::delDir($basedir);
513
514 ilUtil::sendFailure($this->lng->txt("qpl_import_non_ilias_files"), true);
515 if(!$questions_only)
516 {
517 $this->ctrl->redirect($this, 'create');
518 }
519 return false;
520 }
521
522 $_SESSION["qpl_import_xml_file"] = $xml_file;
523 $_SESSION["qpl_import_qti_file"] = $qti_file;
524 $_SESSION["qpl_import_subdir"] = $subdir;
525 // display of found questions
526 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.qpl_import_verification.html",
527 "Modules/TestQuestionPool");
528 $row_class = array("tblrow1", "tblrow2");
529 $counter = 0;
530 foreach ($founditems as $item)
531 {
532 $this->tpl->setCurrentBlock("verification_row");
533 $this->tpl->setVariable("ROW_CLASS", $row_class[$counter++ % 2]);
534 $this->tpl->setVariable("QUESTION_TITLE", $item["title"]);
535 $this->tpl->setVariable("QUESTION_IDENT", $item["ident"]);
536 include_once "./Services/QTI/classes/class.ilQTIItem.php";
537 switch ($item["type"])
538 {
540 $type = $this->lng->txt("assClozeTest");
541 break;
543 $type = $this->lng->txt("assImagemapQuestion");
544 break;
546 $type = $this->lng->txt("assJavaApplet");
547 break;
549 $type = $this->lng->txt("assMatchingQuestion");
550 break;
552 $type = $this->lng->txt("assMultipleChoice");
553 break;
555 $type = $this->lng->txt("assKprimChoice");
556 break;
558 $type = $this->lng->txt("assLongMenu");
559 break;
561 $type = $this->lng->txt("assSingleChoice");
562 break;
564 $type = $this->lng->txt("assOrderingQuestion");
565 break;
567 $type = $this->lng->txt("assTextQuestion");
568 break;
570 $type = $this->lng->txt("assNumeric");
571 break;
573 $type = $this->lng->txt("assTextSubset");
574 break;
575 default:
576 $type = $this->lng->txt($item["type"]);
577 break;
578 }
579
580 if (strcmp($type, "-" . $item["type"] . "-") == 0)
581 {
582 global $ilPluginAdmin;
583 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, "TestQuestionPool", "qst");
584 foreach ($pl_names as $pl_name)
585 {
586 $pl = ilPlugin::getPluginObject(IL_COMP_MODULE, "TestQuestionPool", "qst", $pl_name);
587 if (strcmp($pl->getQuestionType(), $item["type"]) == 0)
588 {
589 $type = $pl->getQuestionTypeTranslation();
590 }
591 }
592 }
593 $this->tpl->setVariable("QUESTION_TYPE", $type);
594 $this->tpl->parseCurrentBlock();
595 }
596
597 $this->tpl->setCurrentBlock("import_qpl");
598 if (is_file($xml_file))
599 {
600 // read file into a string
601 $fh = @fopen($xml_file, "r") or die("");
602 $xml = @fread($fh, filesize($xml_file));
603 @fclose($fh);
604 if (preg_match("/<ContentObject.*?MetaData.*?General.*?Title[^>]*?>([^<]*?)</", $xml, $matches))
605 {
606 $this->tpl->setVariable("VALUE_NEW_QUESTIONPOOL", $matches[1]);
607 }
608 }
609 $this->tpl->setVariable("TEXT_CREATE_NEW_QUESTIONPOOL", $this->lng->txt("qpl_import_create_new_qpl"));
610 $this->tpl->parseCurrentBlock();
611
612 $this->tpl->setCurrentBlock("adm_content");
613 $this->tpl->setVariable("TEXT_TYPE", $this->lng->txt("question_type"));
614 $this->tpl->setVariable("TEXT_TITLE", $this->lng->txt("question_title"));
615 $this->tpl->setVariable("FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt("qpl_import_verify_found_questions"));
616 if ($questions_only)
617 {
618 $this->tpl->setVariable("VERIFICATION_HEADING", $this->lng->txt("import_questions_into_qpl"));
619 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
620 }
621 else
622 {
623 $this->tpl->setVariable("VERIFICATION_HEADING", $this->lng->txt("import_qpl"));
624
625 $this->ctrl->setParameter($this, "new_type", $this->type);
626 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
627
628 //$this->tpl->setVariable("FORMACTION", $this->getFormAction("save","adm_object.php?cmd=gateway&ref_id=".$_GET["ref_id"]."&new_type=".$this->type));
629 }
630 $this->tpl->setVariable("ARROW", ilUtil::getImagePath("arrow_downright.svg"));
631 $this->tpl->setVariable("VALUE_IMPORT", $this->lng->txt("import"));
632 $this->tpl->setVariable("VALUE_CANCEL", $this->lng->txt("cancel"));
633 $value_questions_only = 0;
634 if ($questions_only) $value_questions_only = 1;
635 $this->tpl->setVariable("VALUE_QUESTIONS_ONLY", $value_questions_only);
636
637 $this->tpl->parseCurrentBlock();
638
639 return true;
640 }
Title class.
Definition: Title.php:30
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...
_setImportDirectory($a_import_dir=null)
set import directory
_setImportDirectory($a_import_dir=null)
set import directory
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin object.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
if(!file_exists(getcwd().'/ilias.ini.php')) if(isset( $_GET["client_id"]))
registration confirmation script for ilias
Definition: confirmReg.php:20
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
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

References $_REQUEST, $_SESSION, $file, $GLOBALS, $result, ilObjQuestionPool\_createImportDirectory(), ilObjQuestionPool\_getImportDirectory(), ilObjTest\_setImportDirectory(), ilObjQuestionPool\_setImportDirectory(), CLOZE_TEST_IDENTIFIER, ilUtil\delDir(), ilUtil\getImagePath(), 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, ilUtil\moveUploadedFile(), 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: