ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjSurveyQuestionPoolGUI Class Reference

Class ilObjSurveyQuestionPoolGUI. More...

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

Public Member Functions

 ilObjSurveyQuestionPoolGUI ()
 Constructor public.
 executeCommand ()
 execute command
 cancelObject ()
 cancel action and go back to previous page
 saveObject ()
 save object
 propertiesObject ()
 Questionpool properties.
 savePropertiesObject ()
 Save questionpool properties.
 copyObject ()
 Copies checked questions in the questionpool to a clipboard.
 moveObject ()
 mark one or more question objects for moving
 exportQuestionObject ()
 export a question
 deleteQuestionsObject ()
 Creates a confirmation form to delete questions from the question pool.
 confirmDeleteQuestionsObject ()
 delete questions
 cancelDeleteQuestionsObject ()
 cancel delete questions
 pasteObject ()
 paste questios from the clipboard into the question pool
 importQuestionsObject ()
 display the import form to import questions into the questionpool
 uploadQuestionsObject ()
 imports question(s) into the questionpool
 filterQuestionBrowserObject ()
 resetfilterQuestionBrowserObject ()
 questionsObject ($arrFilter=null)
 list questions of question pool
 updateObject ()
 updates object entry in object_data
 exportObject ()
 createExportFileObject ($questions=null)
 create export file
 downloadExportFileObject ()
 download export file
 confirmDeleteExportFileObject ()
 confirmation screen for export file deletion
 cancelDeleteExportFileObject ()
 cancel deletion of export files
 deleteExportFileObject ()
 delete export files
 importObject ()
 display dialogue for importing questionpools
 uploadSplObject ($redirect=true)
 imports question(s) into the questionpool
 createObject ()
 form for new content object creation
 importFileObject ()
 form for new survey object import
createQuestionObject ()
 create new question
editQuestionForSurveyObject ()
 edit question
createQuestionForSurveyObject ()
 create question from survey
previewObject ()
 create preview of object
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 getTabs (&$tabs_gui)
 adds tabs to tab gui object
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 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
 getCreationMode ()
 get creation mode
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getHTML ()
 undeleteObject ()
 Get objects back from trash.
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 editObject ()
 edit object
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 trashObject ()
 Show trash content of object.
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.

Static Public Member Functions

static _goto ($a_target)
 Redirect script to call a survey question pool reference id.

Data Fields

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

Additional Inherited Members

- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showUpperIcon ()
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 omitLocator ($a_omit=true)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 displayEditForm ($fields)
 display edit form (usually called by editObject)
 afterUpdate ()
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 __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
 __showClipboardTable ($a_result_set, $a_from="")
 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
 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.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="")

Detailed Description

Member Function Documentation

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

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

{
global $ilAccess, $ilErr, $lng;
if ($ilAccess->checkAccess("write", "", $a_target))
{
$_GET["baseClass"] = "ilObjSurveyQuestionPoolGUI";
$_GET["cmd"] = "questions";
$_GET["ref_id"] = $a_target;
include_once("ilias.php");
}
else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
{
$_GET["cmd"] = "frameset";
$_GET["target"] = "";
$_GET["ref_id"] = ROOT_FOLDER_ID;
ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
include("repository.php");
}
$ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::addLocatorItems ( )

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

Reimplemented from ilObjectGUI.

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

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

{
global $ilLocator;
switch ($this->ctrl->getCmd())
{
case "create":
case "importFile":
case "cancel":
break;
default:
$ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $_GET["ref_id"]);
break;
}
if ($_GET["q_id"] > 0)
{
include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
$q_type = SurveyQuestion::_getQuestionType($_GET["q_id"]) . "GUI";
$this->ctrl->setParameterByClass($q_type, "q_id", $_GET["q_id"]);
$ilLocator->addItem(SurveyQuestion::_getTitle($_GET["q_id"]), $this->ctrl->getLinkTargetByClass($q_type, "editQuestion"));
}
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::cancelDeleteExportFileObject ( )

cancel deletion of export files

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

{
session_unregister("ilExportFiles");
$this->ctrl->redirect($this, "export");
}
ilObjSurveyQuestionPoolGUI::cancelDeleteQuestionsObject ( )

cancel delete questions

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

{
// delete questions after confirmation
$this->ctrl->redirect($this, "questions");
}
ilObjSurveyQuestionPoolGUI::cancelObject ( )

cancel action and go back to previous page

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

References $_GET, and ilUtil\redirect().

{
ilUtil::redirect("repository.php?cmd=frameset&ref_id=".$_GET["ref_id"]);
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::confirmDeleteExportFileObject ( )

confirmation screen for export file deletion

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

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

{
if(!isset($_POST["file"]))
{
ilUtil::sendInfo($this->lng->txt("no_checkbox"),true);
$this->ctrl->redirect($this, "export");
}
ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionPoolExportTableGUI.php";
$table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export', true);
$export_dir = $this->object->getExportDirectory();
$data = array();
foreach ($_POST['file'] as $exp_file)
{
$file_arr = explode("__", $exp_file);
array_push($data, array('file' => $exp_file, 'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)), 'size' => filesize($export_dir."/".$exp_file)));
}
$table_gui->setData($data);
$this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::confirmDeleteQuestionsObject ( )

delete questions

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

References $_POST, and ilUtil\sendSuccess().

{
// delete questions after confirmation
ilUtil::sendSuccess($this->lng->txt("qpl_questions_deleted"), true);
foreach ($_POST['q_id'] as $q_id)
{
$this->object->removeQuestion($q_id);
}
$this->ctrl->redirect($this, "questions");
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::copyObject ( )

Copies checked questions in the questionpool to a clipboard.

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

References $_POST, and ilUtil\sendInfo().

{
if (count($_POST["q_id"]) > 0)
{
foreach ($_POST["q_id"] as $key => $value)
{
$this->object->copyToClipboard($value);
}
ilUtil::sendInfo($this->lng->txt("spl_copy_insert_clipboard"), true);
}
else
{
ilUtil::sendInfo($this->lng->txt("spl_copy_select_none"), true);
}
$this->ctrl->redirect($this, "questions");
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::createExportFileObject (   $questions = null)

create export file

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

References ilUtil\sendInfo().

Referenced by exportQuestionObject().

{
global $rbacsystem;
if ($rbacsystem->checkAccess("write", $this->ref_id))
{
include_once("./Modules/SurveyQuestionPool/classes/class.ilSurveyQuestionpoolExport.php");
$survey_exp = new ilSurveyQuestionpoolExport($this->object);
$survey_exp->buildExportFile($questions);
$this->ctrl->redirect($this, "export");
}
else
{
ilUtil::sendInfo("cannot_export_questionpool");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjSurveyQuestionPoolGUI::createObject ( )

form for new content object creation

Reimplemented from ilObjectGUI.

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

References $_GET, $_POST, $_SESSION, ilObjectGUI\$data, ilFrameTargetInfo\_getFrame(), ilObjectGUI\fillCloneTemplate(), ilUtil\getImagePath(), ilObjectGUI\getTemplateFile(), and ilUtil\prepareFormOutput().

Referenced by importFileObject().

{
global $rbacsystem;
$new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $new_type))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
else
{
$this->getTemplateFile("create", $new_type);
include_once("./Modules/Survey/classes/class.ilObjSurvey.php");
$this->fillCloneTemplate('DUPLICATE','spl');
$this->tpl->setCurrentBlock("adm_content");
// fill in saved values in case of error
$data = array();
$data["fields"] = array();
include_once "./Services/Utilities/classes/class.ilUtil.php";
$data["fields"]["title"] = ilUtil::prepareFormOutput($_SESSION["error_post_vars"]["Fobject"]["title"],true);
$data["fields"]["desc"] = ilUtil::prepareFormOutput($_SESSION["error_post_vars"]["Fobject"]["desc"]);
foreach ($data["fields"] as $key => $val)
{
$this->tpl->setVariable("TXT_".strtoupper($key), $this->lng->txt($key));
$this->tpl->setVariable(strtoupper($key), $val);
if ($this->prepare_output)
{
$this->tpl->parseCurrentBlock();
}
}
$this->ctrl->setParameter($this, "new_type", $this->type);
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("TXT_HEADER", $this->lng->txt($new_type."_new"));
$this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
$this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt($new_type."_add"));
$this->tpl->setVariable("CMD_SUBMIT", "save");
$this->tpl->setVariable("TARGET", ' target="'.
ilFrameTargetInfo::_getFrame("MainContent").'" ');
$this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
$this->tpl->setVariable("TXT_IMPORT_SPL", $this->lng->txt("import_spl"));
$this->tpl->setVariable("TXT_SPL_FILE", $this->lng->txt("spl_upload_file"));
$this->tpl->setVariable("NEW_TYPE", $this->type);
$this->tpl->setVariable("TXT_IMPORT", $this->lng->txt("import"));
$this->tpl->setVariable("TYPE_IMG", ilUtil::getImagePath('icon_spl.gif'));
$this->tpl->setVariable("ALT_IMG",$this->lng->txt("obj_spl"));
$this->tpl->setVariable("TYPE_IMG2", ilUtil::getImagePath('icon_spl.gif'));
$this->tpl->setVariable("ALT_IMG2",$this->lng->txt("obj_spl"));
$this->tpl->parseCurrentBlock();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilObjSurveyQuestionPoolGUI::createQuestionForSurveyObject ( )

create question from survey

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

References $_GET, and SurveyQuestionGUI\_getQuestionGUI().

{
include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
$q_gui =& SurveyQuestionGUI::_getQuestionGUI($_GET["sel_question_types"]);
$q_gui->object->createNewQuestion();
$this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
$this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $q_gui->getQuestionType());
$this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
}

+ Here is the call graph for this function:

& ilObjSurveyQuestionPoolGUI::createQuestionObject ( )

create new question

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

References $_POST, and SurveyQuestionGUI\_getQuestionGUI().

{
global $ilUser;
$ilUser->writePref("svy_lastquestiontype", $_POST["sel_question_types"]);
include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
$q_gui =& SurveyQuestionGUI::_getQuestionGUI($_POST["sel_question_types"]);
$q_gui->object->setObjId($this->object->getId());
$q_gui->object->createNewQuestion();
$this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
$this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $_POST["sel_question_types"]);
$this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::deleteExportFileObject ( )

delete export files

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

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

{
$export_dir = $this->object->getExportDirectory();
foreach($_POST['file'] as $file)
{
$exp_file = $export_dir."/".$file;
$exp_dir = $export_dir."/".substr($file, 0, strlen($file) - 4);
if (@is_file($exp_file))
{
unlink($exp_file);
}
if (@is_dir($exp_dir))
{
include_once "./Services/Utilities/classes/class.ilUtil.php";
ilUtil::delDir($exp_dir);
}
}
$this->ctrl->redirect($this, "export");
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::deleteQuestionsObject ( )

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

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

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

{
global $rbacsystem;
// create an array of all checked checkboxes
$checked_questions = $_POST['q_id'];
if (count($checked_questions) > 0)
{
if ($rbacsystem->checkAccess('write', $this->ref_id))
{
ilUtil::sendQuestion($this->lng->txt("qpl_confirm_delete_questions"));
}
else
{
ilUtil::sendFailure($this->lng->txt("qpl_delete_rbac_error"));
$this->questionsObject();
return;
}
}
elseif (count($checked_questions) == 0)
{
ilUtil::sendInfo($this->lng->txt("qpl_delete_select_none"));
$this->questionsObject();
return;
}
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_qpl_confirm_delete_questions.html", "Modules/SurveyQuestionPool");
$infos = $this->object->getQuestionInfos($checked_questions);
$colors = array("tblrow1", "tblrow2");
$counter = 0;
include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
foreach ($infos as $data)
{
$this->tpl->setCurrentBlock("row");
$this->tpl->setVariable("COLOR_CLASS", $colors[$counter % 2]);
$this->tpl->setVariable("TXT_TITLE", $data["title"]);
$this->tpl->setVariable("TXT_DESCRIPTION", $data["description"]);
$this->tpl->setVariable("TXT_TYPE", SurveyQuestion::_getQuestionTypeName($data["type_tag"]));
$this->tpl->parseCurrentBlock();
$counter++;
}
foreach ($checked_questions as $id)
{
$this->tpl->setCurrentBlock("hidden");
$this->tpl->setVariable("HIDDEN_NAME", "q_id[]");
$this->tpl->setVariable("HIDDEN_VALUE", $id);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("adm_content");
$this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
$this->tpl->setVariable("TXT_DESCRIPTION", $this->lng->txt("description"));
$this->tpl->setVariable("TXT_TYPE", $this->lng->txt("question_type"));
$this->tpl->setVariable("BTN_CONFIRM", $this->lng->txt("confirm"));
$this->tpl->setVariable("BTN_CANCEL", $this->lng->txt("cancel"));
$this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::downloadExportFileObject ( )

download export file

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

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

{
if(!isset($_POST["file"]))
{
ilUtil::sendInfo($this->lng->txt("no_checkbox"), true);
$this->ctrl->redirect($this, "export");
}
if (count($_POST["file"]) > 1)
{
ilUtil::sendInfo($this->lng->txt("select_max_one_item"),true);
$this->ctrl->redirect($this, "export");
}
$export_dir = $this->object->getExportDirectory();
include_once "./Services/Utilities/classes/class.ilUtil.php";
ilUtil::deliverFile($export_dir."/".$_POST["file"][0],
$_POST["file"][0]);
}

+ Here is the call graph for this function:

& ilObjSurveyQuestionPoolGUI::editQuestionForSurveyObject ( )

edit question

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

References $_GET, and SurveyQuestionGUI\_getQuestionGUI().

{
include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
$q_gui =& SurveyQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
$this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $q_gui->getQuestionType());
$this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $_GET["q_id"]);
$this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

References $_GET, $_POST, $cmd, ilObjectGUI\$ilias, $ret, SurveyQuestionGUI\_getQuestionGUI(), ilMDEditorGUI\addObserver(), ilObjectGUI\getCreationMode(), ilUtil\getStyleSheetLocation(), and ilObjectGUI\prepareOutput().

{
global $ilAccess, $ilNavigationHistory;
if ((!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) && (!$ilAccess->checkAccess("visible", "", $_GET["ref_id"])))
{
global $ilias;
$ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE);
}
// add entry to navigation history
if (!$this->getCreationMode() &&
$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
{
$ilNavigationHistory->addItem($_GET["ref_id"],
"ilias.php?baseClass=ilObjSurveyQuestionPoolGUI&cmd=questions&ref_id=".$_GET["ref_id"], "spl");
}
$this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "survey.css", "Modules/Survey"), "screen");
$this->prepareOutput();
$cmd = $this->ctrl->getCmd("questions");
$next_class = $this->ctrl->getNextClass($this);
$this->ctrl->setReturn($this, "questions");
if ($_GET["q_id"] < 1)
{
$q_type = ($_POST["sel_question_types"] != "")
? $_POST["sel_question_types"]
: $_GET["sel_question_types"];
}
switch($next_class)
{
case 'ilmdeditorgui':
include_once "./Services/MetaData/classes/class.ilMDEditorGUI.php";
$md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
$md_gui->addObserver($this->object,'MDUpdateListener','General');
$this->ctrl->forwardCommand($md_gui);
break;
case 'ilpermissiongui':
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
case "ilsurveyphrasesgui":
include_once("./Modules/SurveyQuestionPool/classes/class.ilSurveyPhrasesGUI.php");
$phrases_gui =& new ilSurveyPhrasesGUI($this);
$ret =& $this->ctrl->forwardCommand($phrases_gui);
break;
case 'ilobjectcopygui':
include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
$cp = new ilObjectCopyGUI($this);
$cp->setType('spl');
$this->ctrl->forwardCommand($cp);
break;
case "":
$cmd.= "Object";
$ret =& $this->$cmd();
break;
default:
include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
$q_gui = SurveyQuestionGUI::_getQuestionGUI($q_type, $_GET["q_id"]);
$q_gui->object->setObjId($this->object->getId());
$q_gui->setQuestionTabs();
$ret =& $this->ctrl->forwardCommand($q_gui);
break;
}
if (strtolower($_GET["baseClass"]) != "iladministrationgui" &&
$this->getCreationMode() != true)
{
$this->tpl->show();
}
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::exportObject ( )

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

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

{
include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionPoolExportTableGUI.php";
$table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export');
$export_dir = $this->object->getExportDirectory();
$export_files = $this->object->getExportFiles($export_dir);
$data = array();
foreach ($export_files as $exp_file)
{
$file_arr = explode("__", $exp_file);
array_push($data, array('file' => $exp_file, 'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)), 'size' => filesize($export_dir."/".$exp_file)));
}
$table_gui->setData($data);
$this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::exportQuestionObject ( )

export a question

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

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

{
if (is_array($_POST['q_id']) && count($_POST['q_id']) > 0)
{
$this->createExportFileObject($_POST['q_id']);
}
else
{
ilUtil::sendInfo($this->lng->txt("qpl_export_select_none"));
$this->questionsObject();
}
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::filterQuestionBrowserObject ( )

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

{
include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
$table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
$table_gui->writeFilterToSession();
$this->ctrl->redirect($this, 'questions');
}
ilObjSurveyQuestionPoolGUI::getTabs ( $tabs_gui)

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

Reimplemented from ilObjectGUI.

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

References $_GET.

{
global $ilAccess;
$next_class = $this->ctrl->getNextClass($this);
switch ($next_class)
{
case "":
case "ilpermissiongui":
case "ilmdeditorgui":
case "ilsurveyphrasesgui":
break;
default:
return;
break;
}
if (($_GET["calling_survey"] > 0) || ($_GET["new_for_survey"] > 0)) return;
// questions
$force_active = ($this->ctrl->getCmdClass() == "" ||
$this->ctrl->getCmd() == "")
? true
: false;
if (!$force_active)
{
if (is_array($_GET["sort"]))
{
$force_active = true;
}
}
$tabs_gui->addTarget("survey_questions",
$this->ctrl->getLinkTarget($this,'questions'),
array("questions", "filterQuestionBrowser", "filter", "reset", "createQuestion",
"importQuestions", "deleteQuestions", "copy", "paste",
"exportQuestions", "confirmDeleteQuestions", "cancelDeleteQuestions",
"confirmPasteQuestions", "cancelPasteQuestions", "uploadQuestions",
"editQuestion", "addMaterial", "removeMaterial", "save", "cancel",
"cancelExplorer", "linkChilds", "addGIT", "addST", "addPG", "preview",
"moveCategory", "deleteCategory", "addPhrase", "addCategory", "savePhrase",
"addSelectedPhrase", "cancelViewPhrase", "confirmSavePhrase", "cancelSavePhrase",
"insertBeforeCategory", "insertAfterCategory", "confirmDeleteCategory",
"cancelDeleteCategory", "categories", "saveCategories",
"savePhrase", "addPhrase"
),
array("ilobjsurveyquestionpoolgui", "ilsurveyphrasesgui"), "", $force_active);
if ($ilAccess->checkAccess('write', '', $this->ref_id))
{
// properties
$tabs_gui->addTarget("settings",
$this->ctrl->getLinkTarget($this,'properties'),
"properties",
"", "");
// manage phrases
$tabs_gui->addTarget("manage_phrases",
$this->ctrl->getLinkTargetByClass("ilsurveyphrasesgui", "phrases"),
array("phrases", "deletePhrase", "confirmDeletePhrase", "cancelDeletePhrase", "editPhrase", "newPhrase", "saveEditPhrase", "phraseEditor"),
"ilsurveyphrasesgui", "");
// meta data
$tabs_gui->addTarget("meta_data",
$this->ctrl->getLinkTargetByClass('ilmdeditorgui','listSection'),
"", "ilmdeditorgui");
// export
$tabs_gui->addTarget("export",
$this->ctrl->getLinkTarget($this,'export'),
array("export", "createExportFile", "confirmDeleteExportFile",
"downloadExportFile", "cancelDeleteExportFile", "deleteExportFile"),
"", "");
}
if ($ilAccess->checkAccess("edit_permission", "", $this->ref_id))
{
$tabs_gui->addTarget("perm_settings",
$this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
}
}
ilObjSurveyQuestionPoolGUI::ilObjSurveyQuestionPoolGUI ( )

Constructor public.

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

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

{
global $lng, $ilCtrl;
$this->type = "spl";
$lng->loadLanguageModule("survey");
$this->ctrl =& $ilCtrl;
$this->ctrl->saveParameter($this, array("ref_id", "calling_survey", "new_for_survey"));
$this->ilObjectGUI("",$_GET["ref_id"], true, false);
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::importFileObject ( )

form for new survey object import

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

References ilObjectGUI\$ref_id, createObject(), ilUtil\redirect(), ilUtil\sendInfo(), ilUtil\sendSuccess(), and uploadSplObject().

{
if (strcmp($_FILES["xmldoc"]["tmp_name"], "") == 0)
{
ilUtil::sendInfo($this->lng->txt("spl_select_file_for_import"));
$this->createObject();
return;
}
$this->ctrl->setParameter($this, "new_type", $this->type);
$ref_id = $this->uploadSplObject(false);
// always send a message
ilUtil::sendSuccess($this->lng->txt("object_imported"),true);
ilUtil::redirect("ilias.php?ref_id=".$ref_id.
"&baseClass=ilObjSurveyQuestionPoolGUI");
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::importObject ( )

display dialogue for importing questionpools

public

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

References $_GET, and ilObjectGUI\getTemplateFile().

Referenced by uploadSplObject().

{
global $rbacsystem;
if (!$rbacsystem->checkAccess("create", $_GET["ref_id"]))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
$this->getTemplateFile("import", "spl");
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("BTN_NAME", "uploadSpl");
$this->tpl->setVariable("TXT_UPLOAD", $this->lng->txt("upload"));
$this->tpl->setVariable("TXT_IMPORT_SPL", $this->lng->txt("import_spl"));
$this->tpl->setVariable("TXT_SELECT_MODE", $this->lng->txt("select_mode"));
$this->tpl->setVariable("TXT_SELECT_FILE", $this->lng->txt("select_file"));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjSurveyQuestionPoolGUI::importQuestionsObject ( )

display the import form to import questions into the questionpool

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

{
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_import_question.html", "Modules/SurveyQuestionPool");
$this->tpl->setCurrentBlock("adm_content");
$this->tpl->setVariable("TEXT_IMPORT_QUESTION", $this->lng->txt("import_question"));
$this->tpl->setVariable("TEXT_SELECT_FILE", $this->lng->txt("select_file"));
$this->tpl->setVariable("TEXT_UPLOAD", $this->lng->txt("upload"));
$this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
$this->tpl->parseCurrentBlock();
}
ilObjSurveyQuestionPoolGUI::moveObject ( )

mark one or more question objects for moving

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

References $_POST, and ilUtil\sendInfo().

{
if (count($_POST["q_id"]) > 0)
{
foreach ($_POST["q_id"] as $key => $value)
{
$this->object->moveToClipboard($value);
}
ilUtil::sendInfo($this->lng->txt("spl_move_insert_clipboard"), true);
}
else
{
ilUtil::sendInfo($this->lng->txt("spl_move_select_none"), true);
}
$this->ctrl->redirect($this, "questions");
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::pasteObject ( )

paste questios from the clipboard into the question pool

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

References $_SESSION, and ilUtil\sendInfo().

{
if (array_key_exists("spl_clipboard", $_SESSION))
{
$this->object->pasteFromClipboard();
}
else
{
ilUtil::sendInfo($this->lng->txt("spl_paste_no_objects"), true);
}
$this->ctrl->redirect($this, "questions");
}

+ Here is the call graph for this function:

& ilObjSurveyQuestionPoolGUI::previewObject ( )

create preview of object

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

References $_GET, and SurveyQuestionGUI\_getQuestionGUI().

{
include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
$q_gui =& SurveyQuestionGUI::_getQuestionGUI("", $_GET["preview"]);
$this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $q_gui->getQuestionType());
$this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $_GET["preview"]);
$this->ctrl->redirectByClass(get_class($q_gui), "preview");
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::propertiesObject ( )

Questionpool properties.

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

References ilFormPropertyGUI\setInfo().

{
$save = ((strcmp($this->ctrl->getCmd(), "save") == 0)) ? true : false;
include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, 'properties'));
$form->setTitle($this->lng->txt("properties"));
$form->setMultipart(false);
$form->setId("properties");
// online
$online = new ilCheckboxInputGUI($this->lng->txt("spl_online_property"), "online");
$online->setInfo($this->lng->txt("spl_online_property_description"));
$online->setChecked($this->object->getOnline());
$form->addItem($online);
$form->addCommandButton("saveProperties", $this->lng->txt("save"));
if ($save)
{
$form->checkInput();
}
$this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::questionsObject (   $arrFilter = null)

list questions of question pool

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

References $_GET, $_SESSION, ilObjectGUI\$data, and ilSurveyQuestionsTableGUI\setEditable().

Referenced by deleteQuestionsObject(), and exportQuestionObject().

{
global $rbacsystem;
global $ilUser;
$this->object->purgeQuestions();
$_SESSION['q_id_table_nav'] = $_GET['q_id_table_nav'];
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_qpl_questionbrowser.html", "Modules/SurveyQuestionPool");
include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
$table_gui = new ilSurveyQuestionsTableGUI($this, 'questions', (($rbacsystem->checkAccess('write', $_GET['ref_id']) ? true : false)));
$table_gui->setEditable($rbacsystem->checkAccess('write', $_GET['ref_id']));
$arrFilter = array();
foreach ($table_gui->getFilterItems() as $item)
{
if ($item->getValue() !== false)
{
$arrFilter[$item->getPostVar()] = $item->getValue();
}
}
$data = $this->object->getQuestionsData($arrFilter);
$table_gui->setData($data);
$this->tpl->setVariable('TABLE', $table_gui->getHTML());
if ($rbacsystem->checkAccess('write', $_GET['ref_id']))
{
$this->tpl->setCurrentBlock("QTypes");
$types =& ilObjSurveyQuestionPool::_getQuestionTypes();
$lastquestiontype = $ilUser->getPref("svy_lastquestiontype");
foreach ($types as $translation => $data)
{
if ($data["type_tag"] == $lastquestiontype)
{
$this->tpl->setVariable("QUESTION_TYPE_SELECTED", " selected=\"selected\"");
}
$this->tpl->setVariable("QUESTION_TYPE_ID", $data["type_tag"]);
$this->tpl->setVariable("QUESTION_TYPE", $translation);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setVariable("QUESTION_ADD", $this->lng->txt("create"));
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, 'questions'));
$this->tpl->parseCurrentBlock();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjSurveyQuestionPoolGUI::resetfilterQuestionBrowserObject ( )

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

{
include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
$table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
$table_gui->resetFilter();
$this->ctrl->redirect($this, 'questions');
}
ilObjSurveyQuestionPoolGUI::saveObject ( )

save object

Reimplemented from ilObjectGUI.

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

References $_GET, $_POST, ilUtil\redirect(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $rbacadmin;
if (!strlen($_POST['Fobject']['title']))
{
ilUtil::sendFailure($this->lng->txt('title_required'), true);
$this->ctrl->setParameter($this, 'new_type', $_GET['new_type']);
$this->ctrl->redirect($this, 'create');
}
// create and insert forum in objecttree
$newObj = parent::saveObject();
// always send a message
ilUtil::sendSuccess($this->lng->txt("object_added"),true);
ilUtil::redirect("ilias.php?ref_id=".$newObj->getRefId().
"&baseClass=ilObjSurveyQuestionPoolGUI");
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::savePropertiesObject ( )

Save questionpool properties.

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

References $_POST, and ilUtil\sendSuccess().

{
$qpl_online = $_POST["online"];
if (strlen($qpl_online) == 0) $qpl_online = "0";
$this->object->setOnline($qpl_online);
$this->object->saveToDb();
ilUtil::sendSuccess($this->lng->txt("saved_successfully"), true);
$this->ctrl->redirect($this, "properties");
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::updateObject ( )

updates object entry in object_data

public

Reimplemented from ilObjectGUI.

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

References ilUtil\sendSuccess().

{
$this->update = $this->object->update();
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::uploadQuestionsObject ( )

imports question(s) into the questionpool

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

References ilUtil\moveUploadedFile().

{
// check if file was uploaded
$source = $_FILES["qtidoc"]["tmp_name"];
$error = 0;
if (($source == 'none') || (!$source) || $_FILES["qtidoc"]["error"] > UPLOAD_ERR_OK)
{
$error = 1;
}
// check correct file type
if (strpos("xml", $_FILES["qtidoc"]["type"]) !== FALSE)
{
$error = 1;
}
if (!$error)
{
// import file into questionpool
// create import directory
$this->object->createImportDirectory();
// copy uploaded file to import directory
$full_path = $this->object->getImportDirectory()."/".$_FILES["qtidoc"]["name"];
include_once "./Services/Utilities/classes/class.ilUtil.php";
ilUtil::moveUploadedFile($_FILES["qtidoc"]["tmp_name"],
$_FILES["qtidoc"]["name"], $full_path);
$source = $full_path;
$this->object->importObject($source, TRUE);
unlink($source);
}
$this->ctrl->redirect($this, "questions");
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::uploadSplObject (   $redirect = true)

imports question(s) into the questionpool

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

References $_GET, $file, $redirect, importObject(), ilUtil\moveUploadedFile(), and ilUtil\sendInfo().

Referenced by importFileObject().

{
if ($_FILES["xmldoc"]["error"] > UPLOAD_ERR_OK)
{
ilUtil::sendInfo($this->lng->txt("spl_select_file_for_import"));
$this->importObject();
return;
}
include_once "./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
// create new questionpool object
$newObj = new ilObjSurveyQuestionPool();
// set type of questionpool object
$newObj->setType($_GET["new_type"]);
// set title of questionpool object to "dummy"
$newObj->setTitle("dummy");
// create the questionpool class in the ILIAS database (object_data table)
$newObj->create(true);
// create a reference for the questionpool object in the ILIAS database (object_reference table)
$newObj->createReference();
// put the questionpool object in the administration tree
$newObj->putInTree($_GET["ref_id"]);
// get default permissions and set the permissions for the questionpool object
$newObj->setPermissions($_GET["ref_id"]);
// notify the questionpool object and all its parent objects that a "new" object was created
$newObj->notify("new",$_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$newObj->getRefId());
// create import directory
$newObj->createImportDirectory();
// copy uploaded file to import directory
$file = pathinfo($_FILES["xmldoc"]["name"]);
$full_path = $newObj->getImportDirectory()."/".$_FILES["xmldoc"]["name"];
include_once "./Services/Utilities/classes/class.ilUtil.php";
ilUtil::moveUploadedFile($_FILES["xmldoc"]["tmp_name"],
$_FILES["xmldoc"]["name"], $full_path);
// import qti data
$qtiresult = $newObj->importObject($full_path);
if ($redirect)
{
$this->ctrl->redirect($this, "cancel");
}
return $newObj->getRefId();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilObjSurveyQuestionPoolGUI::$defaultscript

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


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