ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilObjQuestionPoolGUI Class Reference

Class ilObjQuestionPoolGUI. More...

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

Public Member Functions

 __construct ()
 Constructor 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 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 ()
 
 pasteObject ()
 paste questios from the clipboard into the question pool More...
 
 copyObject ()
 copy one or more question objects to the clipboard More...
 
 moveObject ()
 mark one or more question objects for moving More...
 
 createExportExcel ()
 
editQuestionForTestObject ()
 edit question More...
 
 addLocatorItems ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 getTabs ()
 adds tabs to tab gui object More...
 
 infoScreenObject ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 infoScreenForward ()
 show information screen More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page 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 ()
 
 renoveImportFailsObject ()
 
 fetchAuthoringQuestionIdParamater ()
 
 initImportForm ($a_new_type)
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 form for new questionpool object import More...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs 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...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Private Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjQuestionPoolGUI::__construct ( )

Constructor public.

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

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

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

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 public

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

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

1667  {
1668  global $ilAccess, $ilErr, $lng;
1669 
1670  if ($ilAccess->checkAccess("write", "", $a_target) || $ilAccess->checkAccess('read', '', $a_target))
1671  {
1672  $_GET['cmdClass'] = 'ilObjQuestionPoolGUI';
1673  $_GET['cmd'] = 'questions';
1674  $_GET['baseClass'] = 'ilRepositoryGUI';
1675  $_GET["ref_id"] = $a_target;
1676  include_once("ilias.php");
1677  exit;
1678  }
1679  else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
1680  {
1681  ilUtil::sendInfo(sprintf($lng->txt("msg_no_perm_read_item"),
1682  ilObject::_lookupTitle(ilObject::_lookupObjId($a_target))), true);
1684  }
1685  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
1686  }
global $ilErr
Definition: raiseError.php:16
$_GET["client_id"]
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _lookupObjId($a_id)
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjQuestionPoolGUI::addLocatorItems ( )

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

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

1368  {
1369  global $ilLocator;
1370  switch ($this->ctrl->getCmd())
1371  {
1372  case "create":
1373  case "importFile":
1374  case "cancel":
1375  break;
1376  default:
1377  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $_GET["ref_id"]);
1378  break;
1379  }
1380  if ($_GET["q_id"] > 0)
1381  {
1382  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1383  $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
1384  if($q_gui->object instanceof assQuestion)
1385  {
1386  $q_gui->object->setObjId($this->object->getId());
1387  $title = $q_gui->object->getTitle();
1388  if(!$title)
1389  {
1390  $title = $this->lng->txt('new').': '.assQuestion::_getQuestionTypeName($q_gui->object->getQuestionType());
1391  }
1392  $ilLocator->addItem($title, $this->ctrl->getLinkTargetByClass(get_class($q_gui), "editQuestion"));
1393  }
1394  else
1395  {
1396  // Workaround for context issues: If no object was found, redirect without q_id parameter
1397  $this->ctrl->setParameter($this, 'q_id', '');
1398  $this->ctrl->redirect($this);
1399  }
1400  }
1401  }
$_GET["client_id"]
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.
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ addSettingsSubTabs()

ilObjQuestionPoolGUI::addSettingsSubTabs ( ilTabsGUI  $tabs)
private

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

References ilTabsGUI\addSubTabTarget().

Referenced by getTabs().

1610  {
1611  $tabs->addSubTabTarget(
1612  'qpl_settings_subtab_general',
1613  $this->ctrl->getLinkTargetByClass('ilObjQuestionPoolSettingsGeneralGUI'),
1614  '', 'ilObjQuestionPoolSettingsGeneralGUI'
1615  );
1616 
1617  $tabs->addSubTabTarget(
1618  'qpl_settings_subtab_taxonomies',
1619  $this->ctrl->getLinkTargetByClass('ilObjTaxonomyGUI', 'editAOTaxonomySettings'),
1620  '', 'ilObjTaxonomyGUI'
1621  );
1622  }
addSubTabTarget($a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
DEPRECATED.
+ 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 public

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

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

877  {
878  // always send a message
879  ilUtil::sendSuccess($this->lng->txt("object_added"),true);
880 
881  ilUtil::redirect("ilias.php?ref_id=".$a_new_object->getRefId().
882  "&baseClass=ilObjQuestionPoolGUI");
883  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getRefId()
get reference id public
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ buildCreateQuestionForm()

ilObjQuestionPoolGUI::buildCreateQuestionForm ( )
private

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

References $_POST, $d, ilObjectGUI\$data, $ilUser, $options, $si, assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT, assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT, ilRadioGroupInputGUI\addOption(), array, ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled(), object, ilSelectInputGUI\setOptions(), and ilUtil\stripSlashes().

Referenced by createQuestionFormObject().

1141  {
1142  global $ilUser;
1143 
1144  // form
1145 
1146  require_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1147  $form = new ilPropertyFormGUI();
1148  $form->setTitle($this->lng->txt('ass_create_question'));
1149  $form->setFormAction($this->ctrl->getFormAction($this));
1150 
1151  // question type
1152 
1153  $options = array();
1154  foreach( $this->object->getQuestionTypes(false, true) as $translation => $data )
1155  {
1156  $options[$data['type_tag']] = $translation;
1157  }
1158 
1159  require_once("Services/Form/classes/class.ilSelectInputGUI.php");
1160  $si = new ilSelectInputGUI($this->lng->txt('question_type'), 'sel_question_types');
1161  $si->setOptions($options);
1162  //$si->setValue($ilUser->getPref("tst_lastquestiontype"));
1163 
1164  $form->addItem($si);
1165 
1166  // content editing mode
1167 
1169  {
1170  $ri = new ilRadioGroupInputGUI($this->lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
1171 
1172  $ri->addOption(new ilRadioOption(
1173  $this->lng->txt('tst_add_quest_cont_edit_mode_default'),
1175  ));
1176 
1177  $ri->addOption(new ilRadioOption(
1178  $this->lng->txt('tst_add_quest_cont_edit_mode_page_object'),
1180  ));
1181 
1183 
1184  $form->addItem($ri, true);
1185  }
1186  else
1187  {
1188  $hi = new ilHiddenInputGUI("question_content_editing_type");
1190  $form->addItem($hi, true);
1191  }
1192 
1193  // commands
1194 
1195  $form->addCommandButton('createQuestion', $this->lng->txt('create'));
1196  $form->addCommandButton('questions', $this->lng->txt('cancel'));
1197 
1198  return $form;
1199  }
This class represents an option in a radio group.
This class represents a selection list property in a property form.
This class represents a property form user interface.
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.
This class represents a property in a property form.
addOption($a_option)
Add Option.
if(!is_array($argv)) $options
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
const ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT
constant for additional content editing mode "default"
Create new PHPExcel object
obj_idprivate
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildQuestionBrowserTableGUI()

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

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

References $_GET, ilObjectGUI\$data, $ilDB, ilObjectGUI\$lng, array, object, ilTree\readRootId(), and ilQuestionBrowserTableGUI\setEditable().

Referenced by executeCommand(), and questionsObject().

1697  {
1698  global $rbacsystem, $ilDB, $lng, $ilPluginAdmin;
1699 
1700  include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
1701  $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', (($rbacsystem->checkAccess('write', $_GET['ref_id']) ? true : false)), false, $taxIds);
1702  $table_gui->setEditable($rbacsystem->checkAccess('write', $_GET['ref_id']));
1703 
1704  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
1705  $questionList = new ilAssQuestionList($ilDB, $lng, $ilPluginAdmin);
1706  $questionList->setParentObjId($this->object->getId());
1707 
1708  foreach ($table_gui->getFilterItems() as $item)
1709  {
1710  if( substr($item->getPostVar(), 0, strlen('tax_')) == 'tax_' )
1711  {
1712  $v = $item->getValue();
1713 
1714  if( is_array($v) && count($v) && !(int)$v[0] )
1715  {
1716  continue;
1717  }
1718 
1719  $taxId = substr($item->getPostVar(), strlen('tax_'));
1720 
1721  $questionList->addTaxonomyFilter(
1722  $taxId, $item->getValue(), $this->object->getId(), $this->object->getType()
1723  );
1724  }
1725  elseif( $item->getValue() !== false )
1726  {
1727  $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
1728  }
1729  }
1730 
1731  if( $this->object->isNavTaxonomyActive() && (int)$_GET['tax_node'] )
1732  {
1733  require_once 'Services/Taxonomy/classes/class.ilTaxonomyTree.php';
1734  $taxTree = new ilTaxonomyTree($this->object->getNavTaxonomyId());
1735  $rootNodeId = $taxTree->readRootId();
1736 
1737  if( (int)$_GET['tax_node'] != $rootNodeId )
1738  {
1739  $questionList->addTaxonomyFilter(
1740  $this->object->getNavTaxonomyId(), array((int)$_GET['tax_node']),
1741  $this->object->getId(), $this->object->getType()
1742  );
1743  }
1744  }
1745 
1746  $questionList->load();
1747  $data = $questionList->getQuestionDataArray();
1748 
1749  $table_gui->setData($data);
1750 
1751  return $table_gui;
1752  }
$_GET["client_id"]
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
global $ilDB
readRootId()
read root id from database
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancelDeleteQuestionsObject()

ilObjQuestionPoolGUI::cancelDeleteQuestionsObject ( )

Cancel question deletion.

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

937  {
938  $this->ctrl->redirect($this, "questions");
939  }

◆ cancelImportObject()

ilObjQuestionPoolGUI::cancelImportObject ( )

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

References $_POST.

742  {
743  if ($_POST["questions_only"] == 1)
744  {
745  $this->ctrl->redirect($this, "questions");
746  }
747  else
748  {
749  $this->ctrl->redirect($this, "cancel");
750  }
751  }
$_POST["username"]

◆ confirmDeleteQuestionsObject()

ilObjQuestionPoolGUI::confirmDeleteQuestionsObject ( )

delete questions

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

References $_POST, and ilUtil\sendSuccess().

919  {
920  // delete questions after confirmation
921  foreach ($_POST["q_id"] as $key => $value)
922  {
923  $this->object->deleteQuestion($value);
924  $this->object->cleanupClipboard($value);
925  }
926  if (count($_POST["q_id"])) ilUtil::sendSuccess($this->lng->txt("qpl_questions_deleted"), true);
927 
928  $this->ctrl->setParameter($this, 'q_id', '');
929 
930  $this->ctrl->redirect($this, "questions");
931  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ copyObject()

ilObjQuestionPoolGUI::copyObject ( )

copy one or more question objects to the clipboard

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

References $_POST, and ilUtil\sendInfo().

1273  {
1274  if (isset($_POST["q_id"]) && is_array($_POST["q_id"]) && count($_POST["q_id"]) > 0)
1275  {
1276  foreach ($_POST["q_id"] as $key => $value)
1277  {
1278  $this->object->copyToClipboard($value);
1279  }
1280  ilUtil::sendInfo($this->lng->txt("qpl_copy_insert_clipboard"), true);
1281  }
1282  else
1283  {
1284  ilUtil::sendInfo($this->lng->txt("qpl_copy_select_none"), true);
1285  }
1286  $this->ctrl->redirect($this, "questions");
1287  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ createExportExcel()

ilObjQuestionPoolGUI::createExportExcel ( )

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

References $_GET.

1310  {
1311  global $rbacsystem;
1312  if ($rbacsystem->checkAccess("write", $_GET['ref_id']))
1313  {
1314  include_once("./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
1315  $question_ids =& $this->object->getAllQuestionIds();
1316  $qpl_exp = new ilQuestionpoolExport($this->object, 'xls', $question_ids);
1317  $qpl_exp->buildExportFile();
1318  $this->ctrl->redirectByClass("ilquestionpoolexportgui", "");
1319  }
1320  }
$_GET["client_id"]
Export class for questionpools.

◆ createQuestionFormObject()

ilObjQuestionPoolGUI::createQuestionFormObject ( )
private

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

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

1120  {
1121  global $DIC; /* @var \ILIAS\DI\Container $DIC */
1122  $ilHelp = $DIC['ilHelp']; /* @var ilHelpGUI $ilHelp */
1123 
1124  $ilHelp->setScreenId('assQuestions');
1125 
1127  {
1128  $ilHelp->setSubScreenId('createQuestion_editMode');
1129  }
1130  else
1131  {
1132  $ilHelp->setSubScreenId('createQuestion');
1133  }
1134 
1135  $form = $this->buildCreateQuestionForm();
1136 
1137  $this->tpl->setContent( $this->ctrl->getHTML($form) );
1138  }
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not ...
global $DIC
+ Here is the call graph for this function:

◆ createQuestionForTestObject()

& ilObjQuestionPoolGUI::createQuestionForTestObject ( )

create new question

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

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

837  {
838  if( !$_REQUEST['q_id'] )
839  {
840  require_once 'Modules/Test/classes/class.ilObjAssessmentFolder.php';
842  {
843  $addContEditMode = $_REQUEST['add_quest_cont_edit_mode'];
844  }
845  else
846  {
848  }
849 
850  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
851  $q_gui =& assQuestionGUI::_getQuestionGUI($_GET["sel_question_types"]);
852  $q_gui->object->setObjId($this->object->getId());
853  $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
854  $q_gui->object->createNewQuestion();
855 
856  $class = get_class($q_gui);
857  $qId = $q_gui->object->getId();
858  }
859  else
860  {
861  $class = $_GET["sel_question_types"] . 'gui';
862  $qId = $_REQUEST['q_id'];
863  }
864 
865  $this->ctrl->setParameterByClass($class, "q_id", $qId);
866  $this->ctrl->setParameterByClass($class, "sel_question_types", $_REQUEST["sel_question_types"]);
867  $this->ctrl->setParameterByClass($class, "prev_qid", $_REQUEST["prev_qid"]);
868 
869  $this->ctrl->redirectByClass($class, "editQuestion");
870  }
$_GET["client_id"]
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
const ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT
constant for additional content editing mode "default"
Create new PHPExcel object
obj_idprivate
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not ...
+ Here is the call graph for this function:

◆ createQuestionObject()

& ilObjQuestionPoolGUI::createQuestionObject ( )

create new question

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

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

812  {
814  {
815  $addContEditMode = $_POST['add_quest_cont_edit_mode'];
816  }
817  else
818  {
820  }
821 
822  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
823  $q_gui =& assQuestionGUI::_getQuestionGUI($_POST["sel_question_types"]);
824  $this->object->addQuestionChangeListeners($q_gui->object);
825  $q_gui->object->setObjId($this->object->getId());
826  $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
827  $q_gui->object->createNewQuestion();
828  $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
829  $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $_POST["sel_question_types"]);
830  $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
831  }
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
const ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT
constant for additional content editing mode "default"
Create new PHPExcel object
obj_idprivate
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not ...
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteQuestionsObject()

ilObjQuestionPoolGUI::deleteQuestionsObject ( )

delete questions confirmation screen

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

References $_GET, $_POST, ilUtil\sendInfo(), ilUtil\sendQuestion(), and ilQuestionBrowserTableGUI\setEditable().

896  {
897  global $rbacsystem;
898 
899  if (count($_POST["q_id"]) < 1)
900  {
901  ilUtil::sendInfo($this->lng->txt("qpl_delete_select_none"), true);
902  $this->ctrl->redirect($this, "questions");
903  }
904 
905  ilUtil::sendQuestion($this->lng->txt("qpl_confirm_delete_questions"));
906  $deleteable_questions =& $this->object->getDeleteableQuestionDetails($_POST["q_id"]);
907  include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
908  $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', (($rbacsystem->checkAccess('write', $_GET['ref_id']) ? true : false)), true);
909  $table_gui->setEditable($rbacsystem->checkAccess('write', $_GET['ref_id']));
910  $table_gui->setData($deleteable_questions);
911  $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
912  }
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ download_paragraphObject()

ilObjQuestionPoolGUI::download_paragraphObject ( )

download source code paragraph

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

References $_GET, and exit.

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

◆ downloadFileObject()

ilObjQuestionPoolGUI::downloadFileObject ( )

download file

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

References $_GET, $file, and exit.

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

◆ editQuestionForTestObject()

& ilObjQuestionPoolGUI::editQuestionForTestObject ( )

edit question

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

References $_GET, and assQuestionGUI\_getQuestionGUI().

1326  {
1327  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1328  $q_gui =& assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
1329  $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
1330  }
$_GET["client_id"]
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
+ Here is the call graph for this function:

◆ executeCommand()

ilObjQuestionPoolGUI::executeCommand ( )

execute command

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

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

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

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(), $this->fetchAuthoringQuestionIdParamater());
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/Content/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";
181  $q_gui->setRenderPurpose(assQuestionGUI::RENDER_PURPOSE_PREVIEW);
182  $q_gui->setQuestionTabs();
183  $q_gui->outAdditionalOutput();
184  $q_gui->object->setObjId($this->object->getId());
185 
186  $q_gui->setTargetGuiClass(null);
187  $q_gui->setQuestionActionCmd(null);
188 
189  $question = $q_gui->object;
190  $this->ctrl->saveParameter($this, "q_id");
191  include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
192  $this->lng->loadLanguageModule("content");
193  $this->ctrl->setReturnByClass("ilAssQuestionPageGUI", "view");
194  $this->ctrl->setReturn($this, "questions");
195  $page_gui = new ilAssQuestionPageGUI($_GET["q_id"]);
196  $page_gui->obj->addUpdateListener(
197  $question,
198  'updateTimestamp'
199  );
200  $page_gui->setEditPreview(true);
201  $page_gui->setEnabledTabs(false);
202  if (strlen($this->ctrl->getCmd()) == 0 && !isset($_POST["editImagemapForward_x"])) // workaround for page edit imagemaps, keep in mind
203  {
204  $this->ctrl->setCmdClass(get_class($page_gui));
205  $this->ctrl->setCmd("preview");
206  }
207  $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
208  $page_gui->setTemplateTargetVar("ADM_CONTENT");
209  $page_gui->setOutputMode("edit");
210  $page_gui->setHeader($question->getTitle());
211  $page_gui->setPresentationTitle($question->getTitle());
212  $ret = $this->ctrl->forwardCommand($page_gui);
213  $tpl->setContent($ret);
214  break;
215 
216  case 'ilpermissiongui':
217  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
218  $perm_gui = new ilPermissionGUI($this);
219  $ret = $this->ctrl->forwardCommand($perm_gui);
220  break;
221 
222  case 'ilobjectcopygui':
223  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
224  $cp = new ilObjectCopyGUI($this);
225  $cp->setType('qpl');
226  $this->ctrl->forwardCommand($cp);
227  break;
228 
229  case "ilquestionpoolexportgui":
230  require_once 'Modules/TestQuestionPool/classes/class.ilQuestionPoolExportGUI.php';
231  $exp_gui = new ilQuestionPoolExportGUI($this);
232  $exp_gui->addFormat('xml', $this->lng->txt('qpl_export_xml'));
233  $exp_gui->addFormat('xls', $this->lng->txt('qpl_export_excel'), $this, 'createExportExcel');
234  $ret = $this->ctrl->forwardCommand($exp_gui);
235  break;
236 
237  case "ilinfoscreengui":
238  $this->infoScreenForward();
239  break;
240 
241  case 'ilassquestionhintsgui':
242 
243  // set return target
244  $this->ctrl->setReturn($this, "questions");
245 
246  // set context tabs
247  require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
248  $questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $this->fetchAuthoringQuestionIdParamater());
249  $questionGUI->object->setObjId($this->object->getId());
250  $questionGUI->setQuestionTabs();
251  global $ilHelp;
252  $ilHelp->setScreenIdComponent("qpl");
253 
254  // forward to ilAssQuestionHintsGUI
255  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
256  $gui = new ilAssQuestionHintsGUI($questionGUI);
257 
258  global $DIC; /* @var ILIAS\DI\Container $DIC */
259 
260  $gui->setEditingEnabled(
261  $DIC->access()->checkAccess('write', '', $this->object->getRefId())
262  );
263 
264  $ilCtrl->forwardCommand($gui);
265 
266  break;
267 
268  case 'illocalunitconfigurationgui':
269  if(!$ilAccess->checkAccess('write','',$this->object->getRefId()))
270  {
271  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
272  }
273 
274  require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
275  $questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $this->fetchAuthoringQuestionIdParamater());
276  $questionGUI->object->setObjId($this->object->getId());
277  $questionGUI->setQuestionTabs();
278 
279  $this->ctrl->setReturn($this, 'questions');
280 
281  require_once 'Modules/TestQuestionPool/classes/class.ilLocalUnitConfigurationGUI.php';
282  require_once 'Modules/TestQuestionPool/classes/class.ilUnitConfigurationRepository.php';
283  $gui = new ilLocalUnitConfigurationGUI(
284  new ilUnitConfigurationRepository((int)$_GET['q_id'])
285  );
286  $ilCtrl->forwardCommand($gui);
287  break;
288 
289  case 'ilassquestionfeedbackeditinggui':
290 
291  // set return target
292  $this->ctrl->setReturn($this, "questions");
293 
294  // set context tabs
295  require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
296  $questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $this->fetchAuthoringQuestionIdParamater());
297  $questionGUI->object->setObjId($this->object->getId());
298  $questionGUI->setQuestionTabs();
299  global $ilHelp;
300  $ilHelp->setScreenIdComponent("qpl");
301 
302  // forward to ilAssQuestionFeedbackGUI
303  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
304  $gui = new ilAssQuestionFeedbackEditingGUI($questionGUI, $ilCtrl, $ilAccess, $tpl, $ilTabs, $lng);
305  $ilCtrl->forwardCommand($gui);
306 
307  break;
308 
309  case 'ilobjquestionpoolsettingsgeneralgui':
310  require_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPoolSettingsGeneralGUI.php';
311  $gui = new ilObjQuestionPoolSettingsGeneralGUI($ilCtrl, $ilAccess, $lng, $tpl, $ilTabs, $this);
312  $this->ctrl->forwardCommand($gui);
313  break;
314 
315  case "ilobjtaxonomygui":
316 
317  require_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPoolTaxonomyEditingCommandForwarder.php';
319  $this->object, $ilDB, $ilPluginAdmin, $ilCtrl, $ilTabs, $lng
320  );
321 
322  $forwarder->forward();
323 
324  break;
325 
326  case 'ilquestionpoolskilladministrationgui':
327 
328  require_once 'Modules/TestQuestionPool/classes/class.ilQuestionPoolSkillAdministrationGUI.php';
330  $ilias, $ilCtrl, $ilAccess, $ilTabs, $tpl, $lng, $ilDB, $ilPluginAdmin, $this->object, $this->ref_id
331  );
332 
333  $this->ctrl->forwardCommand($gui);
334 
335  break;
336 
337  case 'ilquestionbrowsertablegui':
338  $this->ctrl->forwardCommand($this->buildQuestionBrowserTableGUI($taxIds = array())); // no tax ids required
339  break;
340 
341  case "ilobjquestionpoolgui":
342  case "":
343 
344  if( $cmd == 'questions' )
345  {
346  $this->ctrl->setParameter($this, 'q_id', '');
347  }
348 
349  $cmd.= "Object";
350  $ret = $this->$cmd();
351  break;
352 
353  default:
354  $this->ctrl->setReturn($this, "questions");
355  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
357  $q_gui->setEditContext(assQuestionGUI::EDIT_CONTEXT_AUTHORING);
358  $q_gui->object->setObjId($this->object->getId());
359  if($this->object->getType() == 'qpl')
360  {
361  $q_gui->setTaxonomyIds($this->object->getTaxonomyIds());
362  $this->object->addQuestionChangeListeners($q_gui->object);
363  }
364  $q_gui->setQuestionTabs();
365  global $ilHelp;
366  $ilHelp->setScreenIdComponent("qpl");
367  $ret = $this->ctrl->forwardCommand($q_gui);
368  break;
369  }
370 
371  if ( !(strtolower($_GET["baseClass"]) == "iladministrationgui"
372  || strtolower($_GET['baseClass']) == 'ilrepositorygui')
373  && $this->getCreationMode() != true)
374  {
375  $this->tpl->show();
376  }
377  }
global $ilErr
Definition: raiseError.php:16
Class ilObjectMetaDataGUI.
Export User Interface Class.
GUI class for the workflow of copying objects.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
Class ilUnitConfigurationRepository.
Question page GUI class.
global $ilCtrl
Definition: ilias.php:18
prepareOutput($a_show_subobjects=true)
prepare output
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
$ilUser
Definition: imgupload.php:18
static getSyntaxStylePath()
get syntax style path
Create styles array
The data for the language used.
static getContentStylePath($a_style_id)
get content style path
Create new PHPExcel object
obj_idprivate
global $ilDB
$ret
Definition: parser.php:6
getCreationMode()
get creation mode
Class ilLocalUnitConfigurationGUI.
infoScreenForward()
show information screen
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
global $DIC
$_POST["username"]
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ 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 383 of file class.ilObjQuestionPoolGUI.php.

References $DIC.

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

◆ exportQuestionObject()

ilObjQuestionPoolGUI::exportQuestionObject ( )

export question

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

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

945  {
946  // export button was pressed
947  if (count($_POST["q_id"]) > 0)
948  {
949  include_once("./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
950  $qpl_exp = new ilQuestionpoolExport($this->object, "xml", $_POST["q_id"]);
951  $export_file = $qpl_exp->buildExportFile();
952  $filename = $export_file;
953  $filename = preg_replace("/.*\//", "", $filename);
954  include_once "./Services/Utilities/classes/class.ilUtil.php";
955  ilUtil::deliverFile($export_file, $filename);
956  exit();
957  }
958  else
959  {
960  ilUtil::sendInfo($this->lng->txt("qpl_export_select_none"), true);
961  }
962  $this->ctrl->redirect($this, "questions");
963  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Export class for questionpools.
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
$_POST["username"]
+ Here is the call graph for this function:

◆ fetchAuthoringQuestionIdParamater()

ilObjQuestionPoolGUI::fetchAuthoringQuestionIdParamater ( )
protected
Returns
mixed

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

References $_GET, and object.

Referenced by executeCommand().

1108  {
1109  $qId = (int)$_GET['q_id'];
1110 
1111  if( $this->object->checkQuestionParent($qId) )
1112  {
1113  return $qId;
1114  }
1115 
1116  throw new ilTestQuestionPoolException('question id does not relate to parent object!');
1117  }
$_GET["client_id"]
Create new PHPExcel object
obj_idprivate
+ Here is the caller graph for this function:

◆ filterObject()

ilObjQuestionPoolGUI::filterObject ( )

set question list filter

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

References questionsObject().

416  {
417  $this->questionsObject();
418  }
questionsObject()
list questions of question pool
+ Here is the call graph for this function:

◆ filterQuestionBrowserObject()

ilObjQuestionPoolGUI::filterQuestionBrowserObject ( )

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

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

966  {
967  require_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
968  $taxIds = ilObjTaxonomy::getUsageOfObject($this->object->getId());
969 
970  include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
971  $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', false, false, $taxIds);
972  $table_gui->resetOffset();
973  $table_gui->writeFilterToSession();
974  $this->questionsObject();
975  }
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
questionsObject()
list questions of question pool
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ fullscreenObject()

ilObjQuestionPoolGUI::fullscreenObject ( )

show fullscreen view

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

References $_GET.

405  {
406  include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
407  $page_gui = new ilAssQuestionPageGUI($_GET["pg_id"]);
408  $page_gui->showMediaFullscreen();
409  }
$_GET["client_id"]
Question page GUI class.

◆ getImportQuestionsForm()

ilObjQuestionPoolGUI::getImportQuestionsForm ( )
protected
Returns
ilPropertyFormGUI

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

References $file.

Referenced by importQuestionsObject(), and uploadObject().

792  {
793  require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
794  $form = new ilPropertyFormGUI();
795  $form->setTitle($this->lng->txt('import_question'));
796  $form->setFormAction($this->ctrl->getFormAction($this, 'upload'));
797 
798  $file = new ilFileInputGUI($this->lng->txt('select_file'), 'xmldoc');
799  $file->setRequired(true);
800  $form->addItem($file);
801 
802  $form->addCommandButton('upload', $this->lng->txt('upload'));
803  $form->addCommandButton('questions', $this->lng->txt('cancel'));
804 
805  return $form;
806  }
This class represents a property form user interface.
This class represents a file property in a property form.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ Here is the caller graph for this function:

◆ getTabs()

ilObjQuestionPoolGUI::getTabs ( )

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

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

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

1446  {
1447  global $ilAccess, $ilHelp;
1448 
1449  $currentUserHasWriteAccess = $ilAccess->checkAccess("write", "", $this->object->getRefId());
1450 
1451  $ilHelp->setScreenIdComponent("qpl");
1452 
1453  $next_class = strtolower($this->ctrl->getNextClass());
1454  switch ($next_class)
1455  {
1456  case "":
1457  case "ilpermissiongui":
1458  case "ilobjectmetadatagui":
1459  case "ilquestionpoolexportgui":
1460  case "ilquestionpoolskilladministrationgui":
1461  break;
1462 
1463  case 'ilobjtaxonomygui':
1464  case 'ilobjquestionpoolsettingsgeneralgui':
1465 
1466  if( $currentUserHasWriteAccess )
1467  {
1468  $this->addSettingsSubTabs($this->tabs_gui);
1469  }
1470 
1471  break;
1472 
1473  default:
1474  return;
1475  break;
1476  }
1477  // questions
1478  $force_active = false;
1479  $commands = $_POST["cmd"];
1480  if (is_array($commands))
1481  {
1482  foreach ($commands as $key => $value)
1483  {
1484  if (preg_match("/^delete_.*/", $key, $matches) ||
1485  preg_match("/^addSelectGap_.*/", $key, $matches) ||
1486  preg_match("/^addTextGap_.*/", $key, $matches) ||
1487  preg_match("/^deleteImage_.*/", $key, $matches) ||
1488  preg_match("/^upload_.*/", $key, $matches) ||
1489  preg_match("/^addSuggestedSolution_.*/", $key, $matches)
1490  )
1491  {
1492  $force_active = true;
1493  }
1494  }
1495  }
1496  if (array_key_exists("imagemap_x", $_POST))
1497  {
1498  $force_active = true;
1499  }
1500  if (!$force_active)
1501  {
1502  $force_active = ((strtolower($this->ctrl->getCmdClass()) == strtolower(get_class($this)) || strlen($this->ctrl->getCmdClass()) == 0) &&
1503  $this->ctrl->getCmd() == "")
1504  ? true
1505  : false;
1506  }
1507  $this->tabs_gui->addTarget("assQuestions",
1508  $this->ctrl->getLinkTarget($this, "questions"),
1509  array("questions", "filter", "resetFilter", "createQuestion",
1510  "importQuestions", "deleteQuestions", "filterQuestionBrowser",
1511  "view", "preview", "editQuestion", "exec_pg",
1512  "addItem", "upload", "save", "cancel", "addSuggestedSolution",
1513  "cancelExplorer", "linkChilds", "removeSuggestedSolution",
1514  "add", "addYesNo", "addTrueFalse", "createGaps", "saveEdit",
1515  "setMediaMode", "uploadingImage", "uploadingImagemap", "addArea",
1516  "deletearea", "saveShape", "back", "addPair", "uploadingJavaapplet",
1517  "addParameter", "assessment", "addGIT", "addST", "addPG", "delete",
1518  "toggleGraphicalAnswers", "deleteAnswer", "deleteImage", "removeJavaapplet"),
1519  "", "", $force_active);
1520 
1521  if ($ilAccess->checkAccess("read", "", $this->ref_id) || $ilAccess->checkAccess("visible", "", $this->ref_id))
1522  {
1523  $this->tabs_gui->addTarget("info_short",
1524  $this->ctrl->getLinkTarget($this, "infoScreen"),
1525  array("infoScreen", "showSummary"));
1526  }
1527 
1528  if ($ilAccess->checkAccess("write", "", $_GET['ref_id']))
1529  {
1530  // properties
1531  $this->tabs_gui->addTarget(
1532  'settings', $this->ctrl->getLinkTargetByClass('ilObjQuestionPoolSettingsGeneralGUI'),
1533  array(), array('ilObjQuestionPoolSettingsGeneralGUI', 'ilObjTaxonomyGUI')
1534  );
1535 
1536  // skill service
1537  if( $this->isSkillsTabRequired() )
1538  {
1539  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentsGUI.php';
1540 
1541  $link = $this->ctrl->getLinkTargetByClass(
1542  array('ilQuestionPoolSkillAdministrationGUI', 'ilAssQuestionSkillAssignmentsGUI'),
1544  );
1545 
1546  $this->tabs_gui->addTarget('qpl_tab_competences', $link, array(), array());
1547  }
1548  }
1549 
1550  // print view
1551  $this->tabs_gui->addTarget("print_view",
1552  $this->ctrl->getLinkTarget($this,'print'),
1553  array("print"),
1554  "", "");
1555 
1556  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1557  {
1558  // meta data
1559  include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
1560  $mdgui = new ilObjectMetaDataGUI($this->object);
1561  $mdtab = $mdgui->getTab();
1562  if($mdtab)
1563  {
1564  $this->tabs_gui->addTarget("meta_data",
1565  $mdtab,
1566  "", "ilmdeditorgui");
1567  }
1568 
1569 // $this->tabs_gui->addTarget("export",
1570 // $this->ctrl->getLinkTarget($this,'export'),
1571 // array("export", "createExportFile", "confirmDeleteExportFile", "downloadExportFile"),
1572 // "", "");
1573  }
1574 
1575  if( $currentUserHasWriteAccess )
1576  {
1577  $this->tabs_gui->addTarget("export",
1578  $this->ctrl->getLinkTargetByClass("ilquestionpoolexportgui", ""),
1579  "", "ilquestionpoolexportgui");
1580  }
1581 
1582  if ($ilAccess->checkAccess("edit_permission", "", $this->object->getRefId()))
1583  {
1584  $this->tabs_gui->addTarget("perm_settings",
1585  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
1586  }
1587  }
Class ilObjectMetaDataGUI.
$_GET["client_id"]
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
$_POST["username"]
+ Here is the call graph for this function:

◆ importFileObject()

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

form for new questionpool object import

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

References initImportForm(), and uploadQplObject().

1356  {
1357  $form = $this->initImportForm($_REQUEST["new_type"]);
1358  if($form->checkInput())
1359  {
1360  $this->uploadQplObject();
1361  }
1362 
1363  // display form to correct errors
1364  $this->tpl->setContent($form->getHTML());
1365  }
uploadQplObject($questions_only=false)
imports question(s) into the questionpool
+ 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 778 of file class.ilObjQuestionPoolGUI.php.

References getImportQuestionsForm().

Referenced by uploadObject().

779  {
780  if(!$form instanceof ilPropertyFormGUI)
781  {
782  $form = $this->getImportQuestionsForm();
783  }
784 
785  $this->tpl->setContent($form->getHtml());
786  }
This class represents a property form user interface.
+ 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 656 of file class.ilObjQuestionPoolGUI.php.

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

657  {
658  if ($_POST["questions_only"] == 1)
659  {
660  $newObj =& $this->object;
661  }
662  else
663  {
664  include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
665  // create new questionpool object
666  $newObj = new ilObjQuestionPool(0, true);
667  // set type of questionpool object
668  $newObj->setType($_GET["new_type"]);
669  // set title of questionpool object to "dummy"
670  $newObj->setTitle("dummy");
671  // set description of questionpool object
672  $newObj->setDescription("questionpool import");
673  // create the questionpool class in the ILIAS database (object_data table)
674  $newObj->create(true);
675  // create a reference for the questionpool object in the ILIAS database (object_reference table)
676  $newObj->createReference();
677  // put the questionpool object in the administration tree
678  $newObj->putInTree($_GET["ref_id"]);
679  // get default permissions and set the permissions for the questionpool object
680  $newObj->setPermissions($_GET["ref_id"]);
681  }
682 
683  if (is_file($_SESSION["qpl_import_dir"].'/'.$_SESSION["qpl_import_subdir"]."/manifest.xml"))
684  {
685  $_SESSION["qpl_import_idents"] = $_POST["ident"];
686 
687  $fileName = $_SESSION["qpl_import_subdir"].'.zip';
688  $fullPath = $_SESSION["qpl_import_dir"].'/'.$fileName;
689 
690  include_once("./Services/Export/classes/class.ilImport.php");
691  $imp = new ilImport((int) $_GET["ref_id"]);
692  $map = $imp->getMapping();
693  $map->addMapping("Modules/TestQuestionPool", "qpl", "new_id", $newObj->getId());
694  $imp->importObject($newObj, $fullPath, $fileName, "qpl", "Modules/TestQuestionPool", true);
695  }
696  else
697  {
698  // start parsing of QTI files
699  include_once "./Services/QTI/classes/class.ilQTIParser.php";
700  $qtiParser = new ilQTIParser($_SESSION["qpl_import_qti_file"], IL_MO_PARSE_QTI, $newObj->getId(), $_POST["ident"]);
701  $result = $qtiParser->startParsing();
702 
703  // import page data
704  if (strlen($_SESSION["qpl_import_xml_file"]))
705  {
706  include_once ("./Modules/LearningModule/classes/class.ilContObjParser.php");
707  $contParser = new ilContObjParser($newObj, $_SESSION["qpl_import_xml_file"], $_SESSION["qpl_import_subdir"]);
708  $contParser->setQuestionMapping($qtiParser->getImportMapping());
709  $contParser->startParsing();
710 
711  // #20494
712  $newObj->fromXML($_SESSION["qpl_import_xml_file"]);
713  }
714 
715  // set another question pool name (if possible)
716  if( isset($_POST["qpl_new"]) && strlen($_POST["qpl_new"]) )
717  {
718  $newObj->setTitle($_POST["qpl_new"]);
719  }
720 
721  $newObj->update();
722  $newObj->saveToDb();
723  }
724 
725  // delete import directory
726  include_once "./Services/Utilities/classes/class.ilUtil.php";
728 
729  if ($_POST["questions_only"] == 1)
730  {
731  $this->ctrl->redirect($this, "questions");
732  }
733  else
734  {
735  ilUtil::sendSuccess($this->lng->txt("object_imported"),true);
736  ilUtil::redirect("ilias.php?ref_id=".$newObj->getRefId().
737  "&baseClass=ilObjQuestionPoolGUI");
738  }
739  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Content Object Parser.
$_SESSION["AccountId"]
$result
$_GET["client_id"]
Import class.
const IL_MO_PARSE_QTI
static _getImportDirectory()
get import directory of lm
static redirect($a_script)
http redirect to other script
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
$_POST["username"]
+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjQuestionPoolGUI::infoScreenForward ( )

show information screen

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

References $ilErr, $info, and object.

Referenced by executeCommand(), and infoScreenObject().

1640  {
1641  global $ilErr, $ilAccess;
1642 
1643  if(!$ilAccess->checkAccess("visible", "", $this->ref_id))
1644  {
1645  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"));
1646  }
1647 
1648  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1649  $info = new ilInfoScreenGUI($this);
1650  $info->enablePrivateNotes();
1651 
1652  // standard meta data
1653  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1654 
1655  $this->ctrl->forwardCommand($info);
1656  }
global $ilErr
Definition: raiseError.php:16
Class ilInfoScreenGUI.
$info
Definition: example_052.php:80
Create new PHPExcel object
obj_idprivate
+ 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 1629 of file class.ilObjQuestionPoolGUI.php.

References infoScreenForward().

1630  {
1631  $this->ctrl->setCmd("showSummary");
1632  $this->ctrl->setCmdClass("ilinfoscreengui");
1633  $this->infoScreenForward();
1634  }
infoScreenForward()
show information screen
+ Here is the call graph for this function:

◆ initImportForm()

ilObjQuestionPoolGUI::initImportForm (   $a_new_type)
protected

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

References array, and ilFileInputGUI\setSuffixes().

Referenced by importFileObject().

1333  {
1334  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1335  $form = new ilPropertyFormGUI();
1336  $form->setTarget("_top");
1337  $form->setFormAction($this->ctrl->getFormAction($this));
1338  $form->setTitle($this->lng->txt("import_qpl"));
1339 
1340  include_once("./Services/Form/classes/class.ilFileInputGUI.php");
1341  $fi = new ilFileInputGUI($this->lng->txt("import_file"), "xmldoc");
1342  $fi->setSuffixes(array("zip"));
1343  $fi->setRequired(true);
1344  $form->addItem($fi);
1345 
1346  $form->addCommandButton("importFile", $this->lng->txt("import"));
1347  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
1348 
1349  return $form;
1350  }
This class represents a property form user interface.
This class represents a file property in a property form.
Create styles array
The data for the language used.
setSuffixes($a_suffixes)
Set Accepted Suffixes.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isSkillsTabRequired()

ilObjQuestionPoolGUI::isSkillsTabRequired ( )
private

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

References ilObjQuestionPool\isSkillManagementGloballyActivated(), and object.

Referenced by getTabs().

1590  {
1591  if( !($this->object instanceof ilObjQuestionPool) )
1592  {
1593  return false;
1594  }
1595 
1596  if( !$this->object->isSkillServiceEnabled() )
1597  {
1598  return false;
1599  }
1600 
1602  {
1603  return false;
1604  }
1605 
1606  return true;
1607  }
Create new PHPExcel object
obj_idprivate
+ 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 1292 of file class.ilObjQuestionPoolGUI.php.

References $_POST, and ilUtil\sendInfo().

1293  {
1294  if (isset($_POST["q_id"]) && is_array($_POST["q_id"]) && count($_POST["q_id"]) > 0)
1295  {
1296  foreach ($_POST["q_id"] as $key => $value)
1297  {
1298  $this->object->moveToClipboard($value);
1299  }
1300  ilUtil::sendInfo($this->lng->txt("qpl_move_insert_clipboard"), true);
1301  }
1302  else
1303  {
1304  ilUtil::sendInfo($this->lng->txt("qpl_move_select_none"), true);
1305  }
1306  $this->ctrl->redirect($this, "questions");
1307  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ pasteObject()

ilObjQuestionPoolGUI::pasteObject ( )

paste questios from the clipboard into the question pool

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

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

1250  {
1251  if (array_key_exists("qpl_clipboard", $_SESSION))
1252  {
1253  if($this->object->pasteFromClipboard())
1254  {
1255  ilUtil::sendSuccess($this->lng->txt("qpl_paste_success"), true);
1256  }
1257  else
1258  {
1259  ilUtil::sendFailure($this->lng->txt("qpl_paste_error"), true);
1260  }
1261  }
1262  else
1263  {
1264  ilUtil::sendInfo($this->lng->txt("qpl_paste_no_objects"), true);
1265  }
1266  $this->ctrl->redirect($this, "questions");
1267  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_SESSION["AccountId"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ questionObject()

ilObjQuestionPoolGUI::questionObject ( )

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

References $_GET.

886  {
887 //echo "<br>ilObjQuestionPoolGUI->questionObject()";
888  $type = $_GET["sel_question_types"];
889  $this->editQuestionForm($type);
890  }
$_GET["client_id"]

◆ questionsObject()

ilObjQuestionPoolGUI::questionsObject ( )

list questions of question pool

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

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

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

1002  {
1003  global $rbacsystem, $ilUser, $ilCtrl, $ilDB, $lng, $ilPluginAdmin;
1004 
1005  if(get_class($this->object) == "ilObjTest")
1006  {
1007  if ($_GET["calling_test"] > 0)
1008  {
1009  $ref_id = $_GET["calling_test"];
1010  $q_id = $_GET["q_id"];
1011 
1012  if ($_REQUEST['test_express_mode']) {
1013  if ($q_id)
1014  ilUtil::redirect("ilias.php?ref_id=".$ref_id."&q_id=".$q_id."&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
1015  else
1016  ilUtil::redirect("ilias.php?ref_id=".$ref_id."&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
1017  }
1018  else
1019  ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&ref_id=".$ref_id."&cmd=questions");
1020 
1021  }
1022  }
1023  else if(isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])
1024  {
1025  $ref_id = (int)$_GET['calling_consumer'];
1027  if($consumer instanceof ilQuestionEditingFormConsumer)
1028  {
1029  ilUtil::redirect($consumer->getQuestionEditingFormBackTarget($_GET['consumer_context']));
1030  }
1031  require_once 'Services/Link/classes/class.ilLink.php';
1033  }
1034 
1035  $this->object->purgeQuestions();
1036  // reset test_id SESSION variable
1037  $_SESSION["test_id"] = "";
1038 
1039  require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssQuestionSkillAssignmentImportFails.php';
1040  $qsaImportFails = new ilAssQuestionSkillAssignmentImportFails($this->object->getId());
1041  if( $qsaImportFails->failedImportsRegistered() )
1042  {
1043  require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
1044  $button = ilLinkButton::getInstance();
1045  $button->setUrl($this->ctrl->getLinkTarget($this, 'renoveImportFails'));
1046  $button->setCaption('ass_skl_import_fails_remove_btn');
1047 
1048  ilUtil::sendFailure($qsaImportFails->getFailedImportsMessage($this->lng).'<br />'.$button->render());
1049  }
1050 
1051  require_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
1052  $taxIds = ilObjTaxonomy::getUsageOfObject($this->object->getId());
1053 
1054  $table_gui = $this->buildQuestionBrowserTableGUI($taxIds);
1055  $table_gui->setPreventDoubleSubmission(false);
1056 
1057  if( $rbacsystem->checkAccess('write', $_GET['ref_id']) )
1058  {
1059  $toolbar = new ilToolbarGUI();
1060 
1061  require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
1062  $btn = ilLinkButton::getInstance();
1063  $btn->setCaption('ass_create_question');
1064  $btn->setUrl($this->ctrl->getLinkTarget($this, 'createQuestionForm'));
1065  $btn->setPrimary(true);
1066  $toolbar->addButtonInstance($btn);
1067 
1068  $this->tpl->setContent(
1069  $this->ctrl->getHTML($toolbar) . $this->ctrl->getHTML($table_gui)
1070  );
1071  }
1072  else
1073  {
1074  $this->tpl->setContent( $this->ctrl->getHTML($table_gui) );
1075  }
1076 
1077  if( $this->object->getShowTaxonomies() )
1078  {
1079  $this->lng->loadLanguageModule('tax');
1080 
1081  require_once 'Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php';
1082 
1083  foreach($taxIds as $taxId)
1084  {
1085  if( $taxId != $this->object->getNavTaxonomyId() )
1086  {
1087  continue;
1088  }
1089 
1090  $taxExp = new ilTaxonomyExplorerGUI(
1091  $this, 'showNavTaxonomy', $taxId, 'ilobjquestionpoolgui', 'questions'
1092  );
1093 
1094  if( !$taxExp->handleCommand() )
1095  {
1096  $this->tpl->setLeftContent($taxExp->getHTML()."&nbsp;");
1097  }
1098 
1099  break;
1100  }
1101  }
1102  }
$_SESSION["AccountId"]
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
$_GET["client_id"]
Taxonomy explorer GUI class.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Create new PHPExcel object
obj_idprivate
global $ilDB
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renoveImportFailsObject()

ilObjQuestionPoolGUI::renoveImportFailsObject ( )
protected

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

References ilAssQuestionSkillAssignmentImportFails\deleteRegisteredImportFails(), and object.

990  {
991  require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssQuestionSkillAssignmentImportFails.php';
992  $qsaImportFails = new ilAssQuestionSkillAssignmentImportFails($this->object->getId());
993  $qsaImportFails->deleteRegisteredImportFails();
994 
995  $this->ctrl->redirect($this, 'infoScreen');
996  }
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ resetFilterObject()

ilObjQuestionPoolGUI::resetFilterObject ( )

resets filter

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

References $_POST, and questionsObject().

424  {
425  $_POST["filter_text"] = "";
426  $_POST["sel_filter_type"] = "";
427  $this->questionsObject();
428  }
questionsObject()
list questions of question pool
$_POST["username"]
+ Here is the call graph for this function:

◆ resetQuestionBrowserObject()

ilObjQuestionPoolGUI::resetQuestionBrowserObject ( )

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

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

978  {
979  require_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
980  $taxIds = ilObjTaxonomy::getUsageOfObject($this->object->getId());
981 
982  include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
983  $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', false, false, $taxIds);
984  $table_gui->resetOffset();
985  $table_gui->resetFilter();
986  $this->questionsObject();
987  }
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
questionsObject()
list questions of question pool
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ setTitleAndDescription()

ilObjQuestionPoolGUI::setTitleAndDescription ( )

called by prepare output

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

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

1407  {
1408  parent::setTitleAndDescription();
1409  if ($_GET["q_id"] > 0)
1410  {
1411  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1412  $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
1413  if($q_gui->object instanceof assQuestion)
1414  {
1415  $q_gui->object->setObjId($this->object->getId());
1416  $title = $q_gui->object->getTitle();
1417  if(!$title)
1418  {
1419  $title = $this->lng->txt('new').': '.assQuestion::_getQuestionTypeName($q_gui->object->getQuestionType());
1420  }
1421  $this->tpl->setTitle($title);
1422  $this->tpl->setDescription($q_gui->object->getComment());
1423  $this->tpl->setTitleIcon(ilObject2::_getIcon("", "big", $this->object->getType()));
1424  }
1425  else
1426  {
1427  // Workaround for context issues: If no object was found, redirect without q_id parameter
1428  $this->ctrl->setParameter($this, 'q_id', '');
1429  $this->ctrl->redirect($this);
1430  }
1431  }
1432  else
1433  {
1434  $this->tpl->setTitle($this->object->getTitle());
1435  $this->tpl->setDescription($this->object->getLongDescription());
1436  $this->tpl->setTitleIcon(ilObject2::_getIcon("", "big", $this->object->getType()));
1437  }
1438  }
$_GET["client_id"]
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.
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ updateObject()

ilObjQuestionPoolGUI::updateObject ( )

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

References ilUtil\sendSuccess().

1240  {
1241 // $this->update = $this->object->updateMetaData();
1242  $this->update = $this->object->update();
1243  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1244  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
+ Here is the call graph for this function:

◆ uploadObject()

ilObjQuestionPoolGUI::uploadObject ( )

imports question(s) into the questionpool

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

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

757  {
758  $upload_valid = true;
759  $form = $this->getImportQuestionsForm();
760  if($form->checkInput())
761  {
762  if(!$this->uploadQplObject(true))
763  {
764  $form->setValuesByPost();
765  $this->importQuestionsObject($form);
766  }
767  }
768  else
769  {
770  $form->setValuesByPost();
771  $this->importQuestionsObject($form);
772  }
773  }
importQuestionsObject(ilPropertyFormGUI $form=null)
display the import form to import questions into the questionpool
uploadQplObject($questions_only=false)
imports question(s) into the questionpool
+ Here is the call graph for this function:

◆ uploadQplObject()

ilObjQuestionPoolGUI::uploadQplObject (   $questions_only = false)

imports question(s) into the questionpool

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

References $_SESSION, $fh, $file, $GLOBALS, $result, $row, ilObjQuestionPool\_createImportDirectory(), ilObjQuestionPool\_getImportDirectory(), ilObjQuestionPool\_setImportDirectory(), ilObjTest\_setImportDirectory(), array, CLOZE_TEST_IDENTIFIER, ilUtil\delDir(), ilPlugin\getPluginObject(), IL_COMP_MODULE, IL_MO_VERIFY_QTI, IMAGEMAP_QUESTION_IDENTIFIER, JAVAAPPLET_QUESTION_IDENTIFIER, KPRIM_CHOICE_QUESTION_IDENTIFIER, LONG_MENU_QUESTION_IDENTIFIER, MATCHING_QUESTION_IDENTIFIER, 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().

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