40 include_once
"./classes/class.ilObjectGUI.php";
41 include_once
"./Modules/Survey/classes/inc.SurveyConstants.php";
54 $lng->loadLanguageModule(
"survey");
56 $this->ctrl->saveParameter($this,
"ref_id");
63 include_once
"./Services/Utilities/classes/class.ilUtil.php";
64 $path = $this->tree->getPathFull($this->object->getRefID());
73 global $ilAccess, $ilNavigationHistory,
$ilCtrl;
75 if ((!$ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"])) && (!$ilAccess->checkAccess(
"visible",
"",
$_GET[
"ref_id"])))
78 $ilias->raiseError($this->lng->txt(
"permission_denied"), $ilias->error_obj->MESSAGE);
82 $ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
84 $ilNavigationHistory->addItem(
$_GET[
"ref_id"],
85 "ilias.php?baseClass=ilObjSurveyGUI&cmd=infoScreen&ref_id=".
$_GET[
"ref_id"],
"svy");
88 $cmd = $this->ctrl->getCmd(
"properties");
91 if (
$cmd ==
"saveTags")
93 $ilCtrl->setCmdClass(
"ilinfoscreengui");
96 $next_class = $this->ctrl->getNextClass($this);
97 $this->ctrl->setReturn($this,
"properties");
103 case "ilinfoscreengui":
106 case 'ilmdeditorgui':
107 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
108 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
109 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
111 $this->ctrl->forwardCommand($md_gui);
114 case "ilsurveyevaluationgui":
115 include_once(
"./Modules/Survey/classes/class.ilSurveyEvaluationGUI.php");
117 $ret =& $this->ctrl->forwardCommand($eval_gui);
120 case "ilsurveyexecutiongui":
121 include_once(
"./Modules/Survey/classes/class.ilSurveyExecutionGUI.php");
123 $ret =& $this->ctrl->forwardCommand($exec_gui);
126 case 'ilpermissiongui':
127 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
129 $ret =& $this->ctrl->forwardCommand($perm_gui);
132 case 'ilobjectcopygui':
133 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
136 $this->ctrl->forwardCommand($cp);
145 if (strtolower(
$_GET[
"baseClass"]) !=
"iladministrationgui" &&
160 if (!strlen(
$_POST[
'Fobject'][
'title']))
163 $this->ctrl->setParameter($this,
'new_type',
$_GET[
'new_type']);
164 $this->ctrl->redirect($this,
'create');
171 ilUtil::redirect(
"ilias.php?baseClass=ilObjSurveyGUI&ref_id=".$newObj->getRefId().
"&cmd=properties");
193 $this->ctrl->redirect($this,
"properties");
206 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
210 $this->ctrl->redirect($this,
"infoScreen");
227 $this->
object->setEvaluationAccess(
$_POST[
"evaluation_access"]);
228 $this->
object->setStartDateEnabled(
$_POST[
"enabled_start_date"]);
229 if ($this->object->getStartDateEnabled())
231 $this->
object->setStartDate(
$_POST[
'start_date'][
'date']);
235 $this->
object->setStartDate(null);
237 $this->
object->setEndDateEnabled(
$_POST[
"enabled_end_date"]);
238 if ($this->object->getEndDateEnabled())
240 $this->
object->setEndDate(
$_POST[
'end_date'][
'date']);
244 $this->
object->setEndDate(null);
247 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
248 $introduction =
$_POST[
"introduction"];
249 $this->
object->setIntroduction($introduction);
251 $this->
object->setOutro($outro);
253 $hasDatasets = $this->
object->_hasDatasets($this->object->getSurveyId());
256 $anonymize =
$_POST[
"anonymization"];
261 $this->
object->setAnonymize($anonymize);
263 $this->
object->setShowQuestionTitles(
$_POST[
"show_question_titles"]);
264 $this->
object->saveToDb();
273 $this->ctrl->redirect($this,
"properties");
286 $save = (strcmp($this->ctrl->getCmd(),
"saveProperties") == 0) ? TRUE : FALSE;
288 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
290 $form->setFormAction($this->ctrl->getFormAction($this));
291 $form->setTableWidth(
"100%");
292 $form->setId(
"survey_properties");
296 $header->setTitle($this->lng->txt(
"properties"));
297 $form->addItem($header);
302 $online->setChecked($this->object->isOnline());
303 $form->addItem($online);
307 $intro->
setValue($this->object->prepareTextareaOutput($this->object->getIntroduction()));
310 $intro->setUseRte(TRUE);
311 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
313 $intro->addPlugin(
"latex");
314 $intro->addButton(
"latex");
315 $intro->addPlugin(
"pastelatex");
316 $intro->setRTESupport($this->object->getId(),
"svy",
"survey");
317 $form->addItem($intro);
320 $enablestartingtime =
new ilCheckboxInputGUI($this->lng->txt(
"start_date"),
"enabled_start_date");
322 $enablestartingtime->setOptionTitle($this->lng->txt(
"enabled"));
323 $enablestartingtime->setChecked($this->object->getStartDateEnabled());
326 $startingtime->setShowDate(
true);
327 $startingtime->setShowTime(
false);
328 if ($this->object->getStartDateEnabled())
336 $enablestartingtime->addSubItem($startingtime);
337 $form->addItem($enablestartingtime);
340 $enableendingtime =
new ilCheckboxInputGUI($this->lng->txt(
"end_date"),
"enabled_end_date");
342 $enableendingtime->setOptionTitle($this->lng->txt(
"enabled"));
343 $enableendingtime->setChecked($this->object->getEndDateEnabled());
346 $endingtime->setShowDate(
true);
347 $endingtime->setShowTime(
false);
348 if ($this->object->getEndDateEnabled())
356 $enableendingtime->addSubItem($endingtime);
357 $form->addItem($enableendingtime);
360 $anonymization =
new ilCheckboxInputGUI($this->lng->txt(
"anonymization"),
"anonymization");
361 $hasDatasets = $this->
object->_hasDatasets($this->object->getSurveyId());
366 $anonymization->setOptionTitle($this->lng->txt(
"on"));
367 $anonymization->setValue(1);
368 $anonymization->setChecked($this->object->getAnonymize());
369 $anonymization->setInfo($this->lng->txt(
"anonymize_survey_description"));
374 $anonymization_options->setDisabled(
true);
376 $anonymization_options->addOption(
new ilCheckboxOption($this->lng->txt(
"anonymize_without_code"),
'anonymize_without_code',
''));
377 $anonymization_options->addOption(
new ilCheckboxOption($this->lng->txt(
"anonymize_with_code"),
'anonymize_with_code',
''));
378 $anonymization_options->setValue(($this->object->isAccessibleWithoutCode()) ?
'anonymize_without_code' :
'anonymize_with_code');
380 $anonymization->addSubItem($anonymization_options);
381 $form->addItem($anonymization);
384 $evaluation_access =
new ilRadioGroupInputGUI($this->lng->txt(
'evaluation_access'),
"evaluation_access");
385 $evaluation_access->
setInfo($this->lng->txt(
'evaluation_access_description'));
389 $evaluation_access->setValue($this->object->getEvaluationAccess());
390 $form->addItem($evaluation_access);
394 $show_question_titles->setOptionTitle($this->lng->txt(
"svy_show_questiontitles"));
395 $show_question_titles->setValue(1);
396 $show_question_titles->setChecked($this->object->getShowQuestionTitles());
397 $form->addItem($show_question_titles);
401 $finalstatement->
setValue($this->object->prepareTextareaOutput($this->object->getOutro()));
402 $finalstatement->setRows(10);
403 $finalstatement->setCols(80);
404 $finalstatement->setUseRte(TRUE);
406 $finalstatement->addPlugin(
"latex");
407 $finalstatement->addButton(
"latex");
408 $finalstatement->addPlugin(
"pastelatex");
409 $finalstatement->setRTESupport($this->object->getId(),
"svy",
"survey");
410 $form->addItem($finalstatement);
412 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])) $form->addCommandButton(
"saveProperties", $this->lng->txt(
"save"));
417 $errors = !$form->checkInput();
418 $form->setValuesByPost();
421 if (($online->getChecked()) && (count($this->object->questions) == 0))
423 $online->setAlert($this->lng->txt(
"cannot_switch_to_online_no_questions"));
428 if (
$errors) $checkonly =
false;
430 if (!$checkonly) $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
443 $checked_questions = array();
444 $checked_questionblocks = array();
447 if (preg_match(
"/cb_(\d+)/",
$key, $matches))
449 array_push($checked_questions, $matches[1]);
451 if (preg_match(
"/cb_qb_(\d+)/",
$key, $matches))
453 array_push($checked_questionblocks, $matches[1]);
456 if (count($checked_questions) + count($checked_questionblocks) > 0)
464 ilUtil::sendInfo($this->lng->txt(
"no_question_selected_for_removal"),
true);
465 $this->ctrl->redirect($this,
"questions");
474 $inserted_objects = 0;
475 if (is_array(
$_POST[
'q_id']))
477 foreach (
$_POST[
'q_id'] as $question_id)
479 $this->
object->insertQuestion($question_id);
483 if ($inserted_objects)
485 $this->
object->saveCompletionStatus();
487 $this->ctrl->redirect($this,
"questions");
492 $this->ctrl->redirect($this,
'browseForQuestions');
501 $inserted_objects = 0;
502 if (is_array(
$_POST[
'cb']))
504 foreach (
$_POST[
'cb'] as $questionblock_id)
506 $this->
object->insertQuestionblock($questionblock_id);
510 if ($inserted_objects)
512 $this->
object->saveCompletionStatus();
513 ilUtil::sendSuccess(($inserted_objects == 1) ? $this->lng->txt(
"questionblock_inserted") : $this->lng->txt(
"questionblocks_inserted"),
true);
514 $this->ctrl->redirect($this,
"questions");
519 $this->ctrl->redirect($this,
'browseForQuestionblocks');
529 $ilUser->writePref(
'svy_insert_type',
$_POST[
'datatype']);
530 switch (
$_POST[
"datatype"])
533 $this->ctrl->redirect($this,
'browseForQuestionblocks');
537 $this->ctrl->redirect($this,
'browseForQuestions');
547 include_once
"./Modules/Survey/classes/tables/class.ilSurveyQuestionblockbrowserTableGUI.php";
549 $table_gui->writeFilterToSession();
550 $this->ctrl->redirect($this,
'browseForQuestionblocks');
558 include_once
"./Modules/Survey/classes/tables/class.ilSurveyQuestionblockbrowserTableGUI.php";
560 $table_gui->resetFilter();
561 $this->ctrl->redirect($this,
'browseForQuestionblocks');
573 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_questionbrowser.html",
"Modules/Survey");
574 include_once
"./Modules/Survey/classes/tables/class.ilSurveyQuestionblockbrowserTableGUI.php";
576 $table_gui->
setEditable($rbacsystem->checkAccess(
'write',
$_GET[
'ref_id']));
577 $arrFilter = array();
578 foreach ($table_gui->getFilterItems() as $item)
580 if ($item->getValue() !==
false)
582 $arrFilter[$item->getPostVar()] = $item->getValue();
585 $data = $this->
object->getQuestionblocksTable($arrFilter);
586 $table_gui->setData(
$data);
587 $this->tpl->setVariable(
'TABLE', $table_gui->getHTML());
589 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
'changeDatatype'));
590 $this->tpl->setVariable(
"OPTION_QUESTIONS", $this->lng->txt(
"questions"));
591 $this->tpl->setVariable(
"OPTION_QUESTIONBLOCKS", $this->lng->txt(
"questionblocks"));
592 $this->tpl->setVariable(
"SELECTED_QUESTIONBLOCKS",
" selected=\"selected\"");
593 $this->tpl->setVariable(
"TEXT_DATATYPE", $this->lng->txt(
"display_all_available"));
594 $this->tpl->setVariable(
"BTN_CHANGE", $this->lng->txt(
"change"));
602 include_once
"./Modules/Survey/classes/tables/class.ilSurveyQuestionbrowserTableGUI.php";
604 $table_gui->writeFilterToSession();
605 $this->ctrl->redirect($this,
'browseForQuestions');
613 include_once
"./Modules/Survey/classes/tables/class.ilSurveyQuestionbrowserTableGUI.php";
615 $table_gui->resetFilter();
616 $this->ctrl->redirect($this,
'browseForQuestions');
628 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_questionbrowser.html",
"Modules/Survey");
629 include_once
"./Modules/Survey/classes/tables/class.ilSurveyQuestionbrowserTableGUI.php";
631 $table_gui->
setEditable($rbacsystem->checkAccess(
'write',
$_GET[
'ref_id']));
632 $arrFilter = array();
633 foreach ($table_gui->getFilterItems() as $item)
635 if ($item->getValue() !==
false)
637 $arrFilter[$item->getPostVar()] = $item->getValue();
640 $data = $this->
object->getQuestionsTable($arrFilter);
641 $table_gui->setData(
$data);
642 $this->tpl->setVariable(
'TABLE', $table_gui->getHTML());
644 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
'changeDatatype'));
645 $this->tpl->setVariable(
"OPTION_QUESTIONS", $this->lng->txt(
"questions"));
646 $this->tpl->setVariable(
"OPTION_QUESTIONBLOCKS", $this->lng->txt(
"questionblocks"));
647 $this->tpl->setVariable(
"SELECTED_QUESTIONS",
" selected=\"selected\"");
648 $this->tpl->setVariable(
"TEXT_DATATYPE", $this->lng->txt(
"display_all_available"));
649 $this->tpl->setVariable(
"BTN_CHANGE", $this->lng->txt(
"change"));
664 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_remove_questions.html",
"Modules/Survey");
665 $colors = array(
"tblrow1",
"tblrow2");
667 $surveyquestions =& $this->
object->getSurveyQuestions();
668 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
669 foreach ($surveyquestions as $question_id =>
$data)
671 if (in_array(
$data[
"question_id"], $checked_questions) or (in_array(
$data[
"questionblock_id"], $checked_questionblocks)))
673 $this->tpl->setCurrentBlock(
"row");
674 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
675 $this->tpl->setVariable(
"TEXT_TITLE",
$data[
"title"]);
676 $this->tpl->setVariable(
"TEXT_DESCRIPTION",
$data[
"description"]);
678 $this->tpl->setVariable(
"TEXT_QUESTIONBLOCK",
$data[
"questionblock_title"]);
679 $this->tpl->parseCurrentBlock();
683 foreach ($checked_questions as $id)
685 $this->tpl->setCurrentBlock(
"hidden");
686 $this->tpl->setVariable(
"HIDDEN_NAME",
"id_$id");
687 $this->tpl->setVariable(
"HIDDEN_VALUE",
"$id");
688 $this->tpl->parseCurrentBlock();
690 foreach ($checked_questionblocks as $id)
692 $this->tpl->setCurrentBlock(
"hidden");
693 $this->tpl->setVariable(
"HIDDEN_NAME",
"id_qb_$id");
694 $this->tpl->setVariable(
"HIDDEN_VALUE",
"$id");
695 $this->tpl->parseCurrentBlock();
697 $this->tpl->setCurrentBlock(
"adm_content");
698 $this->tpl->setVariable(
"TEXT_TITLE", $this->lng->txt(
"title"));
699 $this->tpl->setVariable(
"TEXT_DESCRIPTION", $this->lng->txt(
"description"));
700 $this->tpl->setVariable(
"TEXT_TYPE", $this->lng->txt(
"question_type"));
701 $this->tpl->setVariable(
"TEXT_QUESTIONBLOCK", $this->lng->txt(
"questionblock"));
702 $this->tpl->setVariable(
"BTN_CONFIRM", $this->lng->txt(
"confirm"));
703 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
704 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"confirmRemoveQuestions"));
705 $this->tpl->parseCurrentBlock();
721 if ($questionblock_id)
723 $questionblock = $this->
object->getQuestionblock($questionblock_id);
725 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_define_questionblock.html",
"Modules/Survey");
728 if (preg_match(
"/cb_(\d+)/",
$key, $matches))
730 $this->tpl->setCurrentBlock(
"hidden");
731 $this->tpl->setVariable(
"HIDDEN_NAME",
"cb_$matches[1]");
732 $this->tpl->setVariable(
"HIDDEN_VALUE", $matches[1]);
733 $this->tpl->parseCurrentBlock();
736 if ($questionblock_id)
738 $this->tpl->setCurrentBlock(
"hidden");
739 $this->tpl->setVariable(
"HIDDEN_NAME",
"questionblock_id");
740 $this->tpl->setVariable(
"HIDDEN_VALUE", $questionblock_id);
741 $this->tpl->parseCurrentBlock();
743 $this->tpl->setCurrentBlock(
"adm_content");
744 $this->tpl->setVariable(
"TEXT_TITLE", $this->lng->txt(
"title"));
745 if ($questionblock_id)
747 $this->tpl->setVariable(
"VALUE_TITLE", $questionblock[
"title"]);
749 $this->tpl->setVariable(
"TXT_QUESTIONTEXT_DESCRIPTION", $this->lng->txt(
"show_questiontext_description"));
750 $this->tpl->setVariable(
"TXT_QUESTIONTEXT", $this->lng->txt(
"show_questiontext"));
751 if (($questionblock[
"show_questiontext"]) || (strlen($questionblock_id) == 0))
753 $this->tpl->setVariable(
"CHECKED_QUESTIONTEXT",
" checked=\"checked\"");
755 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
756 $this->tpl->setVariable(
"HEADING_QUESTIONBLOCK", $this->lng->txt(
"define_questionblock"));
757 $this->tpl->setVariable(
"SAVE", $this->lng->txt(
"save"));
758 $this->tpl->setVariable(
"CANCEL", $this->lng->txt(
"cancel"));
759 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"saveDefineQuestionblock"));
760 $this->tpl->parseCurrentBlock();
774 $tpl =
new ilTemplate(
"tpl.il_svy_svy_qpl_select.html", TRUE, TRUE,
"Modules/Survey");
775 $questionpools =& $this->
object->getAvailableQuestionpools(FALSE, TRUE, TRUE,
"write");
776 if (count($questionpools))
778 foreach ($questionpools as
$key => $value)
780 $tpl->setCurrentBlock(
"option");
781 $tpl->setVariable(
"VALUE_OPTION",
$key);
782 $tpl->setVariable(
"TEXT_OPTION", $value);
783 $tpl->parseCurrentBlock();
785 $tpl->setCurrentBlock(
"selection");
786 $tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"select_questionpool"));
787 $tpl->parseCurrentBlock();
791 $tpl->setCurrentBlock(
"selection");
792 $tpl->setVariable(
"TXT_QPL_ENTER", $this->lng->txt(
"cat_create_spl"));
793 $tpl->parseCurrentBlock();
795 $tpl->setVariable(
"BTN_SUBMIT", $this->lng->txt(
"submit"));
796 $sel_question_types = (strlen(
$_POST[
"sel_question_types"])) ?
$_POST[
"sel_question_types"] :
$_GET[
"sel_question_types"];
797 $this->ctrl->setParameter($this,
"sel_question_types", $sel_question_types);
798 $tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"executeCreateQuestion"));
799 $tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
800 $this->tpl->setVariable(
"ADM_CONTENT",
$tpl->get());
812 $this->ctrl->redirect($this,
"questions");
824 if (strlen(
$_POST[
"sel_spl"]))
826 include_once
"./Services/Utilities/classes/class.ilUtil.php";
827 ilUtil::redirect(
"ilias.php?baseClass=ilObjSurveyQuestionPoolGUI&ref_id=" .
$_POST[
"sel_spl"] .
"&cmd=createQuestionForSurvey&new_for_survey=".
$_GET[
"ref_id"].
"&sel_question_types=".
$_GET[
"sel_question_types"]);
832 ilUtil::redirect(
"ilias.php?baseClass=ilObjSurveyQuestionPoolGUI&ref_id=" .
$ref_id .
"&cmd=createQuestionForSurvey&new_for_survey=".
$_GET[
"ref_id"].
"&sel_question_types=".
$_GET[
"sel_question_types"]);
837 $this->ctrl->setParameter($this,
"sel_question_types",
$_GET[
"sel_question_types"]);
838 $this->ctrl->redirect($this,
"createQuestion");
851 $parent_ref = $tree->getParentId($this->object->getRefId());
852 include_once
"./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
854 $qpl->setType(
"spl");
855 $qpl->setTitle(
$name);
856 $qpl->setDescription(
"");
858 $qpl->createReference();
859 $qpl->putInTree($parent_ref);
860 $qpl->setPermissions($parent_ref);
863 return $qpl->getRefId();
877 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_heading.html",
"Modules/Survey");
878 $survey_questions =& $this->
object->getSurveyQuestions();
881 $_POST[
"insertbefore"] = $question_id;
882 $_POST[
"heading"] = $survey_questions[$question_id][
"heading"];
884 foreach ($survey_questions as
$key => $value)
886 $this->tpl->setCurrentBlock(
"insertbefore_row");
887 $this->tpl->setVariable(
"VALUE_OPTION",
$key);
888 $option = $this->lng->txt(
"before") .
": \"" . $value[
"title"] .
"\"";
889 if (strlen($option) > 80)
891 $option = preg_replace(
"/^(.{40}).*(.{40})$/",
"\\1 [...] \\2", $option);
893 include_once
"./Services/Utilities/classes/class.ilUtil.php";
897 $this->tpl->setVariable(
"SELECTED_OPTION",
" selected=\"selected\"");
899 $this->tpl->parseCurrentBlock();
903 $this->tpl->setCurrentBlock(
"hidden");
904 $this->tpl->setVariable(
"INSERTBEFORE_ORIGINAL", $question_id);
905 $this->tpl->parseCurrentBlock();
907 $this->tpl->setCurrentBlock(
"adm_content");
908 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"saveHeading"));
909 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
912 $this->tpl->setVariable(
"TEXT_ADD_HEADING", $this->lng->txt(
"edit_heading"));
913 $this->tpl->setVariable(
"SELECT_DISABLED",
" disabled=\"disabled\"");
917 $this->tpl->setVariable(
"TEXT_ADD_HEADING", $this->lng->txt(
"add_heading"));
919 $this->tpl->setVariable(
"TEXT_HEADING", $this->lng->txt(
"heading"));
920 $this->tpl->setVariable(
"VALUE_HEADING",
$_POST[
"heading"]);
921 $this->tpl->setVariable(
"TEXT_INSERT", $this->lng->txt(
"insert"));
922 $this->tpl->setVariable(
"CANCEL", $this->lng->txt(
"cancel"));
923 $this->tpl->setVariable(
"SAVE", $this->lng->txt(
"save"));
924 $this->tpl->parseCurrentBlock();
925 include_once
"./Services/RTE/classes/class.ilRTE.php";
927 include_once
"./Services/RTE/classes/class.$rtestring.php";
928 $rte =
new $rtestring();
929 $rte->removePlugin(
"ibrowser");
930 include_once
"./classes/class.ilObject.php";
933 $rte->addRTESupport(
$obj_id, $obj_type,
"survey");
947 if (preg_match(
"/id_(\d+)/",
$key, $matches)) {
948 if (
$_GET[
"browsetype"] == 1)
950 $this->
object->insertQuestion($matches[1]);
954 $this->
object->insertQuestionBlock($matches[1]);
958 $this->
object->saveCompletionStatus();
960 $this->ctrl->redirect($this,
"questions");
972 $this->ctrl->redirect($this,
"questions");
986 $insertbefore =
$_POST[
"insertbefore"];
989 $insertbefore =
$_POST[
"insertbefore_original"];
991 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
993 $this->ctrl->redirect($this,
"questions");
1012 $this->ctrl->redirect($this,
"questions");
1024 $this->
object->saveHeading(
"",
$_POST[
"removeheading"]);
1025 $this->ctrl->redirect($this,
"questions");
1037 $this->ctrl->redirect($this,
"questions");
1050 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_confirm_removeheading.html",
"Modules/Survey");
1051 $this->tpl->setCurrentBlock(
"adm_content");
1052 $this->tpl->setVariable(
"BTN_CONFIRM_REMOVE", $this->lng->txt(
"confirm"));
1053 $this->tpl->setVariable(
"BTN_CANCEL_REMOVE", $this->lng->txt(
"cancel"));
1054 $this->tpl->setVariable(
"REMOVE_HEADING",
$_GET[
"removeheading"]);
1055 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"confirmRemoveHeading"));
1056 $this->tpl->parseCurrentBlock();
1068 $checked_questions = array();
1069 $checked_questionblocks = array();
1072 if (preg_match(
"/id_(\d+)/",
$key, $matches))
1074 array_push($checked_questions, $matches[1]);
1076 if (preg_match(
"/id_qb_(\d+)/",
$key, $matches))
1078 array_push($checked_questionblocks, $matches[1]);
1081 $this->
object->removeQuestions($checked_questions, $checked_questionblocks);
1082 $this->
object->saveCompletionStatus();
1084 $this->ctrl->redirect($this,
"questions");
1096 $this->ctrl->redirect($this,
"questions");
1108 $questionblock = array();
1111 if (preg_match(
"/cb_(\d+)/",
$key, $matches))
1113 array_push($questionblock, $value);
1116 if (count($questionblock) < 2)
1118 ilUtil::sendInfo($this->lng->txt(
"qpl_define_questionblock_select_missing"),
true);
1119 $this->ctrl->redirect($this,
"questions");
1135 $show_questiontext = (
$_POST[
"show_questiontext"]) ? 1 : 0;
1136 if (
$_POST[
"questionblock_id"])
1138 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1143 $questionblock = array();
1146 if (preg_match(
"/cb_(\d+)/",
$key, $matches))
1148 array_push($questionblock, $value);
1151 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1155 $this->ctrl->redirect($this,
"questions");
1170 $unfoldblocks = array();
1173 if (preg_match(
"/cb_qb_(\d+)/",
$key, $matches))
1175 array_push($unfoldblocks, $matches[1]);
1178 if (count($unfoldblocks))
1181 $this->
object->unfoldQuestionblocks($unfoldblocks);
1187 $this->ctrl->redirect($this,
"questions");
1196 $this->ctrl->redirect($this,
"questions");
1204 $move_questions = array();
1207 if (preg_match(
"/cb_(\d+)/",
$key, $matches))
1209 array_push($move_questions, $matches[1]);
1211 if (preg_match(
"/cb_qb_(\d+)/",
$key, $matches))
1213 $ids = $this->
object->getQuestionblockQuestionIds($matches[1]);
1214 foreach ($ids as $qkey => $qid)
1216 array_push($move_questions, $qid);
1220 if (count($move_questions) == 0)
1223 $this->ctrl->redirect($this,
"questions");
1227 $_SESSION[
"move_questions"] = $move_questions;
1228 ilUtil::sendInfo($this->lng->txt(
"select_target_position_for_move_question"));
1239 $move_questions =
$_SESSION[
"move_questions"];
1244 if (preg_match(
"/^cb_(\d+)$/",
$key, $matches))
1248 $insert_id = $matches[1];
1251 if (preg_match(
"/^cb_qb_(\d+)$/",
$key, $matches))
1255 $ids =& $this->
object->getQuestionblockQuestionIds($matches[1]);
1258 if ($insert_mode == 0)
1260 $insert_id = $ids[0];
1262 else if ($insert_mode == 1)
1264 $insert_id = $ids[count($ids)-1];
1270 if ($insert_id <= 0)
1277 $this->
object->moveQuestions($move_questions, $insert_id, $insert_mode);
1280 $this->ctrl->redirect($this,
"questions");
1304 $obligatory = array();
1307 if (preg_match(
"/obligatory_(\d+)/",
$key, $matches))
1309 $obligatory[$matches[1]] = 1;
1312 $this->
object->setObligatoryStates($obligatory);
1314 $this->ctrl->redirect($this,
"questions");
1325 $hasDatasets = $this->
object->_hasDatasets($this->object->getSurveyId());
1326 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1327 if ((!$rbacsystem->checkAccess(
"read", $this->ref_id)) && (!$rbacsystem->checkAccess(
"write", $this->ref_id)))
1331 $path = $this->tree->getPathFull($this->object->getRefID());
1336 if (
$_GET[
"new_id"] > 0)
1339 $existing = $this->
object->getExistingQuestions();
1340 if (!in_array(
$_GET[
"new_id"], $existing))
1342 $inserted = $this->
object->insertQuestion(
$_GET[
"new_id"]);
1352 ilUtil::redirect(
"ilias.php?baseClass=ilObjSurveyQuestionPoolGUI&ref_id=" . $_GET[
"eqpl"] .
"&cmd=editQuestionForSurvey&calling_survey=".$_GET[
"ref_id"].
"&q_id=" . $_GET[
"eqid"]);
1356 $_SESSION[
"calling_survey"] = $this->
object->getRefId();
1359 if ($_GET[
"editheading"])
1365 if ($_GET[
"up"] > 0)
1367 $this->
object->moveUpQuestion($_GET[
"up"]);
1370 if ($_GET[
"down"] > 0)
1372 $this->
object->moveDownQuestion($_GET[
"down"]);
1375 if ($_GET[
"qbup"] > 0)
1377 $this->
object->moveUpQuestionblock($_GET[
"qbup"]);
1380 if ($_GET[
"qbdown"] > 0)
1382 $this->
object->moveDownQuestionblock($_GET[
"qbdown"]);
1386 if ($_GET[
"removeheading"])
1392 if ($_GET[
"editblock"])
1401 $selected_array = array();
1402 array_push($selected_array, $_GET[
"add"]);
1404 $this->insertQuestionsForm($selected_array);
1408 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_questions.html",
"Modules/Survey");
1409 $survey_questions =& $this->
object->getSurveyQuestions();
1410 $questionpools =& $this->
object->getQuestionpoolTitles();
1411 $colors = array(
"tblrow1",
"tblrow2");
1414 $last_color_class =
"";
1415 $obligatory =
"<img src=\"" .
ilUtil::getImagePath(
"obligatory.gif",
"Modules/Survey") .
"\" alt=\"" . $this->lng->txt(
"question_obligatory") .
"\" title=\"" . $this->lng->txt(
"question_obligatory") .
"\" />";
1416 include_once
"./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
1418 if (count($survey_questions) > 0)
1420 foreach ($survey_questions as $question_id =>
$data)
1423 if (($last_questionblock_id > 0) && (
$data[
"questionblock_id"] == 0))
1427 if (($last_questionblock_id > 0) && (
$data[
"questionblock_id"] > 0) && (
$data[
"questionblock_id"] != $last_questionblock_id))
1431 if ((
$data[
"questionblock_id"] > 0) and (
$data[
"questionblock_id"] != $last_questionblock_id))
1434 $this->tpl->setCurrentBlock(
"separator");
1435 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
1436 $this->tpl->parseCurrentBlock();
1437 $this->tpl->setCurrentBlock(
"QTab");
1438 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
1439 $this->tpl->parseCurrentBlock();
1441 $this->tpl->setCurrentBlock(
"block");
1442 $this->tpl->setVariable(
"TYPE_ICON",
"<img src=\"" .
ilUtil::getImagePath(
"questionblock.gif",
"Modules/Survey") .
"\" alt=\"".$this->lng->txt(
"questionblock_icon").
"\" />");
1443 $this->tpl->setVariable(
"TEXT_QUESTIONBLOCK", $this->lng->txt(
"questionblock") .
": " .
$data[
"questionblock_title"]);
1444 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
1445 if ($rbacsystem->checkAccess(
"write", $this->ref_id) and !$hasDatasets)
1447 if (
$data[
"question_id"] != $this->object->questions[0])
1449 $this->tpl->setVariable(
"BUTTON_UP",
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"questions") .
"&qbup=" .
$data[
"questionblock_id"] .
"\"><img src=\"" .
ilUtil::getImagePath(
"a_up.gif") .
"\" alt=\"" . $this->lng->txt(
"up") .
"\" title=\"" . $this->lng->txt(
"up") .
"\" border=\"0\" /></a>");
1451 $akeys = array_keys($survey_questions);
1452 if (
$data[
"questionblock_id"] != $survey_questions[$akeys[count($akeys)-1]][
"questionblock_id"])
1454 $this->tpl->setVariable(
"BUTTON_DOWN",
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"questions") .
"&qbdown=" .
$data[
"questionblock_id"] .
"\"><img src=\"" .
ilUtil::getImagePath(
"a_down.gif") .
"\" alt=\"" . $this->lng->txt(
"down") .
"\" title=\"" . $this->lng->txt(
"down") .
"\" border=\"0\" /></a>");
1456 $this->tpl->setVariable(
"TEXT_EDIT", $this->lng->txt(
"edit"));
1457 $this->tpl->setVariable(
"HREF_EDIT", $this->ctrl->getLinkTarget($this,
"questions") .
"&editblock=" .
$data[
"questionblock_id"]);
1459 $this->tpl->parseCurrentBlock();
1460 $this->tpl->setCurrentBlock(
"QTab");
1461 $this->tpl->setVariable(
"QUESTION_ID",
"qb_" .
$data[
"questionblock_id"]);
1462 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
1463 $this->tpl->parseCurrentBlock();
1465 if (($last_questionblock_id > 0) && (
$data[
"questionblock_id"] == 0))
1468 $this->tpl->setCurrentBlock(
"separator");
1469 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
1470 $this->tpl->parseCurrentBlock();
1471 $this->tpl->setCurrentBlock(
"QTab");
1472 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
1473 $this->tpl->parseCurrentBlock();
1475 if (
$data[
"heading"])
1477 $this->tpl->setCurrentBlock(
"heading");
1478 $this->tpl->setVariable(
"TEXT_HEADING",
$data[
"heading"]);
1479 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
1480 if ($rbacsystem->checkAccess(
"write", $this->ref_id) and !$hasDatasets)
1482 $this->tpl->setVariable(
"TEXT_EDIT", $this->lng->txt(
"edit"));
1483 $this->tpl->setVariable(
"HREF_EDIT", $this->ctrl->getLinkTarget($this,
"questions") .
"&editheading=" .
$data[
"question_id"]);
1484 $this->tpl->setVariable(
"TEXT_DELETE", $this->lng->txt(
"remove"));
1485 $this->tpl->setVariable(
"HREF_DELETE", $this->ctrl->getLinkTarget($this,
"questions") .
"&removeheading=" .
$data[
"question_id"]);
1487 $this->tpl->parseCurrentBlock();
1488 $this->tpl->setCurrentBlock(
"QTab");
1489 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
1490 $this->tpl->parseCurrentBlock();
1492 if (!
$data[
"questionblock_id"])
1494 $this->tpl->setCurrentBlock(
"checkable");
1495 $this->tpl->setVariable(
"QUESTION_ID",
$data[
"question_id"]);
1496 $this->tpl->parseCurrentBlock();
1498 $this->tpl->setCurrentBlock(
"QTab");
1499 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
1500 if ($rbacsystem->checkAccess(
"write", $this->ref_id) and !$hasDatasets)
1502 $q_id =
$data[
"question_id"];
1504 $this->tpl->setVariable(
"QUESTION_TITLE",
"$title_counter. <a href=\"" . $this->ctrl->getLinkTarget($this,
"questions") .
"&eqid=$q_id&eqpl=$qpl_ref_id" .
"\">" .
$data[
"title"] .
"</a>");
1508 $this->tpl->setVariable(
"QUESTION_TITLE",
"$title_counter. ".
$data[
"title"]);
1510 $this->tpl->setVariable(
"TYPE_ICON",
"<img src=\"" .
ilUtil::getImagePath(
"question.gif",
"Modules/Survey") .
"\" alt=\"".$this->lng->txt(
"question_icon").
"\" />");
1511 if ($rbacsystem->checkAccess(
"write", $this->ref_id) and !$hasDatasets)
1513 $obligatory_checked =
"";
1514 if (
$data[
"obligatory"] == 1)
1516 $obligatory_checked =
" checked=\"checked\"";
1518 $this->tpl->setVariable(
"QUESTION_OBLIGATORY",
"<input type=\"checkbox\" name=\"obligatory_" .
$data[
"question_id"] .
"\" value=\"1\"$obligatory_checked />");
1522 if (
$data[
"obligatory"] == 1)
1524 $this->tpl->setVariable(
"QUESTION_OBLIGATORY", $obligatory);
1527 $this->tpl->setVariable(
"QUESTION_COMMENT",
$data[
"description"]);
1528 if ($rbacsystem->checkAccess(
"write", $this->ref_id) and !$hasDatasets)
1530 if (!
$data[
"questionblock_id"])
1533 if (
$data[
"question_id"] != $this->object->questions[0])
1535 $this->tpl->setVariable(
"BUTTON_UP",
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"questions") .
"&up=" .
$data[
"question_id"] .
"\"><img src=\"" .
ilUtil::getImagePath(
"a_up.gif") .
"\" alt=\"".$this->lng->txt(
"up").
"\" border=\"0\" /></a>");
1537 if (
$data[
"question_id"] != $this->object->questions[count($this->object->questions)-1])
1539 $this->tpl->setVariable(
"BUTTON_DOWN",
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"questions") .
"&down=" .
$data[
"question_id"] .
"\"><img src=\"" .
ilUtil::getImagePath(
"a_down.gif") .
"\" alt=\"".$this->lng->txt(
"down").
"\" border=\"0\" /></a>");
1545 if (
$data[
"questionblock_id"] == $last_questionblock_id)
1547 $this->tpl->setVariable(
"BUTTON_UP",
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"questions") .
"&up=" .
$data[
"question_id"] .
"\"><img src=\"" .
ilUtil::getImagePath(
"a_up.gif") .
"\" alt=\"".$this->lng->txt(
"up").
"\" border=\"0\" /></a>");
1549 $tmp_questions = array_keys($survey_questions);
1550 $blockkey = array_search($question_id, $tmp_questions);
1551 if (($blockkey !== FALSE) && ($blockkey < count($tmp_questions)-1))
1553 if (
$data[
"questionblock_id"] == $survey_questions[$tmp_questions[$blockkey+1]][
"questionblock_id"])
1555 $this->tpl->setVariable(
"BUTTON_DOWN",
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"questions") .
"&down=" .
$data[
"question_id"] .
"\"><img src=\"" .
ilUtil::getImagePath(
"a_down.gif") .
"\" alt=\"".$this->lng->txt(
"down").
"\" border=\"0\" /></a>");
1560 foreach ($questiontypes as $trans => $typedata)
1562 if (strcmp($typedata[
"type_tag"],
$data[
"type_tag"]) == 0)
1564 $this->tpl->setVariable(
"QUESTION_TYPE", $trans);
1567 $this->tpl->setVariable(
"QUESTION_AUTHOR",
$data[
"author"]);
1568 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
1569 $last_color_class = $colors[$counter % 2];
1570 if (!
$data[
"questionblock_id"])
1574 $this->tpl->parseCurrentBlock();
1575 $last_questionblock_id =
$data[
"questionblock_id"];
1578 if ($rbacsystem->checkAccess(
"write", $this->ref_id) and !$hasDatasets)
1580 $this->tpl->setCurrentBlock(
"selectall");
1581 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
1582 $this->tpl->setVariable(
"COLOR_CLASS", $last_color_class);
1583 $this->tpl->parseCurrentBlock();
1584 if (array_key_exists(
"move_questions",
$_SESSION))
1586 $this->tpl->setCurrentBlock(
"move_buttons");
1587 $this->tpl->setVariable(
"INSERT_BEFORE", $this->lng->txt(
"insert_before"));
1588 $this->tpl->setVariable(
"INSERT_AFTER", $this->lng->txt(
"insert_after"));
1589 $this->tpl->parseCurrentBlock();
1591 $this->tpl->setCurrentBlock(
"QFooter");
1592 $this->tpl->setVariable(
"ARROW",
"<img src=\"" .
ilUtil::getImagePath(
"arrow_downright.gif") .
"\" alt=\"".$this->lng->txt(
"arrow_downright").
"\">");
1593 $this->tpl->setVariable(
"REMOVE", $this->lng->txt(
"remove_question"));
1594 $this->tpl->setVariable(
"MOVE", $this->lng->txt(
"move"));
1595 $this->tpl->setVariable(
"QUESTIONBLOCK", $this->lng->txt(
"define_questionblock"));
1596 $this->tpl->setVariable(
"UNFOLD", $this->lng->txt(
"unfold"));
1597 $this->tpl->setVariable(
"SAVE", $this->lng->txt(
"save_obligatory_state"));
1598 $this->tpl->parseCurrentBlock();
1603 $this->tpl->setCurrentBlock(
"Emptytable");
1604 $this->tpl->setVariable(
"TEXT_EMPTYTABLE", $this->lng->txt(
"no_questions_available"));
1605 $this->tpl->parseCurrentBlock();
1607 if (($last_questionblock_id > 0))
1610 $this->tpl->setCurrentBlock(
"separator");
1611 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
1612 $this->tpl->parseCurrentBlock();
1613 $this->tpl->setCurrentBlock(
"QTab");
1614 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
1615 $this->tpl->parseCurrentBlock();
1618 if ($rbacsystem->checkAccess(
"write", $this->ref_id) and !$hasDatasets)
1620 $this->tpl->setCurrentBlock(
"QTypes");
1621 include_once
"./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
1623 foreach ($qtypes as $translation =>
$data)
1625 $this->tpl->setVariable(
"QUESTION_TYPE_ID",
$data[
"type_tag"]);
1626 $this->tpl->setVariable(
"QUESTION_TYPE", $translation);
1627 $this->tpl->parseCurrentBlock();
1629 $this->tpl->parseCurrentBlock();
1631 $this->tpl->setCurrentBlock(
"adm_content");
1632 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"questions"));
1633 $this->tpl->setVariable(
"QUESTION_TITLE", $this->lng->txt(
"title"));
1634 $this->tpl->setVariable(
"QUESTION_COMMENT", $this->lng->txt(
"description"));
1635 $this->tpl->setVariable(
"QUESTION_OBLIGATORY", $this->lng->txt(
"obligatory"));
1636 $this->tpl->setVariable(
"QUESTION_SEQUENCE", $this->lng->txt(
"sequence"));
1637 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"question_type"));
1638 $this->tpl->setVariable(
"QUESTION_AUTHOR", $this->lng->txt(
"author"));
1640 if ($rbacsystem->checkAccess(
"write", $this->ref_id) and !$hasDatasets)
1642 $this->tpl->setVariable(
"BUTTON_INSERT_QUESTION", $this->lng->txt(
"browse_for_questions"));
1644 $this->tpl->setVariable(
'BROWSE_COMMAND', ($ilUser->getPref(
'svy_insert_type') == 1 || strlen($ilUser->getPref(
'svy_insert_type')) == 0) ?
'browseForQuestions' :
'browseForQuestionblocks');
1645 $this->tpl->setVariable(
"TEXT_CREATE_NEW",
" " . strtolower($this->lng->txt(
"or")) .
" " . $this->lng->txt(
"create_new"));
1646 $this->tpl->setVariable(
"BUTTON_CREATE_QUESTION", $this->lng->txt(
"create"));
1647 $this->tpl->setVariable(
"HEADING", $this->lng->txt(
"add_heading"));
1654 $this->tpl->parseCurrentBlock();
1667 include_once(
"./Modules/Survey/classes/class.ilSurveyEvaluationGUI.php");
1669 $this->ctrl->setCmdClass(get_class($eval_gui));
1670 $this->ctrl->redirect($eval_gui,
"evaluation");
1687 if (is_array(
$_POST[
"user_select"]))
1689 foreach (
$_POST[
"user_select"] as $user_id)
1691 $this->
object->disinviteUser($user_id);
1695 $this->ctrl->redirect($this,
"invite");
1705 if (is_array(
$_POST[
"user_select"]))
1707 foreach (
$_POST[
"user_select"] as $user_id)
1709 $this->
object->inviteUser($user_id);
1714 if (is_array(
$_POST[
"group_select"]))
1716 foreach (
$_POST[
"group_select"] as $group_id)
1718 $invited += $this->
object->inviteGroup($group_id);
1722 if (is_array(
$_POST[
"role_select"]))
1724 foreach (
$_POST[
"role_select"] as $role_id)
1726 $invited += $this->
object->inviteRole($role_id);
1737 $this->ctrl->redirect($this,
"invite");
1745 $mode =
$_POST[
'invitation'];
1749 $this->
object->setInvitation(0);
1752 $this->
object->setInvitation(1);
1753 $this->
object->setInvitationMode(0);
1756 $this->
object->setInvitation(1);
1757 $this->
object->setInvitationMode(1);
1760 $this->
object->saveToDb();
1762 $this->ctrl->redirect($this,
"invite");
1774 if ((!$rbacsystem->checkAccess(
"visible,invite", $this->ref_id)) && (!$rbacsystem->checkAccess(
"write", $this->ref_id)))
1778 $path = $this->tree->getPathFull($this->object->getRefID());
1779 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1790 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1792 $form->setFormAction($this->ctrl->getFormAction($this));
1793 $form->setTableWidth(
"500");
1794 $form->setId(
"invite");
1798 $header->setTitle($this->lng->txt(
"invitation"));
1799 $form->addItem($header);
1803 $invitation->
setInfo($this->lng->txt(
'invitation_mode_desc'));
1804 $invitation->addOption(
new ilRadioOption($this->lng->txt(
"invitation_off"), 0,
''));
1805 $surveySetting =
new ilSetting(
"survey");
1806 if ($surveySetting->get(
"unlimited_invitation"))
1808 $invitation->addOption(
new ilRadioOption($this->lng->txt(
"unlimited_users"), 1,
''));
1810 $invitation->addOption(
new ilRadioOption($this->lng->txt(
"predefined_users"), 2,
''));
1812 if ($this->object->getInvitation())
1814 $inv = $this->
object->getInvitationMode() + 1;
1816 $invitation->setValue($inv);
1817 $form->addItem($invitation);
1819 $form->addCommandButton(
"saveInvitationStatus", $this->lng->txt(
"save"));
1821 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_invite.html",
"Modules/Survey");
1822 $this->tpl->setVariable(
"INVITATION_TABLE", $form->getHTML());
1824 if ($this->object->getInvitation() && $this->
object->getInvitationMode() == 1)
1827 $searchform->setFormAction($this->ctrl->getFormAction($this));
1828 $searchform->setTableWidth(
"500");
1829 $searchform->setId(
"search");
1833 $header->setTitle($this->lng->txt(
"search_invitation"));
1834 $searchform->addItem($header);
1836 $param_search_term = (strlen(
$_POST[
'search_term'])) ?
$_POST[
'search_term'] :
$_GET[
'search_term'];
1837 $param_concatenation = (strlen(
$_POST[
'concatenation'])) ?
$_POST[
'concatenation'] :
$_GET[
'concatenation'];
1838 if (is_array(
$_POST[
'search_for']))
1840 $param_search_for =
$_POST[
'search_for'];
1844 $param_search_for = array();
1847 if (preg_match(
"/search_for_(\d+)/is",
$key, $matches))
1849 array_push($param_search_for, $value);
1855 $search_term =
new ilTextInputGUI($this->lng->txt(
'search_term'),
"search_term");
1856 if (strlen($param_search_term)) $search_term->
setValue($param_search_term);
1857 $searchform->addItem($search_term);
1862 $concatenation->addOption(
new ilRadioOption($this->lng->txt(
"and"),
'and',
''));
1863 $concatenation->setValue((strlen($param_concatenation)) ? $param_concatenation :
'or');
1864 $searchform->addItem($concatenation);
1869 $search_for->addOption(
new ilCheckboxOption($this->lng->txt(
"objs_grp"),
'grp',
''));
1870 $search_for->addOption(
new ilCheckboxOption($this->lng->txt(
"objs_role"),
'role',
''));
1871 $search_for->setValue((is_array($param_search_for)) ? $param_search_for : array(
'usr'));
1872 $searchform->addItem($search_for);
1874 $searchform->addCommandButton(
"searchInvitation", $this->lng->txt(
"search"));
1875 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
1877 $this->tpl->setVariable(
"SEARCH_TABLE", $searchform->getHTML());
1879 $invited_users = $this->
object->getUserData($this->object->getInvitedUsers());
1880 include_once
"./Modules/Survey/classes/tables/class.ilSurveyInvitedUsersTableGUI.php";
1882 $table_gui->setData($invited_users);
1883 $this->tpl->setVariable(
'TBL_INVITED_USERS', $table_gui->getHTML());
1887 $concat = ($param_concatenation) ? $param_concatenation :
"or";
1888 $searchfor = ($param_search_for) ? $param_search_for : array(
"usr");
1889 if (strcmp($this->ctrl->getCmd(),
"searchInvitation") == 0 || strlen(
$_GET[
'searchInvitation']))
1891 $this->ctrl->setParameter($this,
'search_term', $param_search_term);
1892 $this->ctrl->setParameter($this,
'concatenation', $param_concatenation);
1894 foreach ($searchfor as
$param)
1896 $this->ctrl->setParameter($this,
'search_for_' . $c, $param);
1899 $this->ctrl->setParameter($this,
'searchInvitation', 1);
1901 if (is_array($param_search_for))
1903 if (in_array(
"usr", $searchfor) or in_array(
"grp", $searchfor) or in_array(
"role", $searchfor))
1905 include_once
"./classes/class.ilSearch.php";
1906 $search =&
new ilSearch($ilUser->id);
1907 $search->setSearchString($param_search_term);
1908 $search->setCombination($concat);
1909 $search->setSearchFor($searchfor);
1910 $search->setSearchType(
"new");
1911 if($search->validate($message))
1913 $search->performSearch();
1919 if(!$search->getNumberOfResults() && $search->getSearchFor())
1924 if ($searchresult = $search->getResultByType(
"usr"))
1927 foreach ($searchresult as
$res)
1929 array_push($found, $res[
'id']);
1931 $users = $this->
object->getUserData($found);
1932 include_once
"./Modules/Survey/classes/tables/class.ilSurveyInviteUsersTableGUI.php";
1934 $table_gui->setData($users);
1935 $this->tpl->setVariable(
'TBL_USER_RESULT', $table_gui->getHTML());
1937 $searchresult = array();
1938 if ($searchresult = $search->getResultByType(
"grp"))
1941 foreach ($searchresult as
$res)
1943 array_push($found, $res[
'id']);
1945 $groups = $this->
object->getGroupData($found);
1946 include_once
"./Modules/Survey/classes/tables/class.ilSurveyInviteGroupsTableGUI.php";
1948 $table_gui->setData($groups);
1949 $this->tpl->setVariable(
'TBL_GROUP_RESULT', $table_gui->getHTML());
1951 $searchresult = array();
1952 if ($searchresult = $search->getResultByType(
"role"))
1955 foreach ($searchresult as
$res)
1957 array_push($found, $res[
'id']);
1959 $roles = $this->
object->getRoleData($found);
1962 include_once
"./Modules/Survey/classes/tables/class.ilSurveyInviteRolesTableGUI.php";
1964 $table_gui->setData($roles);
1965 $this->tpl->setVariable(
'TBL_ROLE_RESULT', $table_gui->getHTML());
1983 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_maintenance.html",
"Modules/Survey");
1984 $this->tpl->setCurrentBlock(
"adm_content");
1985 $this->tpl->setVariable(
"BTN_CONFIRM_DELETE_ALL", $this->lng->txt(
"confirm"));
1986 $this->tpl->setVariable(
"BTN_CANCEL_DELETE_ALL", $this->lng->txt(
"cancel"));
1987 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"deleteAllUserData"));
1988 $this->tpl->parseCurrentBlock();
1996 $this->
object->deleteAllUserData();
1998 $this->ctrl->redirect($this,
"maintenance");
2006 $this->ctrl->redirect($this,
"maintenance");
2014 $this->
object->removeSelectedSurveyResults(
$_POST[
"chbUser"]);
2016 $this->ctrl->redirect($this,
"maintenance");
2025 $this->ctrl->redirect($this,
"maintenance");
2035 if (count(
$_POST[
"chbUser"]) == 0)
2038 $this->ctrl->redirect($this,
"maintenance");
2042 include_once
"./Modules/Survey/classes/tables/class.ilSurveyMaintenanceTableGUI.php";
2044 $total =& $this->
object->getSurveyParticipants();
2046 foreach (
$total as $user_data)
2048 if (in_array($user_data[
'active_id'],
$_POST[
'chbUser']))
2050 $last_access = $this->
object->_getLastAccess($user_data[
"active_id"]);
2051 array_push(
$data, array(
2052 'id' => $user_data[
"active_id"],
2053 'name' => $user_data[
"sortname"],
2054 'login' => $user_data[
"login"],
2059 $table_gui->setData(
$data);
2060 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
2070 if (
$_GET[
"fill"] > 0)
2072 for ($i = 0; $i <
$_GET[
"fill"]; $i++) $this->object->fillSurveyForUser();
2074 include_once
"./Modules/Survey/classes/tables/class.ilSurveyMaintenanceTableGUI.php";
2076 $total =& $this->
object->getSurveyParticipants();
2078 foreach (
$total as $user_data)
2080 $last_access = $this->
object->_getLastAccess($user_data[
"active_id"]);
2081 array_push(
$data, array(
2082 'id' => $user_data[
"active_id"],
2083 'name' => $user_data[
"sortname"],
2084 'login' => $user_data[
"login"],
2088 $table_gui->setData(
$data);
2089 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
2100 $this->tpl->setCurrentBlock(
"option_qpl");
2101 include_once(
"./Modules/Survey/classes/class.ilObjSurvey.php");
2103 $questionpools =& $svy->getAvailableQuestionpools(TRUE, FALSE, TRUE);
2104 if (count($questionpools) == 0)
2109 foreach ($questionpools as
$key => $value)
2111 $this->tpl->setCurrentBlock(
"option_spl");
2112 $this->tpl->setVariable(
"OPTION_VALUE",
$key);
2113 $this->tpl->setVariable(
"TXT_OPTION", $value);
2114 $this->tpl->parseCurrentBlock();
2117 $this->tpl->setVariable(
"TXT_SELECT_QUESTIONPOOL", $this->lng->txt(
"select_questionpool"));
2118 $this->tpl->setVariable(
"OPTION_SELECT_QUESTIONPOOL", $this->lng->txt(
"select_questionpool_option"));
2119 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"import"));
2120 $this->tpl->setVariable(
"BTN_NAME",
"upload");
2121 $this->tpl->setVariable(
"TXT_UPLOAD", $this->lng->txt(
"upload"));
2122 $this->tpl->setVariable(
"TXT_IMPORT_TST", $this->lng->txt(
"import_tst"));
2123 $this->tpl->setVariable(
"TXT_SELECT_MODE", $this->lng->txt(
"select_mode"));
2124 $this->tpl->setVariable(
"TXT_SELECT_FILE", $this->lng->txt(
"select_file"));
2142 if (strcmp($_FILES[
"xmldoc"][
"tmp_name"],
"") == 0)
2149 include_once(
"./Modules/Survey/classes/class.ilObjSurvey.php");
2151 $newObj->setType(
$_GET[
"new_type"]);
2152 $newObj->setTitle(
"dummy");
2153 $newObj->setDescription(
"dummy");
2154 $newObj->create(
true);
2155 $newObj->createReference();
2156 $newObj->putInTree(
$_GET[
"ref_id"]);
2157 $newObj->setPermissions(
$_GET[
"ref_id"]);
2158 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
2160 $error = $newObj->importObject($_FILES[
"xmldoc"],
$_POST[
"spl"]);
2164 $this->ilias->raiseError(
$error, $this->ilias->error_obj->MESSAGE);
2169 $ref_id = $newObj->getRefId();
2173 include_once
"./Services/Utilities/classes/class.ilUtil.php";
2186 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"], $new_type))
2188 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
2194 include_once(
"./Modules/Survey/classes/class.ilObjSurvey.php");
2198 $questionpools =& $svy->getAvailableQuestionpools($use_obj_id = TRUE, $could_be_offline = TRUE, $showPath = TRUE);
2199 if (count($questionpools) > 0)
2201 foreach ($questionpools as
$key => $value)
2203 $this->tpl->setCurrentBlock(
"option_spl");
2204 $this->tpl->setVariable(
"OPTION_VALUE",
$key);
2205 $this->tpl->setVariable(
"TXT_OPTION", $value);
2208 $this->tpl->setVariable(
"OPTION_SELECTED",
" selected=\"selected\"");
2210 $this->tpl->parseCurrentBlock();
2215 $data[
"fields"] = array();
2216 include_once
"./Services/Utilities/classes/class.ilUtil.php";
2220 foreach (
$data[
"fields"] as
$key => $val)
2222 $this->tpl->setVariable(
"TXT_".strtoupper(
$key), $this->lng->txt(
$key));
2223 $this->tpl->setVariable(strtoupper(
$key), $val);
2225 if ($this->prepare_output)
2227 $this->tpl->parseCurrentBlock();
2231 $this->ctrl->setParameter($this,
"new_type", $this->type);
2232 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"create"));
2233 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt($new_type.
"_new"));
2234 $this->tpl->setVariable(
"TXT_SELECT_QUESTIONPOOL", $this->lng->txt(
"select_questionpool_short"));
2235 $this->tpl->setVariable(
"OPTION_SELECT_QUESTIONPOOL", $this->lng->txt(
"select_questionpool_option"));
2236 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
2237 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt($new_type.
"_add"));
2238 $this->tpl->setVariable(
"CMD_SUBMIT",
"save");
2239 $this->tpl->setVariable(
"TARGET",
' target="'.
2241 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
2243 $this->tpl->setVariable(
"TXT_IMPORT_SVY", $this->lng->txt(
"import_svy"));
2244 $this->tpl->setVariable(
"TXT_SVY_FILE", $this->lng->txt(
"svy_upload_file"));
2245 $this->tpl->setVariable(
"TXT_IMPORT", $this->lng->txt(
"import"));
2248 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
"obj_svy"));
2250 $this->tpl->setVariable(
"ALT_IMG2",$this->lng->txt(
"obj_svy"));
2265 if (strcmp($_FILES[
"xmldoc"][
"tmp_name"],
"") == 0)
2271 $this->ctrl->setParameter($this,
"new_type", $this->type);
2277 "&baseClass=ilObjSurveyGUI");
2288 $export_dir = $this->
object->getExportDirectory();
2289 $export_files = $this->
object->getExportFiles($export_dir);
2291 if(count($export_files) > 0)
2293 foreach($export_files as $exp_file)
2295 $file_arr = explode(
"__", $exp_file);
2297 array_push(
$data, array(
2298 'file' => $exp_file,
2299 'size' => filesize($export_dir.
"/".$exp_file),
2305 include_once
"./Modules/Survey/classes/tables/class.ilSurveyExportTableGUI.php";
2307 $table_gui->setData(
$data);
2308 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
2317 include_once(
"./Modules/Survey/classes/class.ilSurveyExport.php");
2319 $survey_exp->buildExportFile();
2320 $this->ctrl->redirect($this,
"export");
2328 if(!isset(
$_POST[
"file"]))
2331 $this->ctrl->redirect($this,
"export");
2334 if (count(
$_POST[
"file"]) > 1)
2337 $this->ctrl->redirect($this,
"export");
2341 $export_dir = $this->
object->getExportDirectory();
2342 include_once
"./Services/Utilities/classes/class.ilUtil.php";
2354 if (!isset(
$_POST[
"file"]))
2357 $this->ctrl->redirect($this,
"export");
2362 $export_dir = $this->
object->getExportDirectory();
2363 $export_files = $this->
object->getExportFiles($export_dir);
2365 if (count(
$_POST[
"file"]) > 0)
2367 foreach (
$_POST[
"file"] as $exp_file)
2369 $file_arr = explode(
"__", $exp_file);
2371 array_push(
$data, array(
2372 'file' => $exp_file,
2373 'size' => filesize($export_dir.
"/".$exp_file),
2379 include_once
"./Modules/Survey/classes/tables/class.ilSurveyExportTableGUI.php";
2381 $table_gui->setData(
$data);
2382 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
2392 $this->ctrl->redirect($this,
"export");
2401 $export_dir = $this->
object->getExportDirectory();
2404 $exp_file = $export_dir.
"/".
$file;
2405 $exp_dir = $export_dir.
"/".substr($file, 0, strlen($file) - 4);
2406 if (@is_file($exp_file))
2410 if (@is_dir($exp_dir))
2412 include_once
"./Services/Utilities/classes/class.ilUtil.php";
2417 $this->ctrl->redirect($this,
"export");
2425 if (strcmp(
$_POST[
"lang"],
"-1") != 0)
2428 $ilUser->writePref(
"survey_code_language",
$_POST[
"lang"]);
2431 $this->ctrl->redirect($this,
'codes');
2442 if ($this->object->getAnonymize() != 1)
2447 include_once
"./Modules/Survey/classes/tables/class.ilSurveyCodesTableGUI.php";
2449 $default_lang = $ilUser->getPref(
"survey_code_language");
2450 $survey_codes =& $this->
object->getSurveyCodesTableData($default_lang);
2451 $table_gui->setData($survey_codes);
2452 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_codes.html",
true);
2453 $this->tpl->setCurrentBlock(
"adm_content");
2454 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"codes"));
2455 $this->tpl->setVariable(
"TEXT_CREATE", $this->lng->txt(
"create"));
2456 $this->tpl->setVariable(
"TEXT_SURVEY_CODES", $this->lng->txt(
"new_survey_codes"));
2457 $this->tpl->setVariable(
'TABLE', $table_gui->getHTML());
2465 if (is_array(
$_POST[
"chb_code"]) && (count(
$_POST[
"chb_code"]) > 0))
2467 foreach (
$_POST[
"chb_code"] as $survey_code)
2469 $this->
object->deleteSurveyCode($survey_code);
2477 $this->ctrl->redirect($this,
'codes');
2485 if (is_array(
$_POST[
"chb_code"]) && (count(
$_POST[
"chb_code"]) > 0))
2487 $export = $this->
object->getSurveyCodesForExport(
$_POST[
"chb_code"]);
2493 $this->ctrl->redirect($this,
'codes');
2502 $export = $this->
object->getSurveyCodesForExport(array());
2511 if (preg_match(
"/\d+/",
$_POST[
"nrOfCodes"]))
2513 $this->
object->createSurveyCodes(
$_POST[
"nrOfCodes"]);
2520 $this->ctrl->redirect($this,
'codes');
2528 $this->ctrl->saveParameter($this,
"preid");
2529 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_add_constraint.html",
"Modules/Survey");
2530 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
2531 if (is_array($questions))
2533 foreach ($questions as $question)
2535 $this->tpl->setCurrentBlock(
"option_q");
2536 $this->tpl->setVariable(
"OPTION_VALUE", $question[
"question_id"]);
2538 if ($question[
"question_id"] == $postvalues[
"q"])
2540 $this->tpl->setVariable(
"OPTION_CHECKED",
" selected=\"selected\"");
2542 $this->tpl->parseCurrentBlock();
2547 $relations = $this->
object->getAllRelations();
2548 foreach ($relations as $rel_id => $relation)
2550 if (in_array($relation[
"short"], $survey_questions[$postvalues[
"q"]][
"availableRelations"]))
2552 $this->tpl->setCurrentBlock(
"option_r");
2553 $this->tpl->setVariable(
"OPTION_VALUE", $rel_id);
2554 $this->tpl->setVariable(
"OPTION_TEXT", $relation[
"short"]);
2555 if ($rel_id == $postvalues[
"r"])
2557 $this->tpl->setVariable(
"OPTION_CHECKED",
" selected=\"selected\"");
2559 $this->tpl->parseCurrentBlock();
2562 $this->tpl->setCurrentBlock(
"select_relation");
2563 $this->tpl->setVariable(
"SELECT_RELATION", $this->lng->txt(
"step") .
" 2: " . $this->lng->txt(
"select_relation"));
2564 $this->tpl->parseCurrentBlock();
2569 $variables =& $this->
object->getVariables($postvalues[
"q"]);
2570 $question_type = $survey_questions[$postvalues[
"q"]][
"type_tag"];
2571 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
2573 $question =
new $question_type();
2574 $question->loadFromDb($postvalues[
"q"]);
2575 $select_value = $question->getPreconditionSelectValue($postvalues[
"v"]);
2576 $this->tpl->setCurrentBlock(
"select_value");
2577 $this->tpl->setVariable(
"SELECT_VALUE", $select_value);
2578 $this->tpl->parseCurrentBlock();
2581 $this->tpl->setCurrentBlock(
"buttons");
2582 $this->tpl->setVariable(
"BTN_CONTINUE", $this->lng->txt(
"continue"));
2586 $this->tpl->setVariable(
"COMMAND",
"constraintStep2");
2587 $this->tpl->setVariable(
"COMMAND_BACK",
"constraints");
2590 $this->tpl->setVariable(
"COMMAND",
"constraintStep3");
2591 $this->tpl->setVariable(
"COMMAND_BACK",
"constraintStep1");
2594 $this->tpl->setVariable(
"COMMAND",
"constraintsAdd");
2595 $this->tpl->setVariable(
"COMMAND_BACK",
"constraintStep2");
2598 $this->tpl->setVariable(
"BTN_BACK", $this->lng->txt(
"back"));
2599 $this->tpl->parseCurrentBlock();
2600 $this->tpl->setCurrentBlock(
"adm_content");
2602 if ($survey_questions[
$_SESSION[
"constraintstructure"][
$_GET[
"start"]][0]][
"questionblock_id"] > 0)
2604 $title = $this->lng->txt(
"questionblock") .
": " . $survey_questions[
$_SESSION[
"constraintstructure"][
$_GET[
"start"]][0]][
"questionblock_title"];
2608 $title = $this->lng->txt($survey_questions[
$_SESSION[
"constraintstructure"][
$_GET[
"start"]][0]][
"type_tag"]) .
": " . $survey_questions[
$_SESSION[
"constraintstructure"][$_GET[
"start"]][0]][
"title"];
2610 $this->tpl->setVariable(
"CONSTRAINT_QUESTION_TEXT",
$title);
2611 $this->tpl->setVariable(
"SELECT_PRIOR_QUESTION", $this->lng->txt(
"step") .
" 1: " . $this->lng->txt(
"select_prior_question"));
2612 if (strlen(
$_GET[
"start"])) $this->ctrl->setParameter($this,
"start",
$_GET[
"start"]);
2613 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"constraintsAdd"));
2614 $this->tpl->parseCurrentBlock();
2626 if (strlen(
$_POST[
"v"]) == 0)
2631 $survey_questions =& $this->
object->getSurveyQuestions();
2632 $structure =&
$_SESSION[
"constraintstructure"];
2633 $include_elements =
$_SESSION[
"includeElements"];
2634 foreach ($include_elements as $elementCounter)
2636 if (is_array($structure[$elementCounter]))
2638 foreach ($structure[$elementCounter] as
$key => $question_id)
2640 if (strlen(
$_GET[
"preid"]))
2642 $this->
object->updateConstraint($question_id,
$_POST[
"q"],
$_POST[
"r"],
$_POST[
"v"]);
2652 unset(
$_SESSION[
"constraintstructure"]);
2653 $this->ctrl->redirect($this,
"constraints");
2665 $survey_questions =& $this->
object->getSurveyQuestions();
2666 $option_questions = array();
2667 if (strlen(
$_GET[
"precondition"]))
2669 $pc = $this->
object->getPrecondition(
$_GET[
"precondition"]);
2670 $postvalues = array(
2671 "q" => $pc[
"question_fi"],
2672 "r" => $pc[
"relation_id"],
2675 $this->ctrl->setParameter($this,
"preid",
$_GET[
"precondition"]);
2676 array_push($option_questions, array(
"question_id" => $pc[
"question_fi"],
"title" => $survey_questions[$pc[
"question_fi"]][
"title"],
"type_tag" => $survey_questions[$pc[
"question_fi"]][
"type_tag"]));
2681 array_push($option_questions, array(
"question_id" =>
$_POST[
"q"],
"title" => $survey_questions[
$_POST[
"q"]][
"title"],
"type_tag" => $survey_questions[$_POST[
"q"]][
"type_tag"]));
2695 $survey_questions =& $this->
object->getSurveyQuestions();
2696 $option_questions = array();
2697 array_push($option_questions, array(
"question_id" =>
$_POST[
"q"],
"title" => $survey_questions[
$_POST[
"q"]][
"title"],
"type_tag" => $survey_questions[$_POST[
"q"]][
"type_tag"]));
2710 $survey_questions =& $this->
object->getSurveyQuestions();
2711 $structure =&
$_SESSION[
"constraintstructure"];
2713 $option_questions = array();
2714 for ($i = 1; $i <
$start; $i++)
2716 if (is_array($structure[$i]))
2718 foreach ($structure[$i] as
$key => $question_id)
2720 if ($survey_questions[$question_id][
"usableForPrecondition"])
2722 array_push($option_questions, array(
"question_id" => $survey_questions[$question_id][
"question_id"],
"title" => $survey_questions[$question_id][
"title"],
"type_tag" => $survey_questions[$question_id][
"type_tag"]));
2727 if (count($option_questions) == 0)
2730 unset(
$_SESSION[
"constraintstructure"]);
2731 ilUtil::sendInfo($this->lng->txt(
"constraints_no_nonessay_available"),
true);
2732 $this->ctrl->redirect($this,
"constraints");
2746 $survey_questions =& $this->
object->getSurveyQuestions();
2747 $structure =&
$_SESSION[
"constraintstructure"];
2750 if (preg_match(
"/^constraint_(\d+)_(\d+)/",
$key, $matches))
2752 foreach ($structure[$matches[1]] as
$key => $question_id)
2754 $this->
object->deleteConstraint($matches[2], $question_id);
2759 $this->ctrl->redirect($this,
"constraints");
2764 $include_elements =
$_POST[
"includeElements"];
2765 if ((!is_array($include_elements)) || (count($include_elements) == 0))
2767 ilUtil::sendInfo($this->lng->txt(
"constraints_no_questions_or_questionblocks_selected"),
true);
2768 $this->ctrl->redirect($this,
"constraints");
2770 else if (count($include_elements) >= 1)
2772 $_SESSION[
"includeElements"] = $include_elements;
2773 sort($include_elements, SORT_NUMERIC);
2774 $_GET[
"start"] = $include_elements[0];
2782 $this->ctrl->setParameter($this,
"precondition",
$_GET[
"precondition"]);
2783 $this->ctrl->setParameter($this,
"start",
$_GET[
"start"]);
2784 $this->ctrl->redirect($this,
"constraintStep3");
2800 $hasDatasets = $this->
object->_hasDatasets($this->object->getSurveyId());
2802 if (array_key_exists(
"step",
$_GET)) $step =
$_GET[
"step"];
2817 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_constraints_list.html",
"Modules/Survey");
2818 $survey_questions =& $this->
object->getSurveyQuestions();
2819 $last_questionblock_title =
"";
2821 $hasPreconditions = FALSE;
2822 $structure = array();
2823 $colors = array(
"tblrow1",
"tblrow2");
2824 foreach ($survey_questions as $question_id =>
$data)
2828 if (
$data[
"questionblock_id"] > 0)
2831 $type = $this->lng->txt(
"questionblock");
2832 if (strcmp(
$title, $last_questionblock_title) != 0)
2834 $last_questionblock_title =
$title;
2835 $structure[$counter] = array();
2836 array_push($structure[$counter],
$data[
"question_id"]);
2840 array_push($structure[$counter-1],
$data[
"question_id"]);
2846 $structure[$counter] = array(
$data[
"question_id"]);
2847 $type = $this->lng->txt(
"question");
2853 $this->tpl->setCurrentBlock(
"description");
2854 $this->tpl->setVariable(
"DESCRIPTION", $this->lng->txt(
"constraints_first_question_description"));
2855 $this->tpl->parseCurrentBlock();
2859 $constraints =& $this->
object->getConstraints(
$data[
"question_id"]);
2861 if (count($constraints))
2863 $hasPreconditions = TRUE;
2864 foreach ($constraints as $constraint)
2866 $this->tpl->setCurrentBlock(
"constraint");
2867 $this->tpl->setVariable(
"SEQUENCE_ID", $counter);
2868 $this->tpl->setVariable(
"CONSTRAINT_ID", $constraint[
"id"]);
2869 $this->tpl->setVariable(
"CONSTRAINT_TEXT", $survey_questions[$constraint[
"question"]][
"title"] .
" " . $constraint[
"short"] .
" " . $constraint[
"valueoutput"]);
2870 $this->tpl->setVariable(
"TEXT_EDIT_PRECONDITION", $this->lng->txt(
"edit"));
2871 $this->ctrl->setParameter($this,
"precondition", $constraint[
"id"]);
2872 $this->ctrl->setParameter($this,
"start", $counter);
2873 $this->tpl->setVariable(
"EDIT_PRECONDITION", $this->ctrl->getLinkTarget($this,
"editPrecondition"));
2874 $this->ctrl->setParameter($this,
"precondition",
"");
2875 $this->ctrl->setParameter($this,
"start",
"");
2876 $this->tpl->parseCurrentBlock();
2882 $this->tpl->setCurrentBlock(
"include_elements");
2883 $this->tpl->setVariable(
"QUESTION_NR",
"$counter");
2884 $this->tpl->parseCurrentBlock();
2886 $this->tpl->setCurrentBlock(
"constraint_section");
2887 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
2888 $this->tpl->setVariable(
"QUESTION_NR",
"$counter");
2889 $this->tpl->setVariable(
"TITLE",
"$title");
2890 $icontype =
"question.gif";
2891 if (
$data[
"questionblock_id"] > 0)
2893 $icontype =
"questionblock.gif";
2895 $this->tpl->setVariable(
"TYPE",
"$type: ");
2896 include_once
"./Services/Utilities/classes/class.ilUtil.php";
2898 $this->tpl->setVariable(
"ICON_ALT",
$type);
2899 $this->tpl->parseCurrentBlock();
2903 if ($rbacsystem->checkAccess(
"write", $this->ref_id) and !$hasDatasets)
2905 if ($hasPreconditions)
2907 $this->tpl->setCurrentBlock(
"selectall_preconditions");
2908 $this->tpl->setVariable(
"SELECT_ALL_PRECONDITIONS", $this->lng->txt(
"select_all"));
2909 $this->tpl->parseCurrentBlock();
2911 $this->tpl->setCurrentBlock(
"selectall");
2913 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
2914 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter % 2]);
2915 $this->tpl->parseCurrentBlock();
2917 if ($hasPreconditions)
2919 $this->tpl->setCurrentBlock(
"delete_button");
2920 $this->tpl->setVariable(
"BTN_DELETE", $this->lng->txt(
"delete"));
2921 include_once
"./Services/Utilities/classes/class.ilUtil.php";
2922 $this->tpl->setVariable(
"ARROW",
"<img src=\"" .
ilUtil::getImagePath(
"arrow_downright.gif") .
"\" alt=\"".$this->lng->txt(
"arrow_downright").
"\">");
2923 $this->tpl->parseCurrentBlock();
2926 $this->tpl->setCurrentBlock(
"buttons");
2927 $this->tpl->setVariable(
"ARROW",
"<img src=\"" .
ilUtil::getImagePath(
"arrow_downright.gif") .
"\" alt=\"".$this->lng->txt(
"arrow_downright").
"\">");
2928 $this->tpl->setVariable(
"BTN_CREATE_CONSTRAINTS", $this->lng->txt(
"constraint_add"));
2929 $this->tpl->parseCurrentBlock();
2931 $this->tpl->setCurrentBlock(
"adm_content");
2932 $this->tpl->setVariable(
"CONSTRAINTS_INTRODUCTION", $this->lng->txt(
"constraints_introduction"));
2933 $this->tpl->setVariable(
"DEFINED_PRECONDITIONS", $this->lng->txt(
"existing_constraints"));
2934 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"constraints"));
2935 $this->tpl->setVariable(
"CONSTRAINTS_HEADER", $this->lng->txt(
"constraints_list_of_entities"));
2936 $this->tpl->parseCurrentBlock();
2937 $_SESSION[
"constraintstructure"] = $structure;
2951 $this->ctrl->setCmd(
"showSummary");
2952 $this->ctrl->setCmdClass(
"ilinfoscreengui");
2959 $tpl =
new ilTemplate(
"tpl.il_svy_svy_main.html", TRUE, TRUE,
"Modules/Survey");
2962 $tpl->setVariable(
"LOCATION_STYLESHEET",$location_stylesheet);
2963 $tpl->setVariable(
"LOCATION_JAVASCRIPT",dirname($location_stylesheet));
2974 if (!$ilAccess->checkAccess(
"visible",
"", $this->ref_id))
2976 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
2979 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
2981 include_once
"./Modules/Survey/classes/class.ilSurveyExecutionGUI.php";
2983 $info->setFormAction($this->ctrl->getFormAction($output_gui,
"infoScreen"));
2984 $info->enablePrivateNotes();
2985 $anonymize_key = NULL;
2986 if ($this->object->getAnonymize() == 1)
2990 $anonymize_key =
$_SESSION[
"anonymous_id"];
2992 else if (
$_POST[
"anonymous_id"])
2994 $anonymize_key =
$_POST[
"anonymous_id"];
2997 $canStart = $this->
object->canStartSurvey($anonymize_key);
2998 $showButtons = $canStart[
"result"];
2999 if (!$showButtons)
ilUtil::sendInfo(implode(
"<br />", $canStart[
"messages"]));
3004 if (!$this->object->getAnonymize())
3006 $survey_started = $this->
object->isSurveyStarted($ilUser->getId(),
"");
3008 if (
$_SESSION[
"AccountId"] == ANONYMOUS_USER_ID)
3014 if ($survey_started === 1)
3018 elseif ($survey_started === 0)
3020 $info->addFormButton(
"resume", $this->lng->txt(
"resume_survey"));
3022 elseif ($survey_started === FALSE)
3024 $info->addFormButton(
"start", $this->lng->txt(
"start_survey"));
3029 else if ($this->object->getAnonymize() && !$this->
object->isAccessibleWithoutCode())
3031 if ((
$_SESSION[
"AccountId"] == ANONYMOUS_USER_ID) && (strlen(
$_POST[
"anonymous_id"]) == 0) && (strlen(
$_SESSION[
"anonymous_id"]) == 0))
3033 $info->setFormAction($this->ctrl->getFormAction($this,
"infoScreen"));
3034 $info->addSection($this->lng->txt(
"anonymization"));
3035 $info->addProperty(
"", $this->lng->txt(
"anonymize_anonymous_introduction"));
3036 $info->addPropertyTextinput($this->lng->txt(
"enter_anonymous_id"),
"anonymous_id",
"", 8,
"infoScreen", $this->lng->txt(
"submit"));
3040 if (strlen(
$_POST[
"anonymous_id"]) > 0)
3042 if (!$this->object->checkSurveyCode(
$_POST[
"anonymous_id"]))
3048 $anonymize_key =
$_POST[
"anonymous_id"];
3051 else if (strlen(
$_SESSION[
"anonymous_id"]) > 0)
3053 if (!$this->object->checkSurveyCode(
$_SESSION[
"anonymous_id"]))
3059 $anonymize_key =
$_SESSION[
"anonymous_id"];
3065 $anonymize_key = $this->
object->getUserAccessCode($ilUser->getId());
3066 if (!strlen($anonymize_key))
3068 $anonymize_key = $this->
object->createNewAccessCode();
3069 $this->
object->saveUserAccessCode($ilUser->getId(), $anonymize_key);
3072 $info->addHiddenElement(
"anonymous_id", $anonymize_key);
3073 $survey_started = $this->
object->isSurveyStarted($ilUser->getId(), $anonymize_key);
3074 if ($survey_started === 1)
3078 elseif ($survey_started === 0)
3080 $info->addFormButton(
"resume", $this->lng->txt(
"resume_survey"));
3082 elseif ($survey_started === FALSE)
3084 $info->addFormButton(
"start", $this->lng->txt(
"start_survey"));
3091 $survey_started = $this->
object->isSurveyStarted($ilUser->getId(),
"");
3092 if ($survey_started === 1)
3096 elseif ($survey_started === 0)
3098 $info->addFormButton(
"resume", $this->lng->txt(
"resume_survey"));
3100 elseif ($survey_started === FALSE)
3102 $info->addFormButton(
"start", $this->lng->txt(
"start_survey"));
3107 if (strlen($this->object->getIntroduction()))
3109 $introduction = $this->
object->getIntroduction();
3110 $info->addSection($this->lng->txt(
"introduction"));
3111 $info->addProperty(
"", $this->object->prepareTextareaOutput($introduction));
3114 $info->addSection($this->lng->txt(
"svy_general_properties"));
3115 if (strlen($this->object->getAuthor()))
3117 $info->addProperty($this->lng->txt(
"author"), $this->
object->getAuthor());
3119 $info->addProperty($this->lng->txt(
"title"), $this->
object->getTitle());
3120 switch ($this->object->getAnonymize())
3123 $info->addProperty($this->lng->txt(
"anonymization"), $this->lng->txt(
"anonymize_personalized"));
3126 if (
$_SESSION[
"AccountId"] == ANONYMOUS_USER_ID)
3128 $info->addProperty($this->lng->txt(
"anonymization"), $this->lng->txt(
"info_anonymize_with_code"));
3132 $info->addProperty($this->lng->txt(
"anonymization"), $this->lng->txt(
"info_anonymize_registered_user"));
3136 $info->addProperty($this->lng->txt(
"anonymization"), $this->lng->txt(
"info_anonymize_without_code"));
3139 include_once
"./Modules/Survey/classes/class.ilObjSurveyAccess.php";
3142 $info->addProperty($this->lng->txt(
"evaluation_access"), $this->lng->txt(
"evaluation_access_info"));
3144 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
3145 $this->ctrl->forwardCommand($info);
3158 $template =
new ilTemplate(
"tpl.il_svy_svy_printview.html", TRUE, TRUE,
"Modules/Survey");
3160 include_once
'./Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
3163 $this->ctrl->setParameter($this,
"pdf",
"1");
3164 $template->setCurrentBlock(
"pdf_export");
3165 $template->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"printView"));
3166 $this->ctrl->setParameter($this,
"pdf",
"");
3167 $template->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
3168 $template->setVariable(
"PDF_IMG_ALT", $this->lng->txt(
"pdf_export"));
3170 $template->parseCurrentBlock();
3172 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
3173 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
3175 $pages =& $this->
object->getSurveyPages();
3176 foreach ($pages as $page)
3178 if (count($page) > 0)
3180 foreach ($page as $question)
3182 $questionGUI = $this->
object->getQuestionGUI($question[
"type_tag"], $question[
"question_id"]);
3183 if (is_object($questionGUI))
3185 if (strlen($question[
"heading"]))
3187 $template->setCurrentBlock(
"textblock");
3188 $template->setVariable(
"TEXTBLOCK", $question[
"heading"]);
3189 $template->parseCurrentBlock();
3191 $template->setCurrentBlock(
"question");
3192 $template->setVariable(
"QUESTION_DATA", $questionGUI->getPrintView($this->object->getShowQuestionTitles(), $question[
"questionblock_show_questiontext"], $this->
object->getSurveyId()));
3193 $template->parseCurrentBlock();
3196 if (count($page) > 1)
3198 $template->setCurrentBlock(
"page");
3199 $template->setVariable(
"BLOCKTITLE", $page[0][
"questionblock_title"]);
3200 $template->parseCurrentBlock();
3204 $template->setCurrentBlock(
"page");
3205 $template->parseCurrentBlock();
3209 $this->tpl->addCss(
"./Modules/Survey/templates/default/survey_print.css",
"print");
3210 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1))
3212 $printbody =
new ilTemplate(
"tpl.il_as_tst_print_body.html", TRUE, TRUE,
"Modules/Test");
3213 $printbody->setVariable(
"TITLE", sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
3214 $printbody->setVariable(
"ADM_CONTENT", $template->get());
3215 $printoutput = $printbody->get();
3216 $printoutput = preg_replace(
"/href=\".*?\"/",
"", $printoutput);
3217 $fo = $this->
object->processPrintoutput2FO($printoutput);
3218 $this->
object->deliverPDFfromFO($fo);
3222 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
3229 switch ($this->ctrl->getCmd())
3235 case "redirectQuestion":
3236 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
3239 case "checkEvaluationAccess":
3240 case "evaluationdetails":
3241 case "evaluationuser":
3242 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTargetByClass(
"ilsurveyevaluationgui",
"evaluation"),
"",
$_GET[
"ref_id"]);
3251 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
3254 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$_GET[
"ref_id"]);
3268 $questions = ($a_cmd ==
'questions') ?
true :
false;
3269 $printview = ($a_cmd ==
'printview') ?
true :
false;
3271 $this->tabs_gui->addSubTabTarget(
"survey_question_editor", $this->ctrl->getLinkTarget($this,
"questions"),
3272 "",
"",
"", $questions);
3273 $this->tabs_gui->addSubTabTarget(
"print_view", $this->ctrl->getLinkTarget($this,
"printView"),
3274 "",
"",
"", $printview);
3288 $ilTabs->addSubTabTarget(
3289 "svy_eval_cumulated",
3290 $this->ctrl->getLinkTargetByClass(
"ilsurveyevaluationgui",
"evaluation"),
3291 array(
"evaluation",
"checkEvaluationAccess"),
3295 $ilTabs->addSubTabTarget(
3297 $this->ctrl->getLinkTargetByClass(
"ilsurveyevaluationgui",
"evaluationdetails"),
3298 array(
"evaluationdetails"),
3302 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
3304 $ilTabs->addSubTabTarget(
3306 $this->ctrl->getLinkTargetByClass(
"ilsurveyevaluationgui",
"evaluationuser"),
3307 array(
"evaluationuser"),
3318 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
3320 $ilTabs->setBackTarget($this->lng->txt(
"menubacktosurvey"), $this->ctrl->getLinkTarget($this,
"questions"));
3321 $ilTabs->addTarget(
"browse_for_questions",
3322 $this->ctrl->getLinkTarget($this,
"browseForQuestions"),
3323 array(
"browseForQuestions",
"browseForQuestionblocks"),
3336 global $ilAccess, $ilUser;
3338 switch ($this->ctrl->getCmd())
3340 case "browseForQuestions":
3341 case "browseForQuestionblocks":
3342 case "insertQuestions":
3343 case "filterQuestions":
3344 case "resetFilterQuestions":
3345 case "changeDatatype":
3351 case "redirectQuestion":
3355 case "checkEvaluationAccess":
3356 case "evaluationdetails":
3357 case "evaluationuser":
3363 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
3365 $force_active = (
$_GET[
"up"] !=
"" ||
$_GET[
"down"] !=
"")
3369 $tabs_gui->addTarget(
"survey_questions",
3370 $this->ctrl->getLinkTarget($this,
'questions'),
3371 array(
"questions",
"browseForQuestions",
"createQuestion",
3372 "filterQuestions",
"resetFilterQuestions",
"changeDatatype",
"insertQuestions",
3373 "removeQuestions",
"cancelRemoveQuestions",
"confirmRemoveQuestions",
3374 "defineQuestionblock",
"saveDefineQuestionblock",
"cancelDefineQuestionblock",
3375 "unfoldQuestionblock",
"moveQuestions",
3376 "insertQuestionsBefore",
"insertQuestionsAfter",
"saveObligatory",
3377 "addHeading",
"saveHeading",
"cancelHeading",
"editHeading",
3378 "confirmRemoveHeading",
"cancelRemoveHeading",
"printView"),
3379 "",
"", $force_active);
3382 if ($ilAccess->checkAccess(
"visible",
"", $this->ref_id))
3384 $tabs_gui->addTarget(
"info_short",
3385 $this->ctrl->getLinkTarget($this,
'infoScreen'),
3386 array(
"infoScreen",
"showSummary"));
3390 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
3392 $force_active = ($this->ctrl->getCmd() ==
"")
3395 $tabs_gui->addTarget(
"properties",
3396 $this->ctrl->getLinkTarget($this,
'properties'),
3397 array(
"properties",
"save",
"cancel"),
"",
3402 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
3405 $tabs_gui->addTarget(
"meta_data",
3406 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
'listSection'),
3407 "",
"ilmdeditorgui");
3410 $tabs_gui->addTarget(
"constraints",
3411 $this->ctrl->getLinkTarget($this,
"constraints"),
3412 array(
"constraints",
"constraintStep1",
"constraintStep2",
3413 "constraintStep3",
"constraintsAdd",
"createConstraints",
3414 "editPrecondition"),
3417 if (($ilAccess->checkAccess(
"write",
"", $this->ref_id)) || ($ilAccess->checkAccess(
"invite",
"", $this->ref_id)))
3420 $tabs_gui->addTarget(
"invitation",
3421 $this->ctrl->getLinkTarget($this,
"invite"),
3422 array(
"invite",
"saveInvitationStatus",
3423 "searchInvitation",
"inviteUserGroup",
3424 "disinviteUserGroup"),
3427 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
3430 $tabs_gui->addTarget(
"export",
3431 $this->ctrl->getLinkTarget($this,
'export'),
3432 array(
"export",
"createExportFile",
"confirmDeleteExportFile",
3433 "downloadExportFile"),
3438 $tabs_gui->addTarget(
"maintenance",
3439 $this->ctrl->getLinkTarget($this,
'maintenance'),
3440 array(
"maintenance",
"deleteAllUserData"),
3443 if ($this->object->getAnonymize() == 1)
3446 $tabs_gui->addTarget(
"codes",
3447 $this->ctrl->getLinkTarget($this,
'codes'),
3448 array(
"codes",
"createSurveyCodes",
"setCodeLanguage",
"deleteCodes",
"exportCodes"),
3453 include_once
"./Modules/Survey/classes/class.ilObjSurveyAccess.php";
3457 $tabs_gui->addTarget(
"svy_evaluation",
3458 $this->ctrl->getLinkTargetByClass(
"ilsurveyevaluationgui",
"evaluation"),
3459 array(
"evaluation",
"checkEvaluationAccess",
"evaluationdetails",
3464 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->ref_id))
3467 $tabs_gui->addTarget(
"perm_settings",
3468 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
3477 function _goto($a_target, $a_access_code =
"")
3480 if ($ilAccess->checkAccess(
"read",
"", $a_target))
3482 include_once
"./Services/Utilities/classes/class.ilUtil.php";
3483 if (strlen($a_access_code))
3485 $_SESSION[
"anonymous_id"] = $a_access_code;
3486 $_GET[
"baseClass"] =
"ilObjSurveyGUI";
3487 $_GET[
"cmd"] =
"infoScreen";
3488 $_GET[
"ref_id"] = $a_target;
3489 include(
"ilias.php");
3494 $_GET[
"baseClass"] =
"ilObjSurveyGUI";
3495 $_GET[
"cmd"] =
"infoScreen";
3496 $_GET[
"ref_id"] = $a_target;
3497 include(
"ilias.php");
3501 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
3503 $_GET[
"cmd"] =
"frameset";
3504 $_GET[
"target"] =
"";
3505 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
3508 include(
"repository.php");
3512 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);