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

Class ilObjSurveyQuestionPoolGUI. More...

+ Inheritance diagram for ilObjSurveyQuestionPoolGUI:
+ Collaboration diagram for ilObjSurveyQuestionPoolGUI:

Public Member Functions

 __construct ()
 Constructor public. More...
 
 executeCommand ()
 execute command More...
 
 propertiesObject (ilPropertyFormGUI $a_form=null)
 Questionpool properties. More...
 
 savePropertiesObject ()
 Save questionpool properties. More...
 
 copyObject ()
 Copies checked questions in the questionpool to a clipboard. More...
 
 moveObject ()
 mark one or more question objects for moving More...
 
 exportQuestionObject ()
 export a question More...
 
 deleteQuestionsObject ()
 Creates a confirmation form to delete questions from the question pool. More...
 
 confirmDeleteQuestionsObject ()
 delete questions More...
 
 cancelDeleteQuestionsObject ()
 cancel delete questions More...
 
 pasteObject ()
 paste questios from the clipboard into the question pool More...
 
 importQuestionsObject ()
 display the import form to import questions into the questionpool More...
 
 uploadQuestionsObject ()
 imports question(s) into the questionpool More...
 
 filterQuestionBrowserObject ()
 
 resetfilterQuestionBrowserObject ()
 
 questionsObject ($arrFilter=null)
 list questions of question pool More...
 
 updateObject ()
 
 afterSave (ilObject $a_new_object)
 
 exportObject ()
 
 createExportFileObject ($questions=null)
 create export file More...
 
 downloadExportFileObject ()
 download export file More...
 
 confirmDeleteExportFileObject ()
 confirmation screen for export file deletion More...
 
 cancelDeleteExportFileObject ()
 cancel deletion of export files More...
 
 deleteExportFileObject ()
 delete export files More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 form for new survey object import More...
 
createQuestionObject ()
 create new question More...
 
previewObject ()
 create preview of 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...
 
 addLocatorItems ()
 
 getTabs ()
 adds tabs to tab gui object More...
 
 saveObligatoryObject ()
 Save obligatory states. 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...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Static Public Member Functions

static _goto ($a_target)
 Redirect script to call a survey 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

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

Protected Member Functions

 initEditForm ()
 
 initImportForm ($a_new_type)
 
 initCreationForms ($a_new_type)
 
- 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...
 
 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...
 

Protected Attributes

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjSurveyQuestionPoolGUI::__construct ( )

Constructor public.

Definition at line 70 of file class.ilObjSurveyQuestionPoolGUI.php.

References $_GET, $DIC, $ilCtrl, ilObjectGUI\$lng, array, ilLoggerFactory\getLogger(), and user().

71  {
72  global $DIC;
73 
74  $this->lng = $DIC->language();
75  $this->nav_history = $DIC["ilNavigationHistory"];
76  $this->tpl = $DIC["tpl"];
77  $this->user = $DIC->user();
78  $this->toolbar = $DIC->toolbar();
79  $this->error = $DIC["ilErr"];
80  $this->locator = $DIC["ilLocator"];
81  $this->help = $DIC["ilHelp"];
82  $lng = $DIC->language();
83  $ilCtrl = $DIC->ctrl();
84 
85  $this->type = "spl";
86  $lng->loadLanguageModule("survey");
87  $this->ctrl = $ilCtrl;
88  $this->ctrl->saveParameter($this, array("ref_id"));
89 
90  parent::__construct("", $_GET["ref_id"], true, false);
91 
92  $this->log = ilLoggerFactory::getLogger('svy');
93  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
user()
Definition: user.php:4
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjSurveyQuestionPoolGUI::_goto (   $a_target)
static

Redirect script to call a survey question pool reference id.

Parameters
integer$a_targetThe reference id of the question pool public

Definition at line 940 of file class.ilObjSurveyQuestionPoolGUI.php.

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

941  {
942  global $DIC;
943 
944  $ilAccess = $DIC->access();
945  $lng = $DIC->language();
946 
947  if ($ilAccess->checkAccess("visible", "", $a_target) ||
948  $ilAccess->checkAccess("read", "", $a_target)) {
949  $_GET["baseClass"] = "ilObjSurveyQuestionPoolGUI";
950  $_GET["cmd"] = "infoScreen";
951  $_GET["ref_id"] = $a_target;
952  include_once("ilias.php");
953  exit;
954  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
955  ilUtil::sendFailure(sprintf(
956  $lng->txt("msg_no_perm_read_item"),
958  ), true);
960  }
961  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static _lookupObjId($a_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjSurveyQuestionPoolGUI::addLocatorItems ( )

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

References $_GET, ilObjectGUI\$locator, SurveyQuestion\_getQuestionType(), SurveyQuestion\_getTitle(), and object.

774  {
775  $ilLocator = $this->locator;
776  switch ($this->ctrl->getCmd()) {
777  case "create":
778  case "importFile":
779  case "cancel":
780  break;
781  default:
782  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $_GET["ref_id"]);
783  break;
784  }
785  if ((int) $_GET["q_id"]) {
786  $q_id = (int) $_GET["q_id"];
787  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
788  $q_type = SurveyQuestion::_getQuestionType($q_id) . "GUI";
789  $q_title = SurveyQuestion::_getTitle($q_id);
790  if ($q_title) {
791  // not on create
792  $this->ctrl->setParameterByClass($q_type, "q_id", $q_id);
793  $ilLocator->addItem(
794  $q_title,
795  $this->ctrl->getLinkTargetByClass($q_type, "editQuestion")
796  );
797  }
798  }
799  }
$_GET["client_id"]
static _getTitle($question_id)
Returns the question title of a question with a given id.
static _getQuestionType($question_id)
Returns the question type of a question with a given id.
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ afterSave()

ilObjSurveyQuestionPoolGUI::afterSave ( ilObject  $a_new_object)

Definition at line 514 of file class.ilObjSurveyQuestionPoolGUI.php.

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

515  {
516  // always send a message
517  ilUtil::sendSuccess($this->lng->txt("object_added"), true);
518 
519  ilUtil::redirect("ilias.php?ref_id=" . $a_new_object->getRefId() .
520  "&baseClass=ilObjSurveyQuestionPoolGUI");
521  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getRefId()
get reference id public
static redirect($a_script)
+ Here is the call graph for this function:

◆ cancelDeleteExportFileObject()

ilObjSurveyQuestionPoolGUI::cancelDeleteExportFileObject ( )

cancel deletion of export files

Definition at line 611 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilSession\clear().

612  {
613  ilSession::clear("ilExportFiles");
614  $this->ctrl->redirect($this, "export");
615  }
static clear($a_var)
Unset a value.
+ Here is the call graph for this function:

◆ cancelDeleteQuestionsObject()

ilObjSurveyQuestionPoolGUI::cancelDeleteQuestionsObject ( )

cancel delete questions

Definition at line 361 of file class.ilObjSurveyQuestionPoolGUI.php.

362  {
363  // delete questions after confirmation
364  $this->ctrl->redirect($this, "questions");
365  }

◆ confirmDeleteExportFileObject()

ilObjSurveyQuestionPoolGUI::confirmDeleteExportFileObject ( )

confirmation screen for export file deletion

Definition at line 587 of file class.ilObjSurveyQuestionPoolGUI.php.

References $_POST, ilObjectGUI\$data, array, ilDatePresentation\formatDate(), IL_CAL_UNIX, ilUtil\sendInfo(), and ilUtil\sendQuestion().

588  {
589  if (!isset($_POST["file"])) {
590  ilUtil::sendInfo($this->lng->txt("no_checkbox"), true);
591  $this->ctrl->redirect($this, "export");
592  }
593 
594  ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
595  include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionPoolExportTableGUI.php";
596  $table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export', true);
597  $export_dir = $this->object->getExportDirectory();
598  $data = array();
599  foreach ($_POST['file'] as $exp_file) {
600  $file_arr = explode("__", $exp_file);
601  array_push($data, array('file' => $exp_file, 'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)), 'size' => filesize($export_dir . "/" . $exp_file)));
602  }
603  $table_gui->setData($data);
604  $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
605  }
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
const IL_CAL_UNIX
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Date and time handling
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
Create styles array
The data for the language used.
$_POST["username"]
+ Here is the call graph for this function:

◆ confirmDeleteQuestionsObject()

ilObjSurveyQuestionPoolGUI::confirmDeleteQuestionsObject ( )

delete questions

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

References $_POST, and ilUtil\sendSuccess().

349  {
350  // delete questions after confirmation
351  ilUtil::sendSuccess($this->lng->txt("qpl_questions_deleted"), true);
352  foreach ($_POST['q_id'] as $q_id) {
353  $this->object->removeQuestion($q_id);
354  }
355  $this->ctrl->redirect($this, "questions");
356  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ copyObject()

ilObjSurveyQuestionPoolGUI::copyObject ( )

Copies checked questions in the questionpool to a clipboard.

Definition at line 265 of file class.ilObjSurveyQuestionPoolGUI.php.

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

266  {
267  if (count($_POST["q_id"]) > 0) {
268  foreach ($_POST["q_id"] as $key => $value) {
269  $this->object->copyToClipboard($value);
270  }
271  ilUtil::sendInfo($this->lng->txt("spl_copy_insert_clipboard"), true);
272  } else {
273  ilUtil::sendInfo($this->lng->txt("spl_copy_select_none"), true);
274  }
275  $this->ctrl->redirect($this, "questions");
276  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$key
Definition: croninfo.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ createExportFileObject()

ilObjSurveyQuestionPoolGUI::createExportFileObject (   $questions = null)

create export file

Definition at line 551 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\checkPermission().

Referenced by exportQuestionObject().

552  {
553  $this->checkPermission("write");
554 
555  include_once("./Modules/SurveyQuestionPool/classes/class.ilSurveyQuestionpoolExport.php");
556  $survey_exp = new ilSurveyQuestionpoolExport($this->object);
557  $survey_exp->buildExportFile($questions);
558  $this->ctrl->redirect($this, "export");
559  }
Export class for survey questionpools.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createQuestionObject()

& ilObjSurveyQuestionPoolGUI::createQuestionObject ( )

create new question

Definition at line 714 of file class.ilObjSurveyQuestionPoolGUI.php.

References $_POST, $ilUser, ilObjectGUI\$user, SurveyQuestionGUI\_getQuestionGUI(), and object.

715  {
717 
718  $ilUser->writePref("svy_lastquestiontype", $_POST["sel_question_types"]);
719 
720  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
721  $q_gui =&SurveyQuestionGUI::_getQuestionGUI($_POST["sel_question_types"]);
722  $q_gui->object->setObjId($this->object->getId());
723  $q_gui->object->createNewQuestion();
724 
725  $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
726  $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $_POST["sel_question_types"]);
727  $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
728  }
static _getQuestionGUI($questiontype, $question_id=-1)
Creates a question gui representation.
$ilUser
Definition: imgupload.php:18
Create new PHPExcel object
obj_idprivate
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteExportFileObject()

ilObjSurveyQuestionPoolGUI::deleteExportFileObject ( )

delete export files

Definition at line 620 of file class.ilObjSurveyQuestionPoolGUI.php.

References $_POST, $file, and ilUtil\delDir().

621  {
622  $export_dir = $this->object->getExportDirectory();
623  foreach ($_POST['file'] as $file) {
624  $file = basename($file);
625 
626  $exp_file = $export_dir . "/" . $file;
627  $exp_dir = $export_dir . "/" . substr($file, 0, strlen($file) - 4);
628  if (@is_file($exp_file)) {
629  unlink($exp_file);
630  }
631  if (@is_dir($exp_dir)) {
632  ilUtil::delDir($exp_dir);
633  }
634  }
635  $this->ctrl->redirect($this, "export");
636  }
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
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:

◆ deleteQuestionsObject()

ilObjSurveyQuestionPoolGUI::deleteQuestionsObject ( )

Creates a confirmation form to delete questions from the question pool.

Definition at line 310 of file class.ilObjSurveyQuestionPoolGUI.php.

References $_POST, ilObjectGUI\$data, $txt, SurveyQuestion\_getQuestionTypeName(), ilObjectGUI\checkPermission(), questionsObject(), and ilUtil\sendInfo().

311  {
312  $this->checkPermission('write');
313 
314  // create an array of all checked checkboxes
315  $checked_questions = $_POST['q_id'];
316  if (count($checked_questions) == 0) {
317  ilUtil::sendInfo($this->lng->txt("qpl_delete_select_none"));
318  $this->questionsObject();
319  return;
320  }
321 
322  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
323  $cgui = new ilConfirmationGUI();
324  $cgui->setHeaderText($this->lng->txt("qpl_confirm_delete_questions"));
325 
326  $cgui->setFormAction($this->ctrl->getFormAction($this));
327  $cgui->setCancel($this->lng->txt("cancel"), "cancelDeleteQuestions");
328  $cgui->setConfirm($this->lng->txt("confirm"), "confirmDeleteQuestions");
329 
330  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
331  $infos = $this->object->getQuestionInfos($checked_questions);
332  foreach ($infos as $data) {
333  $txt = $data["title"] . " (" .
334  SurveyQuestion::_getQuestionTypeName($data["type_tag"]) . ")";
335  if ($data["description"]) {
336  $txt .= "<div class=\"small\">" . $data["description"] . "</div>";
337  }
338 
339  $cgui->addItem("q_id[]", $data["id"], $txt);
340  }
341 
342  $this->tpl->setContent($cgui->getHTML());
343  }
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
questionsObject($arrFilter=null)
list questions of question pool
$txt
Definition: error.php:11
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ downloadExportFileObject()

ilObjSurveyQuestionPoolGUI::downloadExportFileObject ( )

download export file

Definition at line 564 of file class.ilObjSurveyQuestionPoolGUI.php.

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

565  {
566  if (!isset($_POST["file"])) {
567  ilUtil::sendInfo($this->lng->txt("no_checkbox"), true);
568  $this->ctrl->redirect($this, "export");
569  }
570 
571  if (count($_POST["file"]) > 1) {
572  ilUtil::sendInfo($this->lng->txt("select_max_one_item"), true);
573  $this->ctrl->redirect($this, "export");
574  }
575 
576 
577  $export_dir = $this->object->getExportDirectory();
578 
579  $file = basename($_POST["file"][0]);
580 
581  ilUtil::deliverFile($export_dir . "/" . $file, $file);
582  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
$_POST["username"]
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
+ Here is the call graph for this function:

◆ executeCommand()

ilObjSurveyQuestionPoolGUI::executeCommand ( )

execute command

Definition at line 98 of file class.ilObjSurveyQuestionPoolGUI.php.

References $_GET, $_POST, $nav_history, $ret, SurveyQuestionGUI\_getQuestionGUI(), ilObjectGUI\checkPermission(), ilObjectGUI\checkPermissionBool(), ilObjectGUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ilUtil\getStyleSheetLocation(), infoScreenForward(), and ilObjectGUI\prepareOutput().

99  {
100  $ilNavigationHistory = $this->nav_history;
101 
102  if (!$this->checkPermissionBool("visible") &&
103  !$this->checkPermissionBool("read")) {
104  $this->checkPermission("read");
105  }
106 
107  // add entry to navigation history
108  if (!$this->getCreationMode() &&
109  $this->checkPermissionBool("read")) {
110  $ilNavigationHistory->addItem(
111  $this->ref_id,
112  "ilias.php?baseClass=ilObjSurveyQuestionPoolGUI&cmd=questions&ref_id=" . $this->ref_id,
113  "spl"
114  );
115  }
116 
117  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "survey.css", "Modules/Survey"), "screen");
118  $this->prepareOutput();
119 
120  $cmd = $this->ctrl->getCmd("questions");
121  $next_class = $this->ctrl->getNextClass($this);
122  $this->ctrl->setReturn($this, "questions");
123  if ($_GET["q_id"] < 1) {
124  $q_type = ($_POST["sel_question_types"] != "")
125  ? $_POST["sel_question_types"]
126  : $_GET["sel_question_types"];
127  }
128 
129  $this->log->debug("- cmd=" . $cmd . " next_class=" . $next_class);
130  switch ($next_class) {
131  case 'ilobjectmetadatagui':
132  $this->checkPermission('write');
133  include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
134  $md_gui = new ilObjectMetaDataGUI($this->object);
135  $this->ctrl->forwardCommand($md_gui);
136  break;
137 
138  case 'ilpermissiongui':
139  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
140  $perm_gui = new ilPermissionGUI($this);
141  $ret =&$this->ctrl->forwardCommand($perm_gui);
142  break;
143 
144  case "ilsurveyphrasesgui":
145  include_once("./Modules/SurveyQuestionPool/classes/class.ilSurveyPhrasesGUI.php");
146  $phrases_gui = new ilSurveyPhrasesGUI($this);
147  $ret =&$this->ctrl->forwardCommand($phrases_gui);
148  break;
149 
150  case 'ilobjectcopygui':
151  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
152  $cp = new ilObjectCopyGUI($this);
153  $cp->setType('spl');
154  $this->ctrl->forwardCommand($cp);
155  break;
156 
157  case 'ilinfoscreengui':
158  $this->infoScreenForward();
159  break;
160 
161  case "ilcommonactiondispatchergui":
162  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
164  $this->ctrl->forwardCommand($gui);
165  break;
166 
167  case "":
168  $cmd.= "Object";
169  $ret =&$this->$cmd();
170  break;
171 
172  default:
173  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
174  $q_gui = SurveyQuestionGUI::_getQuestionGUI($q_type, $_GET["q_id"]);
175  $this->log->debug("- This is the switch/case default, going to question id =" . $_GET["q_id"]);
176  // $q_gui->object->setObjId($this->object->getId());
177  $q_gui->setQuestionTabs();
178  $ret =&$this->ctrl->forwardCommand($q_gui);
179 
180  // not on create
181  if ($q_gui->object->isComplete()) {
182  $this->tpl->setTitle($this->lng->txt("question") . ": " . $q_gui->object->getTitle());
183  }
184  break;
185  }
186  if (strtolower($_GET["baseClass"]) != "iladministrationgui" &&
187  $this->getCreationMode() != true) {
188  $this->tpl->show();
189  }
190  }
Class ilObjectMetaDataGUI.
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"]
Survey phrases GUI class.
static _getQuestionGUI($questiontype, $question_id=-1)
Creates a question gui representation.
prepareOutput($a_show_subobjects=true)
prepare output
$ret
Definition: parser.php:6
getCreationMode()
get creation mode
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
$_POST["username"]
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ exportObject()

ilObjSurveyQuestionPoolGUI::exportObject ( )

Definition at line 526 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$data, ilObjectGUI\$toolbar, array, ilDatePresentation\formatDate(), and IL_CAL_UNIX.

527  {
528  $ilToolbar = $this->toolbar;
529 
530  $ilToolbar->addButton(
531  $this->lng->txt('create_export_file'),
532  $this->ctrl->getLinkTarget($this, 'createExportFile')
533  );
534 
535  include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionPoolExportTableGUI.php";
536  $table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export');
537  $export_dir = $this->object->getExportDirectory();
538  $export_files = $this->object->getExportFiles($export_dir);
539  $data = array();
540  foreach ($export_files as $exp_file) {
541  $file_arr = explode("__", $exp_file);
542  array_push($data, array('file' => $exp_file, 'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)), 'size' => filesize($export_dir . "/" . $exp_file)));
543  }
544  $table_gui->setData($data);
545  $this->tpl->setContent($table_gui->getHTML());
546  }
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
const IL_CAL_UNIX
Date and time handling
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ exportQuestionObject()

ilObjSurveyQuestionPoolGUI::exportQuestionObject ( )

export a question

Definition at line 297 of file class.ilObjSurveyQuestionPoolGUI.php.

References $_POST, createExportFileObject(), questionsObject(), and ilUtil\sendInfo().

298  {
299  if (is_array($_POST['q_id']) && count($_POST['q_id']) > 0) {
300  $this->createExportFileObject($_POST['q_id']);
301  } else {
302  ilUtil::sendInfo($this->lng->txt("qpl_export_select_none"));
303  $this->questionsObject();
304  }
305  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
questionsObject($arrFilter=null)
list questions of question pool
createExportFileObject($questions=null)
create export file
$_POST["username"]
+ Here is the call graph for this function:

◆ filterQuestionBrowserObject()

ilObjSurveyQuestionPoolGUI::filterQuestionBrowserObject ( )

Definition at line 439 of file class.ilObjSurveyQuestionPoolGUI.php.

440  {
441  include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
442  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
443  $table_gui->writeFilterToSession();
444  $this->ctrl->redirect($this, 'questions');
445  }

◆ getTabs()

ilObjSurveyQuestionPoolGUI::getTabs ( )

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

Definition at line 806 of file class.ilObjSurveyQuestionPoolGUI.php.

References $_GET, $help, array, and ilObjectGUI\checkPermissionBool().

807  {
808  $ilHelp = $this->help;
809 
810  $ilHelp->setScreenIdComponent("spl");
811 
812  $next_class = $this->ctrl->getNextClass($this);
813  switch ($next_class) {
814  case "":
815  case "ilpermissiongui":
816  case "ilobjectmetadatagui":
817  case "ilsurveyphrasesgui":
818  break;
819  default:
820  return;
821  break;
822  }
823 
824  // questions
825  $force_active = (($this->ctrl->getCmdClass() == "" &&
826  $this->ctrl->getCmd() != "properties" && $this->ctrl->getCmd() != "infoScreen") ||
827  $this->ctrl->getCmd() == "")
828  ? true
829  : false;
830  if (!$force_active) {
831  if (is_array($_GET["sort"])) {
832  $force_active = true;
833  }
834  }
835 
836  if ($this->checkPermissionBool("read")) {
837  $this->tabs_gui->addTarget(
838  "survey_questions",
839  $this->ctrl->getLinkTarget($this, 'questions'),
840  array("questions", "filterQuestionBrowser", "filter", "reset", "createQuestion",
841  "importQuestions", "deleteQuestions", "copy", "paste",
842  "exportQuestions", "confirmDeleteQuestions", "cancelDeleteQuestions",
843  "confirmPasteQuestions", "cancelPasteQuestions", "uploadQuestions",
844  "editQuestion", "addMaterial", "removeMaterial", "save", "cancel",
845  "cancelExplorer", "linkChilds", "addGIT", "addST", "addPG", "preview",
846  "moveCategory", "deleteCategory", "addPhrase", "addCategory", "savePhrase",
847  "addSelectedPhrase", "cancelViewPhrase", "confirmSavePhrase", "cancelSavePhrase",
848  "insertBeforeCategory", "insertAfterCategory", "confirmDeleteCategory",
849  "cancelDeleteCategory", "categories", "saveCategories",
850  "savePhrase", "addPhrase"
851  ),
852  array("ilobjsurveyquestionpoolgui", "ilsurveyphrasesgui"),
853  "",
854  $force_active
855  );
856 
857  $this->tabs_gui->addTarget(
858  "info_short",
859  $this->ctrl->getLinkTarget($this, "infoScreen"),
860  array("infoScreen", "showSummary")
861  );
862  }
863 
864  if ($this->checkPermissionBool('write')) {
865  // properties
866  $this->tabs_gui->addTarget(
867  "settings",
868  $this->ctrl->getLinkTarget($this, 'properties'),
869  array("properties", "saveProperties"),
870  "",
871  ""
872  );
873 
874  // manage phrases
875  $this->tabs_gui->addTarget(
876  "manage_phrases",
877  $this->ctrl->getLinkTargetByClass("ilsurveyphrasesgui", "phrases"),
878  array("phrases", "deletePhrase", "confirmDeletePhrase", "cancelDeletePhrase", "editPhrase", "newPhrase", "saveEditPhrase", "phraseEditor"),
879  "ilsurveyphrasesgui",
880  ""
881  );
882 
883  // meta data
884  include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
885  $mdgui = new ilObjectMetaDataGUI($this->object);
886  $mdtab = $mdgui->getTab();
887  if ($mdtab) {
888  $this->tabs_gui->addTarget(
889  "meta_data",
890  $mdtab,
891  "",
892  "ilmdeditorgui"
893  );
894  }
895 
896  // export
897  $this->tabs_gui->addTarget(
898  "export",
899  $this->ctrl->getLinkTarget($this, 'export'),
900  array("export", "createExportFile", "confirmDeleteExportFile",
901  "downloadExportFile", "cancelDeleteExportFile", "deleteExportFile"),
902  "",
903  ""
904  );
905  }
906 
907  if ($this->checkPermissionBool("edit_permission")) {
908  $this->tabs_gui->addTarget(
909  "perm_settings",
910  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
911  array("perm","info","owner"),
912  'ilpermissiongui'
913  );
914  }
915  }
Class ilObjectMetaDataGUI.
$_GET["client_id"]
Create styles array
The data for the language used.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:

◆ importFileObject()

ilObjSurveyQuestionPoolGUI::importFileObject (   $parent_id = null,
  $a_catch_errors = true 
)

form for new survey object import

Definition at line 659 of file class.ilObjSurveyQuestionPoolGUI.php.

References $_GET, $error, $file, $form, ilObjectGUI\$ilErr, ilObjectGUI\$tpl, ilObjectGUI\checkPermissionBool(), initImportForm(), ilObjectGUI\putObjectInTree(), ilUtil\redirect(), and ilUtil\sendSuccess().

660  {
661  $tpl = $this->tpl;
663 
664  if (!$parent_id) {
665  $parent_id = $_GET["ref_id"];
666  }
667  $new_type = $_REQUEST["new_type"];
668 
669  // create permission is already checked in createObject. This check here is done to prevent hacking attempts
670  if (!$this->checkPermissionBool("create", "", $new_type)) {
671  $ilErr->raiseError($this->lng->txt("no_create_permission"));
672  }
673 
674  $this->lng->loadLanguageModule($new_type);
675  $this->ctrl->setParameter($this, "new_type", $new_type);
676 
677  $form = $this->initImportForm($new_type);
678  if ($form->checkInput()) {
679  include_once "./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
680  $newObj = new ilObjSurveyQuestionPool();
681  $newObj->setType($new_type);
682  $newObj->setTitle("dummy");
683  $newObj->create(true);
684  $this->putObjectInTree($newObj);
685 
686  $newObj->createImportDirectory();
687 
688  // copy uploaded file to import directory
689  $upload = $_FILES["importfile"];
690  $file = pathinfo($upload["name"]);
691  $full_path = $newObj->getImportDirectory() . "/" . $upload["name"];
692  ilUtil::moveUploadedFile(
693  $upload["tmp_name"],
694  $upload["name"],
695  $full_path
696  );
697 
698  // import qti data
699  $qtiresult = $newObj->importObject($full_path);
700 
701  ilUtil::sendSuccess($this->lng->txt("object_imported"), true);
702  ilUtil::redirect("ilias.php?ref_id=" . $newObj->getRefId() .
703  "&baseClass=ilObjSurveyQuestionPoolGUI");
704  }
705 
706  // display form to correct errors
707  $form->setValuesByPost();
708  $tpl->setContent($form->getHtml());
709  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
if(isset($_POST['submit'])) $form
putObjectInTree(ilObject $a_obj, $a_parent_node_id=null)
Add object to tree at given position.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static redirect($a_script)
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:

◆ importQuestionsObject()

ilObjSurveyQuestionPoolGUI::importQuestionsObject ( )

display the import form to import questions into the questionpool

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

References $form, ilObjectGUI\$tpl, array, and ilFileInputGUI\setSuffixes().

384  {
385  $tpl = $this->tpl;
386 
387  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
388  $form = new ilPropertyFormGUI();
389  $form->setFormAction($this->ctrl->getFormAction($this, "uploadQuestions"));
390  $form->setTitle($this->lng->txt("import_question"));
391 
392  include_once("./Services/Form/classes/class.ilFileInputGUI.php");
393  $fi = new ilFileInputGUI($this->lng->txt("select_file"), "qtidoc");
394  $fi->setSuffixes(array("xml", "zip"));
395  $fi->setRequired(true);
396  $form->addItem($fi);
397 
398  $form->addCommandButton("uploadQuestions", $this->lng->txt("import"));
399  $form->addCommandButton("questions", $this->lng->txt("cancel"));
400 
401  $tpl->setContent($form->getHTML());
402  }
This class represents a property form user interface.
This class represents a file property in a property form.
if(isset($_POST['submit'])) $form
Create styles array
The data for the language used.
setSuffixes($a_suffixes)
Set Accepted Suffixes.
+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjSurveyQuestionPoolGUI::infoScreenForward ( )

show information screen

Definition at line 757 of file class.ilObjSurveyQuestionPoolGUI.php.

References $info, ilObjectGUI\checkPermission(), ilObjectGUI\checkPermissionBool(), and object.

Referenced by executeCommand(), and infoScreenObject().

758  {
759  if (!$this->checkPermissionBool("read")) {
760  $this->checkPermission("visible");
761  }
762 
763  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
764  $info = new ilInfoScreenGUI($this);
765  $info->enablePrivateNotes();
766 
767  // standard meta data
768  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
769 
770  $this->ctrl->forwardCommand($info);
771  }
Class ilInfoScreenGUI.
Create new PHPExcel object
obj_idprivate
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
$info
Definition: index.php:5
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreenObject()

ilObjSurveyQuestionPoolGUI::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 747 of file class.ilObjSurveyQuestionPoolGUI.php.

References infoScreenForward().

748  {
749  $this->ctrl->setCmd("showSummary");
750  $this->ctrl->setCmdClass("ilinfoscreengui");
751  $this->infoScreenForward();
752  }
+ Here is the call graph for this function:

◆ initCreationForms()

ilObjSurveyQuestionPoolGUI::initCreationForms (   $a_new_type)
protected

Definition at line 646 of file class.ilObjSurveyQuestionPoolGUI.php.

References $form, array, ilObjectGUI\initCreateForm(), and initImportForm().

647  {
648  $form = $this->initImportForm($a_new_type);
649 
650  $forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
651  self::CFORM_IMPORT => $form);
652 
653  return $forms;
654  }
if(isset($_POST['submit'])) $form
initCreateForm($a_new_type)
Init object creation form.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ initEditForm()

ilObjSurveyQuestionPoolGUI::initEditForm ( )
protected

Definition at line 192 of file class.ilObjSurveyQuestionPoolGUI.php.

References $form, $title, object, ilFormPropertyGUI\setInfo(), ilTextAreaInputGUI\setValue(), and ilObject\TITLE_LENGTH.

Referenced by propertiesObject(), and savePropertiesObject().

193  {
194  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
195  $form = new ilPropertyFormGUI();
196  $form->setFormAction($this->ctrl->getFormAction($this, 'properties'));
197  $form->setTitle($this->lng->txt("properties"));
198  $form->setMultipart(false);
199  $form->setId("properties");
200 
201  // title
202  $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
203  $title->setSubmitFormOnEnter(true);
204  $title->setValue($this->object->getTitle());
205  $title->setSize(min(40, ilObject::TITLE_LENGTH));
206  $title->setMaxLength(ilObject::TITLE_LENGTH);
207  $title->setRequired(true);
208  $form->addItem($title);
209 
210  // desc
211  $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
212  $desc->setValue($this->object->getLongDescription());
213  $desc->setRows(2);
214  $desc->setCols(40);
215  $form->addItem($desc);
216 
217  // online
218  $online = new ilCheckboxInputGUI($this->lng->txt("spl_online_property"), "online");
219  $online->setInfo($this->lng->txt("spl_online_property_description"));
220  $online->setChecked($this->object->getOnline());
221  $form->addItem($online);
222 
223  $form->addCommandButton("saveProperties", $this->lng->txt("save"));
224 
225  return $form;
226  }
This class represents a property form user interface.
const TITLE_LENGTH
max length of object title
setValue($a_value)
Set Value.
This class represents a checkbox property in a property form.
setInfo($a_info)
Set Information Text.
if(isset($_POST['submit'])) $form
This class represents a text property in a property form.
Create new PHPExcel object
obj_idprivate
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initImportForm()

ilObjSurveyQuestionPoolGUI::initImportForm (   $a_new_type)
protected

Definition at line 638 of file class.ilObjSurveyQuestionPoolGUI.php.

References $form, and array.

Referenced by importFileObject(), and initCreationForms().

639  {
640  $form = parent::initImportForm($a_new_type);
641  $form->getItemByPostVar('importfile')->setSuffixes(array("zip", "xml"));
642 
643  return $form;
644  }
if(isset($_POST['submit'])) $form
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ moveObject()

ilObjSurveyQuestionPoolGUI::moveObject ( )

mark one or more question objects for moving

Definition at line 281 of file class.ilObjSurveyQuestionPoolGUI.php.

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

282  {
283  if (count($_POST["q_id"]) > 0) {
284  foreach ($_POST["q_id"] as $key => $value) {
285  $this->object->moveToClipboard($value);
286  }
287  ilUtil::sendInfo($this->lng->txt("spl_move_insert_clipboard"), true);
288  } else {
289  ilUtil::sendInfo($this->lng->txt("spl_move_select_none"), true);
290  }
291  $this->ctrl->redirect($this, "questions");
292  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$key
Definition: croninfo.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ pasteObject()

ilObjSurveyQuestionPoolGUI::pasteObject ( )

paste questios from the clipboard into the question pool

Definition at line 370 of file class.ilObjSurveyQuestionPoolGUI.php.

References $_SESSION, and ilUtil\sendInfo().

371  {
372  if (array_key_exists("spl_clipboard", $_SESSION)) {
373  $this->object->pasteFromClipboard();
374  } else {
375  ilUtil::sendInfo($this->lng->txt("spl_paste_no_objects"), true);
376  }
377  $this->ctrl->redirect($this, "questions");
378  }
$_SESSION["AccountId"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ previewObject()

& ilObjSurveyQuestionPoolGUI::previewObject ( )

create preview of object

Definition at line 733 of file class.ilObjSurveyQuestionPoolGUI.php.

References $_GET, and SurveyQuestionGUI\_getQuestionGUI().

734  {
735  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
736  $q_gui =&SurveyQuestionGUI::_getQuestionGUI("", $_GET["preview"]);
737  $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $q_gui->getQuestionType());
738  $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $_GET["preview"]);
739  $this->ctrl->redirectByClass(get_class($q_gui), "preview");
740  }
$_GET["client_id"]
static _getQuestionGUI($questiontype, $question_id=-1)
Creates a question gui representation.
+ Here is the call graph for this function:

◆ propertiesObject()

ilObjSurveyQuestionPoolGUI::propertiesObject ( ilPropertyFormGUI  $a_form = null)

Questionpool properties.

Definition at line 231 of file class.ilObjSurveyQuestionPoolGUI.php.

References initEditForm().

Referenced by savePropertiesObject().

232  {
233  if (!$a_form) {
234  $a_form = $this->initEditForm();
235  }
236 
237  $this->tpl->setVariable("ADM_CONTENT", $a_form->getHTML());
238  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ questionsObject()

ilObjSurveyQuestionPoolGUI::questionsObject (   $arrFilter = null)

list questions of question pool

Definition at line 458 of file class.ilObjSurveyQuestionPoolGUI.php.

References $_GET, $_SESSION, ilObjectGUI\$data, $ilUser, $options, ilObjectGUI\$toolbar, ilObjectGUI\$user, array, ilObjectGUI\checkPermissionBool(), ilSubmitButton\getInstance(), and object.

Referenced by deleteQuestionsObject(), and exportQuestionObject().

459  {
461  $ilToolbar = $this->toolbar;
462 
463  $this->object->purgeQuestions();
464 
465  $_SESSION['q_id_table_nav'] = $_GET['q_id_table_nav'];
466 
467  if ($this->checkPermissionBool('write')) {
468  include_once "Services/Form/classes/class.ilSelectInputGUI.php";
469  $qtypes = new ilSelectInputGUI("", "sel_question_types");
470  $qtypes->setValue($ilUser->getPref("svy_lastquestiontype"));
471  $ilToolbar->addInputItem($qtypes);
472 
473  $options = array();
474  foreach (ilObjSurveyQuestionPool::_getQuestionTypes() as $translation => $data) {
475  $options[$data["type_tag"]] = $translation;
476  }
477  $qtypes->setOptions($options);
478 
479  $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
480 
481  include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
482  $button = ilSubmitButton::getInstance();
483  $button->setCaption("svy_create_question");
484  $button->setCommand("createQuestion");
485  $ilToolbar->addButtonInstance($button);
486 
487  $ilToolbar->addSeparator();
488 
489  $button = ilSubmitButton::getInstance();
490  $button->setCaption("import");
491  $button->setCommand("importQuestions");
492  $ilToolbar->addButtonInstance($button);
493  }
494 
495  include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
496  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions', (($this->checkPermissionBool('write') ? true : false)));
497  $table_gui->setEditable($this->checkPermissionBool('write'));
498  $arrFilter = array();
499  foreach ($table_gui->getFilterItems() as $item) {
500  if ($item->getValue() !== false) {
501  $arrFilter[$item->getPostVar()] = $item->getValue();
502  }
503  }
504  $table_gui->setData($this->object->getQuestionsData($arrFilter));
505  $this->tpl->setContent($table_gui->getHTML());
506  }
$_SESSION["AccountId"]
This class represents a selection list property in a property form.
$_GET["client_id"]
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetfilterQuestionBrowserObject()

ilObjSurveyQuestionPoolGUI::resetfilterQuestionBrowserObject ( )

Definition at line 447 of file class.ilObjSurveyQuestionPoolGUI.php.

448  {
449  include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
450  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
451  $table_gui->resetFilter();
452  $this->ctrl->redirect($this, 'questions');
453  }

◆ saveObligatoryObject()

ilObjSurveyQuestionPoolGUI::saveObligatoryObject ( )

Save obligatory states.

Definition at line 920 of file class.ilObjSurveyQuestionPoolGUI.php.

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

921  {
922  $obligatory = array();
923  foreach ($_POST as $key => $value) {
924  if (preg_match("/obligatory_(\d+)/", $key, $matches)) {
925  $obligatory[]= $matches[1];
926  }
927  }
928  $this->object->setObligatoryStates($obligatory);
929 
930  ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
931  $this->ctrl->redirect($this, "questions");
932  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Create styles array
The data for the language used.
$key
Definition: croninfo.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ savePropertiesObject()

ilObjSurveyQuestionPoolGUI::savePropertiesObject ( )

Save questionpool properties.

Definition at line 243 of file class.ilObjSurveyQuestionPoolGUI.php.

References $form, initEditForm(), propertiesObject(), and ilUtil\sendSuccess().

244  {
245  $form = $this->initEditForm();
246  if ($form->checkInput()) {
247  $this->object->setTitle($form->getInput("title"));
248  $this->object->setDescription($form->getInput("desc"));
249  $this->object->setOnline((int) $form->getInput("online"));
250 
251  $this->object->saveToDb();
252 
253  ilUtil::sendSuccess($this->lng->txt("saved_successfully"), true);
254  $this->ctrl->redirect($this, "properties");
255  }
256 
257  $form->setValuesByPost();
258  $this->propertiesObject($form);
259  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
if(isset($_POST['submit'])) $form
propertiesObject(ilPropertyFormGUI $a_form=null)
Questionpool properties.
+ Here is the call graph for this function:

◆ updateObject()

ilObjSurveyQuestionPoolGUI::updateObject ( )

Definition at line 508 of file class.ilObjSurveyQuestionPoolGUI.php.

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

509  {
510  $this->update = $this->object->update();
511  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
512  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
update($pash, $contents, Config $config)
+ Here is the call graph for this function:

◆ uploadQuestionsObject()

ilObjSurveyQuestionPoolGUI::uploadQuestionsObject ( )

imports question(s) into the questionpool

Definition at line 407 of file class.ilObjSurveyQuestionPoolGUI.php.

References $error, and $source.

408  {
409  // check if file was uploaded
410  $source = $_FILES["qtidoc"]["tmp_name"];
411  $error = 0;
412  if (($source == 'none') || (!$source) || $_FILES["qtidoc"]["error"] > UPLOAD_ERR_OK) {
413  $error = 1;
414  }
415  // check correct file type
416  if (!$error && strpos("xml", $_FILES["qtidoc"]["type"]) !== false) {
417  $error = 1;
418  }
419  if (!$error) {
420  // import file into questionpool
421  // create import directory
422  $this->object->createImportDirectory();
423 
424  // copy uploaded file to import directory
425  $full_path = $this->object->getImportDirectory() . "/" . $_FILES["qtidoc"]["name"];
426 
427  ilUtil::moveUploadedFile(
428  $_FILES["qtidoc"]["tmp_name"],
429  $_FILES["qtidoc"]["name"],
430  $full_path
431  );
432  $source = $full_path;
433  $this->object->importObject($source, true);
434  unlink($source);
435  }
436  $this->ctrl->redirect($this, "questions");
437  }
$source
Definition: linkback.php:22

Field Documentation

◆ $defaultscript

ilObjSurveyQuestionPoolGUI::$defaultscript

Definition at line 64 of file class.ilObjSurveyQuestionPoolGUI.php.

◆ $error

ilObjSurveyQuestionPoolGUI::$error
protected

Definition at line 52 of file class.ilObjSurveyQuestionPoolGUI.php.

Referenced by importFileObject(), and uploadQuestionsObject().

◆ $help

ilObjSurveyQuestionPoolGUI::$help
protected

Definition at line 57 of file class.ilObjSurveyQuestionPoolGUI.php.

Referenced by getTabs().

◆ $log

ilObjSurveyQuestionPoolGUI::$log
protected

Definition at line 62 of file class.ilObjSurveyQuestionPoolGUI.php.

◆ $nav_history

ilObjSurveyQuestionPoolGUI::$nav_history
protected

Definition at line 47 of file class.ilObjSurveyQuestionPoolGUI.php.

Referenced by executeCommand().


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