5use \ILIAS\Survey\Participants;
58 $this->lng =
$DIC->language();
59 $this->nav_history =
$DIC[
"ilNavigationHistory"];
60 $this->tabs =
$DIC->tabs();
61 $this->
user = $DIC->user();
62 $this->
help = $DIC[
"ilHelp"];
63 $this->rbacsystem =
$DIC->rbac()->system();
64 $this->tree =
$DIC->repositoryTree();
65 $this->tpl =
$DIC[
"tpl"];
66 $this->toolbar =
$DIC->toolbar();
67 $this->access =
$DIC->access();
68 $this->locator =
$DIC[
"ilLocator"];
70 $ilCtrl =
$DIC->ctrl();
73 $lng->loadLanguageModule(
"survey");
74 $lng->loadLanguageModule(
"svy");
75 $this->ctrl = $ilCtrl;
76 $this->ctrl->saveParameter($this,
"ref_id");
86 if (!
$DIC->globalScreen()->tool()->context()->stack()->hasMatch(
87 $DIC->globalScreen()->tool()->context()->collection()->repository()
89 $DIC->globalScreen()->tool()->context()->claim()->repository();
98 $this->external_rater_360 =
false;
99 if (!$this->creation_mode &&
100 $this->object->get360Mode() &&
101 $_SESSION[
"anonymous_id"][$this->object->getId()] &&
103 $this->object->getRefId(),
104 $_SESSION[
"anonymous_id"][$this->object->getId()]
106 $this->external_rater_360 =
true;
109 if (!$this->external_rater_360) {
118 $this->ctrl->setParameterByClass(
"ilobjsurveygui",
"ref_id", $this->ref_id);
120 $ilNavigationHistory->addItem($this->ref_id, $link,
"svy");
124 $cmd = $this->ctrl->getCmd(
"properties");
127 if ($cmd ==
"saveTags") {
128 $this->ctrl->setCmdClass(
"ilinfoscreengui");
132 if (!$this->ctrl->getCmdClass() && $cmd ==
"questionsrepo") {
133 $_REQUEST[
"pgov"] = 1;
134 $this->ctrl->setCmd(
"questions");
135 $this->ctrl->setCmdClass(
"ilsurveyeditorgui");
138 $next_class = $this->ctrl->getNextClass($this);
139 $this->ctrl->setReturn($this,
"properties");
143 $this->log->debug(
"next_class= $next_class");
144 switch ($next_class) {
145 case 'illtiproviderobjectsettinggui':
147 $ilTabs->activateTab(
"settings");
148 $ilTabs->activateSubTab(
'lti_provider');
150 $lti_gui->setCustomRolesForSelection(
$GLOBALS[
'DIC']->rbac()->review()->getLocalRoles($this->object->getRefId()));
151 $lti_gui->offerLTIRolesForSelection(
false);
152 $this->ctrl->forwardCommand($lti_gui);
156 case "ilinfoscreengui":
158 $this->ctrl->getCmdClass(),
159 array(
'ilpublicuserprofilegui',
'ilobjportfoliogui')
165 $ilTabs->clearTargets();
167 $this->ctrl->forwardCommand($info);
171 case 'ilobjectmetadatagui':
173 $ilTabs->activateTab(
"meta_data");
176 $this->ctrl->forwardCommand($md_gui);
179 case "ilsurveyevaluationgui":
183 $ilTabs->activateTab(
"svy_results");
186 $this->ctrl->forwardCommand($eval_gui);
190 case "ilsurveyexecutiongui":
191 $ilTabs->clearTargets();
193 $this->ctrl->forwardCommand($exec_gui);
196 case 'ilpermissiongui':
197 $ilTabs->activateTab(
"perm_settings");
200 $this->ctrl->forwardCommand($perm_gui);
203 case 'ilobjectcopygui':
206 $this->ctrl->forwardCommand($cp);
209 case "ilcommonactiondispatchergui":
211 $this->ctrl->forwardCommand($gui);
215 case 'ilsurveyskillgui':
216 $ilTabs->activateTab(
"survey_competences");
218 $this->ctrl->forwardCommand($gui);
221 case 'ilsurveyskilldeterminationgui':
222 $ilTabs->activateTab(
"maintenance");
224 $this->ctrl->forwardCommand($gui);
227 case 'ilsurveyeditorgui':
229 $ilTabs->activateTab(
"survey_questions");
231 $this->ctrl->forwardCommand($gui);
234 case 'ilsurveyconstraintsgui':
236 $ilTabs->activateTab(
"constraints");
238 $this->ctrl->forwardCommand($gui);
241 case 'ilsurveyparticipantsgui':
243 $ilTabs->activateTab(
"maintenance");
245 $ilTabs->activateTab(
"survey_360_appraisees");
248 $this->ctrl->forwardCommand($gui);
251 case "illearningprogressgui":
252 $ilTabs->activateTab(
"learning_progress");
255 $this->object->getRefId()
257 $this->ctrl->forwardCommand($new_gui);
261 $ilTabs->activateTab(
"export");
263 $exp_gui->addFormat(
"xml");
264 $this->ctrl->forwardCommand($exp_gui);
271 $this->log->debug(
"Default cmd= $cmd");
277 if (strtolower(
$_GET[
"baseClass"]) !=
"iladministrationgui" &&
279 $this->tpl->printToStdout();
297 $this->ctrl->setCmdClass(get_class($eval_gui));
298 $this->ctrl->redirect($eval_gui,
"evaluation");
305 foreach ($templates as $item) {
306 $a_options[
"svytpl_" . $item[
"id"]] = array($item[
"title"],
307 nl2br(trim($item[
"description"])));
312 $a_options[
"svy360_1"] = array($this->lng->txt(
"survey_360_mode"),
313 $this->lng->txt(
"survey_360_mode_info"));
316 $a_options[
"svyselfeval_1"] = array($this->lng->txt(
"svy_self_ev_mode"),
317 $this->lng->txt(
"svy_self_ev_info"));
327 $a_new_object->loadFromDb();
331 $a_new_object->applySettingsTemplate(
$tpl);
341 $svy_mode = $a_new_object->getMode();
349 $a_new_object->saveToDB();
352 ilUtil::sendSuccess($this->lng->txt(
"object_added"),
true);
354 $a_new_object->
getRefId() .
"&cmd=properties");
371 $ilHelp->setScreenIdComponent(
"svy");
373 $hidden_tabs = array();
374 $template = $this->
object->getTemplate();
377 $hidden_tabs = $template->getHiddenTabs();
381 $this->tabs_gui->addTab(
383 $this->lng->txt(
"survey_questions"),
384 $this->ctrl->getLinkTargetByClass(array(
"ilsurveyeditorgui",
"ilsurveypagegui"),
"renderPage")
389 $this->tabs_gui->addTab(
391 $this->lng->txt(
"info_short"),
392 $this->ctrl->getLinkTarget($this,
'infoScreen')
398 $this->tabs_gui->addTab(
400 $this->lng->txt(
"settings"),
401 $this->ctrl->getLinkTarget($this,
'properties')
404 if ($this->object->get360Mode() &&
405 $this->object->get360SelfRaters() &&
406 $this->object->isAppraisee(
$ilUser->getId()) &&
407 !$this->object->isAppraiseeClosed(
$ilUser->getId())) {
408 $this->tabs_gui->addTab(
409 "survey_360_edit_raters",
410 $this->lng->txt(
"survey_360_edit_raters"),
411 $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui',
'editRaters')
420 !in_array(
"constraints", $hidden_tabs) &&
423 $this->tabs_gui->addTab(
425 $this->lng->txt(
"constraints"),
426 $this->ctrl->getLinkTargetByClass(
"ilsurveyconstraintsgui",
"constraints")
431 switch ($this->object->getMode()) {
435 if ($this->object->getSkillService() && $skmg_set->isActivated()) {
436 $this->tabs_gui->addTab(
437 "survey_competences",
438 $this->lng->txt(
"survey_competences"),
439 $this->ctrl->getLinkTargetByClass(
"ilsurveyskillgui",
"listQuestionAssignment")
442 $this->tabs_gui->addTab(
443 "survey_360_appraisees",
444 $this->lng->txt(
"survey_360_appraisees"),
445 $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui',
'listAppraisees')
451 if ($this->object->getSkillService() && $skmg_set->isActivated()) {
452 $this->tabs_gui->addTab(
453 "survey_competences",
454 $this->lng->txt(
"survey_competences"),
455 $this->ctrl->getLinkTargetByClass(
"ilsurveyskillgui",
"listQuestionAssignment")
458 $this->tabs_gui->addTab(
460 $this->lng->txt(
"maintenance"),
461 $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui',
'maintenance')
467 $this->tabs_gui->addTab(
469 $this->lng->txt(
"maintenance"),
470 $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui',
'maintenance')
480 $this->tabs_gui->addTab(
482 $this->lng->txt(
"svy_results"),
483 $this->ctrl->getLinkTargetByClass(
"ilsurveyevaluationgui",
"evaluation")
489 $this->tabs_gui->addTarget(
491 $this->ctrl->getLinkTargetByClass(array(
"ilobjsurveygui",
"illearningprogressgui"),
""),
493 array(
"illplistofobjectsgui",
"illplistofsettingsgui",
"illearningprogressgui",
"illplistofprogressgui")
498 if (!in_array(
"meta_data", $hidden_tabs)) {
501 $mdtab = $mdgui->getTab();
503 $this->tabs_gui->addTab(
505 $this->lng->txt(
"meta_data"),
511 if (!in_array(
"export", $hidden_tabs)) {
513 $this->tabs_gui->addTab(
515 $this->lng->txt(
"export"),
516 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
523 $this->tabs_gui->addTab(
525 $this->lng->txt(
"perm_settings"),
526 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm")
549 if ($form->checkInput()) {
552 if (!$this->object->get360Mode()) {
553 if ($form->getInput(
"tut")) {
556 $tut_logins = $form->getInput(
"tut_ids");
557 foreach ($tut_logins as $tut_login) {
559 if ($tut_id &&
$rbacsystem->checkAccessOfUser($tut_id,
"write", $this->object->getRefId())) {
560 $tut_ids[] = $tut_id;
564 $tut_ids = $form->getItemByPostVar(
"tut_ids");
565 $tut_ids->setAlert($this->lng->txt(
"survey_notification_tutor_recipients_invalid"));
569 if ($form->getInput(
"tut_res")) {
570 $end = $form->getItemByPostVar(
"end_date");
571 if (!$end->getDate()) {
572 $tut_res = $form->getItemByPostVar(
"tut_res");
573 $tut_res->setAlert($this->lng->txt(
"svy_notification_tutor_results_alert"));
578 $tut_res_ids = array();
579 $tut_logins = $form->getInput(
"tut_res_ids");
580 foreach ($tut_logins as $tut_login) {
582 if ($tut_id &&
$rbacsystem->checkAccessOfUser($tut_id,
"write", $this->object->getRefId())) {
583 $tut_res_ids[] = $tut_id;
587 $tut_res_ids = $form->getItemByPostVar(
"tut_res_ids");
588 $tut_res_ids->setAlert($this->lng->txt(
"survey_notification_tutor_recipients_invalid"));
595 if ($form->getInput(
"rmd")) {
596 $rmd_start = $form->getItemByPostVar(
"rmd_start")->getDate();
597 $rmd_end = $form->getItemByPostVar(
"rmd_end")->getDate();
601 $rmd_start = $rmd_end;
605 $this->
object->setReminderStatus(
true);
606 $this->
object->setReminderStart($rmd_start);
607 $this->
object->setReminderEnd($rmd_end);
608 $this->
object->setReminderFrequency($form->getInput(
"rmd_freq"));
609 if (!$this->object->get360Mode()) {
610 $this->
object->setReminderTarget($form->getInput(
"rmd_grp"));
611 $this->
object->setReminderTemplate(($form->getInput(
"rmdt") > 0)
612 ? $form->getInput(
"rmdt")
615 if ($form->getInput(
"remind_appraisees") && $form->getInput(
"remind_raters")) {
617 } elseif ($form->getInput(
"remind_appraisees")) {
619 } elseif ($form->getInput(
"remind_raters")) {
622 $this->
object->setReminderTarget(0);
626 $this->
object->setReminderStatus(
false);
629 if (!$this->object->get360Mode()) {
630 if ($form->getInput(
"tut")) {
631 $this->
object->setTutorNotificationStatus(
true);
632 $this->
object->setTutorNotificationRecipients($tut_ids);
633 $this->
object->setTutorNotificationTarget($form->getInput(
"tut_grp"));
635 $this->
object->setTutorNotificationStatus(
false);
638 if ($form->getInput(
"tut_res")) {
639 $this->
object->setTutorResultsStatus(
true);
640 $this->
object->setTutorResultsRecipients($tut_res_ids);
642 $this->
object->setTutorResultsStatus(
false);
647 if (
$_POST[
'online'] && count($this->object->questions) == 0) {
652 $template_settings =
null;
653 $template = $this->
object->getTemplate();
656 $template_settings = $template->getSettings();
659 $md_obj =
new ilMD($this->object->getId(), 0,
"svy");
660 $md_section = $md_obj->getGeneral();
664 $md_section->update();
667 $md_desc_ids = $md_section->getDescriptionIds();
669 $md_desc = $md_section->getDescription(array_pop($md_desc_ids));
674 $this->
object->setViewOwnResults(
$_POST[
"view_own"]);
675 $this->
object->setMailOwnResults(
$_POST[
"mail_own"]);
676 $this->
object->setMailConfirmation(
$_POST[
"mail_confirm"]);
681 $this->
object->setOfflineStatus((
bool) !
$_POST[
'online']);
682 $this->
object->update();
685 $period = $form->getItemByPostVar(
"access_period");
686 if ($period->getStart() && $period->getEnd()) {
687 $this->
object->setActivationLimited(
true);
688 $this->
object->setActivationVisibility(
$_POST[
"access_visiblity"]);
689 $this->
object->setActivationStartDate($period->getStart()->get(
IL_CAL_UNIX));
690 $this->
object->setActivationEndDate($period->getEnd()->get(
IL_CAL_UNIX));
692 $this->
object->setActivationLimited(
false);
696 $obj_service->commonSettings()->legacyForm($form, $this->
object)->saveTileImage();
699 if (!$template_settings[
"enabled_start_date"][
"hide"]) {
700 $start = $form->getItemByPostVar(
"start_date");
701 if ($start->getDate()) {
703 $this->
object->setStartDateAndTime($datetime[0], $datetime[1]);
705 $this->
object->setStartDate(
null);
709 if (!$template_settings[
"enabled_end_date"][
"hide"]) {
710 $end = $form->getItemByPostVar(
"end_date");
711 if ($end->getDate()) {
713 $this->
object->setEndDateAndTime($datetime[0], $datetime[1]);
715 $this->
object->setEndDate(
null);
720 $introduction =
$_POST[
"introduction"];
721 $this->
object->setIntroduction($introduction);
723 $this->
object->setOutro($outro);
725 if (!$template_settings[
"show_question_titles"][
"hide"]) {
726 $this->
object->setShowQuestionTitles(
$_POST[
"show_question_titles"]);
729 if (!$template_settings[
"use_pool"][
"hide"]) {
730 $this->
object->setPoolUsage(
$_POST[
"use_pool"]);
733 $this->
object->setMailNotification(
$_POST[
'mailnotification']);
734 $this->
object->setMailAddresses(
$_POST[
'mailaddresses']);
735 $this->
object->setMailParticipantData(
$_POST[
'mailparticipantdata']);
737 switch ($this->object->getMode()) {
739 $this->
object->set360SelfEvaluation((
bool)
$_POST[
"self_eval"]);
740 $this->
object->set360SelfAppraisee((
bool) $_POST[
"self_appr"]);
741 $this->
object->set360SelfRaters((
bool) $_POST[
"self_rate"]);
742 $this->
object->set360Results((
int) $_POST[
"ts_res"]);;
743 $this->
object->setSkillService((
int) $_POST[
"skill_service"]);
746 $this->
object->setSelfEvaluationResults($_POST[
"self_eval_res"]);
747 $this->
object->setSkillService((
int) $_POST[
"skill_service"]);
750 if (!$template_settings[
"evaluation_access"][
"hide"]) {
751 $this->
object->setEvaluationAccess($_POST[
"evaluation_access"]);
753 $this->
object->setCalculateSumScore((
int) $_POST[
"calculate_sum_score"]);
756 $hide_codes = $template_settings[
"acc_codes"][
"hide"];
757 $hide_anon = $template_settings[
"anonymization_options"][
"hide"];
758 if (!$hide_codes || !$hide_anon) {
759 $current = $this->
object->getAnonymize();
763 $codes = (bool)
$_POST[
"acc_codes"];
769 $anon = ((string)
$_POST[
"anonymization_options"] ==
"statanon");
789 $this->
object->setAnonymousUserList($_POST[
"anon_list"]);
793 unset(
$_SESSION[
"anonymous_id"][$this->object->getId()]);
799 $this->
object->saveToDb();
802 $this->object->getId(),
809 if (strcmp(
$_SESSION[
"info"],
"") != 0) {
810 ilUtil::sendSuccess(
$_SESSION[
"info"] .
"<br />" . $this->lng->txt(
"settings_saved"),
true);
812 ilUtil::sendSuccess($this->lng->txt(
"settings_saved"),
true);
814 $this->ctrl->redirect($this,
"properties");
821 $form->setValuesByPost();
834 $template_settings = $hide_rte_switch =
null;
835 $template = $this->
object->getTemplate();
839 $template_settings = $template->getSettings();
840 $hide_rte_switch = $template_settings[
"rte_switch"][
"hide"];
844 $form->setFormAction($this->ctrl->getFormAction($this));
845 $form->setTableWidth(
"100%");
846 $form->setId(
"survey_properties");
850 $header->setTitle($this->lng->txt(
"settings"));
851 $form->addItem($header);
856 $md_obj =
new ilMD($this->object->getId(), 0,
"svy");
857 $md_section = $md_obj->getGeneral();
860 $title->setRequired(
true);
861 $title->setValue($md_section->getTitle());
862 $form->addItem($title);
864 $ids = $md_section->getDescriptionIds();
866 $desc_obj = $md_section->getDescription(array_pop($ids));
871 $desc->setValue($desc_obj->getDescription());
872 $form->addItem($desc);
876 $pool_usage =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_question_pool_usage"),
"use_pool");
877 $opt =
new ilRadioOption($this->lng->txt(
"survey_question_pool_usage_active"), 1);
878 $opt->setInfo($this->lng->txt(
"survey_question_pool_usage_active_info"));
879 $pool_usage->addOption($opt);
880 $opt =
new ilRadioOption($this->lng->txt(
"survey_question_pool_usage_inactive"), 0);
881 $opt->setInfo($this->lng->txt(
"survey_question_pool_usage_inactive_info"));
882 $pool_usage->addOption($opt);
883 $pool_usage->setValue($this->object->getPoolUsage());
884 $form->addItem($pool_usage);
887 if ($this->object->get360Mode()) {
888 $self_eval =
new ilCheckboxInputGUI($this->lng->txt(
"survey_360_self_evaluation"),
"self_eval");
889 $self_eval->setInfo($this->lng->txt(
"survey_360_self_evaluation_info"));
890 $self_eval->setChecked($this->object->get360SelfEvaluation());
891 $form->addItem($self_eval);
893 $self_rate =
new ilCheckboxInputGUI($this->lng->txt(
"survey_360_self_raters"),
"self_rate");
894 $self_rate->setInfo($this->lng->txt(
"survey_360_self_raters_info"));
895 $self_rate->setChecked($this->object->get360SelfRaters());
896 $form->addItem($self_rate);
898 $self_appr =
new ilCheckboxInputGUI($this->lng->txt(
"survey_360_self_appraisee"),
"self_appr");
899 $self_appr->setInfo($this->lng->txt(
"survey_360_self_appraisee_info"));
900 $self_appr->setChecked($this->object->get360SelfAppraisee());
901 $form->addItem($self_appr);
906 $this->lng->loadLanguageModule(
'rep');
909 $section->setTitle($this->lng->txt(
'rep_activation_availability'));
913 $act_obj_info = $act_ref_info =
"";
915 $act_obj_info =
' ' . $this->lng->txt(
'rep_activation_online_object_info');
916 $act_ref_info = $this->lng->txt(
'rep_activation_access_ref_info');
920 $online->setInfo($this->lng->txt(
'svy_activation_online_info') . $act_obj_info);
921 $online->setChecked(!$this->object->getOfflineStatus());
922 $form->addItem($online);
925 $dur->setShowTime(
true);
926 $date = $this->
object->getActivationStartDate();
930 $date = $this->
object->getActivationEndDate();
934 $form->addItem($dur);
936 $visible =
new ilCheckboxInputGUI($this->lng->txt(
'rep_activation_limited_visibility'),
'access_visiblity');
937 $visible->setInfo($this->lng->txt(
'svy_activation_limited_visibility_info'));
938 $visible->setChecked($this->object->getActivationVisibility());
939 $dur->addSubItem($visible);
943 $section->setTitle($this->lng->txt(
'obj_presentation'));
947 $obj_service->commonSettings()->legacyForm($form, $this->
object)->addTileImage();
952 $section->setTitle($this->lng->txt(
'svy_settings_section_before_start'));
957 $intro->setValue($this->object->prepareTextareaOutput($this->object->getIntroduction()));
961 $intro->setUseRte(
true);
962 $intro->setInfo($this->lng->txt(
"survey_introduction_info"));
964 $intro->addPlugin(
"latex");
965 $intro->addButton(
"latex");
966 $intro->addButton(
"pastelatex");
967 $intro->setRTESupport($this->object->getId(),
"svy",
"survey",
null, $hide_rte_switch);
969 $form->addItem($intro);
975 $section->setTitle($this->lng->txt(
'svy_settings_section_access'));
979 $start = $this->
object->getStartDate();
982 $startingtime->setShowTime(
true);
986 $form->addItem($startingtime);
989 $end = $this->
object->getEndDate();
992 $endingtime->setShowTime(
true);
996 $form->addItem($endingtime);
999 if (!$this->object->get360Mode()) {
1000 $codes =
new ilCheckboxInputGUI($this->lng->txt(
"survey_access_codes"),
"acc_codes");
1001 $codes->setInfo($this->lng->txt(
"survey_access_codes_info"));
1002 $codes->setChecked(!$this->object->isAccessibleWithoutCode());
1003 $form->addItem($codes);
1006 $codes->setDisabled(
true);
1014 $section->setTitle($this->lng->txt(
'svy_settings_section_question_behaviour'));
1018 $show_question_titles =
new ilCheckboxInputGUI($this->lng->txt(
"svy_show_questiontitles"),
"show_question_titles");
1019 $show_question_titles->setValue(1);
1020 $show_question_titles->setChecked($this->object->getShowQuestionTitles());
1021 $form->addItem($show_question_titles);
1027 $info->setTitle($this->lng->txt(
"svy_settings_section_finishing"));
1028 $form->addItem($info);
1030 $view_own =
new ilCheckboxInputGUI($this->lng->txt(
"svy_results_view_own"),
"view_own");
1031 $view_own->setInfo($this->lng->txt(
"svy_results_view_own_info"));
1032 $view_own->setChecked($this->object->hasViewOwnResults());
1033 $form->addItem($view_own);
1035 $mail_confirm =
new ilCheckboxInputGUI($this->lng->txt(
"svy_results_mail_confirm"),
"mail_confirm");
1036 $mail_confirm->setInfo($this->lng->txt(
"svy_results_mail_confirm_info"));
1037 $mail_confirm->setChecked($this->object->hasMailConfirmation());
1038 $form->addItem($mail_confirm);
1040 $mail_own =
new ilCheckboxInputGUI($this->lng->txt(
"svy_results_mail_own"),
"mail_own");
1041 $mail_own->setInfo($this->lng->txt(
"svy_results_mail_own_info"));
1042 $mail_own->setChecked($this->object->hasMailOwnResults());
1043 $mail_confirm->addSubItem($mail_own);
1047 $finalstatement->setValue($this->object->prepareTextareaOutput($this->object->getOutro()));
1048 $finalstatement->setRows(10);
1049 $finalstatement->setCols(80);
1051 $finalstatement->setUseRte(
true);
1053 $finalstatement->addPlugin(
"latex");
1054 $finalstatement->addButton(
"latex");
1055 $finalstatement->addButton(
"pastelatex");
1056 $finalstatement->setRTESupport($this->object->getId(),
"svy",
"survey",
null, $hide_rte_switch);
1058 $form->addItem($finalstatement);
1061 $mailnotification =
new ilCheckboxInputGUI($this->lng->txt(
"mailnotification"),
"mailnotification");
1063 $mailnotification->setInfo($this->lng->txt(
"svy_result_mail_notification_info"));
1064 $mailnotification->setValue(1);
1065 $mailnotification->setChecked($this->object->getMailNotification());
1068 $mailaddresses =
new ilTextInputGUI($this->lng->txt(
"mailaddresses"),
"mailaddresses");
1069 $mailaddresses->setValue($this->object->getMailAddresses());
1070 $mailaddresses->setSize(80);
1071 $mailaddresses->setInfo($this->lng->txt(
'mailaddresses_info'));
1072 $mailaddresses->setRequired(
true);
1075 $participantdata =
new ilTextAreaInputGUI($this->lng->txt(
"mailparticipantdata"),
"mailparticipantdata");
1076 $participantdata->setValue($this->object->getMailParticipantData());
1077 $participantdata->setRows(6);
1078 $participantdata->setCols(80);
1079 $participantdata->setUseRte(
false);
1080 $participantdata->setInfo($this->lng->txt(
"mailparticipantdata_info"));
1083 $placeholders = array(
1084 "FIRST_NAME" =>
"firstname",
1085 "LAST_NAME" =>
"lastname",
1089 foreach ($placeholders as $placeholder => $caption) {
1090 $txt[] =
"[" . strtoupper($placeholder) .
"]: " . $this->lng->txt($caption);
1093 $participantdatainfo =
new ilNonEditableValueGUI($this->lng->txt(
"mailparticipantdata_placeholder"),
"",
true);
1094 $participantdatainfo->setValue(
$txt);
1096 $mailnotification->addSubItem($mailaddresses);
1097 $mailnotification->addSubItem($participantdata);
1098 $mailnotification->addSubItem($participantdatainfo);
1099 $form->addItem($mailnotification);
1102 if (!$this->object->get360Mode()) {
1105 $has_parent =
$tree->checkForParentType($this->object->getRefId(),
"grp");
1107 $has_parent =
$tree->checkForParentType($this->object->getRefId(),
"crs");
1109 $num_inv = count($this->invitation_manager->getAllForSurvey($this->object->getSurveyId()));
1112 $tut =
new ilCheckboxInputGUI($this->lng->txt(
"survey_notification_tutor_setting"),
"tut");
1113 $tut->setChecked($this->object->getTutorNotificationStatus());
1114 $form->addItem($tut);
1116 $tut_logins = array();
1117 $tuts = $this->
object->getTutorNotificationRecipients();
1119 foreach ($tuts as $tut_id) {
1121 if ($tmp[
"login"]) {
1122 $tut_logins[] = $tmp[
"login"];
1126 $tut_ids =
new ilTextInputGUI($this->lng->txt(
"survey_notification_tutor_recipients"),
"tut_ids");
1127 $tut_ids->setDataSource($this->ctrl->getLinkTarget($this,
"doAutoComplete",
"",
true));
1128 $tut_ids->setRequired(
true);
1129 $tut_ids->setMulti(
true);
1130 $tut_ids->setMultiValues($tut_logins);
1131 $tut_ids->setValue(array_shift($tut_logins));
1132 $tut->addSubItem($tut_ids);
1134 $tut_grp =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_notification_target_group"),
"tut_grp");
1135 $tut_grp->setRequired(
true);
1136 $tut_grp->setValue($this->object->getTutorNotificationTarget());
1137 $tut->addSubItem($tut_grp);
1140 $this->lng->txt(
"survey_notification_target_group_parent_course"),
1144 $tut_grp_crs->setInfo($this->lng->txt(
"survey_notification_target_group_parent_course_inactive"));
1146 $tut_grp_crs->setInfo(sprintf(
1147 $this->lng->txt(
"survey_notification_target_group_invited_info"),
1148 count($this->object->getNotificationTargetUserIds(
false))
1151 $tut_grp->addOption($tut_grp_crs);
1154 $this->lng->txt(
"survey_notification_target_group_invited"),
1157 $tut_grp_inv->setInfo(sprintf($this->lng->txt(
"survey_notification_target_group_invited_info"), $num_inv));
1158 $tut_grp->addOption($tut_grp_inv);
1160 $tut_res =
new ilCheckboxInputGUI($this->lng->txt(
"svy_notification_tutor_results"),
"tut_res");
1161 $tut_res->setInfo($this->lng->txt(
"svy_notification_tutor_results_info"));
1162 $tut_res->setChecked($this->object->getTutorResultsStatus());
1163 $form->addItem($tut_res);
1165 $tut_res_logins = array();
1166 $tuts = $this->
object->getTutorResultsRecipients();
1168 foreach ($tuts as $tut_id) {
1170 if ($tmp[
"login"]) {
1171 $tut_res_logins[] = $tmp[
"login"];
1175 $tut_res_ids =
new ilTextInputGUI($this->lng->txt(
"survey_notification_tutor_recipients"),
"tut_res_ids");
1176 $tut_res_ids->setDataSource($this->ctrl->getLinkTarget($this,
"doAutoComplete",
"",
true));
1177 $tut_res_ids->setRequired(
true);
1178 $tut_res_ids->setMulti(
true);
1179 $tut_res_ids->setMultiValues($tut_res_logins);
1180 $tut_res_ids->setValue(array_shift($tut_res_logins));
1181 $tut_res->addSubItem($tut_res_ids);
1188 $info->setTitle($this->lng->txt(
"svy_settings_section_reminders"));
1189 $form->addItem($info);
1192 $rmd->setChecked($this->object->getReminderStatus());
1193 $form->addItem($rmd);
1195 $rmd_start =
new ilDateTimeInputGUI($this->lng->txt(
"survey_reminder_start"),
"rmd_start");
1196 $rmd_start->setRequired(
true);
1197 $start = $this->
object->getReminderStart();
1199 $rmd_start->setDate($start);
1201 $rmd->addSubItem($rmd_start);
1203 $end = $this->
object->getReminderEnd();
1204 $rmd_end =
new ilDateTimeInputGUI($this->lng->txt(
"survey_reminder_end"),
"rmd_end");
1206 $rmd_end->setDate($end);
1208 $rmd->addSubItem($rmd_end);
1210 $rmd_freq =
new ilNumberInputGUI($this->lng->txt(
"survey_reminder_frequency"),
"rmd_freq");
1211 $rmd_freq->setRequired(
true);
1212 $rmd_freq->setSize(3);
1213 $rmd_freq->setSuffix($this->lng->txt(
"survey_reminder_frequency_days"));
1214 $rmd_freq->setValue($this->object->getReminderFrequency());
1215 $rmd_freq->setMinValue(1);
1216 $rmd->addSubItem($rmd_freq);
1219 if (!$this->object->get360Mode()) {
1220 $rmd_grp =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_notification_target_group"),
"rmd_grp");
1221 $rmd_grp->setRequired(
true);
1222 $rmd_grp->setValue($this->object->getReminderTarget());
1223 $rmd->addSubItem($rmd_grp);
1226 $this->lng->txt(
"survey_notification_target_group_parent_course"),
1230 $rmd_grp_crs->setInfo($this->lng->txt(
"survey_notification_target_group_parent_course_inactive"));
1232 $rmd_grp_crs->setInfo(sprintf(
1233 $this->lng->txt(
"survey_notification_target_group_invited_info"),
1234 count($this->object->getNotificationTargetUserIds(
false))
1237 $rmd_grp->addOption($rmd_grp_crs);
1240 $this->lng->txt(
"survey_notification_target_group_invited"),
1243 $rmd_grp_inv->setInfo(sprintf($this->lng->txt(
"survey_notification_target_group_invited_info"), $num_inv));
1244 $rmd_grp->addOption($rmd_grp_inv);
1246 $mtmpl = $this->
object->getReminderMailTemplates();
1249 $rmdt->setRequired(
true);
1250 $rmdt->addOption(
new ilRadioOption($this->lng->txt(
"svy_reminder_mail_template_none"), -1));
1251 foreach ($mtmpl as $mtmpl_id => $mtmpl_caption) {
1253 $rmdt->addOption($option);
1256 $reminderTemplateValue = -1;
1257 if ($this->object->getReminderTemplate()) {
1258 $reminderTemplateValue = $this->
object->getReminderTemplate();
1260 $rmdt->setValue($reminderTemplateValue);
1261 $rmd->addSubItem($rmdt);
1265 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"survey_notification_target_group"),
"remind_appraisees");
1266 $cb->setOptionTitle($this->lng->txt(
"survey_360_appraisees"));
1267 $cb->setInfo($this->lng->txt(
"survey_360_appraisees_remind_info"));
1269 $cb->setChecked(in_array(
1270 $this->object->getReminderTarget(),
1273 $rmd->addSubItem($cb);
1277 $cb->setOptionTitle($this->lng->txt(
"survey_360_raters"));
1278 $cb->setInfo($this->lng->txt(
"survey_360_raters_remind_info"));
1280 $cb->setChecked(in_array(
1281 $this->object->getReminderTarget(),
1284 $rmd->addSubItem($cb);
1291 $results->setTitle($this->lng->txt(
"results"));
1295 switch ($this->object->getMode()) {
1298 $ts_results->setValue($this->object->get360Results());
1301 $option->setInfo($this->lng->txt(
"survey_360_results_none_info"));
1302 $ts_results->addOption($option);
1305 $option->setInfo($this->lng->txt(
"survey_360_results_own_info"));
1306 $ts_results->addOption($option);
1309 $option->setInfo($this->lng->txt(
"survey_360_results_all_info"));
1310 $ts_results->addOption($option);
1312 $form->addItem($ts_results);
1317 $evaluation_access =
new ilRadioGroupInputGUI($this->lng->txt(
'evaluation_access'),
"self_eval_res");
1318 $evaluation_access->setValue($this->object->getSelfEvaluationResults());
1321 $evaluation_access->addOption($option);
1324 $evaluation_access->addOption($option);
1327 $evaluation_access->addOption($option);
1329 $form->addItem($evaluation_access);
1333 $evaluation_access =
new ilRadioGroupInputGUI($this->lng->txt(
'evaluation_access'),
"evaluation_access");
1336 $option->setInfo($this->lng->txt(
"svy_evaluation_access_off_info"));
1337 $evaluation_access->addOption($option);
1340 $option->setInfo($this->lng->txt(
"svy_evaluation_access_all_info"));
1341 $evaluation_access->addOption($option);
1344 $option->setInfo($this->lng->txt(
"svy_evaluation_access_participants_info"));
1345 $evaluation_access->addOption($option);
1347 $evaluation_access->setValue($this->object->getEvaluationAccess());
1348 $form->addItem($evaluation_access);
1350 $anonymization_options =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_results_anonymization"),
"anonymization_options");
1352 $option =
new ilCheckboxOption($this->lng->txt(
"survey_results_personalized"),
"statpers");
1353 $option->setInfo($this->lng->txt(
"survey_results_personalized_info"));
1354 $anonymization_options->addOption($option);
1356 $option =
new ilCheckboxOption($this->lng->txt(
"survey_results_anonymized"),
"statanon");
1357 $option->setInfo($this->lng->txt(
"survey_results_anonymized_info"));
1358 $anonymization_options->addOption($option);
1359 $anonymization_options->setValue($this->object->hasAnonymizedResults()
1362 $form->addItem($anonymization_options);
1364 $surveySetting =
new ilSetting(
"survey");
1365 if ($surveySetting->get(
"anonymous_participants",
false)) {
1367 if ($surveySetting->get(
"anonymous_participants_min", 0)) {
1368 $min =
" (" . $this->lng->txt(
"svy_anonymous_participants_min") .
": " .
1369 $surveySetting->get(
"anonymous_participants_min") .
")";
1372 $anon_list =
new ilCheckboxInputGUI($this->lng->txt(
"svy_anonymous_participants_svy"),
"anon_list");
1373 $anon_list->setInfo($this->lng->txt(
"svy_anonymous_participants_svy_info") . $min);
1374 $anon_list->setChecked($this->object->hasAnonymousUserList());
1375 $option->addSubItem($anon_list);
1378 if ($this->object->_hasDatasets($this->object->getSurveyId())) {
1379 $anonymization_options->setDisabled(
true);
1381 $anon_list->setDisabled(
true);
1386 $sum_score =
new ilCheckboxInputGUI($this->lng->txt(
"survey_calculate_sum_score"),
"calculate_sum_score");
1387 $sum_score->setInfo($this->lng->txt(
"survey_calculate_sum_score_info"));
1388 $sum_score->setValue(
"1");
1389 $sum_score->setChecked($this->object->getCalculateSumScore());
1390 $form->addItem($sum_score);
1398 $svy_mode = $this->
object->getMode();
1401 $other->setTitle($this->lng->txt(
"other"));
1402 $form->addItem($other);
1404 $skill_service =
new ilCheckboxInputGUI($this->lng->txt(
"survey_activate_skill_service"),
"skill_service");
1405 $skill_service->setInfo($this->lng->txt(
"survey_activate_skill_service_info"));
1406 $skill_service->setChecked($this->object->getSkillService());
1407 $form->addItem($skill_service);
1411 ->getObjectPositionSettingsByType($this->object->getType());
1413 if ($position_settings->isActive()) {
1416 $feat->setTitle($this->lng->txt(
'obj_features'));
1417 $form->addItem($feat);
1421 $this->object->getId(),
1429 $form->addCommandButton(
"saveProperties", $this->lng->txt(
"save"));
1432 if ($template_settings) {
1433 foreach ($template_settings as $id => $item) {
1434 if ($item[
"hide"]) {
1435 if ($id ==
"enabled_end_date") {
1438 if ($id ==
"enabled_start_date") {
1441 $form->removeItemByPostVar($id,
true);
1454 if ($a_section ==
'settings') {
1455 $this->tabs_gui->addSubTabTarget(
1457 $this->ctrl->getLinkTarget($this,
'properties')
1461 if ($lti_settings->hasSettingsAccess()) {
1462 $this->tabs_gui->addSubTabTarget(
1464 $this->ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
1484 $ilTabs->activateTab(
"settings");
1485 $ilTabs->activateSubTab(
'settings');
1487 if ($this->object->get360Mode()) {
1488 $ilHelp->setScreenId(
"settings_360");
1497 if ($this->object->getTemplate()) {
1498 $link = $this->ctrl->getLinkTarget($this,
"confirmResetTemplate");
1499 $link =
"<a href=\"" . $link .
"\">" . $this->lng->txt(
"survey_using_template_link") .
"</a>";
1500 $message =
"<div style=\"margin-top:10px\">" .
1502 $this->lng->txt(
"survey_using_template"),
1509 $this->tpl->setContent($a_form->getHTML() .
$message);
1514 $fields = array(
'login',
'firstname',
'lastname',
'email');
1517 $auto->setSearchFields($fields);
1518 $auto->setResultField(
'login');
1519 $auto->enableFieldSearchableCheck(
true);
1520 $auto->setMoreLinkAvailable(
true);
1522 if (($_REQUEST[
'fetchall'])) {
1536 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_confirm_resettemplate.html",
"Modules/Survey");
1537 $this->tpl->setCurrentBlock(
"adm_content");
1538 $this->tpl->setVariable(
"BTN_CONFIRM_REMOVE", $this->lng->txt(
"confirm"));
1539 $this->tpl->setVariable(
"BTN_CANCEL_REMOVE", $this->lng->txt(
"cancel"));
1540 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"resetTemplateObject"));
1541 $this->tpl->parseCurrentBlock();
1549 $this->
object->setTemplate(
null);
1550 $this->
object->saveToDB();
1552 ilUtil::sendSuccess($this->lng->txt(
"survey_template_reset"),
true);
1553 $this->ctrl->redirect($this,
"properties");
1565 $form->setTarget(
"_top");
1566 $form->setFormAction($this->ctrl->getFormAction($this));
1567 $form->setTitle($this->lng->txt(
"import_svy"));
1569 $fi =
new ilFileInputGUI($this->lng->txt(
"import_file"),
"importfile");
1570 $fi->setSuffixes(array(
"zip"));
1571 $fi->setRequired(
true);
1572 $form->addItem($fi);
1575 $questionspools = $svy->getAvailableQuestionpools(
true,
true,
true);
1577 $pools =
new ilSelectInputGUI($this->lng->txt(
"select_questionpool_short"),
"spl");
1578 $pools->setOptions(array(
"" => $this->lng->txt(
"dont_use_questionpool")) + $questionspools);
1579 $pools->setRequired(
false);
1580 $form->addItem($pools);
1582 $form->addCommandButton(
"importSurvey", $this->lng->txt(
"import"));
1583 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
1595 $parent_id =
$_GET[
"ref_id"];
1596 $new_type = $_REQUEST[
"new_type"];
1601 $this->lng->loadLanguageModule($new_type);
1602 $this->ctrl->setParameter($this,
"new_type", $new_type);
1605 if ($form->checkInput()) {
1607 $newObj->setType($new_type);
1608 $newObj->setTitle(
"dummy");
1609 $newObj->create(
true);
1614 $this->log->debug(
"form->getInput(spl) = " . $form->getInput(
"spl"));
1616 $error = $newObj->importObject($_FILES[
"importfile"], $form->getInput(
"spl"));
1617 if (strlen($error)) {
1623 ilUtil::sendSuccess($this->lng->txt(
"object_imported"),
true);
1625 "&baseClass=ilObjSurveyGUI");
1631 $tpl->addJavaScript(
"./Modules/Scorm2004/scripts/questions/jquery.js");
1634 $this->tpl->setCurrentBlock(
"template_option");
1635 $this->tpl->setVariable(
"VAL_TEMPLATE_OPTION",
"");
1636 $this->tpl->setVariable(
"TXT_TEMPLATE_OPTION", $this->lng->txt(
"none"));
1637 $this->tpl->parseCurrentBlock();
1639 foreach ($templates as $item) {
1640 $this->tpl->setCurrentBlock(
"template_option");
1641 $this->tpl->setVariable(
"VAL_TEMPLATE_OPTION", $item[
"id"]);
1642 $this->tpl->setVariable(
"TXT_TEMPLATE_OPTION", $item[
"title"]);
1643 $this->tpl->parseCurrentBlock();
1645 $desc = str_replace(
"\n",
"", nl2br($item[
"description"]));
1646 $desc = str_replace(
"\r",
"", $desc);
1648 $this->tpl->setCurrentBlock(
"js_data");
1649 $this->tpl->setVariable(
"JS_DATA_ID", $item[
"id"]);
1650 $this->tpl->setVariable(
"JS_DATA_TEXT", $desc);
1651 $this->tpl->parseCurrentBlock();
1654 $this->tpl->setCurrentBlock(
"templates");
1655 $this->tpl->setVariable(
"TXT_TEMPLATE", $this->lng->txt(
"svy_settings_template"));
1656 $this->tpl->parseCurrentBlock();
1661 $form->setValuesByPost();
1662 $tpl->setContent($form->getHtml());
1677 $this->ctrl->setCmd(
"showSummary");
1678 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1692 if (!$this->external_rater_360) {
1698 $ilTabs->activateTab(
"info_short");
1703 $info->enablePrivateNotes();
1706 $is_appraisee =
false;
1709 if ($this->object->get360Mode() &&
1710 $this->object->isAppraisee(
$ilUser->getId())) {
1711 $is_appraisee =
true;
1713 $info->addSection($this->lng->txt(
"survey_360_appraisee_info"));
1715 $appr_data = $this->
object->getAppraiseesData();
1716 $appr_data = $appr_data[
$ilUser->getId()];
1717 $info->addProperty($this->lng->txt(
"survey_360_raters_status_info"), $appr_data[
"finished"]);
1719 if (!$appr_data[
"closed"]) {
1721 $button->setCaption(
"survey_360_appraisee_close_action");
1722 $button->setUrl($this->ctrl->getLinkTargetByClass(
"ilsurveyparticipantsgui",
"confirmappraiseeclose"));
1723 $close_button_360 =
'<div>' . $button->render() .
'</div>';
1725 $txt =
"survey_360_appraisee_close_action_info";
1726 if ($this->object->getSkillService()) {
1730 $this->lng->txt(
"status"),
1731 $close_button_360 . $this->lng->txt(
$txt)
1738 $this->lng->txt(
"status"),
1740 $this->lng->txt(
"survey_360_appraisee_close_action_status"),
1751 $code_input =
false;
1752 $anonymous_code =
$_POST[
"anonymous_id"];
1753 if ($anonymous_code) {
1756 if (!$this->object->checkSurveyCode($anonymous_code)) {
1757 $anonymous_code =
null;
1760 $this->
object->bindSurveyCodeToUser(
$ilUser->getId(), $anonymous_code);
1763 if ($anonymous_code) {
1764 $_SESSION[
"anonymous_id"][$this->
object->getId()] = $anonymous_code;
1766 $anonymous_code =
$_SESSION[
"anonymous_id"][$this->
object->getId()];
1767 if ($anonymous_code) {
1773 if ($this->object->getAnonymize() && !$anonymous_code) {
1774 $anonymous_code = $this->
object->findCodeForUser(
$ilUser->getId());
1778 $participant_status = $this->
object->getUserSurveyExecutionStatus($anonymous_code);
1779 if ($participant_status) {
1780 $anonymous_code = $participant_status[
"code"];
1781 $participant_status = $participant_status[
"runs"];
1785 if (!$this->object->isAccessibleWithoutCode() &&
1788 (!$anonymous_code || !$this->object->isAnonymousKey($anonymous_code))) {
1789 $anonymous_code =
null;
1794 $_SESSION[
"anonymous_id"][$this->
object->getId()] = $anonymous_code;
1796 $survey_started = $this->
object->isSurveyStarted(
$ilUser->getId(), $anonymous_code);
1798 $showButtons = $big_button =
false;
1801 if (!$this->object->get360Mode() &&
1802 ($survey_started === 1 &&
1807 if ($this->object->hasViewOwnResults()) {
1809 $button->setCaption(
"svy_view_own_results");
1810 $button->setUrl($this->ctrl->getLinkTarget($this,
"viewUserResults"));
1811 $ilToolbar->addButtonInstance($button);
1815 if ($this->object->hasMailConfirmation()) {
1816 if ($this->object->hasViewOwnResults()) {
1817 $ilToolbar->addSeparator();
1822 require_once
"Services/Form/classes/class.ilTextInputGUI.php";
1825 $mail->setValue(
$ilUser->getEmail());
1826 $ilToolbar->addInputItem($mail,
true);
1829 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"mailUserResults"));
1832 $button->setCaption(
"svy_mail_send_confirmation");
1833 $button->setCommand(
"mailUserResults");
1834 $ilToolbar->addButtonInstance($button);
1839 $canStart = $this->
object->canStartSurvey(
null, $this->external_rater_360);
1841 $showButtons = $canStart[
"result"];
1842 if (!$showButtons) {
1843 if ($canStart[
"edit_settings"] &&
1844 $ilAccess->checkAccess(
"write",
"", $this->ref_id)) {
1845 $canStart[
"messages"][] =
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"properties") .
"\">» " .
1846 $this->lng->txt(
"survey_edit_settings") .
"</a>";
1854 if (!$is_appraisee &&
1856 !$this->object->isAccessibleWithoutCode()) {
1857 $info->setFormAction($this->ctrl->getFormAction($this,
"infoScreen"));
1858 $info->addSection($this->lng->txt(
"anonymization"));
1859 $info->addProperty(
"", $this->lng->txt(
"anonymize_anonymous_introduction"));
1860 $info->addPropertyTextinput($this->lng->txt(
"enter_anonymous_id"),
"anonymous_id",
"", 8,
"infoScreen", $this->lng->txt(
"submit"),
true);
1863 if (!$this->object->get360Mode()) {
1864 if ($anonymous_code) {
1865 $info->addHiddenElement(
"anonymous_id", $anonymous_code);
1867 if ($survey_started === 0) {
1868 $big_button = array(
"resume", $this->lng->txt(
"resume_survey"));
1869 } elseif ($survey_started ===
false) {
1870 $big_button = array(
"start", $this->lng->txt(
"start_survey"));
1875 $appr_ids = array();
1878 if ($anonymous_code) {
1879 $anonymous_id = $this->
object->getAnonymousIdByCode($anonymous_code);
1880 if ($anonymous_id) {
1881 $appr_ids = $this->
object->getAppraiseesToRate(0, $anonymous_id);
1888 $appr_ids = $this->
object->getAppraiseesToRate(
$ilUser->getId());
1891 if (
sizeof($appr_ids)) {
1893 $active_appraisees = array();
1894 if ($participant_status) {
1895 foreach ($participant_status as $item) {
1896 $active_appraisees[$item[
"appr_id"]] = $item[
"finished"];
1902 foreach ($appr_ids as $appr_id) {
1903 if ($this->object->isAppraiseeClosed($appr_id)) {
1905 $list[$appr_id] = $this->lng->txt(
"survey_360_appraisee_is_closed");
1906 } elseif (array_key_exists($appr_id, $active_appraisees)) {
1908 if ($active_appraisees[$appr_id]) {
1909 $list[$appr_id] = $this->lng->txt(
"already_completed_survey");
1913 $list[$appr_id] = array(
"resume", $this->lng->txt(
"resume_survey"));
1917 $list[$appr_id] = array(
"start", $this->lng->txt(
"start_survey"));
1921 $info->addSection($this->lng->txt(
"survey_360_rate_other_appraisees"));
1923 foreach ($list as $appr_id => $item) {
1926 if (!is_array($item)) {
1927 $info->addProperty($appr_name, $item);
1929 $this->ctrl->setParameter($output_gui,
"appr_id", $appr_id);
1930 $href = $this->ctrl->getLinkTarget($output_gui, $item[0]);
1931 $this->ctrl->setParameter($output_gui,
"appr_id",
"");
1934 $button->setCaption($item[1],
false);
1935 $button->setUrl($href);
1936 $big_button_360 =
'<div>' . $button->render() .
'</div>';
1938 $info->addProperty($appr_name, $big_button_360);
1941 } elseif (!$is_appraisee) {
1947 if ($this->object->get360Mode() &&
1948 $this->object->get360SelfAppraisee() &&
1949 !$this->object->isAppraisee(
$ilUser->getId()) &&
1951 $link = $this->ctrl->getLinkTargetByClass(
"ilsurveyparticipantsgui",
"addSelfAppraisee");
1952 $link =
'<a href="' . $link .
'">' . $this->lng->txt(
"survey_360_add_self_appraisee") .
'</a>';
1953 $info->addProperty(
" ", $link);
1958 $ilToolbar->setFormAction($this->ctrl->getFormAction($output_gui,
"infoScreen"));
1961 $button->setCaption($big_button[1],
false);
1962 $button->setCommand($big_button[0]);
1963 $button->setPrimary(
true);
1964 $ilToolbar->addButtonInstance($button);
1966 $ilToolbar->setCloseFormTag(
false);
1967 $info->setOpenFormTag(
false);
1976 if (strlen($this->object->getIntroduction())) {
1977 $introduction = $this->
object->getIntroduction();
1978 $info->addSection($this->lng->txt(
"introduction"));
1979 $info->addProperty(
"", $this->object->prepareTextareaOutput($introduction) .
1980 "<br />" . $info->getHiddenToggleButton());
1982 $info->addSection($this->lng->txt(
"show_details"));
1983 $info->addProperty(
"", $info->getHiddenToggleButton());
1986 $info->hideFurtherSections(
false);
1988 if (!$this->object->get360Mode()) {
1989 $info->addSection($this->lng->txt(
"svy_general_properties"));
1992 $this->lng->txt(
"survey_results_anonymization"),
1993 !$this->object->hasAnonymizedResults()
1994 ? $this->lng->txt(
"survey_results_personalized_info")
1995 : $this->lng->txt(
"survey_results_anonymized_info")
2000 $info->addProperty($this->lng->txt(
"evaluation_access"), $this->lng->txt(
"evaluation_access_info"));
2004 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
2006 $this->ctrl->forwardCommand($info);
2012 switch ($this->ctrl->getCmd()) {
2017 case "redirectQuestion":
2018 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
2021 case "checkEvaluationAccess":
2022 case "evaluationdetails":
2023 case "evaluationuser":
2024 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTargetByClass(
"ilsurveyevaluationgui",
"evaluation"),
"",
$_GET[
"ref_id"]);
2029 case "importSurvey":
2033 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
2036 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
2039 if ((
int)
$_GET[
"q_id"] && !(
int) $_REQUEST[
"new_for_survey"]) {
2042 $q_id = (int)
$_GET[
"q_id"];
2044 $this->ctrl->setParameterByClass($q_type,
"q_id", $q_id);
2045 $ilLocator->addItem(
2047 $this->ctrl->getLinkTargetByClass(array(
"ilSurveyEditorGUI", $q_type),
"editQuestion")
2061 public static function _goto($a_target, $a_access_code =
"")
2065 $ilAccess =
$DIC->access();
2069 if (strlen($a_access_code)) {
2071 $_GET[
"baseClass"] =
"ilObjSurveyGUI";
2072 $_GET[
"cmd"] =
"infoScreen";
2073 $_GET[
"ref_id"] = $a_target;
2074 include(
"ilias.php");
2078 if ($ilAccess->checkAccess(
"visible",
"", $a_target) ||
2079 $ilAccess->checkAccess(
"read",
"", $a_target)) {
2080 $_GET[
"baseClass"] =
"ilObjSurveyGUI";
2081 $_GET[
"cmd"] =
"infoScreen";
2082 $_GET[
"ref_id"] = $a_target;
2083 include(
"ilias.php");
2087 $lng->txt(
"msg_no_perm_read_item"),
2096 $rtpl =
new ilTemplate(
"tpl.svy_view_user_results.html",
true,
true,
"Modules/Survey");
2098 $show_titles = (bool) $this->object->getShowQuestionTitles();
2100 foreach ($this->object->getSurveyPages() as $page) {
2101 if (count($page) > 0) {
2103 if (count($page) > 1) {
2104 if ((
bool) $page[0][
"questionblock_show_blocktitle"]) {
2105 $rtpl->setVariable(
"BLOCK_TITLE", trim($page[0][
"questionblock_title"]));
2110 foreach ($page as $question) {
2111 $question_gui = $this->
object->getQuestionGUI($question[
"type_tag"], $question[
"question_id"]);
2112 if (is_object($question_gui)) {
2113 $rtpl->setCurrentBlock(
"question_bl");
2116 if (strlen($question[
"heading"])) {
2117 $rtpl->setVariable(
"HEADING", trim($question[
"heading"]));
2122 $question_gui->getPrintView(
2124 (
bool) $question[
"questionblock_show_questiontext"],
2125 $this->object->getId(),
2126 $this->object->loadWorkingData($question[
"question_id"], $a_active_id)
2130 $rtpl->parseCurrentBlock();
2134 $rtpl->setCurrentBlock(
"block_bl");
2135 $rtpl->parseCurrentBlock();
2139 return $rtpl->get();
2148 $anonymous_code =
$_SESSION[
"anonymous_id"][$this->
object->getId()];
2149 $active_id = $this->
object->getActiveID(
$ilUser->getId(), $anonymous_code, 0);
2150 if ($this->object->isSurveyStarted(
$ilUser->getId(), $anonymous_code) !== 1 ||
2152 $this->ctrl->redirect($this,
"infoScreen");
2155 $ilTabs->clearTargets();
2156 $ilTabs->setBackTarget(
2157 $this->lng->txt(
"btn_back"),
2158 $this->ctrl->getLinkTarget($this,
"infoScreen")
2162 $tpl->setContent($html);
2169 $show_titles = (bool) $this->object->getShowQuestionTitles();
2171 foreach ($this->object->getSurveyPages() as $page) {
2172 if (count($page) > 0) {
2173 $res[] =
"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
2176 if (count($page) > 1) {
2177 if ((
bool) $page[0][
"questionblock_show_blocktitle"]) {
2178 $res[$this->lng->txt(
"questionblock")] = trim($page[0][
"questionblock_title"]) .
"\n";
2184 $page_res = array();
2186 foreach ($page as $question) {
2187 $question_gui = $this->
object->getQuestionGUI($question[
"type_tag"], $question[
"question_id"]);
2188 if (is_object($question_gui)) {
2189 $question_parts = array();
2192 if (strlen($question[
"heading"])) {
2193 $question_parts[$this->lng->txt(
"heading")] = trim($question[
"heading"]);
2197 $question_parts[$this->lng->txt(
"title")] = trim($question[
"title"]);
2200 if ((
bool) $question[
"questionblock_show_questiontext"]) {
2201 $question_parts[$this->lng->txt(
"question")] = trim(strip_tags($question_gui->object->getQuestionText()));
2204 $answers = $question_gui->getParsedAnswers(
2205 $this->object->loadWorkingData($question[
"question_id"], $a_active_id),
2209 if (
sizeof($answers)) {
2211 if (
sizeof($answers) > 1 ||
2212 get_class($question_gui) ==
"SurveyTextQuestionGUI") {
2217 foreach ($answers as $answer) {
2219 if ($answer[
"textanswer"]) {
2220 $text =
' ("' . $answer[
"textanswer"] .
'")';
2222 if (!isset($answer[
"cols"])) {
2223 if (isset($answer[
"title"])) {
2224 $parts[] = $answer[
"title"] . $text;
2225 } elseif (isset($answer[
"value"])) {
2226 $parts[] = $answer[
"value"];
2228 $parts[] = substr($text, 2, -1);
2234 foreach ($answer[
"cols"] as $col) {
2235 $tmp[] = $col[
"title"];
2237 $parts[] = $answer[
"title"] .
": " . implode(
", ", $tmp) . $text;
2240 $question_parts[$this->lng->txt(
"answer")] =
2241 ($multiline ?
"\n" :
"") . implode(
"\n", $parts);
2245 foreach ($question_parts as
$type => $value) {
2246 $tmp[] =
$type .
": " . $value;
2248 $page_res[] = implode(
"\n", $tmp);
2252 $res[] = implode(
"\n\n-------------------------------\n\n", $page_res);
2256 $res[] =
"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
2258 return implode(
"\n",
$res);
2261 public function sendUserResultsMail($a_active_id, $a_recipient)
2265 $finished = $this->
object->getSurveyParticipants(array($a_active_id));
2266 $finished = array_pop($finished);
2269 require_once
"Services/Mail/classes/class.ilMail.php";
2270 require_once
"Services/Link/classes/class.ilLink.php";
2273 $body .= $this->lng->txt(
"svy_mail_own_results_body") .
"\n";
2274 $body .=
"\n" . $this->lng->txt(
"obj_svy") .
": " . $this->
object->getTitle() .
"\n";
2276 $body .=
"\n" . $this->lng->txt(
"survey_results_finished") .
": " . $finished .
"\n\n";
2278 if ($this->object->hasMailOwnResults()) {
2279 $subject =
"svy_mail_own_results_subject";
2282 $subject =
"svy_mail_confirmation_subject";
2289 $senderFactory =
$GLOBALS[
"DIC"][
"mail.mime.sender.factory"];
2292 $mmail->From($senderFactory->system());
2293 $mmail->To($a_recipient);
2294 $mmail->Subject(sprintf($this->lng->txt($subject), $this->object->getTitle()),
true);
2295 $mmail->Body($body);
2303 $anonymous_code =
$_SESSION[
"anonymous_id"][$this->
object->getId()];
2304 $active_id = $this->
object->getActiveID(
$ilUser->getId(), $anonymous_code, 0);
2305 if ($this->object->isSurveyStarted(
$ilUser->getId(), $anonymous_code) !== 1 ||
2307 $this->ctrl->redirect($this,
"infoScreen");
2310 $recipient =
$_POST[
"mail"];
2312 $recipient =
$ilUser->getEmail();
2315 $this->ctrl->redirect($this,
"infoScreen");
2318 $this->sendUserResultsMail($active_id, $recipient);
2320 ilUtil::sendSuccess($this->lng->txt(
"mail_sent"),
true);
2321 $this->ctrl->redirect($this,
"infoScreen");
2333 return $access->checkRbacOrPositionPermissionAccess(
2335 $a_position_permission,
2336 $this->object->getRefId()
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
An exception for terminatinating execution or to throw for unit testing.
static _getTitle($question_id)
Returns the question title of a question with a given id.
static _getQuestionType($question_id)
Returns the question type of a question with a given id.
This class represents an option in a checkbox group.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static setUseRelativeDates($a_status)
set use relative dates
@classDescription Date and time handling
Export User Interface Class.
GUI class for LTI provider object settings.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
const LP_CONTEXT_REPOSITORY
Class ilObjUserTrackingGUI.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static getLogger($a_component_id)
Get component logger.
static _getInstallationSignature()
static getSalutation($a_usr_id, ilLanguage $a_language=null)
This class represents a non editable value in a property form.
static _getRichTextEditor()
Returns the identifier for the Rich Text Editor.
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
static _hasEvaluationAccess($a_obj_id, $user_id)
propertiesObject(ilPropertyFormGUI $a_form=null)
Display and fill the properties form of the test.
afterSave(ilObject $a_new_object)
save object @access public
initPropertiesForm()
Init survey settings form.
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually,...
static _goto($a_target, $a_access_code="")
redirect script
initImportForm($a_new_type)
Init object import form.
savePropertiesObject()
Save the survey properties.
getUserResultsPlain($a_active_id)
addSubTabs($a_section)
Add subtabs for tabs.
addDidacticTemplateOptions(array &$a_options)
Add custom templates.
executeCommand()
execute command
importSurveyObject()
form for new survey object import
infoScreen()
show information screen
evaluationObject()
Redirects the evaluation object call to the ilSurveyEvaluationGUI class.
resetTemplateObject()
Enable all settings - remove template.
addLocatorItems()
should be overwritten to add object specific items (repository items are preloaded)
confirmResetTemplateObject()
Enable all settings - Confirmation.
getTabs()
adds tabs to tab gui object
getUserResultsTable($a_active_id)
checkRbacOrPositionPermission($a_rbac_permission, $a_position_permission)
Check rbac or position permission.
Class ilObjSurveyQuestionPool.
const EVALUATION_ACCESS_PARTICIPANTS
const RESULTS_SELF_EVAL_NONE
const NOTIFICATION_INVITED_USERS
const RESULTS_SELF_EVAL_ALL
const NOTIFICATION_PARENT_COURSE
const EVALUATION_ACCESS_ALL
static _hasDatasets($survey_id)
const NOTIFICATION_APPRAISEES_AND_RATERS
const ANONYMIZE_FREEACCESS
const EVALUATION_ACCESS_OFF
static validateExternalRaterCode($a_ref_id, $a_code)
const RESULTS_SELF_EVAL_OWN
const NOTIFICATION_APPRAISEES
const NOTIFICATION_RATERS
static _lookupId($a_user_str)
Lookup id by login.
static _lookupName($a_user_id)
lookup user name
GUI class for the workflow of copying objects.
Class ilObjectGUI Basic methods of all Output classes.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
getDidacticTemplateVar($a_type)
Get didactic template setting from creation screen.
putObjectInTree(ilObject $a_obj, $a_parent_node_id=null)
Add object to tree at given position.
prepareOutput($a_show_subobjects=true)
prepare output
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
getCreationMode()
get creation mode
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
addHeaderAction()
Add header action menu.
const ORGU_POSITION_ACCESS
static initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Init service settings form.
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.
Class ilObject Basic functions for all objects.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
getRefId()
get reference id @access public
static _getAllReferences($a_id)
get all reference ids of object
static getInstance()
Get instance.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This class represents an option in a radio group.
Settings template application class.
static getAllSettingsTemplates($a_type, $a_include_auto_generated=false)
Get all settings templates of type.
static lookupTitle($a_id)
Lookup title.
Skill management settings.
Class ilSurveyConstraintsGUI.
Survey evaluation graphical output.
Survey execution graphical output.
Class ilSurveyParticipantsGUI.
Survey skill determination GUI class.
Survey skill service GUI class.
special template class to simplify handling of ITX/PEAR
This class represents a text area property in a property form.
This class represents a text property in a property form.
Auto completion class for user lists.
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, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static is_email($a_email, ilMailRfc822AddressParserFactory $mailAddressParserFactory=null)
This preg-based function checks whether an e-mail address is formally valid.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getSystemMessageHTML($a_txt, $a_type="info")
Get HTML for a system message.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
foreach($_POST as $key=> $value) $res