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 @access 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 ()
 updates object entry in object_data More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 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 ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 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 @access 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 ()
 Init object edit form. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 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 @access public.

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

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 }
user()
Definition: user.php:4
$_GET["client_id"]
error($a_errmsg)
set error message @access public
static getLogger($a_component_id)
Get component logger.
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7

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

+ 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 @access public

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

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)) {
956 $lng->txt("msg_no_perm_read_item"),
958 ), true);
960 }
961 }
sprintf('%.4f', $callTime)
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

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

+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjSurveyQuestionPoolGUI::addLocatorItems ( )

should be overwritten to add object specific items (repository items are preloaded)

Reimplemented from ilObjectGUI.

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

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

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

+ Here is the call graph for this function:

◆ afterSave()

ilObjSurveyQuestionPoolGUI::afterSave ( ilObject  $a_new_object)

Post (successful) object creation hook.

Parameters
ilObject$a_new_object

Reimplemented from ilObjectGUI.

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

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 }
getRefId()
get reference id @access public
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)

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

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

612 {
613 ilSession::clear("ilExportFiles");
614 $this->ctrl->redirect($this, "export");
615 }
static clear($a_var)
Unset a value.

References ilSession\clear().

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

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 }
$_POST["username"]
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date @access public.
@classDescription Date and time handling
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

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

+ Here is the call graph for this function:

◆ confirmDeleteQuestionsObject()

ilObjSurveyQuestionPoolGUI::confirmDeleteQuestionsObject ( )

delete questions

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

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 }

References $_POST, and ilUtil\sendSuccess().

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

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 }
$key
Definition: croninfo.php:18

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

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

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 }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
Export class for survey questionpools.

References ilObjectGUI\checkPermission().

Referenced by exportQuestionObject().

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

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

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

+ Here is the call graph for this function:

◆ deleteExportFileObject()

ilObjSurveyQuestionPoolGUI::deleteExportFileObject ( )

delete export files

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

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 }
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file

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

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

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"] . " (" .
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.
Confirmation screen class.
questionsObject($arrFilter=null)
list questions of question pool
$txt
Definition: error.php:11

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

+ Here is the call graph for this function:

◆ downloadExportFileObject()

ilObjSurveyQuestionPoolGUI::downloadExportFileObject ( )

download export file

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

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 deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.

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

+ Here is the call graph for this function:

◆ executeCommand()

ilObjSurveyQuestionPoolGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

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 }
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
GUI class for the workflow of copying objects.
prepareOutput($a_show_subobjects=true)
prepare output
getCreationMode()
get creation mode
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
Class ilObjectMetaDataGUI.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
Survey phrases GUI class.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$ret
Definition: parser.php:6

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

+ Here is the call graph for this function:

◆ exportObject()

ilObjSurveyQuestionPoolGUI::exportObject ( )

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

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 }

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

+ Here is the call graph for this function:

◆ exportQuestionObject()

ilObjSurveyQuestionPoolGUI::exportQuestionObject ( )

export a question

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

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 }
createExportFileObject($questions=null)
create export file

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

+ 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

Reimplemented from ilObjectGUI.

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

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 }

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

+ Here is the call graph for this function:

◆ importFileObject()

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

form for new survey object import

Reimplemented from ilObjectGUI.

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

660 {
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 }
initImportForm($a_new_type)
Init object import form.
putObjectInTree(ilObject $a_obj, $a_parent_node_id=null)
Add object to tree at given position.
if(isset($_POST['submit'])) $form

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

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

384 {
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 file property in a property form.
This class represents a property form user interface.

References $form, and ilObjectGUI\$tpl.

◆ infoScreenForward()

ilObjSurveyQuestionPoolGUI::infoScreenForward ( )

show information screen

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

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.
$info
Definition: index.php:5

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

Referenced by executeCommand(), and infoScreenObject().

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

748 {
749 $this->ctrl->setCmd("showSummary");
750 $this->ctrl->setCmdClass("ilinfoscreengui");
751 $this->infoScreenForward();
752 }

References infoScreenForward().

+ Here is the call graph for this function:

◆ initCreationForms()

ilObjSurveyQuestionPoolGUI::initCreationForms (   $a_new_type)
protected

Init creation froms.

this will create the default creation forms: new, import, clone

Parameters
string$a_new_type
Returns
array

Reimplemented from ilObjectGUI.

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

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 }
initCreateForm($a_new_type)
Init object creation form.

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

+ Here is the call graph for this function:

◆ initEditForm()

ilObjSurveyQuestionPoolGUI::initEditForm ( )
protected

Init object edit form.

Returns
ilPropertyFormGUI

Reimplemented from ilObjectGUI.

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

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 checkbox property in a property form.
const TITLE_LENGTH
max length of object title
This class represents a text area property in a property form.
This class represents a text property in a property form.

References $form, $title, and ilObject\TITLE_LENGTH.

Referenced by propertiesObject(), and savePropertiesObject().

+ Here is the caller graph for this function:

◆ initImportForm()

ilObjSurveyQuestionPoolGUI::initImportForm (   $a_new_type)
protected

Init object import form.

Parameters
stringnew type
Returns
ilPropertyFormGUI

Reimplemented from ilObjectGUI.

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

639 {
640 $form = parent::initImportForm($a_new_type);
641 $form->getItemByPostVar('importfile')->setSuffixes(array("zip", "xml"));
642
643 return $form;
644 }

References $form.

Referenced by importFileObject(), and initCreationForms().

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

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 }

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

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

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"]

References $_SESSION, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ previewObject()

& ilObjSurveyQuestionPoolGUI::previewObject ( )

create preview of object

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

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 }

References $_GET, and SurveyQuestionGUI\_getQuestionGUI().

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

232 {
233 if (!$a_form) {
234 $a_form = $this->initEditForm();
235 }
236
237 $this->tpl->setVariable("ADM_CONTENT", $a_form->getHTML());
238 }

References initEditForm().

Referenced by savePropertiesObject().

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

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 }
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
This class represents a selection list property in a property form.
static getInstance()
Factory.

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

Referenced by deleteQuestionsObject(), and exportQuestionObject().

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

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 }

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

+ Here is the call graph for this function:

◆ savePropertiesObject()

ilObjSurveyQuestionPoolGUI::savePropertiesObject ( )

Save questionpool properties.

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

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 }
propertiesObject(ilPropertyFormGUI $a_form=null)
Questionpool properties.

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

+ Here is the call graph for this function:

◆ updateObject()

ilObjSurveyQuestionPoolGUI::updateObject ( )

updates object entry in object_data

Reimplemented from ilObjectGUI.

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

509 {
510 $this->update = $this->object->update();
511 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
512 }
update($pash, $contents, Config $config)

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

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

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

References $error, and $source.

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: