4 include_once
"./Services/Object/classes/class.ilObjectGUI.php";
30 $lng->loadLanguageModule(
"survey");
32 $this->ctrl->saveParameter($this,
"ref_id");
34 parent::__construct(
"", (
int)
$_GET[
"ref_id"],
true,
false);
39 global $ilAccess, $ilNavigationHistory,
$ilErr, $ilTabs;
41 $this->external_rater_360 =
false;
42 if(!$this->creation_mode &&
43 $this->object->get360Mode() &&
44 $_SESSION[
"anonymous_id"][$this->
object->getId()] &&
46 $_SESSION[
"anonymous_id"][$this->
object->getId()]))
48 $this->external_rater_360 =
true;
51 if(!$this->external_rater_360)
53 if (!$ilAccess->checkAccess(
"visible",
"", $this->ref_id) &&
54 !$ilAccess->checkAccess(
"read",
"", $this->ref_id))
56 $ilErr->raiseError($this->lng->txt(
"permission_denied"), $ilErr->MESSAGE);
61 $ilAccess->checkAccess(
"read",
"", $this->ref_id))
63 $this->ctrl->setParameterByClass(
"ilobjsurveygui",
"ref_id", $this->ref_id);
64 $link = $this->ctrl->getLinkTargetByClass(
"ilobjsurveygui",
"");
65 $ilNavigationHistory->addItem($this->ref_id, $link,
"svy");
69 $cmd = $this->ctrl->getCmd(
"properties");
72 if (
$cmd ==
"saveTags")
74 $this->ctrl->setCmdClass(
"ilinfoscreengui");
78 if(!$this->ctrl->getCmdClass() &&
$cmd ==
"questionsrepo")
81 $this->ctrl->setCmd(
"questions");
82 $this->ctrl->setCmdClass(
"ilsurveyeditorgui");
85 $next_class = $this->ctrl->getNextClass($this);
86 $this->ctrl->setReturn($this,
"properties");
92 case "ilinfoscreengui":
93 if(!in_array($this->ctrl->getCmdClass(),
94 array(
'ilpublicuserprofilegui',
'ilobjportfoliogui')))
102 $ilTabs->clearTargets();
103 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
105 $this->ctrl->forwardCommand(
$info);
109 case 'ilobjectmetadatagui':
111 $ilTabs->activateTab(
"meta_data");
113 include_once
'Services/Object/classes/class.ilObjectMetaDataGUI.php';
115 $this->ctrl->forwardCommand($md_gui);
118 case "ilsurveyevaluationgui":
119 $ilTabs->activateTab(
"svy_results");
121 include_once(
"./Modules/Survey/classes/class.ilSurveyEvaluationGUI.php");
123 $this->ctrl->forwardCommand($eval_gui);
126 case "ilsurveyexecutiongui":
127 $ilTabs->clearTargets();
128 include_once(
"./Modules/Survey/classes/class.ilSurveyExecutionGUI.php");
130 $this->ctrl->forwardCommand($exec_gui);
133 case 'ilpermissiongui':
134 $ilTabs->activateTab(
"perm_settings");
136 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
138 $this->ctrl->forwardCommand($perm_gui);
141 case 'ilobjectcopygui':
142 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
145 $this->ctrl->forwardCommand($cp);
148 case "ilcommonactiondispatchergui":
149 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
151 $this->ctrl->forwardCommand($gui);
155 case 'ilsurveyskillgui':
156 $ilTabs->activateTab(
"survey_competences");
157 include_once(
"./Modules/Survey/classes/class.ilSurveySkillGUI.php");
159 $this->ctrl->forwardCommand($gui);
162 case 'ilsurveyskilldeterminationgui':
163 $ilTabs->activateTab(
"maintenance");
164 include_once(
"./Modules/Survey/classes/class.ilSurveySkillDeterminationGUI.php");
166 $this->ctrl->forwardCommand($gui);
169 case 'ilsurveyeditorgui':
171 $ilTabs->activateTab(
"survey_questions");
172 include_once(
"./Modules/Survey/classes/class.ilSurveyEditorGUI.php");
174 $this->ctrl->forwardCommand($gui);
177 case 'ilsurveyconstraintsgui':
179 $ilTabs->activateTab(
"constraints");
180 include_once(
"./Modules/Survey/classes/class.ilSurveyConstraintsGUI.php");
182 $this->ctrl->forwardCommand($gui);
185 case 'ilsurveyparticipantsgui':
186 if(!$this->object->get360Mode())
188 $ilTabs->activateTab(
"maintenance");
192 $ilTabs->activateTab(
"survey_360_appraisees");
194 include_once(
"./Modules/Survey/classes/class.ilSurveyParticipantsGUI.php");
196 $this->ctrl->forwardCommand($gui);
199 case "illearningprogressgui":
200 $ilTabs->activateTab(
"learning_progress");
201 include_once(
"./Services/Tracking/classes/class.ilLearningProgressGUI.php");
203 $this->object->getRefId());
204 $this->ctrl->forwardCommand($new_gui);
208 $ilTabs->activateTab(
"export");
209 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
211 $exp_gui->addFormat(
"xml");
212 $this->ctrl->forwardCommand($exp_gui);
222 if (strtolower(
$_GET[
"baseClass"]) !=
"iladministrationgui" &&
238 include_once(
"./Modules/Survey/classes/class.ilSurveyEvaluationGUI.php");
240 $this->ctrl->setCmdClass(get_class($eval_gui));
241 $this->ctrl->redirect($eval_gui,
"evaluation");
246 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
250 foreach($templates as $item)
252 $a_options[
"svytpl_".$item[
"id"]] = array($item[
"title"],
253 nl2br(trim($item[
"description"])));
258 $a_options[
"svy360_1"] = array($this->lng->txt(
"survey_360_mode"),
259 $this->lng->txt(
"survey_360_mode_info"));
269 $a_new_object->loadFromDb();
274 $a_new_object->applySettingsTemplate(
$tpl);
278 if($a_new_object->get360Mode())
284 $a_new_object->saveToDB();
289 $a_new_object->
getRefId().
"&cmd=properties");
299 global $ilAccess,
$ilUser, $ilHelp;
306 $ilHelp->setScreenIdComponent(
"svy");
308 $hidden_tabs = array();
309 $template = $this->
object->getTemplate();
312 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
314 $hidden_tabs = $template->getHiddenTabs();
317 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
319 $tabs_gui->addTab(
"survey_questions",
320 $this->lng->txt(
"survey_questions"),
321 $this->ctrl->getLinkTargetByClass(array(
"ilsurveyeditorgui",
"ilsurveypagegui"),
"renderPage"));
324 if ($ilAccess->checkAccess(
"read",
"", $this->ref_id))
326 $tabs_gui->addTab(
"info_short",
327 $this->lng->txt(
"info_short"),
328 $this->ctrl->getLinkTarget($this,
'infoScreen'));
332 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
334 $tabs_gui->addTab(
"settings",
335 $this->lng->txt(
"settings"),
336 $this->ctrl->getLinkTarget($this,
'properties'));
338 else if ($ilAccess->checkAccess(
"read",
"", $this->ref_id))
340 if($this->object->get360Mode() &&
341 $this->
object->get360SelfRaters() &&
342 $this->
object->isAppraisee($ilUser->getId()) &&
343 !$this->object->isAppraiseeClosed($ilUser->getId()))
345 $tabs_gui->addTab(
"survey_360_edit_raters",
346 $this->lng->txt(
"survey_360_edit_raters"),
347 $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui',
'editRaters'));
354 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) &&
355 !in_array(
"constraints", $hidden_tabs) &&
356 !$this->
object->get360Mode())
359 $tabs_gui->addTab(
"constraints",
360 $this->lng->txt(
"constraints"),
361 $this->ctrl->getLinkTargetByClass(
"ilsurveyconstraintsgui",
"constraints"));
364 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
367 if($this->object->get360Mode())
370 include_once(
"./Services/Skill/classes/class.ilSkillManagementSettings.php");
372 if ($this->object->get360SkillService() && $skmg_set->isActivated())
374 $tabs_gui->addTab(
"survey_competences",
375 $this->lng->txt(
"survey_competences"),
376 $this->ctrl->getLinkTargetByClass(
"ilsurveyskillgui",
"listQuestionAssignment"));
379 $tabs_gui->addTab(
"survey_360_appraisees",
380 $this->lng->txt(
"survey_360_appraisees"),
381 $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui',
'listAppraisees'));
386 $tabs_gui->addTab(
"maintenance",
387 $this->lng->txt(
"maintenance"),
388 $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui',
'maintenance'));
392 include_once
"./Modules/Survey/classes/class.ilObjSurveyAccess.php";
393 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) ||
397 $tabs_gui->addTab(
"svy_results",
398 $this->lng->txt(
"svy_results"),
399 $this->ctrl->getLinkTargetByClass(
"ilsurveyevaluationgui",
"evaluation"));
403 include_once
"./Services/Tracking/classes/class.ilLearningProgressAccess.php";
406 $tabs_gui->addTarget(
"learning_progress",
407 $this->ctrl->getLinkTargetByClass(array(
"ilobjsurveygui",
"illearningprogressgui"),
""),
409 array(
"illplistofobjectsgui",
"illplistofsettingsgui",
"illearningprogressgui",
"illplistofprogressgui"));
412 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
414 if(!in_array(
"meta_data", $hidden_tabs))
417 include_once
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
419 $mdtab = $mdgui->getTab();
422 $tabs_gui->addTab(
"meta_data",
423 $this->lng->txt(
"meta_data"),
428 if(!in_array(
"export", $hidden_tabs))
431 $tabs_gui->addTab(
"export",
432 $this->lng->txt(
"export"),
433 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""));
437 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->ref_id))
440 $tabs_gui->addTab(
"perm_settings",
441 $this->lng->txt(
"perm_settings"),
442 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"));
456 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
460 $this->ctrl->redirect($this,
"infoScreen");
481 if ($form->checkInput())
485 if(!$this->object->get360Mode())
487 if($form->getInput(
"tut"))
491 $tut_logins = $form->getInput(
"tut_ids");
492 foreach($tut_logins as $tut_login)
495 if($tut_id && $rbacsystem->checkAccessOfUser($tut_id,
"write", $this->object->getRefId()))
497 $tut_ids[] = $tut_id;
502 $tut_ids = $form->getItemByPostVar(
"tut_ids");
503 $tut_ids->setAlert($this->lng->txt(
"survey_notification_tutor_recipients_invalid"));
511 if(!$this->object->get360Mode())
513 if($form->getInput(
"rmd"))
515 $rmd_start = $form->getInput(
"rmd_start");
516 $rmd_start = $rmd_start[
"date"];
518 if($form->getInput(
"rmd_end_tgl"))
520 $rmd_end = $form->getInput(
"rmd_end");
521 $rmd_end = $rmd_end[
"date"];
522 if($rmd_start > $rmd_end)
525 $rmd_start = $rmd_end;
532 $this->
object->setReminderStatus(
true);
533 $this->
object->setReminderStart($rmd_start);
534 $this->
object->setReminderEnd($rmd_end);
535 $this->
object->setReminderFrequency($form->getInput(
"rmd_freq"));
536 $this->
object->setReminderTarget($form->getInput(
"rmd_grp"));
540 $this->
object->setReminderStatus(
false);
543 if($form->getInput(
"tut"))
545 $this->
object->setTutorNotificationStatus(
true);
546 $this->
object->setTutorNotificationRecipients($tut_ids);
547 $this->
object->setTutorNotificationTarget($form->getInput(
"tut_grp"));
551 $this->
object->setTutorNotificationStatus(
false);
556 if (
$_POST[
'online'] && count($this->object->questions) == 0)
562 $template_settings = null;
563 $template = $this->
object->getTemplate();
566 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
568 $template_settings = $template->getSettings();
571 include_once
'Services/MetaData/classes/class.ilMD.php';
572 $md_obj =&
new ilMD($this->object->getId(), 0,
"svy");
580 $md_desc_ids = $md_section->getDescriptionIds();
583 $md_desc = $md_section->getDescription(array_pop($md_desc_ids));
588 $this->
object->setViewOwnResults(
$_POST[
"view_own"]);
589 $this->
object->setMailOwnResults(
$_POST[
"mail_own"]);
594 $this->
object->update();
596 $this->
object->setStatus(
$_POST[
'online']);
601 $this->
object->setActivationLimited(
true);
602 $this->
object->setActivationVisibility(
$_POST[
"access_visiblity"]);
604 $period = $form->getItemByPostVar(
"access_period");
605 $this->
object->setActivationStartDate($period->getStart()->get(
IL_CAL_UNIX));
606 $this->
object->setActivationEndDate($period->getEnd()->get(
IL_CAL_UNIX));
610 $this->
object->setActivationLimited(
false);
614 if(!$template_settings[
"enabled_start_date"][
"hide"])
616 if (
$_POST[
"enabled_start_date"])
618 $this->
object->setStartDateAndTime(
$_POST[
"start_date"][
'date'],
$_POST[
"start_date"][
'time']);
622 $this->
object->setStartDate(null);
626 if(!$template_settings[
"enabled_end_date"][
"hide"])
628 if (
$_POST[
"enabled_end_date"])
630 $this->
object->setEndDateAndTime(
$_POST[
"end_date"][
'date'],
$_POST[
"end_date"][
'time']);
634 $this->
object->setEndDate(null);
639 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
640 $introduction =
$_POST[
"introduction"];
641 $this->
object->setIntroduction($introduction);
643 $this->
object->setOutro($outro);
645 if(!$template_settings[
"show_question_titles"][
"hide"])
647 $this->
object->setShowQuestionTitles(
$_POST[
"show_question_titles"]);
650 if(!$template_settings[
"use_pool"][
"hide"])
652 $this->
object->setPoolUsage(
$_POST[
"use_pool"]);
655 $this->
object->setMailNotification(
$_POST[
'mailnotification']);
656 $this->
object->setMailAddresses(
$_POST[
'mailaddresses']);
657 $this->
object->setMailParticipantData(
$_POST[
'mailparticipantdata']);
660 if($this->object->get360Mode())
662 $this->
object->set360SelfEvaluation((
bool)
$_POST[
"self_eval"]);
663 $this->
object->set360SelfAppraisee((
bool)$_POST[
"self_appr"]);
664 $this->
object->set360SelfRaters((
bool)$_POST[
"self_rate"]);
665 $this->
object->set360Results((
int)$_POST[
"ts_res"]);;
666 $this->
object->set360SkillService((
int)$_POST[
"skill_service"]);
670 if(!$template_settings[
"evaluation_access"][
"hide"])
672 $this->
object->setEvaluationAccess(
$_POST[
"evaluation_access"]);
675 $hasDatasets = $this->
object->_hasDatasets($this->object->getSurveyId());
678 $hide_codes = $template_settings[
"acc_codes"][
"hide"];
679 $hide_anon = $template_settings[
"anonymization_options"][
"hide"];
680 if(!$hide_codes || !$hide_anon)
682 $current = $this->
object->getAnonymize();
687 $codes = (bool)
$_POST[
"acc_codes"];
696 $anon = ((string)
$_POST[
"anonymization_options"] ==
"statanon");
729 unset(
$_SESSION[
"anonymous_id"][$this->object->getId()]);
734 $this->
object->saveToDb();
744 $this->ctrl->redirect($this,
"properties");
753 $form->setValuesByPost();
764 $template_settings = $hide_rte_switch = null;
765 $template = $this->
object->getTemplate();
768 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
771 $template_settings = $template->getSettings();
772 $hide_rte_switch = $template_settings[
"rte_switch"][
"hide"];
775 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
777 $form->setFormAction($this->ctrl->getFormAction($this));
778 $form->setTableWidth(
"100%");
779 $form->setId(
"survey_properties");
783 $header->setTitle($this->lng->txt(
"settings"));
789 include_once
'Services/MetaData/classes/class.ilMD.php';
790 $md_obj =
new ilMD($this->object->getId(), 0,
"svy");
795 $title->setValue($md_section->getTitle());
796 $form->addItem($title);
798 $ids = $md_section->getDescriptionIds();
801 $desc_obj = $md_section->getDescription(array_pop($ids));
806 $desc->setValue($desc_obj->getDescription());
807 $form->addItem($desc);
811 $pool_usage =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_question_pool_usage"),
"use_pool");
812 $opt =
new ilRadioOption($this->lng->txt(
"survey_question_pool_usage_active"), 1);
813 $opt->
setInfo($this->lng->txt(
"survey_question_pool_usage_active_info"));
814 $pool_usage->addOption($opt);
815 $opt =
new ilRadioOption($this->lng->txt(
"survey_question_pool_usage_inactive"), 0);
816 $opt->
setInfo($this->lng->txt(
"survey_question_pool_usage_inactive_info"));
817 $pool_usage->addOption($opt);
818 $pool_usage->setValue($this->object->getPoolUsage());
819 $form->addItem($pool_usage);
822 if($this->object->get360Mode())
824 $self_eval =
new ilCheckboxInputGUI($this->lng->txt(
"survey_360_self_evaluation"),
"self_eval");
825 $self_eval->
setInfo($this->lng->txt(
"survey_360_self_evaluation_info"));
826 $self_eval->setChecked($this->object->get360SelfEvaluation());
827 $form->addItem($self_eval);
829 $self_rate =
new ilCheckboxInputGUI($this->lng->txt(
"survey_360_self_raters"),
"self_rate");
830 $self_rate->
setInfo($this->lng->txt(
"survey_360_self_raters_info"));
831 $self_rate->setChecked($this->object->get360SelfRaters());
832 $form->addItem($self_rate);
834 $self_appr =
new ilCheckboxInputGUI($this->lng->txt(
"survey_360_self_appraisee"),
"self_appr");
835 $self_appr->
setInfo($this->lng->txt(
"survey_360_self_appraisee_info"));
836 $self_appr->setChecked($this->object->get360SelfAppraisee());
837 $form->addItem($self_appr);
843 include_once
"Services/Object/classes/class.ilObjectActivation.php";
844 $this->lng->loadLanguageModule(
'rep');
847 $section->setTitle($this->lng->txt(
'rep_activation_availability'));
851 $act_obj_info = $act_ref_info =
"";
854 $act_obj_info =
' '.$this->lng->txt(
'rep_activation_online_object_info');
855 $act_ref_info = $this->lng->txt(
'rep_activation_access_ref_info');
859 $online->
setInfo($this->lng->txt(
'svy_activation_online_info').$act_obj_info);
860 $online->setChecked($this->object->isOnline());
861 $form->addItem($online);
863 $act_type =
new ilCheckboxInputGUI($this->lng->txt(
'rep_visibility_until'),
'access_type');
865 $act_type->
setChecked($this->object->isActivationLimited());
867 $this->tpl->addJavaScript(
'./Services/Form/js/date_duration.js');
868 include_once
"Services/Form/classes/class.ilDateDurationInputGUI.php";
871 $date = $this->
object->getActivationStartDate();
873 $dur->setStartText($this->lng->txt(
'rep_activation_limited_start'));
874 $date = $this->
object->getActivationEndDate();
876 $dur->setEndText($this->lng->txt(
'rep_activation_limited_end'));
877 $act_type->addSubItem($dur);
879 $visible =
new ilCheckboxInputGUI($this->lng->txt(
'rep_activation_limited_visibility'),
'access_visiblity');
880 $visible->
setInfo($this->lng->txt(
'svy_activation_limited_visibility_info'));
881 $visible->setChecked($this->object->getActivationVisibility());
882 $act_type->addSubItem($visible);
884 $form->addItem($act_type);
890 $section->setTitle($this->lng->txt(
'svy_settings_section_before_start'));
895 $intro->
setValue($this->object->prepareTextareaOutput($this->object->getIntroduction()));
898 $intro->setUseRte(TRUE);
899 $intro->setInfo($this->lng->txt(
"survey_introduction_info"));
900 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
902 $intro->addPlugin(
"latex");
903 $intro->addButton(
"latex");
904 $intro->addButton(
"pastelatex");
905 $intro->setRTESupport($this->object->getId(),
"svy",
"survey", null, $hide_rte_switch);
906 $form->addItem($intro);
912 $section->setTitle($this->lng->txt(
'svy_settings_section_access'));
916 $start = $this->
object->getStartDate();
917 $enablestartingtime =
new ilCheckboxInputGUI($this->lng->txt(
"start_date"),
"enabled_start_date");
920 $enablestartingtime->setChecked($start);
923 $startingtime->setShowTime(
true);
928 $enablestartingtime->addSubItem($startingtime);
929 $form->addItem($enablestartingtime);
932 $end = $this->
object->getEndDate();
933 $enableendingtime =
new ilCheckboxInputGUI($this->lng->txt(
"end_date"),
"enabled_end_date");
936 $enableendingtime->setChecked($end);
939 $endingtime->setShowTime(
true);
944 $enableendingtime->addSubItem($endingtime);
945 $form->addItem($enableendingtime);
948 if(!$this->object->get360Mode())
951 $codes->
setInfo($this->lng->txt(
"survey_access_codes_info"));
952 $codes->setChecked(!$this->object->isAccessibleWithoutCode());
953 $form->addItem($codes);
955 if ($this->object->_hasDatasets($this->object->getSurveyId()))
957 $codes->setDisabled(
true);
965 $section->setTitle($this->lng->txt(
'svy_settings_section_question_behaviour'));
969 $show_question_titles =
new ilCheckboxInputGUI($this->lng->txt(
"svy_show_questiontitles"),
"show_question_titles");
971 $show_question_titles->setChecked($this->object->getShowQuestionTitles());
972 $form->addItem($show_question_titles);
978 $info->setTitle($this->lng->txt(
"svy_settings_section_finishing"));
979 $form->addItem(
$info);
981 $view_own =
new ilCheckboxInputGUI($this->lng->txt(
"svy_results_view_own"),
"view_own");
982 $view_own->
setInfo($this->lng->txt(
"svy_results_view_own_info"));
983 $view_own->setChecked($this->object->hasViewOwnResults());
984 $form->addItem($view_own);
986 $mail_own =
new ilCheckboxInputGUI($this->lng->txt(
"svy_results_mail_own"),
"mail_own");
987 $mail_own->
setInfo($this->lng->txt(
"svy_results_mail_own_info"));
988 $mail_own->setChecked($this->object->hasMailOwnResults());
989 $form->addItem($mail_own);
993 $finalstatement->
setValue($this->object->prepareTextareaOutput($this->object->getOutro()));
994 $finalstatement->setRows(10);
995 $finalstatement->setCols(80);
996 $finalstatement->setUseRte(TRUE);
998 $finalstatement->addPlugin(
"latex");
999 $finalstatement->addButton(
"latex");
1000 $finalstatement->addButton(
"pastelatex");
1001 $finalstatement->setRTESupport($this->object->getId(),
"svy",
"survey", null, $hide_rte_switch);
1002 $form->addItem($finalstatement);
1005 $mailnotification =
new ilCheckboxInputGUI($this->lng->txt(
"mailnotification"),
"mailnotification");
1007 $mailnotification->
setInfo($this->lng->txt(
"svy_result_mail_notification_info"));
1008 $mailnotification->setValue(1);
1009 $mailnotification->setChecked($this->object->getMailNotification());
1012 $mailaddresses =
new ilTextInputGUI($this->lng->txt(
"mailaddresses"),
"mailaddresses");
1013 $mailaddresses->
setValue($this->object->getMailAddresses());
1014 $mailaddresses->setSize(80);
1015 $mailaddresses->setInfo($this->lng->txt(
'mailaddresses_info'));
1016 $mailaddresses->setRequired(
true);
1019 $participantdata =
new ilTextAreaInputGUI($this->lng->txt(
"mailparticipantdata"),
"mailparticipantdata");
1020 $participantdata->
setValue($this->object->getMailParticipantData());
1021 $participantdata->setRows(6);
1022 $participantdata->setCols(80);
1023 $participantdata->setUseRte(
false);
1024 $participantdata->setInfo($this->lng->txt(
"mailparticipantdata_info"));
1027 $placeholders = array(
1028 "FIRST_NAME" =>
"firstname",
1029 "LAST_NAME" =>
"lastname",
1033 foreach($placeholders as $placeholder => $caption)
1035 $txt[] =
"[".strtoupper($placeholder).
"]: ".$this->lng->txt($caption);
1038 $participantdatainfo =
new ilNonEditableValueGUI($this->lng->txt(
"mailparticipantdata_placeholder"),
"",
true);
1041 $mailnotification->addSubItem($mailaddresses);
1042 $mailnotification->addSubItem($participantdata);
1043 $mailnotification->addSubItem($participantdatainfo);
1044 $form->addItem($mailnotification);
1047 if(!$this->object->get360Mode())
1051 $has_parent = $tree->checkForParentType($this->object->getRefId(),
"grp");
1054 $has_parent = $tree->checkForParentType($this->object->getRefId(),
"crs");
1056 $num_inv =
sizeof($this->
object->getInvitedUsers());
1059 $tut =
new ilCheckboxInputGUI($this->lng->txt(
"survey_notification_tutor_setting"),
"tut");
1060 $tut->
setChecked($this->object->getTutorNotificationStatus());
1061 $form->addItem($tut);
1063 $tut_logins = array();
1064 $tuts = $this->
object->getTutorNotificationRecipients();
1067 foreach($tuts as $tut_id)
1072 $tut_logins[] = $tmp[
"login"];
1076 $tut_ids =
new ilTextInputGUI($this->lng->txt(
"survey_notification_tutor_recipients"),
"tut_ids");
1077 $tut_ids->
setDataSource($this->ctrl->getLinkTarget($this,
"doAutoComplete",
"",
true));
1078 $tut_ids->setRequired(
true);
1079 $tut_ids->setMulti(
true);
1080 $tut_ids->setMultiValues($tut_logins);
1081 $tut_ids->setValue(array_shift($tut_logins));
1082 $tut->addSubItem($tut_ids);
1084 $tut_grp =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_notification_target_group"),
"tut_grp");
1086 $tut_grp->setValue($this->object->getTutorNotificationTarget());
1087 $tut->addSubItem($tut_grp);
1089 $tut_grp_crs =
new ilRadioOption($this->lng->txt(
"survey_notification_target_group_parent_course"),
1093 $tut_grp_crs->
setInfo($this->lng->txt(
"survey_notification_target_group_parent_course_inactive"));
1097 $tut_grp_crs->setInfo(sprintf($this->lng->txt(
"survey_notification_target_group_invited_info"),
1098 count($this->object->getNotificationTargetUserIds(
false))));
1100 $tut_grp->addOption($tut_grp_crs);
1102 $tut_grp_inv =
new ilRadioOption($this->lng->txt(
"survey_notification_target_group_invited"),
1104 $tut_grp_inv->
setInfo(sprintf($this->lng->txt(
"survey_notification_target_group_invited_info"), $num_inv));
1105 $tut_grp->addOption($tut_grp_inv);
1112 if(!$this->object->get360Mode())
1115 $info->setTitle($this->lng->txt(
"svy_settings_section_reminders"));
1116 $form->addItem(
$info);
1119 $rmd->
setChecked($this->object->getReminderStatus());
1120 $form->addItem($rmd);
1122 $rmd_start =
new ilDateTimeInputGUI($this->lng->txt(
"survey_reminder_start"),
"rmd_start");
1124 $start = $this->
object->getReminderStart();
1127 $rmd_start->setDate($start);
1129 $rmd->addSubItem($rmd_start);
1131 $end = $this->
object->getReminderEnd();
1132 $rmd_end =
new ilDateTimeInputGUI($this->lng->txt(
"survey_reminder_end"),
"rmd_end");
1136 $rmd_end->setDate($end);
1138 $rmd->addSubItem($rmd_end);
1140 $rmd_freq =
new ilNumberInputGUI($this->lng->txt(
"survey_reminder_frequency"),
"rmd_freq");
1142 $rmd_freq->setSize(3);
1143 $rmd_freq->setSuffix($this->lng->txt(
"survey_reminder_frequency_days"));
1144 $rmd_freq->setValue($this->object->getReminderFrequency());
1145 $rmd_freq->setMinValue(1);
1146 $rmd->addSubItem($rmd_freq);
1148 $rmd_grp =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_notification_target_group"),
"rmd_grp");
1150 $rmd_grp->setValue($this->object->getReminderTarget());
1151 $rmd->addSubItem($rmd_grp);
1153 $rmd_grp_crs =
new ilRadioOption($this->lng->txt(
"survey_notification_target_group_parent_course"),
1157 $rmd_grp_crs->
setInfo($this->lng->txt(
"survey_notification_target_group_parent_course_inactive"));
1161 $rmd_grp_crs->setInfo(sprintf($this->lng->txt(
"survey_notification_target_group_invited_info"),
1162 count($this->object->getNotificationTargetUserIds(
false))));
1164 $rmd_grp->addOption($rmd_grp_crs);
1166 $rmd_grp_inv =
new ilRadioOption($this->lng->txt(
"survey_notification_target_group_invited"),
1168 $rmd_grp_inv->
setInfo(sprintf($this->lng->txt(
"survey_notification_target_group_invited_info"), $num_inv));
1169 $rmd_grp->addOption($rmd_grp_inv);
1176 $results->setTitle($this->lng->txt(
"results"));
1180 if(!$this->object->get360Mode())
1182 $evaluation_access =
new ilRadioGroupInputGUI($this->lng->txt(
'evaluation_access'),
"evaluation_access");
1185 $option->
setInfo($this->lng->txt(
"svy_evaluation_access_off_info"));
1186 $evaluation_access->addOption($option);
1189 $option->
setInfo($this->lng->txt(
"svy_evaluation_access_all_info"));
1190 $evaluation_access->addOption($option);
1193 $option->
setInfo($this->lng->txt(
"svy_evaluation_access_participants_info"));
1194 $evaluation_access->addOption($option);
1196 $evaluation_access->setValue($this->object->getEvaluationAccess());
1197 $form->addItem($evaluation_access);
1200 $anonymization_options =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_results_anonymization"),
"anonymization_options");
1202 $option =
new ilCheckboxOption($this->lng->txt(
"survey_results_personalized"),
"statpers");
1203 $option->
setInfo($this->lng->txt(
"survey_results_personalized_info"));
1204 $anonymization_options->addOption($option);
1206 $option =
new ilCheckboxOption($this->lng->txt(
"survey_results_anonymized"),
"statanon");
1207 $option->
setInfo($this->lng->txt(
"survey_results_anonymized_info"));
1208 $anonymization_options->addOption($option);
1209 $anonymization_options->setValue($this->object->hasAnonymizedResults()
1212 $form->addItem($anonymization_options);
1214 if ($this->object->_hasDatasets($this->object->getSurveyId()))
1216 $anonymization_options->setDisabled(
true);
1223 $ts_results->
setValue($this->object->get360Results());
1226 $option->
setInfo($this->lng->txt(
"survey_360_results_none_info"));
1227 $ts_results->addOption($option);
1230 $option->
setInfo($this->lng->txt(
"survey_360_results_own_info"));
1231 $ts_results->addOption($option);
1234 $option->
setInfo($this->lng->txt(
"survey_360_results_all_info"));
1235 $ts_results->addOption($option);
1236 $form->addItem($ts_results);
1242 include_once(
"./Services/Skill/classes/class.ilSkillManagementSettings.php");
1244 if($this->object->get360Mode() && $skmg_set->isActivated())
1247 $other->setTitle($this->lng->txt(
"other"));
1248 $form->addItem($other);
1250 $skill_service =
new ilCheckboxInputGUI($this->lng->txt(
"survey_activate_skill_service"),
"skill_service");
1251 $skill_service->
setInfo($this->lng->txt(
"survey_activate_skill_service_info"));
1252 $skill_service->setChecked($this->object->get360SkillService());
1253 $form->addItem($skill_service);
1257 $form->addCommandButton(
"saveProperties", $this->lng->txt(
"save"));
1260 if($template_settings)
1262 foreach($template_settings as $id => $item)
1266 $form->removeItemByPostVar($id);
1281 global $ilTabs, $ilHelp;
1285 $ilTabs->activateTab(
"settings");
1288 if ($this->object->get360Mode())
1290 $ilHelp->setScreenId(
"settings_360");
1300 if($this->object->getTemplate())
1302 $link = $this->ctrl->getLinkTarget($this,
"confirmResetTemplate");
1303 $link =
"<a href=\"".$link.
"\">".$this->lng->txt(
"survey_using_template_link").
"</a>";
1304 $message =
"<div style=\"margin-top:10px\">".
1305 $this->tpl->getMessageHTML(sprintf($this->lng->txt(
"survey_using_template"),
1310 $this->tpl->setContent($a_form->getHTML().$message);
1315 $fields = array(
'login',
'firstname',
'lastname',
'email');
1317 include_once
'./Services/User/classes/class.ilUserAutoComplete.php';
1319 $auto->setSearchFields($fields);
1320 $auto->setResultField(
'login');
1321 $auto->enableFieldSearchableCheck(
true);
1322 $auto->setMoreLinkAvailable(
true);
1339 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_confirm_resettemplate.html",
"Modules/Survey");
1340 $this->tpl->setCurrentBlock(
"adm_content");
1341 $this->tpl->setVariable(
"BTN_CONFIRM_REMOVE", $this->lng->txt(
"confirm"));
1342 $this->tpl->setVariable(
"BTN_CANCEL_REMOVE", $this->lng->txt(
"cancel"));
1343 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"resetTemplateObject"));
1344 $this->tpl->parseCurrentBlock();
1352 $this->
object->setTemplate(null);
1353 $this->
object->saveToDB();
1356 $this->ctrl->redirect($this,
"properties");
1367 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1369 $form->setTarget(
"_top");
1370 $form->setFormAction($this->ctrl->getFormAction($this));
1371 $form->setTitle($this->lng->txt(
"import_svy"));
1373 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
1374 $fi =
new ilFileInputGUI($this->lng->txt(
"import_file"),
"importfile");
1376 $fi->setRequired(
true);
1377 $form->addItem($fi);
1379 include_once(
"./Modules/Survey/classes/class.ilObjSurvey.php");
1381 $questionspools = $svy->getAvailableQuestionpools(
true,
true,
true);
1383 $pools =
new ilSelectInputGUI($this->lng->txt(
"select_questionpool_short"),
"spl");
1384 $pools->
setOptions(array(
""=>$this->lng->txt(
"dont_use_questionpool")) + $questionspools);
1385 $pools->setRequired(
false);
1386 $form->addItem($pools);
1388 $form->addCommandButton(
"importFile", $this->lng->txt(
"import"));
1389 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
1401 $parent_id =
$_GET[
"ref_id"];
1407 $ilErr->raiseError($this->lng->txt(
"no_create_permission"));
1410 $this->lng->loadLanguageModule($new_type);
1411 $this->ctrl->setParameter($this,
"new_type", $new_type);
1414 if ($form->checkInput())
1416 include_once(
"./Modules/Survey/classes/class.ilObjSurvey.php");
1418 $newObj->setType($new_type);
1419 $newObj->setTitle(
"dummy");
1420 $newObj->setDescription(
"dummy");
1421 $newObj->create(
true);
1425 $error = $newObj->importObject($_FILES[
"importfile"], $form->getInput(
"spl"));
1429 $this->
ilias->raiseError($error, $this->
ilias->error_obj->MESSAGE);
1435 "&baseClass=ilObjSurveyGUI");
1438 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
1443 $tpl->addJavaScript(
"./Modules/Scorm2004/scripts/questions/jquery.js");
1446 $this->tpl->setCurrentBlock(
"template_option");
1447 $this->tpl->setVariable(
"VAL_TEMPLATE_OPTION",
"");
1448 $this->tpl->setVariable(
"TXT_TEMPLATE_OPTION", $this->lng->txt(
"none"));
1449 $this->tpl->parseCurrentBlock();
1451 foreach($templates as $item)
1453 $this->tpl->setCurrentBlock(
"template_option");
1454 $this->tpl->setVariable(
"VAL_TEMPLATE_OPTION", $item[
"id"]);
1455 $this->tpl->setVariable(
"TXT_TEMPLATE_OPTION", $item[
"title"]);
1456 $this->tpl->parseCurrentBlock();
1458 $desc = str_replace(
"\n",
"", nl2br($item[
"description"]));
1459 $desc = str_replace(
"\r",
"", $desc);
1461 $this->tpl->setCurrentBlock(
"js_data");
1462 $this->tpl->setVariable(
"JS_DATA_ID", $item[
"id"]);
1463 $this->tpl->setVariable(
"JS_DATA_TEXT", $desc);
1464 $this->tpl->parseCurrentBlock();
1467 $this->tpl->setCurrentBlock(
"templates");
1468 $this->tpl->setVariable(
"TXT_TEMPLATE", $this->lng->txt(
"svy_settings_template"));
1469 $this->tpl->parseCurrentBlock();
1474 $form->setValuesByPost();
1475 $tpl->setContent($form->getHtml());
1490 $this->ctrl->setCmd(
"showSummary");
1491 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1500 global $ilAccess, $ilTabs,
$ilUser, $ilToolbar;
1502 if (!$this->external_rater_360 &&
1503 !$ilAccess->checkAccess(
"visible",
"", $this->ref_id) &&
1504 !$ilAccess->checkAccess(
"read",
"", $this->ref_id))
1506 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->
ilias->error_obj->MESSAGE);
1509 $ilTabs->activateTab(
"info_short");
1511 include_once
"./Modules/Survey/classes/class.ilSurveyExecutionGUI.php";
1514 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1516 $info->enablePrivateNotes();
1519 $canStart = $this->
object->canStartSurvey(null, $this->external_rater_360);
1521 $showButtons = $canStart[
"result"];
1524 if($canStart[
"edit_settings"] &&
1525 $ilAccess->checkAccess(
"write",
"", $this->ref_id))
1527 $canStart[
"messages"][] =
"<a href=\"".$this->ctrl->getLinkTarget($this,
"properties").
"\">» ".
1528 $this->lng->txt(
"survey_edit_settings").
"</a>";
1533 $big_button =
false;
1537 $is_appraisee =
false;
1538 if($this->object->get360Mode() &&
1539 $this->
object->isAppraisee($ilUser->getId()))
1541 $info->addSection($this->lng->txt(
"survey_360_appraisee_info"));
1543 $appr_data = $this->
object->getAppraiseesData();
1544 $appr_data = $appr_data[$ilUser->getId()];
1545 $info->addProperty($this->lng->txt(
"survey_360_raters_status_info"), $appr_data[
"finished"]);
1547 if(!$appr_data[
"closed"])
1549 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
1551 $button->setCaption(
"survey_360_appraisee_close_action");
1552 $button->setUrl($this->ctrl->getLinkTargetByClass(
"ilsurveyparticipantsgui",
"confirmappraiseeclose"));
1553 $close_button_360 =
'<div>'.$button->render().
'</div>';
1555 $txt =
"survey_360_appraisee_close_action_info";
1556 if($this->object->get360SkillService())
1560 $info->addProperty($this->lng->txt(
"status"),
1561 $close_button_360.$this->lng->txt(
$txt));
1568 $info->addProperty($this->lng->txt(
"status"),
1569 sprintf($this->lng->txt(
"survey_360_appraisee_close_action_status"),
1573 $is_appraisee =
true;
1580 $code_input =
false;
1581 $anonymous_code =
$_POST[
"anonymous_id"];
1582 if ($anonymous_code)
1586 if(!$this->object->checkSurveyCode($anonymous_code))
1588 $anonymous_code = null;
1593 $this->
object->bindSurveyCodeToUser($ilUser->getId(), $anonymous_code);
1596 if ($anonymous_code)
1598 $_SESSION[
"anonymous_id"][$this->
object->getId()] = $anonymous_code;
1602 $anonymous_code =
$_SESSION[
"anonymous_id"][$this->
object->getId()];
1610 if($this->object->getAnonymize() && !$anonymous_code)
1612 $anonymous_code = $this->
object->findCodeForUser($ilUser->getId());
1616 $participant_status = $this->
object->getUserSurveyExecutionStatus($anonymous_code);
1617 if($participant_status)
1619 $anonymous_code = $participant_status[
"code"];
1620 $participant_status = $participant_status[
"runs"];
1624 if(!$this->object->isAccessibleWithoutCode() &&
1627 (!$anonymous_code || !$this->
object->isAnonymousKey($anonymous_code)))
1629 $anonymous_code = null;
1634 $_SESSION[
"anonymous_id"][$this->
object->getId()] = $anonymous_code;
1637 if(!$is_appraisee &&
1639 !$this->object->isAccessibleWithoutCode())
1641 $info->setFormAction($this->ctrl->getFormAction($this,
"infoScreen"));
1642 $info->addSection($this->lng->txt(
"anonymization"));
1643 $info->addProperty(
"", $this->lng->txt(
"anonymize_anonymous_introduction"));
1644 $info->addPropertyTextinput($this->lng->txt(
"enter_anonymous_id"),
"anonymous_id",
"", 8,
"infoScreen", $this->lng->txt(
"submit"),
true);
1649 if(!$this->object->get360Mode())
1653 $info->addHiddenElement(
"anonymous_id", $anonymous_code);
1656 $survey_started = $this->
object->isSurveyStarted($ilUser->getId(), $anonymous_code);
1657 if ($survey_started === 1)
1659 if($ilUser->getId() != ANONYMOUS_USER_ID)
1661 if($this->object->hasViewOwnResults())
1663 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
1665 $button->setCaption(
"svy_view_own_results");
1666 $button->setUrl($this->ctrl->getLinkTarget($this,
"viewUserResults"));
1667 $ilToolbar->addButtonInstance($button);
1670 if($this->object->hasMailOwnResults())
1672 if($this->object->hasViewOwnResults())
1674 $ilToolbar->addSeparator();
1677 require_once
"Services/Form/classes/class.ilTextInputGUI.php";
1680 $mail->setValue($ilUser->getEmail());
1681 $ilToolbar->addInputItem($mail,
true);
1683 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"mailUserResults"));
1685 include_once
"Services/UIComponent/Button/classes/class.ilSubmitButton.php";
1687 $button->setCaption(
"svy_mail_own_results");
1688 $button->setCommand(
"mailUserResults");
1689 $ilToolbar->addButtonInstance($button);
1695 elseif ($survey_started === 0)
1697 $big_button = array(
"resume", $this->lng->txt(
"resume_survey"));
1699 elseif ($survey_started === FALSE)
1701 $big_button = array(
"start", $this->lng->txt(
"start_survey"));
1707 $appr_ids = array();
1712 $anonymous_id = $this->
object->getAnonymousIdByCode($anonymous_code);
1715 $appr_ids = $this->
object->getAppraiseesToRate(0, $anonymous_id);
1721 if(!$appr_ids && $ilUser->getId() != ANONYMOUS_USER_ID)
1723 $appr_ids = $this->
object->getAppraiseesToRate($ilUser->getId());
1726 if(
sizeof($appr_ids))
1729 $active_appraisees = array();
1730 if($participant_status)
1732 foreach($participant_status as $item)
1734 $active_appraisees[$item[
"appr_id"]] = $item[
"finished"];
1740 foreach($appr_ids as $appr_id)
1742 if($this->object->isAppraiseeClosed($appr_id))
1745 $list[$appr_id] = $this->lng->txt(
"survey_360_appraisee_is_closed");
1747 else if(array_key_exists($appr_id, $active_appraisees))
1750 if($active_appraisees[$appr_id])
1752 $list[$appr_id] = $this->lng->txt(
"already_completed_survey");
1757 $list[$appr_id] = array(
"resume", $this->lng->txt(
"resume_survey"));
1763 $list[$appr_id] = array(
"start", $this->lng->txt(
"start_survey"));
1767 $info->addSection($this->lng->txt(
"survey_360_rate_other_appraisees"));
1769 include_once
"Services/User/classes/class.ilUserUtil.php";
1770 foreach($list as $appr_id => $item)
1774 if(!is_array($item))
1776 $info->addProperty($appr_name, $item);
1780 $this->ctrl->setParameter($output_gui,
"appr_id", $appr_id);
1781 $href = $this->ctrl->getLinkTarget($output_gui, $item[0]);
1782 $this->ctrl->setParameter($output_gui,
"appr_id",
"");
1784 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
1786 $button->setCaption($item[1],
false);
1787 $button->setUrl($href);
1788 $big_button_360 =
'<div>'.$button->render().
'</div>';
1790 $info->addProperty($appr_name, $big_button_360);
1794 else if(!$is_appraisee)
1801 if($this->object->get360Mode() &&
1802 $this->
object->get360SelfAppraisee() &&
1803 !$this->
object->isAppraisee($ilUser->getId()) &&
1804 $ilUser->getId() != ANONYMOUS_USER_ID)
1806 $link = $this->ctrl->getLinkTargetByClass(
"ilsurveyparticipantsgui",
"addSelfAppraisee");
1807 $link =
'<a href="'.$link.
'">'.$this->lng->txt(
"survey_360_add_self_appraisee").
'</a>';
1808 $info->addProperty(
" ", $link);
1814 $ilToolbar->setFormAction($this->ctrl->getFormAction($output_gui,
"infoScreen"));
1816 include_once
"Services/UIComponent/Button/classes/class.ilSubmitButton.php";
1818 $button->setCaption($big_button[1],
false);
1819 $button->setCommand($big_button[0]);
1820 $button->setPrimary(
true);
1821 $ilToolbar->addButtonInstance($button);
1823 $ilToolbar->setCloseFormTag(
false);
1824 $info->setOpenFormTag(
false);
1833 if (strlen($this->object->getIntroduction()))
1835 $introduction = $this->
object->getIntroduction();
1836 $info->addSection($this->lng->txt(
"introduction"));
1837 $info->addProperty(
"", $this->object->prepareTextareaOutput($introduction).
1838 "<br />".$info->getHiddenToggleButton());
1842 $info->addSection(
"");
1843 $info->addProperty(
"",
$info->getHiddenToggleButton());
1846 $info->hideFurtherSections(
false);
1848 if(!$this->object->get360Mode())
1850 $info->addSection($this->lng->txt(
"svy_general_properties"));
1852 $info->addProperty($this->lng->txt(
"survey_results_anonymization"),
1853 !$this->
object->hasAnonymizedResults()
1854 ? $this->lng->txt(
"survey_results_personalized_info")
1855 : $this->lng->txt(
"survey_results_anonymized_info"));
1857 include_once
"./Modules/Survey/classes/class.ilObjSurveyAccess.php";
1858 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) ||
1861 $info->addProperty($this->lng->txt(
"evaluation_access"), $this->lng->txt(
"evaluation_access_info"));
1865 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
1867 $this->ctrl->forwardCommand(
$info);
1873 switch ($this->ctrl->getCmd())
1879 case "redirectQuestion":
1880 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
1883 case "checkEvaluationAccess":
1884 case "evaluationdetails":
1885 case "evaluationuser":
1886 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTargetByClass(
"ilsurveyevaluationgui",
"evaluation"),
"",
$_GET[
"ref_id"]);
1895 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
1898 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
1905 $q_id = (int)
$_GET[
"q_id"];
1906 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
1908 $this->ctrl->setParameterByClass($q_type,
"q_id", $q_id);
1910 $this->ctrl->getLinkTargetByClass(array(
"ilSurveyEditorGUI", $q_type),
"editQuestion"));
1923 public static function _goto($a_target, $a_access_code =
"")
1928 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1929 if (strlen($a_access_code))
1932 $_GET[
"baseClass"] =
"ilObjSurveyGUI";
1933 $_GET[
"cmd"] =
"infoScreen";
1934 $_GET[
"ref_id"] = $a_target;
1935 include(
"ilias.php");
1939 if ($ilAccess->checkAccess(
"visible",
"", $a_target) ||
1940 $ilAccess->checkAccess(
"read",
"", $a_target))
1942 $_GET[
"baseClass"] =
"ilObjSurveyGUI";
1943 $_GET[
"cmd"] =
"infoScreen";
1944 $_GET[
"ref_id"] = $a_target;
1945 include(
"ilias.php");
1948 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1955 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
1960 $rtpl =
new ilTemplate(
"tpl.svy_view_user_results.html",
true,
true,
"Modules/Survey");
1962 $show_titles = (bool)$this->object->getShowQuestionTitles();
1964 foreach($this->object->getSurveyPages() as $page)
1966 if(count($page) > 0)
1969 if(count($page) > 1)
1971 if((
bool)$page[0][
"questionblock_show_blocktitle"])
1973 $rtpl->setVariable(
"BLOCK_TITLE", trim($page[0][
"questionblock_title"]));
1978 foreach($page as $question)
1980 $question_gui = $this->
object->getQuestionGUI($question[
"type_tag"], $question[
"question_id"]);
1981 if(is_object($question_gui))
1983 $rtpl->setCurrentBlock(
"question_bl");
1986 if(strlen($question[
"heading"]))
1988 $rtpl->setVariable(
"HEADING", trim($question[
"heading"]));
1991 $rtpl->setVariable(
"QUESTION_DATA",
1992 $question_gui->getPrintView(
1994 (
bool)$question[
"questionblock_show_questiontext"],
1995 $this->object->getId(),
1996 $this->
object->loadWorkingData($question[
"question_id"], $a_active_id)
2000 $rtpl->parseCurrentBlock();
2004 $rtpl->setCurrentBlock(
"block_bl");
2005 $rtpl->parseCurrentBlock();
2009 return $rtpl->get();
2016 $anonymous_code =
$_SESSION[
"anonymous_id"][$this->
object->getId()];
2017 $active_id = $this->
object->getActiveID($ilUser->getId(), $anonymous_code, 0);
2018 if($this->object->isSurveyStarted($ilUser->getId(), $anonymous_code) !== 1 ||
2021 $this->ctrl->redirect($this,
"infoScreen");
2024 $ilTabs->clearTargets();
2025 $ilTabs->setBackTarget($this->lng->txt(
"btn_back"),
2026 $this->ctrl->getLinkTarget($this,
"infoScreen"));
2029 $tpl->setContent(
$html);
2036 $show_titles = (bool)$this->object->getShowQuestionTitles();
2038 foreach($this->object->getSurveyPages() as $page)
2040 if(count($page) > 0)
2042 $res[] =
"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
2045 if(count($page) > 1)
2047 if((
bool)$page[0][
"questionblock_show_blocktitle"])
2049 $res[$this->lng->txt(
"questionblock")] = trim($page[0][
"questionblock_title"]).
"\n";
2055 $page_res = array();
2057 foreach($page as $question)
2059 $question_gui = $this->
object->getQuestionGUI($question[
"type_tag"], $question[
"question_id"]);
2060 if(is_object($question_gui))
2062 $question_parts = array();
2065 if(strlen($question[
"heading"]))
2067 $question_parts[$this->lng->txt(
"heading")] = trim($question[
"heading"]);
2072 $question_parts[$this->lng->txt(
"title")] = trim($question[
"title"]);
2075 if((
bool)$question[
"questionblock_show_questiontext"])
2077 $question_parts[$this->lng->txt(
"question")] = trim(strip_tags($question_gui->object->getQuestionText()));
2080 $answers = $question_gui->getParsedAnswers(
2081 $this->object->loadWorkingData($question[
"question_id"], $a_active_id),
2085 if(
sizeof($answers))
2088 if(
sizeof($answers) > 1 ||
2089 get_class($question_gui) ==
"SurveyTextQuestionGUI")
2095 foreach($answers as $answer)
2098 if($answer[
"textanswer"])
2100 $text =
' ("'.$answer[
"textanswer"].
'")';
2102 if(!isset($answer[
"cols"]))
2104 if(isset($answer[
"title"]))
2106 $parts[] = $answer[
"title"].$text;
2108 else if(isset($answer[
"value"]))
2110 $parts[] = $answer[
"value"];
2114 $parts[] = substr(
$text, 2, -1);
2121 foreach($answer[
"cols"] as $col)
2123 $tmp[] = $col[
"title"];
2125 $parts[] = $answer[
"title"].
": ".implode(
", ", $tmp).$text;
2129 $question_parts[$this->lng->txt(
"answer")] =
2130 ($multiline ?
"\n" :
"").implode(
"\n", $parts);
2134 foreach($question_parts as $type => $value)
2136 $tmp[] = $type.
": ".$value;
2138 $page_res[] = implode(
"\n", $tmp);
2142 $res[] = implode(
"\n\n-------------------------------\n\n", $page_res);
2146 $res[] =
"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
2148 return implode(
"\n",
$res);
2155 $finished = $this->
object->getSurveyParticipants(array($a_active_id));
2156 $finished = array_pop($finished);
2159 require_once
"Services/Mail/classes/class.ilMail.php";
2160 require_once
"Services/Link/classes/class.ilLink.php";
2163 $body .= $this->lng->txt(
"svy_mail_own_results_body").
"\n";
2164 $body .=
"\n".$this->lng->txt(
"obj_svy").
": ".$this->
object->getTitle().
"\n";
2166 $body .=
"\n".$this->lng->txt(
"survey_results_finished").
": ".$finished.
"\n\n";
2173 require_once
"Services/Mail/classes/class.ilMail.php";
2174 $mail =
new ilMail(ANONYMOUS_USER_ID);
2175 $mail->sendMimeMail(
2179 sprintf($this->lng->txt(
"svy_mail_own_results_subject"), $this->
object->getTitle()),
2190 $anonymous_code =
$_SESSION[
"anonymous_id"][$this->
object->getId()];
2191 $active_id = $this->
object->getActiveID($ilUser->getId(), $anonymous_code, 0);
2192 if($this->object->isSurveyStarted($ilUser->getId(), $anonymous_code) !== 1 ||
2195 $this->ctrl->redirect($this,
"infoScreen");
2198 $recipient =
$_POST[
"mail"];
2201 $this->ctrl->redirect($this,
"infoScreen");
2207 $this->ctrl->redirect($this,
"infoScreen");
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilSurveyParticipantsGUI.
static _lookupName($a_user_id)
lookup user name
This class represents an option in a radio group.
Survey skill service GUI class.
static getAllSettingsTemplates($a_type, $a_include_auto_generated=false)
Get all settings templates of type.
setDataSource($href, $a_delimiter=null)
set datasource link for js autocomplete
static _goto($a_target, $a_access_code="")
redirect script
importFileObject()
form for new survey object import
setValue($a_value)
Set Value.
This class represents an option in a checkbox group.
resetTemplateObject()
Enable all settings - remove template.
const EVALUATION_ACCESS_OFF
GUI class for the workflow of copying objects.
static validateExternalRaterCode($a_ref_id, $a_code)
_getTitle($question_id)
Returns the question title of a question with a given id.
Skill management settings.
const EVALUATION_ACCESS_PARTICIPANTS
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
Class ilSurveyConstraintsGUI.
handleWriteAccess()
Checks for write access and returns to the parent object.
Class ilObject Basic functions for all objects.
setValue($a_value)
Set Value.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static is_email($a_email)
This preg-based function checks whether an e-mail address is formally valid.
static _lookupId($a_user_str)
Lookup id by login.
static setUseRelativeDates($a_status)
set use relative dates
static _lookupTitle($a_id)
lookup object title
getUserResultsPlain($a_active_id)
setInfo($a_info)
Set Info.
initImportForm($a_new_type)
savePropertiesObject()
Save the survey properties.
static _getAllReferences($a_id)
get all reference ids of object
Auto completion class for user lists.
getTabs(&$tabs_gui)
adds tabs to tab gui object
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Export User Interface Class.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
static getNamePresentation($a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false)
Default behaviour is:
addDidacticTemplateOptions(array &$a_options)
afterSave(ilObject $a_new_object)
save object public
const ANONYMIZE_FREEACCESS
const NOTIFICATION_PARENT_COURSE
Class Mail this class handles base functions for mail handling.
Survey execution graphical output.
Class ilObjectGUI Basic methods of all Output classes.
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
setSize($a_size)
Set Size.
This class represents a text property in a property form.
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually...
static formatDate(ilDateTime $date)
Format a date public.
setCols($a_cols)
Set Cols.
static getSalutation($a_usr_id, $a_language=null)
Get salutation.
redirection script todo: (a better solution should control the processing via a xml file) ...
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static lookupTitle($a_id)
Lookup title.
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
const NOTIFICATION_INVITED_USERS
infoScreen()
show information screen
prepareOutput()
prepare output
evaluationObject()
Redirects the evaluation object call to the ilSurveyEvaluationGUI class.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const EVALUATION_ACCESS_ALL
sendUserResultsMail($a_active_id, $a_recipient)
propertiesObject(ilPropertyFormGUI $a_form=null)
Display and fill the properties form of the test.
confirmResetTemplateObject()
Enable all settings - Confirmation.
This class represents a non editable value in a property form.
_getQuestionType($question_id)
Returns the question type of a question with a given id.
& _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
const LP_CONTEXT_REPOSITORY
_hasEvaluationAccess($a_obj_id, $user_id)
This class represents a text area property in a property form.
getCreationMode()
get creation mode
getRefId()
get reference id public
putObjectInTree(ilObject $a_obj, $a_parent_node_id=null)
Add object to tree at given position.
getDidacticTemplateVar($a_type)
Get didactic template setting from creation screen.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Survey skill determination GUI class.
Survey evaluation graphical output.
getUserResultsTable($a_active_id)
setValue($a_value)
Set Value.
static redirect($a_script)
http redirect to other script
addHeaderAction()
Add header action menu.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
Class ilObjUserTrackingGUI.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
Settings template application class.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static _getInstallationSignature()
Static getter for the installation signature.
initPropertiesForm()
Init survey settings form.