ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjQuestionPoolGUI Class Reference

Class ilObjQuestionPoolGUI. More...

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

Public Member Functions

 ilObjQuestionPoolGUI ()
 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...
 
 assessmentObject ()
 show assessment data of object 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...
 
 createExportQTI ()
 create export file More...
 
 createExportExcel ()
 
editQuestionForTestObject ()
 edit question More...
 
 importFileObject ()
 form for new questionpool object import More...
 
 addLocatorItems ()
 
 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...
 
 _goto ($a_target)
 Redirect script to call a test with the question pool reference id. More...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor 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 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...
 

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)
 
- 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 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...
 
 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)
 

Additional Inherited Members

- 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...
 

Detailed Description

Member Function Documentation

◆ _goto()

ilObjQuestionPoolGUI::_goto (   $a_target)

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

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

1534  {
1535  global $ilAccess, $ilErr, $lng;
1536 
1537  if ($ilAccess->checkAccess("write", "", $a_target))
1538  {
1539  $_GET["baseClass"] = "ilObjQuestionPoolGUI";
1540  $_GET["cmd"] = "questions";
1541  $_GET["ref_id"] = $a_target;
1542  include_once("ilias.php");
1543  exit;
1544  }
1545  else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
1546  {
1547  ilUtil::sendInfo(sprintf($lng->txt("msg_no_perm_read_item"),
1548  ilObject::_lookupTitle(ilObject::_lookupObjId($a_target))), true);
1550  }
1551  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
1552  }
exit
Definition: login.php:54
$_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 1270 of file class.ilObjQuestionPoolGUI.php.

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

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

◆ addSettingsSubTabs()

ilObjQuestionPoolGUI::addSettingsSubTabs ( ilTabsGUI  $tabs)
private

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

References ilTabsGUI\addSubTabTarget().

Referenced by getTabs().

1477  {
1478  $tabs->addSubTabTarget(
1479  'qpl_settings_subtab_general',
1480  $this->ctrl->getLinkTargetByClass('ilObjQuestionPoolSettingsGeneralGUI'),
1481  '', 'ilObjQuestionPoolSettingsGeneralGUI'
1482  );
1483 
1484  $tabs->addSubTabTarget(
1485  'qpl_settings_subtab_taxonomies',
1486  $this->ctrl->getLinkTargetByClass('ilObjTaxonomyGUI', 'editAOTaxonomySettings'),
1487  '', 'ilObjTaxonomyGUI'
1488  );
1489  }
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 783 of file class.ilObjQuestionPoolGUI.php.

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

784  {
785  // always send a message
786  ilUtil::sendSuccess($this->lng->txt("object_added"),true);
787 
788  ilUtil::redirect("ilias.php?ref_id=".$a_new_object->getRefId().
789  "&baseClass=ilObjQuestionPoolGUI");
790  }
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:

◆ assessmentObject()

ilObjQuestionPoolGUI::assessmentObject ( )

show assessment data of object

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

References $_GET, assQuestion\_getTitle(), assQuestion\_getTotalAnswers(), assQuestion\_getTotalRightAnswers(), and ilUtil\sendInfo().

796  {
797  $this->tpl->addBlockFile("CONTENT", "content", "tpl.il_as_qpl_content.html", "Modules/TestQuestionPool");
798  $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
799 
800  // catch feedback message
802 
803  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
804  $question_title = assQuestion::_getTitle($_GET["q_id"]);
805  $title = $this->lng->txt("statistics") . " - $question_title";
806  if (!empty($title))
807  {
808  $this->tpl->setVariable("HEADER", $title);
809  }
810  include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
811  $total_of_answers = assQuestion::_getTotalAnswers($_GET["q_id"]);
812  $counter = 0;
813  $color_class = array("tblrow1", "tblrow2");
814  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_qpl_assessment_of_questions.html", "Modules/TestQuestionPool");
815  if (!$total_of_answers)
816  {
817  $this->tpl->setCurrentBlock("emptyrow");
818  $this->tpl->setVariable("TXT_NO_ASSESSMENT", $this->lng->txt("qpl_assessment_no_assessment_of_questions"));
819  $this->tpl->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
820  $this->tpl->parseCurrentBlock();
821  }
822  else
823  {
824  $this->tpl->setCurrentBlock("row");
825  $this->tpl->setVariable("TXT_RESULT", $this->lng->txt("qpl_assessment_total_of_answers"));
826  $this->tpl->setVariable("TXT_VALUE", $total_of_answers);
827  $this->tpl->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
828  $counter++;
829  $this->tpl->parseCurrentBlock();
830  $this->tpl->setCurrentBlock("row");
831  $this->tpl->setVariable("TXT_RESULT", $this->lng->txt("qpl_assessment_total_of_right_answers"));
832  $this->tpl->setVariable("TXT_VALUE", sprintf("%2.2f", assQuestion::_getTotalRightAnswers($_GET["edit"]) * 100.0) . " %");
833  $this->tpl->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
834  $this->tpl->parseCurrentBlock();
835  }
836  $this->tpl->setCurrentBlock("adm_content");
837  $this->tpl->setVariable("TXT_QUESTION_TITLE", $question_title);
838  $this->tpl->setVariable("TXT_RESULT", $this->lng->txt("result"));
839  $this->tpl->setVariable("TXT_VALUE", $this->lng->txt("value"));
840  $this->tpl->parseCurrentBlock();
841  }
_getTotalAnswers($a_q_id)
get number of answers for question id (static) note: do not use $this inside this method ...
$_GET["client_id"]
_getTotalRightAnswers($a_q_id)
get number of answers for question id (static) note: do not use $this inside this method ...
_getTitle($a_q_id)
Returns the title of a question.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ buildCreateQuestionForm()

ilObjQuestionPoolGUI::buildCreateQuestionForm ( )
private

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

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

Referenced by createQuestionFormObject().

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

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

References $_GET, ilObjectGUI\$data, ilObjectGUI\$lng, ilAssQuestionList\addTaxonomyFilter(), and ilQuestionBrowserTableGUI\setEditable().

Referenced by executeCommand(), and questionsObject().

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

895  {
896  $this->ctrl->redirect($this, "questions");
897  }

◆ cancelImportObject()

ilObjQuestionPoolGUI::cancelImportObject ( )

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

References $_POST.

649  {
650  if ($_POST["questions_only"] == 1)
651  {
652  $this->ctrl->redirect($this, "questions");
653  }
654  else
655  {
656  $this->ctrl->redirect($this, "cancel");
657  }
658  }
$_POST['username']
Definition: cron.php:12

◆ confirmDeleteQuestionsObject()

ilObjQuestionPoolGUI::confirmDeleteQuestionsObject ( )

delete questions

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

References $_POST, and ilUtil\sendSuccess().

877  {
878  // delete questions after confirmation
879  foreach ($_POST["q_id"] as $key => $value)
880  {
881  $this->object->deleteQuestion($value);
882  $this->object->cleanupClipboard($value);
883  }
884  if (count($_POST["q_id"])) ilUtil::sendSuccess($this->lng->txt("qpl_questions_deleted"), true);
885 
886  $this->ctrl->setParameter($this, 'q_id', '');
887 
888  $this->ctrl->redirect($this, "questions");
889  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
+ Here is the call graph for this function:

◆ copyObject()

ilObjQuestionPoolGUI::copyObject ( )

copy one or more question objects to the clipboard

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

References $_POST, and ilUtil\sendInfo().

1160  {
1161  if (count($_POST["q_id"]) > 0)
1162  {
1163  foreach ($_POST["q_id"] as $key => $value)
1164  {
1165  $this->object->copyToClipboard($value);
1166  }
1167  ilUtil::sendInfo($this->lng->txt("qpl_copy_insert_clipboard"), true);
1168  }
1169  else
1170  {
1171  ilUtil::sendInfo($this->lng->txt("qpl_copy_select_none"), true);
1172  }
1173  $this->ctrl->redirect($this, "questions");
1174  }
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ createExportExcel()

ilObjQuestionPoolGUI::createExportExcel ( )

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

References $_GET.

1213  {
1214  global $rbacsystem;
1215  if ($rbacsystem->checkAccess("write", $_GET['ref_id']))
1216  {
1217  include_once("./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
1218  $question_ids =& $this->object->getAllQuestionIds();
1219  $qpl_exp = new ilQuestionpoolExport($this->object, 'xls', $question_ids);
1220  $qpl_exp->buildExportFile();
1221  $this->ctrl->redirectByClass("ilexportgui", "");
1222  }
1223  }
$_GET["client_id"]
Export class for questionpools.

◆ createExportQTI()

ilObjQuestionPoolGUI::createExportQTI ( )

create export file

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

References $_GET.

1200  {
1201  global $rbacsystem;
1202  if ($rbacsystem->checkAccess("write", $_GET['ref_id']))
1203  {
1204  include_once("./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
1205  $question_ids =& $this->object->getAllQuestionIds();
1206  $qpl_exp = new ilQuestionpoolExport($this->object, 'xml', $question_ids);
1207  $qpl_exp->buildExportFile();
1208  $this->ctrl->redirectByClass("ilexportgui", "");
1209  }
1210  }
$_GET["client_id"]
Export class for questionpools.

◆ createQuestionFormObject()

ilObjQuestionPoolGUI::createQuestionFormObject ( )
private

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

References buildCreateQuestionForm().

1028  {
1029  $form = $this->buildCreateQuestionForm();
1030 
1031  $this->tpl->setContent( $this->ctrl->getHTML($form) );
1032  }
+ Here is the call graph for this function:

◆ createQuestionForTestObject()

& ilObjQuestionPoolGUI::createQuestionForTestObject ( )

create new question

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

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

744  {
745  if( !$_REQUEST['q_id'] )
746  {
747  require_once 'Modules/Test/classes/class.ilObjAssessmentFolder.php';
749  {
750  $addContEditMode = $_REQUEST['add_quest_cont_edit_mode'];
751  }
752  else
753  {
755  }
756 
757  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
758  $q_gui =& assQuestionGUI::_getQuestionGUI($_GET["sel_question_types"]);
759  $q_gui->object->setObjId($this->object->getId());
760  $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
761  $q_gui->object->createNewQuestion();
762 
763  $class = get_class($q_gui);
764  $qId = $q_gui->object->getId();
765  }
766  else
767  {
768  $class = $_GET["sel_question_types"] . 'gui';
769  $qId = $_REQUEST['q_id'];
770  }
771 
772  $this->ctrl->setParameterByClass($class, "q_id", $qId);
773  $this->ctrl->setParameterByClass($class, "sel_question_types", $_REQUEST["sel_question_types"]);
774  $this->ctrl->setParameterByClass($class, "prev_qid", $_REQUEST["prev_qid"]);
775 
776  $this->ctrl->redirectByClass($class, "editQuestion");
777  }
$_GET["client_id"]
& _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"
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not ...
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ createQuestionObject()

& ilObjQuestionPoolGUI::createQuestionObject ( )

create new question

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

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

719  {
721  {
722  $addContEditMode = $_POST['add_quest_cont_edit_mode'];
723  }
724  else
725  {
727  }
728 
729  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
730  $q_gui =& assQuestionGUI::_getQuestionGUI($_POST["sel_question_types"]);
731  $this->object->addQuestionChangeListeners($q_gui->object);
732  $q_gui->object->setObjId($this->object->getId());
733  $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
734  $q_gui->object->createNewQuestion();
735  $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
736  $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $_POST["sel_question_types"]);
737  $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
738  }
$_POST['username']
Definition: cron.php:12
& _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"
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:

◆ deleteQuestionsObject()

ilObjQuestionPoolGUI::deleteQuestionsObject ( )

delete questions confirmation screen

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

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

854  {
855  global $rbacsystem;
856 
857  if (count($_POST["q_id"]) < 1)
858  {
859  ilUtil::sendInfo($this->lng->txt("qpl_delete_select_none"), true);
860  $this->ctrl->redirect($this, "questions");
861  }
862 
863  ilUtil::sendQuestion($this->lng->txt("qpl_confirm_delete_questions"));
864  $deleteable_questions =& $this->object->getDeleteableQuestionDetails($_POST["q_id"]);
865  include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
866  $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', (($rbacsystem->checkAccess('write', $_GET['ref_id']) ? true : false)), true);
867  $table_gui->setEditable($rbacsystem->checkAccess('write', $_GET['ref_id']));
868  $table_gui->setData($deleteable_questions);
869  $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
870  }
$_POST['username']
Definition: cron.php:12
$_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.
+ Here is the call graph for this function:

◆ download_paragraphObject()

ilObjQuestionPoolGUI::download_paragraphObject ( )

download source code paragraph

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

References $_GET, and exit.

367  {
368  include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php");
369  $pg_obj = new ilAssQuestionPage($_GET["pg_id"]);
370  $pg_obj->send_paragraph ($_GET["par_id"], $_GET["downloadtitle"]);
371  exit;
372  }
exit
Definition: login.php:54
$_GET["client_id"]
Question page object.

◆ downloadFileObject()

ilObjQuestionPoolGUI::downloadFileObject ( )

download file

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

References $_GET, $file, and exit.

326  {
327  $file = explode("_", $_GET["file_id"]);
328  include_once("./Modules/File/classes/class.ilObjFile.php");
329  $fileObj =& new ilObjFile($file[count($file) - 1], false);
330  $fileObj->sendFile();
331  exit;
332  }
print $file
exit
Definition: login.php:54
$_GET["client_id"]
Class ilObjFile.

◆ editQuestionForTestObject()

& ilObjQuestionPoolGUI::editQuestionForTestObject ( )

edit question

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

References $_GET, and assQuestionGUI\_getQuestionGUI().

1229  {
1230  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1231  $q_gui =& assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
1232  $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
1233  }
$_GET["client_id"]
& _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 69 of file class.ilObjQuestionPoolGUI.php.

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

70  {
71  global $ilLocator, $ilAccess, $ilNavigationHistory, $tpl, $ilCtrl, $ilErr, $ilTabs, $lng, $ilDB, $ilPluginAdmin;
72 
73  if ((!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) && (!$ilAccess->checkAccess("visible", "", $_GET["ref_id"])))
74  {
75  global $ilias;
76  $ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE);
77  }
78 
79  // add entry to navigation history
80  if (!$this->getCreationMode() &&
81  $ilAccess->checkAccess("read", "", $_GET["ref_id"]))
82  {
83  if('qpl' == $this->object->getType())
84  {
85  $ilNavigationHistory->addItem($_GET["ref_id"],
86  "ilias.php?baseClass=ilObjQuestionPoolGUI&cmd=questions&ref_id=".$_GET["ref_id"], "qpl");
87  }
88  }
89 
90  $cmd = $this->ctrl->getCmd("questions");
91  $next_class = $this->ctrl->getNextClass($this);
92 
93  if( in_array($next_class, array('', 'ilobjquestionpoolgui')) && $cmd == 'questions' )
94  {
95  $_GET['q_id'] = '';
96  }
97 
98  $this->prepareOutput();
99 
100  $this->ctrl->setReturn($this, "questions");
101 
102  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
103  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "ta.css", "Modules/Test"), "screen");
104 
105  if ($_GET["q_id"] < 1)
106  {
107  $q_type = ($_POST["sel_question_types"] != "")
108  ? $_POST["sel_question_types"]
109  : $_GET["sel_question_types"];
110  }
111  if ($cmd != "createQuestion" && $cmd != "createQuestionForTest"
112  && $next_class != "ilassquestionpagegui")
113  {
114  if (($_GET["test_ref_id"] != "") or ($_GET["calling_test"]))
115  {
116  $ref_id = $_GET["test_ref_id"];
117  if (!$ref_id)
118  {
119  $ref_id = $_GET["calling_test"];
120  }
121  }
122  }
123  switch($next_class)
124  {
125  case "ilcommonactiondispatchergui":
126  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
128  $this->ctrl->forwardCommand($gui);
129  break;
130 
131  case 'ilmdeditorgui':
132  if(!$ilAccess->checkAccess('write','',$this->object->getRefId()))
133  {
134  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
135  }
136 
137  include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
138 
139  $md_gui = new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
140  $md_gui->addObserver($this->object,'MDUpdateListener','General');
141  $this->ctrl->forwardCommand($md_gui);
142  break;
143  case "ilassquestionpagegui":
144  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
145  $this->tpl->setCurrentBlock("ContentStyle");
146  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
147  $this->tpl->parseCurrentBlock();
148 
149  // syntax style
150  $this->tpl->setCurrentBlock("SyntaxStyle");
151  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
152  $this->tpl->parseCurrentBlock();
153 
154  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
155  $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
156  $q_gui->setQuestionTabs();
157  $q_gui->outAdditionalOutput();
158  $q_gui->object->setObjId($this->object->getId());
159  $question = $q_gui->object;
160  $this->ctrl->saveParameter($this, "q_id");
161  include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
162  $this->lng->loadLanguageModule("content");
163  $this->ctrl->setReturnByClass("ilAssQuestionPageGUI", "view");
164  $this->ctrl->setReturn($this, "questions");
165  $page_gui = new ilAssQuestionPageGUI($_GET["q_id"]);
166  $page_gui->setEditPreview(true);
167  $page_gui->setEnabledTabs(false);
168  if (strlen($this->ctrl->getCmd()) == 0 && !isset($_POST["editImagemapForward_x"])) // workaround for page edit imagemaps, keep in mind
169  {
170  $this->ctrl->setCmdClass(get_class($page_gui));
171  $this->ctrl->setCmd("preview");
172  }
173  $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
174  $page_gui->setTemplateTargetVar("ADM_CONTENT");
175  $page_gui->setOutputMode("edit");
176  $page_gui->setHeader($question->getTitle());
177  $page_gui->setPresentationTitle($question->getTitle());
178  $ret = $this->ctrl->forwardCommand($page_gui);
179  $tpl->setContent($ret);
180  break;
181 
182  case 'ilpermissiongui':
183  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
184  $perm_gui = new ilPermissionGUI($this);
185  $ret = $this->ctrl->forwardCommand($perm_gui);
186  break;
187 
188  case 'ilobjectcopygui':
189  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
190  $cp = new ilObjectCopyGUI($this);
191  $cp->setType('qpl');
192  $this->ctrl->forwardCommand($cp);
193  break;
194 
195  case "ilexportgui":
196  include_once("./Services/Export/classes/class.ilExportGUI.php");
197  $exp_gui = new ilExportGUI($this);
198  $exp_gui->addFormat("zip", $this->lng->txt('qpl_export_xml'), $this, "createExportQTI");
199  $exp_gui->addFormat("xls", $this->lng->txt('qpl_export_excel'), $this, "createExportExcel");
200  // $exp_gui->addCustomColumn($lng->txt("cont_public_access"), $this, "getPublicAccessColValue");
201  // $exp_gui->addCustomMultiCommand($lng->txt("cont_public_access"), $this, "publishExportFile");
202  $ret = $this->ctrl->forwardCommand($exp_gui);
203  break;
204 
205  case "ilinfoscreengui":
206  $this->infoScreenForward();
207  break;
208 
209  case 'ilassquestionhintsgui':
210 
211  // set return target
212  $this->ctrl->setReturn($this, "questions");
213 
214  // set context tabs
215  require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
216  $questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']);
217  $questionGUI->object->setObjId($this->object->getId());
218  $questionGUI->setQuestionTabs();
219 
220  // forward to ilAssQuestionHintsGUI
221  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
222  $gui = new ilAssQuestionHintsGUI($questionGUI);
223  $ilCtrl->forwardCommand($gui);
224 
225  break;
226 
227  case 'illocalunitconfigurationgui':
228  if(!$ilAccess->checkAccess('write','',$this->object->getRefId()))
229  {
230  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
231  }
232 
233  require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
234  $questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']);
235  $questionGUI->object->setObjId($this->object->getId());
236  $questionGUI->setQuestionTabs();
237 
238  $this->ctrl->setReturn($this, 'questions');
239 
240  require_once 'Modules/TestQuestionPool/classes/class.ilLocalUnitConfigurationGUI.php';
241  require_once 'Modules/TestQuestionPool/classes/class.ilUnitConfigurationRepository.php';
242  $gui = new ilLocalUnitConfigurationGUI(
243  new ilUnitConfigurationRepository((int)$_GET['q_id'])
244  );
245  $ilCtrl->forwardCommand($gui);
246  break;
247 
248  case 'ilassquestionfeedbackeditinggui':
249 
250  // set return target
251  $this->ctrl->setReturn($this, "questions");
252 
253  // set context tabs
254  require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
255  $questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']);
256  $questionGUI->object->setObjId($this->object->getId());
257  $questionGUI->setQuestionTabs();
258 
259  // forward to ilAssQuestionFeedbackGUI
260  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
261  $gui = new ilAssQuestionFeedbackEditingGUI($questionGUI, $ilCtrl, $ilAccess, $tpl, $ilTabs, $lng);
262  $ilCtrl->forwardCommand($gui);
263 
264  break;
265 
266  case 'ilobjquestionpoolsettingsgeneralgui':
267  require_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPoolSettingsGeneralGUI.php';
268  $gui = new ilObjQuestionPoolSettingsGeneralGUI($ilCtrl, $ilAccess, $lng, $tpl, $ilTabs, $this);
269  $this->ctrl->forwardCommand($gui);
270  break;
271 
272  case "ilobjtaxonomygui":
273 
274  require_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPoolTaxonomyEditingCommandForwarder.php';
276  $this->object, $ilDB, $ilPluginAdmin, $ilCtrl, $ilTabs, $lng
277  );
278 
279  $forwarder->forward();
280 
281  break;
282 
283  case 'ilquestionbrowsertablegui':
284  $this->ctrl->forwardCommand($this->buildQuestionBrowserTableGUI($taxIds = array())); // no tax ids required
285  break;
286 
287  case "ilobjquestionpoolgui":
288  case "":
289 
290  if( $cmd == 'questions' )
291  {
292  $this->ctrl->setParameter($this, 'q_id', '');
293  }
294 
295  $cmd.= "Object";
296  $ret = $this->$cmd();
297  break;
298 
299  default:
300  $this->ctrl->setReturn($this, "questions");
301  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
302  $q_gui = assQuestionGUI::_getQuestionGUI($q_type, $_GET["q_id"]);
303  $q_gui->object->setObjId($this->object->getId());
304  if($this->object->getType() == 'qpl')
305  {
306  $q_gui->setTaxonomyIds($this->object->getTaxonomyIds());
307  $this->object->addQuestionChangeListeners($q_gui->object);
308  }
309  $q_gui->setQuestionTabs();
310  $ret = $this->ctrl->forwardCommand($q_gui);
311  break;
312  }
313 
314  if ( !(strtolower($_GET["baseClass"]) == "iladministrationgui"
315  || strtolower($_GET['baseClass']) == 'ilrepositorygui')
316  && $this->getCreationMode() != true)
317  {
318  $this->tpl->show();
319  }
320  }
$_POST['username']
Definition: cron.php:12
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
addObserver(&$a_class, $a_method, $a_element)
Class ilUnitConfigurationRepository.
Question page GUI class.
getSyntaxStylePath()
get syntax style path
global $ilCtrl
Definition: ilias.php:18
Export User Interface Class.
& _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
prepareOutput()
prepare output
getContentStylePath($a_style_id)
get content style path
getCreationMode()
get creation mode
Class ilLocalUnitConfigurationGUI.
infoScreenForward()
show information screen
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ exportQuestionObject()

ilObjQuestionPoolGUI::exportQuestionObject ( )

export question

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

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

903  {
904  // export button was pressed
905  if (count($_POST["q_id"]) > 0)
906  {
907  include_once("./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
908  $qpl_exp = new ilQuestionpoolExport($this->object, "xml", $_POST["q_id"]);
909  $export_file = $qpl_exp->buildExportFile();
910  $filename = $export_file;
911  $filename = preg_replace("/.*\//", "", $filename);
912  include_once "./Services/Utilities/classes/class.ilUtil.php";
913  ilUtil::deliverFile($export_file, $filename);
914  exit();
915  }
916  else
917  {
918  ilUtil::sendInfo($this->lng->txt("qpl_export_select_none"), true);
919  }
920  $this->ctrl->redirect($this, "questions");
921  }
exit
Definition: login.php:54
$_POST['username']
Definition: cron.php:12
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.
$filename
Definition: buildRTE.php:89
+ Here is the call graph for this function:

◆ filterObject()

ilObjQuestionPoolGUI::filterObject ( )

set question list filter

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

References questionsObject().

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

◆ filterQuestionBrowserObject()

ilObjQuestionPoolGUI::filterQuestionBrowserObject ( )

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

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

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

◆ fullscreenObject()

ilObjQuestionPoolGUI::fullscreenObject ( )

show fullscreen view

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

References $_GET.

338  {
339  include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
340  $page_gui = new ilAssQuestionPageGUI($_GET["pg_id"]);
341  $page_gui->showMediaFullscreen();
342  }
$_GET["client_id"]
Question page GUI class.

◆ getImportQuestionsForm()

ilObjQuestionPoolGUI::getImportQuestionsForm ( )
protected
Returns
ilPropertyFormGUI

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

References $file.

Referenced by importQuestionsObject(), and uploadObject().

699  {
700  require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
701  $form = new ilPropertyFormGUI();
702  $form->setTitle($this->lng->txt('import_question'));
703  $form->setFormAction($this->ctrl->getFormAction($this, 'upload'));
704 
705  $file = new ilFileInputGUI($this->lng->txt('select_file'), 'xmldoc');
706  $file->setRequired(true);
707  $form->addItem($file);
708 
709  $form->addCommandButton('upload', $this->lng->txt('upload'));
710  $form->addCommandButton('questions', $this->lng->txt('cancel'));
711 
712  return $form;
713  }
print $file
This class represents a property form user interface.
This class represents a file property in a property form.
+ Here is the caller graph for this function:

◆ getTabs()

ilObjQuestionPoolGUI::getTabs ( $tabs_gui)

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

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

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

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

◆ ilObjQuestionPoolGUI()

ilObjQuestionPoolGUI::ilObjQuestionPoolGUI ( )

Constructor public.

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

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

44  {
45  global $lng, $ilCtrl, $rbacsystem;
46  $lng->loadLanguageModule("assessment");
47  $this->type = "qpl";
48  $this->ctrl =& $ilCtrl;
49 
50  $this->ctrl->saveParameter($this, array(
51  "ref_id", "test_ref_id", "calling_test", "test_express_mode", "q_id", 'tax_node'
52  ));
53 
54  $this->ilObjectGUI("",$_GET["ref_id"], true, false);
55  }
$_GET["client_id"]
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor public.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ importFileObject()

ilObjQuestionPoolGUI::importFileObject ( )

form for new questionpool object import

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

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

1259  {
1260  $form = $this->initImportForm($_REQUEST["new_type"]);
1261  if($form->checkInput())
1262  {
1263  $this->uploadQplObject();
1264  }
1265 
1266  // display form to correct errors
1267  $this->tpl->setContent($form->getHTML());
1268  }
uploadQplObject($questions_only=false)
imports question(s) into the questionpool
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ 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 685 of file class.ilObjQuestionPoolGUI.php.

References getImportQuestionsForm().

Referenced by uploadObject().

686  {
687  if(!$form instanceof ilPropertyFormGUI)
688  {
689  $form = $this->getImportQuestionsForm();
690  }
691 
692  $this->tpl->setContent($form->getHtml());
693  }
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 581 of file class.ilObjQuestionPoolGUI.php.

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

582  {
583  if ($_POST["questions_only"] == 1)
584  {
585  $newObj =& $this->object;
586  }
587  else
588  {
589  include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
590  // create new questionpool object
591  $newObj = new ilObjQuestionPool(0, true);
592  // set type of questionpool object
593  $newObj->setType($_GET["new_type"]);
594  // set title of questionpool object to "dummy"
595  $newObj->setTitle("dummy");
596  // set description of questionpool object
597  $newObj->setDescription("questionpool import");
598  // create the questionpool class in the ILIAS database (object_data table)
599  $newObj->create(true);
600  // create a reference for the questionpool object in the ILIAS database (object_reference table)
601  $newObj->createReference();
602  // put the questionpool object in the administration tree
603  $newObj->putInTree($_GET["ref_id"]);
604  // get default permissions and set the permissions for the questionpool object
605  $newObj->setPermissions($_GET["ref_id"]);
606  // notify the questionpool object and all its parent objects that a "new" object was created
607  $newObj->notify("new",$_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$newObj->getRefId());
608  }
609 
610  // start parsing of QTI files
611  include_once "./Services/QTI/classes/class.ilQTIParser.php";
612  $qtiParser = new ilQTIParser($_SESSION["qpl_import_qti_file"], IL_MO_PARSE_QTI, $newObj->getId(), $_POST["ident"]);
613  $result = $qtiParser->startParsing();
614 
615  // import page data
616  if (strlen($_SESSION["qpl_import_xml_file"]))
617  {
618  include_once ("./Modules/LearningModule/classes/class.ilContObjParser.php");
619  $contParser = new ilContObjParser($newObj, $_SESSION["qpl_import_xml_file"], $_SESSION["qpl_import_subdir"]);
620  $contParser->setQuestionMapping($qtiParser->getImportMapping());
621  $contParser->startParsing();
622  }
623 
624  // set another question pool name (if possible)
625  $qpl_name = $_POST["qpl_new"];
626  if ((strcmp($qpl_name, $newObj->getTitle()) != 0) && (strlen($qpl_name) > 0))
627  {
628  $newObj->setTitle($qpl_name);
629  $newObj->update();
630  }
631 
632  // delete import directory
633  include_once "./Services/Utilities/classes/class.ilUtil.php";
635 
636  if ($_POST["questions_only"] == 1)
637  {
638  $this->ctrl->redirect($this, "questions");
639  }
640  else
641  {
642  ilUtil::sendSuccess($this->lng->txt("object_imported"),true);
643  ilUtil::redirect("ilias.php?ref_id=".$newObj->getRefId().
644  "&baseClass=ilObjQuestionPoolGUI");
645  }
646  }
< 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']
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Content Object Parser.
$_POST['username']
Definition: cron.php:12
$result
$_GET["client_id"]
const IL_MO_PARSE_QTI
_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
+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjQuestionPoolGUI::infoScreenForward ( )

show information screen

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

References $ilErr.

Referenced by executeCommand(), and infoScreenObject().

1507  {
1508  global $ilErr, $ilAccess;
1509 
1510  if(!$ilAccess->checkAccess("visible", "", $this->ref_id))
1511  {
1512  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"));
1513  }
1514 
1515  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1516  $info = new ilInfoScreenGUI($this);
1517  $info->enablePrivateNotes();
1518 
1519  // standard meta data
1520  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1521 
1522  $this->ctrl->forwardCommand($info);
1523  }
Class ilInfoScreenGUI.
+ 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 1496 of file class.ilObjQuestionPoolGUI.php.

References infoScreenForward().

1497  {
1498  $this->ctrl->setCmd("showSummary");
1499  $this->ctrl->setCmdClass("ilinfoscreengui");
1500  $this->infoScreenForward();
1501  }
infoScreenForward()
show information screen
+ Here is the call graph for this function:

◆ initImportForm()

ilObjQuestionPoolGUI::initImportForm (   $a_new_type)
protected

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

References ilFileInputGUI\setSuffixes().

Referenced by importFileObject().

1236  {
1237  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1238  $form = new ilPropertyFormGUI();
1239  $form->setTarget("_top");
1240  $form->setFormAction($this->ctrl->getFormAction($this));
1241  $form->setTitle($this->lng->txt("import_qpl"));
1242 
1243  include_once("./Services/Form/classes/class.ilFileInputGUI.php");
1244  $fi = new ilFileInputGUI($this->lng->txt("import_file"), "xmldoc");
1245  $fi->setSuffixes(array("zip"));
1246  $fi->setRequired(true);
1247  $form->addItem($fi);
1248 
1249  $form->addCommandButton("importFile", $this->lng->txt("import"));
1250  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
1251 
1252  return $form;
1253  }
This class represents a property form user interface.
This class represents a file property in a property form.
setSuffixes($a_suffixes)
Set Accepted Suffixes.
+ 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 1179 of file class.ilObjQuestionPoolGUI.php.

References $_POST, and ilUtil\sendInfo().

1180  {
1181  if (count($_POST["q_id"]) > 0)
1182  {
1183  foreach ($_POST["q_id"] as $key => $value)
1184  {
1185  $this->object->moveToClipboard($value);
1186  }
1187  ilUtil::sendInfo($this->lng->txt("qpl_move_insert_clipboard"), true);
1188  }
1189  else
1190  {
1191  ilUtil::sendInfo($this->lng->txt("qpl_move_select_none"), true);
1192  }
1193  $this->ctrl->redirect($this, "questions");
1194  }
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ pasteObject()

ilObjQuestionPoolGUI::pasteObject ( )

paste questios from the clipboard into the question pool

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

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

1137  {
1138  if (array_key_exists("qpl_clipboard", $_SESSION))
1139  {
1140  if($this->object->pasteFromClipboard())
1141  {
1142  ilUtil::sendSuccess($this->lng->txt("qpl_paste_success"), true);
1143  }
1144  else
1145  {
1146  ilUtil::sendFailure($this->lng->txt("qpl_paste_error"), true);
1147  }
1148  }
1149  else
1150  {
1151  ilUtil::sendInfo($this->lng->txt("qpl_paste_no_objects"), true);
1152  }
1153  $this->ctrl->redirect($this, "questions");
1154  }
< 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']
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ questionObject()

ilObjQuestionPoolGUI::questionObject ( )

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

References $_GET.

844  {
845 //echo "<br>ilObjQuestionPoolGUI->questionObject()";
846  $type = $_GET["sel_question_types"];
847  $this->editQuestionForm($type);
848  }
$_GET["client_id"]

◆ questionsObject()

ilObjQuestionPoolGUI::questionsObject ( )

list questions of question pool

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

References $_GET, $_REQUEST, $_SESSION, $ilCtrl, $ilUser, ilObjectGUI\$lng, ilObjectGUI\$ref_id, buildQuestionBrowserTableGUI(), ilObjTaxonomy\getUsageOfObject(), and ilUtil\redirect().

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

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

◆ resetFilterObject()

ilObjQuestionPoolGUI::resetFilterObject ( )

resets filter

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

References $_POST, and questionsObject().

357  {
358  $_POST["filter_text"] = "";
359  $_POST["sel_filter_type"] = "";
360  $this->questionsObject();
361  }
$_POST['username']
Definition: cron.php:12
questionsObject()
list questions of question pool
+ Here is the call graph for this function:

◆ resetQuestionBrowserObject()

ilObjQuestionPoolGUI::resetQuestionBrowserObject ( )

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

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

936  {
937  require_once 'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
938  $taxIds = ilObjTaxonomy::getUsageOfObject($this->object->getId());
939 
940  include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
941  $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', false, false, $taxIds);
942  $table_gui->resetOffset();
943  $table_gui->resetFilter();
944  $this->questionsObject();
945  }
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
questionsObject()
list questions of question pool
+ Here is the call graph for this function:

◆ setTitleAndDescription()

ilObjQuestionPoolGUI::setTitleAndDescription ( )

called by prepare output

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

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

1310  {
1311  parent::setTitleAndDescription();
1312  if ($_GET["q_id"] > 0)
1313  {
1314  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1315  $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
1316  if($q_gui->object instanceof assQuestion)
1317  {
1318  $q_gui->object->setObjId($this->object->getId());
1319  $title = $q_gui->object->getTitle();
1320  if (strcmp($this->ctrl->getCmd(), "assessment") == 0)
1321  {
1322  $title .= " - " . $this->lng->txt("statistics");
1323  }
1324  if(!$title)
1325  {
1326  $title = $this->lng->txt('new').': '.assQuestion::_getQuestionTypeName($q_gui->object->getQuestionType());
1327  }
1328  $this->tpl->setTitle($title);
1329  $this->tpl->setDescription($q_gui->object->getComment());
1330  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_".$this->object->getType()."_b.png"), $this->lng->txt("obj_qpl"));
1331  }
1332  else
1333  {
1334  // Workaround for context issues: If no object was found, redirect without q_id parameter
1335  $this->ctrl->setParameter($this, 'q_id', '');
1336  $this->ctrl->redirect($this);
1337  }
1338  }
1339  else
1340  {
1341  $this->tpl->setTitle($this->object->getTitle());
1342  $this->tpl->setDescription($this->object->getLongDescription());
1343  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_".$this->object->getType()."_b.png"), $this->lng->txt("obj_qpl"));
1344  }
1345  }
$_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 getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
& _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:

◆ updateObject()

ilObjQuestionPoolGUI::updateObject ( )

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

References ilUtil\sendSuccess().

1127  {
1128 // $this->update = $this->object->updateMetaData();
1129  $this->update = $this->object->update();
1130  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1131  }
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 663 of file class.ilObjQuestionPoolGUI.php.

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

664  {
665  $upload_valid = true;
666  $form = $this->getImportQuestionsForm();
667  if($form->checkInput())
668  {
669  if(!$this->uploadQplObject(true))
670  {
671  $form->setValuesByPost();
672  $this->importQuestionsObject($form);
673  }
674  }
675  else
676  {
677  $form->setValuesByPost();
678  $this->importQuestionsObject($form);
679  }
680  }
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 377 of file class.ilObjQuestionPoolGUI.php.

References $_REQUEST, $_SESSION, $file, $GLOBALS, $result, ilObjQuestionPool\_createImportDirectory(), ilObjQuestionPool\_getImportDirectory(), ilObjQuestionPool\_setImportDirectory(), ilObjTest\_setImportDirectory(), CLOZE_TEST_IDENTIFIER, ilUtil\delDir(), ilUtil\getImagePath(), ilPlugin\getPluginObject(), IL_COMP_MODULE, IL_MO_VERIFY_QTI, IMAGEMAP_QUESTION_IDENTIFIER, JAVAAPPLET_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().

378  {
379  $this->ctrl->setParameter($this, 'new_type', $_REQUEST['new_type']);
380  if ($_FILES["xmldoc"]["error"] > UPLOAD_ERR_OK)
381  {
382  ilUtil::sendFailure($this->lng->txt("error_upload"), true);
383  if(!$questions_only)
384  {
385  $this->ctrl->redirect($this, 'create');
386  }
387  return false;
388  }
389  // create import directory
390  include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
392 
393  // copy uploaded file to import directory
394  $file = pathinfo($_FILES["xmldoc"]["name"]);
395  $full_path = $basedir."/".$_FILES["xmldoc"]["name"];
396  $GLOBALS['ilLog']->write(__METHOD__.": full path " . $full_path);
397  include_once "./Services/Utilities/classes/class.ilUtil.php";
398  ilUtil::moveUploadedFile($_FILES["xmldoc"]["tmp_name"], $_FILES["xmldoc"]["name"], $full_path);
399  $GLOBALS['ilLog']->write(__METHOD__.": full path " . $full_path);
400  if (strcmp($_FILES["xmldoc"]["type"], "text/xml") == 0)
401  {
402  $qti_file = $full_path;
404  }
405  else
406  {
407  // unzip file
408  ilUtil::unzip($full_path);
409 
410  // determine filenames of xml files
411  $subdir = basename($file["basename"],".".$file["extension"]);
413  $xml_file = ilObjQuestionPool::_getImportDirectory().'/'.$subdir.'/'.$subdir.".xml";
414  $qti_file = ilObjQuestionPool::_getImportDirectory().'/'.$subdir.'/'. str_replace("qpl", "qti", $subdir).".xml";
415  }
416 
417  // start verification of QTI files
418  include_once "./Services/QTI/classes/class.ilQTIParser.php";
419  $qtiParser = new ilQTIParser($qti_file, IL_MO_VERIFY_QTI, 0, "");
420  $result = $qtiParser->startParsing();
421  $founditems =& $qtiParser->getFoundItems();
422  if (count($founditems) == 0)
423  {
424  // nothing found
425 
426  // delete import directory
427  ilUtil::delDir($basedir);
428 
429  ilUtil::sendFailure($this->lng->txt("qpl_import_no_items"), true);
430  if(!$questions_only)
431  {
432  $this->ctrl->redirect($this, 'create');
433  }
434  return false;
435  }
436 
437  $complete = 0;
438  $incomplete = 0;
439  foreach ($founditems as $item)
440  {
441  if (strlen($item["type"]))
442  {
443  $complete++;
444  }
445  else
446  {
447  $incomplete++;
448  }
449  }
450 
451  if ($complete == 0)
452  {
453  // delete import directory
454  ilUtil::delDir($basedir);
455 
456  ilUtil::sendFailure($this->lng->txt("qpl_import_non_ilias_files"), true);
457  if(!$questions_only)
458  {
459  $this->ctrl->redirect($this, 'create');
460  }
461  return false;
462  }
463 
464  $_SESSION["qpl_import_xml_file"] = $xml_file;
465  $_SESSION["qpl_import_qti_file"] = $qti_file;
466  $_SESSION["qpl_import_subdir"] = $subdir;
467  // display of found questions
468  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.qpl_import_verification.html",
469  "Modules/TestQuestionPool");
470  $row_class = array("tblrow1", "tblrow2");
471  $counter = 0;
472  foreach ($founditems as $item)
473  {
474  $this->tpl->setCurrentBlock("verification_row");
475  $this->tpl->setVariable("ROW_CLASS", $row_class[$counter++ % 2]);
476  $this->tpl->setVariable("QUESTION_TITLE", $item["title"]);
477  $this->tpl->setVariable("QUESTION_IDENT", $item["ident"]);
478  include_once "./Services/QTI/classes/class.ilQTIItem.php";
479  switch ($item["type"])
480  {
482  $type = $this->lng->txt("assClozeTest");
483  break;
485  $type = $this->lng->txt("assImagemapQuestion");
486  break;
488  $type = $this->lng->txt("assJavaApplet");
489  break;
491  $type = $this->lng->txt("assMatchingQuestion");
492  break;
494  $type = $this->lng->txt("assMultipleChoice");
495  break;
497  $type = $this->lng->txt("assSingleChoice");
498  break;
500  $type = $this->lng->txt("assOrderingQuestion");
501  break;
503  $type = $this->lng->txt("assTextQuestion");
504  break;
506  $type = $this->lng->txt("assNumeric");
507  break;
509  $type = $this->lng->txt("assTextSubset");
510  break;
511  default:
512  $type = $this->lng->txt($item["type"]);
513  break;
514  }
515 
516  if (strcmp($type, "-" . $item["type"] . "-") == 0)
517  {
518  global $ilPluginAdmin;
519  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, "TestQuestionPool", "qst");
520  foreach ($pl_names as $pl_name)
521  {
522  $pl = ilPlugin::getPluginObject(IL_COMP_MODULE, "TestQuestionPool", "qst", $pl_name);
523  if (strcmp($pl->getQuestionType(), $item["type"]) == 0)
524  {
525  $type = $pl->getQuestionTypeTranslation();
526  }
527  }
528  }
529  $this->tpl->setVariable("QUESTION_TYPE", $type);
530  $this->tpl->parseCurrentBlock();
531  }
532 
533  $this->tpl->setCurrentBlock("import_qpl");
534  if (is_file($xml_file))
535  {
536  // read file into a string
537  $fh = @fopen($xml_file, "r") or die("");
538  $xml = @fread($fh, filesize($xml_file));
539  @fclose($fh);
540  if (preg_match("/<ContentObject.*?MetaData.*?General.*?Title[^>]*?>([^<]*?)</", $xml, $matches))
541  {
542  $this->tpl->setVariable("VALUE_NEW_QUESTIONPOOL", $matches[1]);
543  }
544  }
545  $this->tpl->setVariable("TEXT_CREATE_NEW_QUESTIONPOOL", $this->lng->txt("qpl_import_create_new_qpl"));
546  $this->tpl->parseCurrentBlock();
547 
548  $this->tpl->setCurrentBlock("adm_content");
549  $this->tpl->setVariable("TEXT_TYPE", $this->lng->txt("question_type"));
550  $this->tpl->setVariable("TEXT_TITLE", $this->lng->txt("question_title"));
551  $this->tpl->setVariable("FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt("qpl_import_verify_found_questions"));
552  if ($questions_only)
553  {
554  $this->tpl->setVariable("VERIFICATION_HEADING", $this->lng->txt("import_questions_into_qpl"));
555  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
556  }
557  else
558  {
559  $this->tpl->setVariable("VERIFICATION_HEADING", $this->lng->txt("import_qpl"));
560 
561  $this->ctrl->setParameter($this, "new_type", $this->type);
562  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
563 
564  //$this->tpl->setVariable("FORMACTION", $this->getFormAction("save","adm_object.php?cmd=gateway&ref_id=".$_GET["ref_id"]."&new_type=".$this->type));
565  }
566  $this->tpl->setVariable("ARROW", ilUtil::getImagePath("arrow_downright.png"));
567  $this->tpl->setVariable("VALUE_IMPORT", $this->lng->txt("import"));
568  $this->tpl->setVariable("VALUE_CANCEL", $this->lng->txt("cancel"));
569  $value_questions_only = 0;
570  if ($questions_only) $value_questions_only = 1;
571  $this->tpl->setVariable("VALUE_QUESTIONS_ONLY", $value_questions_only);
572 
573  $this->tpl->parseCurrentBlock();
574 
575  return true;
576  }
< 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']
const MATCHING_QUESTION_IDENTIFIER
const MULTIPLE_CHOICE_QUESTION_IDENTIFIER
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin object.
print $file
$result
_setImportDirectory($a_import_dir=null)
set import directory
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
const TEXTSUBSET_QUESTION_IDENTIFIER
Title class.
Definition: Title.php:30
const JAVAAPPLET_QUESTION_IDENTIFIER
const NUMERIC_QUESTION_IDENTIFIER
$GLOBALS['ct_recipient']
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
const ORDERING_QUESTION_IDENTIFIER
_getImportDirectory()
get import directory of lm
_setImportDirectory($a_import_dir=null)
set import directory
const IL_COMP_MODULE
const TEXT_QUESTION_IDENTIFIER
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
if(!file_exists(getcwd().'/ilias.ini.php')) if(isset( $_GET["client_id"]))
registration confirmation script for ilias
Definition: confirmReg.php:20
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
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.
const IMAGEMAP_QUESTION_IDENTIFIER
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $object

ilObjQuestionPoolGUI::$object

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

Referenced by importVerifiedFileObject().


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