ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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...
 
 createExportQTI ()
 create export file 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...
 
 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

 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)
 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 ()
 
 addSettingsSubTabs (ilTabsGUI $tabs)
 
 buildQuestionBrowserTableGUI ($taxIds)
 

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

1543 {
1544 global $ilAccess, $ilErr, $lng;
1545
1546 if ($ilAccess->checkAccess("write", "", $a_target))
1547 {
1548 $_GET["baseClass"] = "ilObjQuestionPoolGUI";
1549 $_GET["cmd"] = "questions";
1550 $_GET["ref_id"] = $a_target;
1551 include_once("ilias.php");
1552 exit;
1553 }
1554 else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
1555 {
1556 ilUtil::sendInfo(sprintf($lng->txt("msg_no_perm_read_item"),
1559 }
1560 $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
1561 }
$_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 1276 of file class.ilObjQuestionPoolGUI.php.

1277 {
1278 global $ilLocator;
1279 switch ($this->ctrl->getCmd())
1280 {
1281 case "create":
1282 case "importFile":
1283 case "cancel":
1284 break;
1285 default:
1286 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $_GET["ref_id"]);
1287 break;
1288 }
1289 if ($_GET["q_id"] > 0)
1290 {
1291 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1292 $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
1293 if($q_gui->object instanceof assQuestion)
1294 {
1295 $q_gui->object->setObjId($this->object->getId());
1296 $title = $q_gui->object->getTitle();
1297 if(!$title)
1298 {
1299 $title = $this->lng->txt('new').': '.assQuestion::_getQuestionTypeName($q_gui->object->getQuestionType());
1300 }
1301 $ilLocator->addItem($title, $this->ctrl->getLinkTargetByClass(get_class($q_gui), "editQuestion"));
1302 }
1303 else
1304 {
1305 // Workaround for context issues: If no object was found, redirect without q_id parameter
1306 $this->ctrl->setParameter($this, 'q_id', '');
1307 $this->ctrl->redirect($this);
1308 }
1309 }
1310 }
& _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 1485 of file class.ilObjQuestionPoolGUI.php.

1486 {
1487 $tabs->addSubTabTarget(
1488 'qpl_settings_subtab_general',
1489 $this->ctrl->getLinkTargetByClass('ilObjQuestionPoolSettingsGeneralGUI'),
1490 '', 'ilObjQuestionPoolSettingsGeneralGUI'
1491 );
1492
1493 $tabs->addSubTabTarget(
1494 'qpl_settings_subtab_taxonomies',
1495 $this->ctrl->getLinkTargetByClass('ilObjTaxonomyGUI', 'editAOTaxonomySettings'),
1496 '', 'ilObjTaxonomyGUI'
1497 );
1498 }
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 821 of file class.ilObjQuestionPoolGUI.php.

822 {
823 // always send a message
824 ilUtil::sendSuccess($this->lng->txt("object_added"),true);
825
826 ilUtil::redirect("ilias.php?ref_id=".$a_new_object->getRefId().
827 "&baseClass=ilObjQuestionPoolGUI");
828 }
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 1033 of file class.ilObjQuestionPoolGUI.php.

1034 {
1035 global $ilUser;
1036
1037 // form
1038
1039 require_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1040 $form = new ilPropertyFormGUI();
1041 $form->setTitle($this->lng->txt('ass_create_question'));
1042 $form->setFormAction($this->ctrl->getFormAction($this));
1043
1044 // question type
1045
1046 $options = array();
1047 foreach( $this->object->getQuestionTypes(false, true) as $translation => $data )
1048 {
1049 $options[$data['type_tag']] = $translation;
1050 }
1051
1052 require_once("Services/Form/classes/class.ilSelectInputGUI.php");
1053 $si = new ilSelectInputGUI($this->lng->txt('question_type'), 'sel_question_types');
1054 $si->setOptions($options);
1055 //$si->setValue($ilUser->getPref("tst_lastquestiontype"));
1056
1057 $form->addItem($si);
1058
1059 // content editing mode
1060
1062 {
1063 $ri = new ilRadioGroupInputGUI($this->lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
1064
1065 $ri->addOption(new ilRadioOption(
1066 $this->lng->txt('tst_add_quest_cont_edit_mode_default'),
1068 ));
1069
1070 $ri->addOption(new ilRadioOption(
1071 $this->lng->txt('tst_add_quest_cont_edit_mode_page_object'),
1073 ));
1074
1076
1077 $form->addItem($ri, true);
1078 }
1079 else
1080 {
1081 $hi = new ilHiddenInputGUI("question_content_editing_type");
1083 $form->addItem($hi, true);
1084 }
1085
1086 // commands
1087
1088 $form->addCommandButton('createQuestion', $this->lng->txt('create'));
1089 $form->addCommandButton('questions', $this->lng->txt('cancel'));
1090
1091 return $form;
1092 }
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 1571 of file class.ilObjQuestionPoolGUI.php.

1572 {
1573 global $rbacsystem, $ilDB, $lng, $ilPluginAdmin;
1574
1575 include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
1576 $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', (($rbacsystem->checkAccess('write', $_GET['ref_id']) ? true : false)), false, $taxIds);
1577 $table_gui->setEditable($rbacsystem->checkAccess('write', $_GET['ref_id']));
1578
1579 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
1580 $questionList = new ilAssQuestionList($ilDB, $lng, $ilPluginAdmin, $this->object->getId());
1581
1582 foreach ($table_gui->getFilterItems() as $item)
1583 {
1584 if( substr($item->getPostVar(), 0, strlen('tax_')) == 'tax_' )
1585 {
1586 $v = $item->getValue();
1587
1588 if( is_array($v) && count($v) && !(int)$v[0] )
1589 {
1590 continue;
1591 }
1592
1593 $taxId = substr($item->getPostVar(), strlen('tax_'));
1594 $questionList->addTaxonomyFilter($taxId, $item->getValue());
1595 }
1596 elseif( $item->getValue() !== false )
1597 {
1598 $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
1599 }
1600 }
1601
1602 if( $this->object->isNavTaxonomyActive() && (int)$_GET['tax_node'] )
1603 {
1604 $questionList->addTaxonomyFilter( $this->object->getNavTaxonomyId(), array((int)$_GET['tax_node']) );
1605 }
1606
1607 $questionList->load();
1608 $data = $questionList->getQuestionDataArray();
1609
1610 $table_gui->setData($data);
1611
1612 return $table_gui;
1613 }
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 881 of file class.ilObjQuestionPoolGUI.php.

882 {
883 $this->ctrl->redirect($this, "questions");
884 }

◆ cancelImportObject()

ilObjQuestionPoolGUI::cancelImportObject ( )

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

687 {
688 if ($_POST["questions_only"] == 1)
689 {
690 $this->ctrl->redirect($this, "questions");
691 }
692 else
693 {
694 $this->ctrl->redirect($this, "cancel");
695 }
696 }
$_POST['username']
Definition: cron.php:12

References $_POST.

◆ confirmDeleteQuestionsObject()

ilObjQuestionPoolGUI::confirmDeleteQuestionsObject ( )

delete questions

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

864 {
865 // delete questions after confirmation
866 foreach ($_POST["q_id"] as $key => $value)
867 {
868 $this->object->deleteQuestion($value);
869 $this->object->cleanupClipboard($value);
870 }
871 if (count($_POST["q_id"])) ilUtil::sendSuccess($this->lng->txt("qpl_questions_deleted"), true);
872
873 $this->ctrl->setParameter($this, 'q_id', '');
874
875 $this->ctrl->redirect($this, "questions");
876 }

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

1166 {
1167 if (count($_POST["q_id"]) > 0)
1168 {
1169 foreach ($_POST["q_id"] as $key => $value)
1170 {
1171 $this->object->copyToClipboard($value);
1172 }
1173 ilUtil::sendInfo($this->lng->txt("qpl_copy_insert_clipboard"), true);
1174 }
1175 else
1176 {
1177 ilUtil::sendInfo($this->lng->txt("qpl_copy_select_none"), true);
1178 }
1179 $this->ctrl->redirect($this, "questions");
1180 }

References $_POST, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ createExportExcel()

ilObjQuestionPoolGUI::createExportExcel ( )

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

1219 {
1220 global $rbacsystem;
1221 if ($rbacsystem->checkAccess("write", $_GET['ref_id']))
1222 {
1223 include_once("./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
1224 $question_ids =& $this->object->getAllQuestionIds();
1225 $qpl_exp = new ilQuestionpoolExport($this->object, 'xls', $question_ids);
1226 $qpl_exp->buildExportFile();
1227 $this->ctrl->redirectByClass("ilquestionpoolexportgui", "");
1228 }
1229 }
Export class for questionpools.

References $_GET.

◆ createExportQTI()

ilObjQuestionPoolGUI::createExportQTI ( )

create export file

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

1206 {
1207 global $rbacsystem;
1208 if ($rbacsystem->checkAccess("write", $_GET['ref_id']))
1209 {
1210 include_once("./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
1211 $question_ids =& $this->object->getAllQuestionIds();
1212 $qpl_exp = new ilQuestionpoolExport($this->object, 'xml', $question_ids);
1213 $qpl_exp->buildExportFile();
1214 $this->ctrl->redirectByClass("ilquestionpoolexportgui", "");
1215 }
1216 }

References $_GET.

◆ createQuestionFormObject()

ilObjQuestionPoolGUI::createQuestionFormObject ( )
private

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

1027 {
1028 $form = $this->buildCreateQuestionForm();
1029
1030 $this->tpl->setContent( $this->ctrl->getHTML($form) );
1031 }

References buildCreateQuestionForm().

+ Here is the call graph for this function:

◆ createQuestionForTestObject()

& ilObjQuestionPoolGUI::createQuestionForTestObject ( )

create new question

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

782 {
783 if( !$_REQUEST['q_id'] )
784 {
785 require_once 'Modules/Test/classes/class.ilObjAssessmentFolder.php';
787 {
788 $addContEditMode = $_REQUEST['add_quest_cont_edit_mode'];
789 }
790 else
791 {
793 }
794
795 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
796 $q_gui =& assQuestionGUI::_getQuestionGUI($_GET["sel_question_types"]);
797 $q_gui->object->setObjId($this->object->getId());
798 $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
799 $q_gui->object->createNewQuestion();
800
801 $class = get_class($q_gui);
802 $qId = $q_gui->object->getId();
803 }
804 else
805 {
806 $class = $_GET["sel_question_types"] . 'gui';
807 $qId = $_REQUEST['q_id'];
808 }
809
810 $this->ctrl->setParameterByClass($class, "q_id", $qId);
811 $this->ctrl->setParameterByClass($class, "sel_question_types", $_REQUEST["sel_question_types"]);
812 $this->ctrl->setParameterByClass($class, "prev_qid", $_REQUEST["prev_qid"]);
813
814 $this->ctrl->redirectByClass($class, "editQuestion");
815 }
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 756 of file class.ilObjQuestionPoolGUI.php.

757 {
759 {
760 $addContEditMode = $_POST['add_quest_cont_edit_mode'];
761 }
762 else
763 {
765 }
766
767 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
768 $q_gui =& assQuestionGUI::_getQuestionGUI($_POST["sel_question_types"]);
769 $this->object->addQuestionChangeListeners($q_gui->object);
770 $q_gui->object->setObjId($this->object->getId());
771 $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
772 $q_gui->object->createNewQuestion();
773 $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
774 $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $_POST["sel_question_types"]);
775 $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
776 }

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

841 {
842 global $rbacsystem;
843
844 if (count($_POST["q_id"]) < 1)
845 {
846 ilUtil::sendInfo($this->lng->txt("qpl_delete_select_none"), true);
847 $this->ctrl->redirect($this, "questions");
848 }
849
850 ilUtil::sendQuestion($this->lng->txt("qpl_confirm_delete_questions"));
851 $deleteable_questions =& $this->object->getDeleteableQuestionDetails($_POST["q_id"]);
852 include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
853 $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', (($rbacsystem->checkAccess('write', $_GET['ref_id']) ? true : false)), true);
854 $table_gui->setEditable($rbacsystem->checkAccess('write', $_GET['ref_id']));
855 $table_gui->setData($deleteable_questions);
856 $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
857 }
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 401 of file class.ilObjQuestionPoolGUI.php.

402 {
403 include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php");
404 $pg_obj = new ilAssQuestionPage($_GET["pg_id"]);
405 $pg_obj->send_paragraph ($_GET["par_id"], $_GET["downloadtitle"]);
406 exit;
407 }
Question page object.

References $_GET, and exit.

◆ downloadFileObject()

ilObjQuestionPoolGUI::downloadFileObject ( )

download file

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

361 {
362 $file = explode("_", $_GET["file_id"]);
363 include_once("./Modules/File/classes/class.ilObjFile.php");
364 $fileObj =& new ilObjFile($file[count($file) - 1], false);
365 $fileObj->sendFile();
366 exit;
367 }
print $file
Class ilObjFile.

References $_GET, $file, and exit.

◆ editQuestionForTestObject()

& ilObjQuestionPoolGUI::editQuestionForTestObject ( )

edit question

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

1235 {
1236 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1237 $q_gui =& assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
1238 $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
1239 }

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

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

◆ exportQuestionObject()

ilObjQuestionPoolGUI::exportQuestionObject ( )

export question

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

890 {
891 // export button was pressed
892 if (count($_POST["q_id"]) > 0)
893 {
894 include_once("./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
895 $qpl_exp = new ilQuestionpoolExport($this->object, "xml", $_POST["q_id"]);
896 $export_file = $qpl_exp->buildExportFile();
897 $filename = $export_file;
898 $filename = preg_replace("/.*\//", "", $filename);
899 include_once "./Services/Utilities/classes/class.ilUtil.php";
900 ilUtil::deliverFile($export_file, $filename);
901 exit();
902 }
903 else
904 {
905 ilUtil::sendInfo($this->lng->txt("qpl_export_select_none"), true);
906 }
907 $this->ctrl->redirect($this, "questions");
908 }
$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 383 of file class.ilObjQuestionPoolGUI.php.

384 {
385 $this->questionsObject();
386 }
questionsObject()
list questions of question pool

References questionsObject().

+ Here is the call graph for this function:

◆ filterQuestionBrowserObject()

ilObjQuestionPoolGUI::filterQuestionBrowserObject ( )

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

911 {
912 require_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
913 $taxIds = ilObjTaxonomy::getUsageOfObject($this->object->getId());
914
915 include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
916 $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', false, false, $taxIds);
917 $table_gui->resetOffset();
918 $table_gui->writeFilterToSession();
919 $this->questionsObject();
920 }
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 372 of file class.ilObjQuestionPoolGUI.php.

373 {
374 include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
375 $page_gui = new ilAssQuestionPageGUI($_GET["pg_id"]);
376 $page_gui->showMediaFullscreen();
377 }

References $_GET.

◆ getImportQuestionsForm()

ilObjQuestionPoolGUI::getImportQuestionsForm ( )
protected
Returns
ilPropertyFormGUI

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

737 {
738 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
739 $form = new ilPropertyFormGUI();
740 $form->setTitle($this->lng->txt('import_question'));
741 $form->setFormAction($this->ctrl->getFormAction($this, 'upload'));
742
743 $file = new ilFileInputGUI($this->lng->txt('select_file'), 'xmldoc');
744 $file->setRequired(true);
745 $form->addItem($file);
746
747 $form->addCommandButton('upload', $this->lng->txt('upload'));
748 $form->addCommandButton('questions', $this->lng->txt('cancel'));
749
750 return $form;
751 }
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 1361 of file class.ilObjQuestionPoolGUI.php.

1362 {
1363 global $ilAccess, $ilHelp;
1364
1365 $currentUserHasWriteAccess = $ilAccess->checkAccess("write", "", $this->object->getRefId());
1366
1367 $ilHelp->setScreenIdComponent("qpl");
1368
1369 $next_class = strtolower($this->ctrl->getNextClass());
1370 switch ($next_class)
1371 {
1372 case "":
1373 case "ilpermissiongui":
1374 case "ilmdeditorgui":
1375 case "ilquestionpoolexportgui":
1376 break;
1377
1378 case 'ilobjtaxonomygui':
1379 case 'ilobjquestionpoolsettingsgeneralgui':
1380
1381 if( $currentUserHasWriteAccess )
1382 {
1383 $this->addSettingsSubTabs($tabs_gui);
1384 }
1385
1386 break;
1387
1388 default:
1389 return;
1390 break;
1391 }
1392 // questions
1393 $force_active = false;
1394 $commands = $_POST["cmd"];
1395 if (is_array($commands))
1396 {
1397 foreach ($commands as $key => $value)
1398 {
1399 if (preg_match("/^delete_.*/", $key, $matches) ||
1400 preg_match("/^addSelectGap_.*/", $key, $matches) ||
1401 preg_match("/^addTextGap_.*/", $key, $matches) ||
1402 preg_match("/^deleteImage_.*/", $key, $matches) ||
1403 preg_match("/^upload_.*/", $key, $matches) ||
1404 preg_match("/^addSuggestedSolution_.*/", $key, $matches)
1405 )
1406 {
1407 $force_active = true;
1408 }
1409 }
1410 }
1411 if (array_key_exists("imagemap_x", $_POST))
1412 {
1413 $force_active = true;
1414 }
1415 if (!$force_active)
1416 {
1417 $force_active = ((strtolower($this->ctrl->getCmdClass()) == strtolower(get_class($this)) || strlen($this->ctrl->getCmdClass()) == 0) &&
1418 $this->ctrl->getCmd() == "")
1419 ? true
1420 : false;
1421 }
1422 $tabs_gui->addTarget("assQuestions",
1423 $this->ctrl->getLinkTarget($this, "questions"),
1424 array("questions", "filter", "resetFilter", "createQuestion",
1425 "importQuestions", "deleteQuestions", "filterQuestionBrowser",
1426 "view", "preview", "editQuestion", "exec_pg",
1427 "addItem", "upload", "save", "cancel", "addSuggestedSolution",
1428 "cancelExplorer", "linkChilds", "removeSuggestedSolution",
1429 "add", "addYesNo", "addTrueFalse", "createGaps", "saveEdit",
1430 "setMediaMode", "uploadingImage", "uploadingImagemap", "addArea",
1431 "deletearea", "saveShape", "back", "addPair", "uploadingJavaapplet",
1432 "addParameter", "assessment", "addGIT", "addST", "addPG", "delete",
1433 "toggleGraphicalAnswers", "deleteAnswer", "deleteImage", "removeJavaapplet"),
1434 "", "", $force_active);
1435
1436 if ($ilAccess->checkAccess("visible", "", $this->ref_id))
1437 {
1438 $tabs_gui->addTarget("info_short",
1439 $this->ctrl->getLinkTarget($this, "infoScreen"),
1440 array("infoScreen", "showSummary"));
1441 }
1442
1443 if ($ilAccess->checkAccess("write", "", $_GET['ref_id']))
1444 {
1445 // properties
1446 $tabs_gui->addTarget(
1447 'settings', $this->ctrl->getLinkTargetByClass('ilObjQuestionPoolSettingsGeneralGUI'),
1448 array(), array('ilObjQuestionPoolSettingsGeneralGUI', 'ilObjTaxonomyGUI')
1449 );
1450 }
1451
1452 // print view
1453 $tabs_gui->addTarget("print_view",
1454 $this->ctrl->getLinkTarget($this,'print'),
1455 array("print"),
1456 "", "");
1457
1458 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1459 {
1460 // meta data
1461 $tabs_gui->addTarget("meta_data",
1462 $this->ctrl->getLinkTargetByClass('ilmdeditorgui','listSection'),
1463 "", "ilmdeditorgui");
1464
1465// $tabs_gui->addTarget("export",
1466// $this->ctrl->getLinkTarget($this,'export'),
1467// array("export", "createExportFile", "confirmDeleteExportFile", "downloadExportFile"),
1468// "", "");
1469 }
1470
1471 if( $currentUserHasWriteAccess )
1472 {
1473 $tabs_gui->addTarget("export",
1474 $this->ctrl->getLinkTargetByClass("ilquestionpoolexportgui", ""),
1475 "", "ilquestionpoolexportgui");
1476 }
1477
1478 if ($ilAccess->checkAccess("edit_permission", "", $this->object->getRefId()))
1479 {
1480 $tabs_gui->addTarget("perm_settings",
1481 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
1482 }
1483 }

References $_GET, $_POST, and addSettingsSubTabs().

+ Here is the call graph for this function:

◆ ilObjQuestionPoolGUI()

ilObjQuestionPoolGUI::ilObjQuestionPoolGUI ( )

Constructor @access public.

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

46 {
47 global $lng, $ilCtrl, $rbacsystem;
48 $lng->loadLanguageModule("assessment");
49 $this->type = "qpl";
50 $this->ctrl =& $ilCtrl;
51
52 $this->ctrl->saveParameter($this, array(
53 "ref_id", "test_ref_id", "calling_test", "test_express_mode", "q_id", 'tax_node', 'calling_consumer', 'consumer_context'
54 ));
55 $this->ctrl->saveParameter($this, "calling_consumer");
56 $this->ctrl->saveParameterByClass('ilAssQuestionPageGUI', 'calling_consumer');
57 $this->ctrl->saveParameterByClass('ilAssQuestionPageGUI', 'consumer_context');
58 $this->ctrl->saveParameterByClass('ilobjquestionpoolgui', 'calling_consumer');
59 $this->ctrl->saveParameterByClass('ilobjquestionpoolgui', 'consumer_context');
60
61 $this->ilObjectGUI("",$_GET["ref_id"], true, false);
62 }
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 1264 of file class.ilObjQuestionPoolGUI.php.

1265 {
1266 $form = $this->initImportForm($_REQUEST["new_type"]);
1267 if($form->checkInput())
1268 {
1269 $this->uploadQplObject();
1270 }
1271
1272 // display form to correct errors
1273 $this->tpl->setContent($form->getHTML());
1274 }
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 723 of file class.ilObjQuestionPoolGUI.php.

724 {
725 if(!$form instanceof ilPropertyFormGUI)
726 {
727 $form = $this->getImportQuestionsForm();
728 }
729
730 $this->tpl->setContent($form->getHtml());
731 }

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

620 {
621 if ($_POST["questions_only"] == 1)
622 {
623 $newObj =& $this->object;
624 }
625 else
626 {
627 include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
628 // create new questionpool object
629 $newObj = new ilObjQuestionPool(0, true);
630 // set type of questionpool object
631 $newObj->setType($_GET["new_type"]);
632 // set title of questionpool object to "dummy"
633 $newObj->setTitle("dummy");
634 // set description of questionpool object
635 $newObj->setDescription("questionpool import");
636 // create the questionpool class in the ILIAS database (object_data table)
637 $newObj->create(true);
638 // create a reference for the questionpool object in the ILIAS database (object_reference table)
639 $newObj->createReference();
640 // put the questionpool object in the administration tree
641 $newObj->putInTree($_GET["ref_id"]);
642 // get default permissions and set the permissions for the questionpool object
643 $newObj->setPermissions($_GET["ref_id"]);
644 // notify the questionpool object and all its parent objects that a "new" object was created
645 $newObj->notify("new",$_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$newObj->getRefId());
646 }
647
648 // start parsing of QTI files
649 include_once "./Services/QTI/classes/class.ilQTIParser.php";
650 $qtiParser = new ilQTIParser($_SESSION["qpl_import_qti_file"], IL_MO_PARSE_QTI, $newObj->getId(), $_POST["ident"]);
651 $result = $qtiParser->startParsing();
652
653 // import page data
654 if (strlen($_SESSION["qpl_import_xml_file"]))
655 {
656 include_once ("./Modules/LearningModule/classes/class.ilContObjParser.php");
657 $contParser = new ilContObjParser($newObj, $_SESSION["qpl_import_xml_file"], $_SESSION["qpl_import_subdir"]);
658 $contParser->setQuestionMapping($qtiParser->getImportMapping());
659 $contParser->startParsing();
660 }
661
662 // set another question pool name (if possible)
663 $qpl_name = $_POST["qpl_new"];
664 if ((strcmp($qpl_name, $newObj->getTitle()) != 0) && (strlen($qpl_name) > 0))
665 {
666 $newObj->setTitle($qpl_name);
667 $newObj->update();
668 }
669
670 // delete import directory
671 include_once "./Services/Utilities/classes/class.ilUtil.php";
673
674 if ($_POST["questions_only"] == 1)
675 {
676 $this->ctrl->redirect($this, "questions");
677 }
678 else
679 {
680 ilUtil::sendSuccess($this->lng->txt("object_imported"),true);
681 ilUtil::redirect("ilias.php?ref_id=".$newObj->getRefId().
682 "&baseClass=ilObjQuestionPoolGUI");
683 }
684 }
$result
const IL_MO_PARSE_QTI
Content Object Parser.
_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
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']

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

1516 {
1517 global $ilErr, $ilAccess;
1518
1519 if(!$ilAccess->checkAccess("visible", "", $this->ref_id))
1520 {
1521 $ilErr->raiseError($this->lng->txt("msg_no_perm_read"));
1522 }
1523
1524 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1525 $info = new ilInfoScreenGUI($this);
1526 $info->enablePrivateNotes();
1527
1528 // standard meta data
1529 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1530
1531 $this->ctrl->forwardCommand($info);
1532 }
Class ilInfoScreenGUI.

References $ilErr.

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

1506 {
1507 $this->ctrl->setCmd("showSummary");
1508 $this->ctrl->setCmdClass("ilinfoscreengui");
1509 $this->infoScreenForward();
1510 }

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

1242 {
1243 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1244 $form = new ilPropertyFormGUI();
1245 $form->setTarget("_top");
1246 $form->setFormAction($this->ctrl->getFormAction($this));
1247 $form->setTitle($this->lng->txt("import_qpl"));
1248
1249 include_once("./Services/Form/classes/class.ilFileInputGUI.php");
1250 $fi = new ilFileInputGUI($this->lng->txt("import_file"), "xmldoc");
1251 $fi->setSuffixes(array("zip"));
1252 $fi->setRequired(true);
1253 $form->addItem($fi);
1254
1255 $form->addCommandButton("importFile", $this->lng->txt("import"));
1256 $form->addCommandButton("cancel", $this->lng->txt("cancel"));
1257
1258 return $form;
1259 }

Referenced by importFileObject().

+ Here is the caller graph for this function:

◆ moveObject()

ilObjQuestionPoolGUI::moveObject ( )

mark one or more question objects for moving

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

1186 {
1187 if (count($_POST["q_id"]) > 0)
1188 {
1189 foreach ($_POST["q_id"] as $key => $value)
1190 {
1191 $this->object->moveToClipboard($value);
1192 }
1193 ilUtil::sendInfo($this->lng->txt("qpl_move_insert_clipboard"), true);
1194 }
1195 else
1196 {
1197 ilUtil::sendInfo($this->lng->txt("qpl_move_select_none"), true);
1198 }
1199 $this->ctrl->redirect($this, "questions");
1200 }

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

1143 {
1144 if (array_key_exists("qpl_clipboard", $_SESSION))
1145 {
1146 if($this->object->pasteFromClipboard())
1147 {
1148 ilUtil::sendSuccess($this->lng->txt("qpl_paste_success"), true);
1149 }
1150 else
1151 {
1152 ilUtil::sendFailure($this->lng->txt("qpl_paste_error"), true);
1153 }
1154 }
1155 else
1156 {
1157 ilUtil::sendInfo($this->lng->txt("qpl_paste_no_objects"), true);
1158 }
1159 $this->ctrl->redirect($this, "questions");
1160 }
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 830 of file class.ilObjQuestionPoolGUI.php.

831 {
832//echo "<br>ilObjQuestionPoolGUI->questionObject()";
833 $type = $_GET["sel_question_types"];
834 $this->editQuestionForm($type);
835 }

References $_GET.

◆ questionsObject()

ilObjQuestionPoolGUI::questionsObject ( )

list questions of question pool

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

938 {
939 global $rbacsystem, $ilUser, $ilCtrl, $ilDB, $lng, $ilPluginAdmin;
940
941 if(get_class($this->object) == "ilObjTest")
942 {
943 if ($_GET["calling_test"] > 0)
944 {
945 $ref_id = $_GET["calling_test"];
946 $q_id = $_GET["q_id"];
947
948 if ($_REQUEST['test_express_mode']) {
949 if ($q_id)
950 ilUtil::redirect("ilias.php?ref_id=".$ref_id."&q_id=".$q_id."&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
951 else
952 ilUtil::redirect("ilias.php?ref_id=".$ref_id."&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
953 }
954 else
955 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&ref_id=".$ref_id."&cmd=questions");
956
957 }
958 }
959 else if(isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])
960 {
961 $ref_id = (int)$_GET['calling_consumer'];
963 if($consumer instanceof ilQuestionEditingFormConsumer)
964 {
965 ilUtil::redirect($consumer->getQuestionEditingFormBackTarget($_GET['consumer_context']));
966 }
967 require_once 'Services/Link/classes/class.ilLink.php';
969 }
970
971 $this->object->purgeQuestions();
972 // reset test_id SESSION variable
973 $_SESSION["test_id"] = "";
974
975 require_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
976 $taxIds = ilObjTaxonomy::getUsageOfObject($this->object->getId());
977
978 $table_gui = $this->buildQuestionBrowserTableGUI($taxIds);
979 $table_gui->setPreventDoubleSubmission(false);
980
981 if( $rbacsystem->checkAccess('write', $_GET['ref_id']) )
982 {
983 $toolbar = new ilToolbarGUI();
984
985 $toolbar->addButton(
986 $this->lng->txt("ass_create_question"),
987 $this->ctrl->getLinkTarget($this, 'createQuestionForm')
988 );
989
990 $this->tpl->setContent(
991 $this->ctrl->getHTML($toolbar) . $this->ctrl->getHTML($table_gui)
992 );
993 }
994 else
995 {
996 $this->tpl->setContent( $this->ctrl->getHTML($table_gui) );
997 }
998
999 if( $this->object->getShowTaxonomies() )
1000 {
1001 $this->lng->loadLanguageModule('tax');
1002
1003 require_once 'Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php';
1004
1005 foreach($taxIds as $taxId)
1006 {
1007 if( $taxId != $this->object->getNavTaxonomyId() )
1008 {
1009 continue;
1010 }
1011
1012 $taxExp = new ilTaxonomyExplorerGUI(
1013 $this, 'showNavTaxonomy', $taxId, 'ilobjquestionpoolgui', 'questions'
1014 );
1015
1016 if( !$taxExp->handleCommand() )
1017 {
1018 $this->tpl->setLeftContent($taxExp->getHTML()."&nbsp;");
1019 }
1020
1021 break;
1022 }
1023 }
1024 }
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(), 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 391 of file class.ilObjQuestionPoolGUI.php.

392 {
393 $_POST["filter_text"] = "";
394 $_POST["sel_filter_type"] = "";
395 $this->questionsObject();
396 }

References $_POST, and questionsObject().

+ Here is the call graph for this function:

◆ resetQuestionBrowserObject()

ilObjQuestionPoolGUI::resetQuestionBrowserObject ( )

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

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

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

1316 {
1317 parent::setTitleAndDescription();
1318 if ($_GET["q_id"] > 0)
1319 {
1320 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1321 $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
1322 if($q_gui->object instanceof assQuestion)
1323 {
1324 $q_gui->object->setObjId($this->object->getId());
1325 $title = $q_gui->object->getTitle();
1326 if(!$title)
1327 {
1328 $title = $this->lng->txt('new').': '.assQuestion::_getQuestionTypeName($q_gui->object->getQuestionType());
1329 }
1330 $this->tpl->setTitle($title);
1331 $this->tpl->setDescription($q_gui->object->getComment());
1332 if($this->object instanceof ilObjectPlugin)
1333 {
1334 $this->tpl->setTitleIcon($this->object->plugin->getImagePath("icon_".$this->object->getType().".svg"), $this->lng->txt("obj_" . $this->object->getType()));
1335 }
1336 else
1337 {
1338 $this->tpl->setTitleIcon(ilObject::_getIcon("", "big", $this->object->getType()));
1339 }
1340 }
1341 else
1342 {
1343 // Workaround for context issues: If no object was found, redirect without q_id parameter
1344 $this->ctrl->setParameter($this, 'q_id', '');
1345 $this->ctrl->redirect($this);
1346 }
1347 }
1348 else
1349 {
1350 $this->tpl->setTitle($this->object->getTitle());
1351 $this->tpl->setDescription($this->object->getLongDescription());
1352 $this->tpl->setTitleIcon(ilObject::_getIcon("", "big", $this->object->getType()));
1353 }
1354 }
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 1132 of file class.ilObjQuestionPoolGUI.php.

1133 {
1134// $this->update = $this->object->updateMetaData();
1135 $this->update = $this->object->update();
1136 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1137 }

References ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ uploadObject()

ilObjQuestionPoolGUI::uploadObject ( )

imports question(s) into the questionpool

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

702 {
703 $upload_valid = true;
704 $form = $this->getImportQuestionsForm();
705 if($form->checkInput())
706 {
707 if(!$this->uploadQplObject(true))
708 {
709 $form->setValuesByPost();
710 $this->importQuestionsObject($form);
711 }
712 }
713 else
714 {
715 $form->setValuesByPost();
716 $this->importQuestionsObject($form);
717 }
718 }
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 412 of file class.ilObjQuestionPoolGUI.php.

413 {
414 $this->ctrl->setParameter($this, 'new_type', $_REQUEST['new_type']);
415 if ($_FILES["xmldoc"]["error"] > UPLOAD_ERR_OK)
416 {
417 ilUtil::sendFailure($this->lng->txt("error_upload"), true);
418 if(!$questions_only)
419 {
420 $this->ctrl->redirect($this, 'create');
421 }
422 return false;
423 }
424 // create import directory
425 include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
427
428 // copy uploaded file to import directory
429 $file = pathinfo($_FILES["xmldoc"]["name"]);
430 $full_path = $basedir."/".$_FILES["xmldoc"]["name"];
431 $GLOBALS['ilLog']->write(__METHOD__.": full path " . $full_path);
432 include_once "./Services/Utilities/classes/class.ilUtil.php";
433 ilUtil::moveUploadedFile($_FILES["xmldoc"]["tmp_name"], $_FILES["xmldoc"]["name"], $full_path);
434 $GLOBALS['ilLog']->write(__METHOD__.": full path " . $full_path);
435 if (strcmp($_FILES["xmldoc"]["type"], "text/xml") == 0)
436 {
437 $qti_file = $full_path;
439 }
440 else
441 {
442 // unzip file
443 ilUtil::unzip($full_path);
444
445 // determine filenames of xml files
446 $subdir = basename($file["basename"],".".$file["extension"]);
448 $xml_file = ilObjQuestionPool::_getImportDirectory().'/'.$subdir.'/'.$subdir.".xml";
449 $qti_file = ilObjQuestionPool::_getImportDirectory().'/'.$subdir.'/'. str_replace("qpl", "qti", $subdir).".xml";
450 }
451
452 // start verification of QTI files
453 include_once "./Services/QTI/classes/class.ilQTIParser.php";
454 $qtiParser = new ilQTIParser($qti_file, IL_MO_VERIFY_QTI, 0, "");
455 $result = $qtiParser->startParsing();
456 $founditems =& $qtiParser->getFoundItems();
457 if (count($founditems) == 0)
458 {
459 // nothing found
460
461 // delete import directory
462 ilUtil::delDir($basedir);
463
464 ilUtil::sendFailure($this->lng->txt("qpl_import_no_items"), true);
465 if(!$questions_only)
466 {
467 $this->ctrl->redirect($this, 'create');
468 }
469 return false;
470 }
471
472 $complete = 0;
473 $incomplete = 0;
474 foreach ($founditems as $item)
475 {
476 if (strlen($item["type"]))
477 {
478 $complete++;
479 }
480 else
481 {
482 $incomplete++;
483 }
484 }
485
486 if ($complete == 0)
487 {
488 // delete import directory
489 ilUtil::delDir($basedir);
490
491 ilUtil::sendFailure($this->lng->txt("qpl_import_non_ilias_files"), true);
492 if(!$questions_only)
493 {
494 $this->ctrl->redirect($this, 'create');
495 }
496 return false;
497 }
498
499 $_SESSION["qpl_import_xml_file"] = $xml_file;
500 $_SESSION["qpl_import_qti_file"] = $qti_file;
501 $_SESSION["qpl_import_subdir"] = $subdir;
502 // display of found questions
503 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.qpl_import_verification.html",
504 "Modules/TestQuestionPool");
505 $row_class = array("tblrow1", "tblrow2");
506 $counter = 0;
507 foreach ($founditems as $item)
508 {
509 $this->tpl->setCurrentBlock("verification_row");
510 $this->tpl->setVariable("ROW_CLASS", $row_class[$counter++ % 2]);
511 $this->tpl->setVariable("QUESTION_TITLE", $item["title"]);
512 $this->tpl->setVariable("QUESTION_IDENT", $item["ident"]);
513 include_once "./Services/QTI/classes/class.ilQTIItem.php";
514 switch ($item["type"])
515 {
517 $type = $this->lng->txt("assClozeTest");
518 break;
520 $type = $this->lng->txt("assImagemapQuestion");
521 break;
523 $type = $this->lng->txt("assJavaApplet");
524 break;
526 $type = $this->lng->txt("assMatchingQuestion");
527 break;
529 $type = $this->lng->txt("assMultipleChoice");
530 break;
532 $type = $this->lng->txt("assKprimChoice");
533 break;
535 $type = $this->lng->txt("assSingleChoice");
536 break;
538 $type = $this->lng->txt("assOrderingQuestion");
539 break;
541 $type = $this->lng->txt("assTextQuestion");
542 break;
544 $type = $this->lng->txt("assNumeric");
545 break;
547 $type = $this->lng->txt("assTextSubset");
548 break;
549 default:
550 $type = $this->lng->txt($item["type"]);
551 break;
552 }
553
554 if (strcmp($type, "-" . $item["type"] . "-") == 0)
555 {
556 global $ilPluginAdmin;
557 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, "TestQuestionPool", "qst");
558 foreach ($pl_names as $pl_name)
559 {
560 $pl = ilPlugin::getPluginObject(IL_COMP_MODULE, "TestQuestionPool", "qst", $pl_name);
561 if (strcmp($pl->getQuestionType(), $item["type"]) == 0)
562 {
563 $type = $pl->getQuestionTypeTranslation();
564 }
565 }
566 }
567 $this->tpl->setVariable("QUESTION_TYPE", $type);
568 $this->tpl->parseCurrentBlock();
569 }
570
571 $this->tpl->setCurrentBlock("import_qpl");
572 if (is_file($xml_file))
573 {
574 // read file into a string
575 $fh = @fopen($xml_file, "r") or die("");
576 $xml = @fread($fh, filesize($xml_file));
577 @fclose($fh);
578 if (preg_match("/<ContentObject.*?MetaData.*?General.*?Title[^>]*?>([^<]*?)</", $xml, $matches))
579 {
580 $this->tpl->setVariable("VALUE_NEW_QUESTIONPOOL", $matches[1]);
581 }
582 }
583 $this->tpl->setVariable("TEXT_CREATE_NEW_QUESTIONPOOL", $this->lng->txt("qpl_import_create_new_qpl"));
584 $this->tpl->parseCurrentBlock();
585
586 $this->tpl->setCurrentBlock("adm_content");
587 $this->tpl->setVariable("TEXT_TYPE", $this->lng->txt("question_type"));
588 $this->tpl->setVariable("TEXT_TITLE", $this->lng->txt("question_title"));
589 $this->tpl->setVariable("FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt("qpl_import_verify_found_questions"));
590 if ($questions_only)
591 {
592 $this->tpl->setVariable("VERIFICATION_HEADING", $this->lng->txt("import_questions_into_qpl"));
593 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
594 }
595 else
596 {
597 $this->tpl->setVariable("VERIFICATION_HEADING", $this->lng->txt("import_qpl"));
598
599 $this->ctrl->setParameter($this, "new_type", $this->type);
600 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
601
602 //$this->tpl->setVariable("FORMACTION", $this->getFormAction("save","adm_object.php?cmd=gateway&ref_id=".$_GET["ref_id"]."&new_type=".$this->type));
603 }
604 $this->tpl->setVariable("ARROW", ilUtil::getImagePath("arrow_downright.svg"));
605 $this->tpl->setVariable("VALUE_IMPORT", $this->lng->txt("import"));
606 $this->tpl->setVariable("VALUE_CANCEL", $this->lng->txt("cancel"));
607 $value_questions_only = 0;
608 if ($questions_only) $value_questions_only = 1;
609 $this->tpl->setVariable("VALUE_QUESTIONS_ONLY", $value_questions_only);
610
611 $this->tpl->parseCurrentBlock();
612
613 return true;
614 }
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['ct_recipient']
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 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, 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 39 of file class.ilObjQuestionPoolGUI.php.

Referenced by importVerifiedFileObject().


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