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"];
73 $lng->loadLanguageModule(
"survey");
74 $lng->loadLanguageModule(
"svy");
76 $this->ctrl->saveParameter($this,
"ref_id");
90 $this->external_rater_360 =
false;
91 if (!$this->creation_mode &&
92 $this->object->get360Mode() &&
93 $_SESSION[
"anonymous_id"][$this->object->getId()] &&
95 $this->object->getRefId(),
96 $_SESSION[
"anonymous_id"][$this->object->getId()]
98 $this->external_rater_360 =
true;
101 if (!$this->external_rater_360) {
110 $this->ctrl->setParameterByClass(
"ilobjsurveygui",
"ref_id", $this->ref_id);
112 $ilNavigationHistory->addItem($this->ref_id, $link,
"svy");
116 $cmd = $this->ctrl->getCmd(
"properties");
119 if ($cmd ==
"saveTags") {
120 $this->ctrl->setCmdClass(
"ilinfoscreengui");
124 if (!$this->ctrl->getCmdClass() && $cmd ==
"questionsrepo") {
125 $_REQUEST[
"pgov"] = 1;
126 $this->ctrl->setCmd(
"questions");
127 $this->ctrl->setCmdClass(
"ilsurveyeditorgui");
130 $next_class = $this->ctrl->getNextClass($this);
131 $this->ctrl->setReturn($this,
"properties");
135 $this->log->debug(
"next_class= $next_class");
136 switch ($next_class) {
137 case 'illtiproviderobjectsettinggui':
139 $ilTabs->activateTab(
"settings");
140 $ilTabs->activateSubTab(
'lti_provider');
142 $lti_gui->setCustomRolesForSelection(
$GLOBALS[
'DIC']->rbac()->review()->getLocalRoles($this->object->getRefId()));
143 $lti_gui->offerLTIRolesForSelection(
false);
144 $this->ctrl->forwardCommand($lti_gui);
148 case "ilinfoscreengui":
150 $this->ctrl->getCmdClass(),
151 array(
'ilpublicuserprofilegui',
'ilobjportfoliogui')
157 $ilTabs->clearTargets();
159 $this->ctrl->forwardCommand($info);
163 case 'ilobjectmetadatagui':
165 $ilTabs->activateTab(
"meta_data");
168 $this->ctrl->forwardCommand($md_gui);
171 case "ilsurveyevaluationgui":
172 $ilTabs->activateTab(
"svy_results");
175 $this->ctrl->forwardCommand($eval_gui);
178 case "ilsurveyexecutiongui":
179 $ilTabs->clearTargets();
181 $this->ctrl->forwardCommand($exec_gui);
184 case 'ilpermissiongui':
185 $ilTabs->activateTab(
"perm_settings");
188 $this->ctrl->forwardCommand($perm_gui);
191 case 'ilobjectcopygui':
194 $this->ctrl->forwardCommand($cp);
197 case "ilcommonactiondispatchergui":
199 $this->ctrl->forwardCommand($gui);
203 case 'ilsurveyskillgui':
204 $ilTabs->activateTab(
"survey_competences");
206 $this->ctrl->forwardCommand($gui);
209 case 'ilsurveyskilldeterminationgui':
210 $ilTabs->activateTab(
"maintenance");
212 $this->ctrl->forwardCommand($gui);
215 case 'ilsurveyeditorgui':
217 $ilTabs->activateTab(
"survey_questions");
219 $this->ctrl->forwardCommand($gui);
222 case 'ilsurveyconstraintsgui':
224 $ilTabs->activateTab(
"constraints");
226 $this->ctrl->forwardCommand($gui);
229 case 'ilsurveyparticipantsgui':
231 $ilTabs->activateTab(
"maintenance");
233 $ilTabs->activateTab(
"survey_360_appraisees");
236 $this->ctrl->forwardCommand($gui);
239 case "illearningprogressgui":
240 $ilTabs->activateTab(
"learning_progress");
243 $this->object->getRefId()
245 $this->ctrl->forwardCommand($new_gui);
249 $ilTabs->activateTab(
"export");
251 $exp_gui->addFormat(
"xml");
252 $this->ctrl->forwardCommand($exp_gui);
259 $this->log->debug(
"Default cmd= $cmd");
265 if (strtolower(
$_GET[
"baseClass"]) !=
"iladministrationgui" &&
267 $this->tpl->printToStdout();
285 $this->ctrl->setCmdClass(get_class($eval_gui));
286 $this->ctrl->redirect($eval_gui,
"evaluation");
293 foreach ($templates as $item) {
294 $a_options[
"svytpl_" . $item[
"id"]] = array($item[
"title"],
295 nl2br(trim($item[
"description"])));
300 $a_options[
"svy360_1"] = array($this->lng->txt(
"survey_360_mode"),
301 $this->lng->txt(
"survey_360_mode_info"));
304 $a_options[
"svyselfeval_1"] = array($this->lng->txt(
"svy_self_ev_mode"),
305 $this->lng->txt(
"svy_self_ev_info"));
315 $a_new_object->loadFromDb();
319 $a_new_object->applySettingsTemplate(
$tpl);
329 $svy_mode = $a_new_object->getMode();
337 $a_new_object->saveToDB();
340 ilUtil::sendSuccess($this->lng->txt(
"object_added"),
true);
342 $a_new_object->
getRefId() .
"&cmd=properties");
359 $ilHelp->setScreenIdComponent(
"svy");
361 $hidden_tabs = array();
362 $template = $this->
object->getTemplate();
365 $hidden_tabs = $template->getHiddenTabs();
369 $this->tabs_gui->addTab(
371 $this->lng->txt(
"survey_questions"),
372 $this->ctrl->getLinkTargetByClass(array(
"ilsurveyeditorgui",
"ilsurveypagegui"),
"renderPage")
377 $this->tabs_gui->addTab(
379 $this->lng->txt(
"info_short"),
380 $this->ctrl->getLinkTarget($this,
'infoScreen')
386 $this->tabs_gui->addTab(
388 $this->lng->txt(
"settings"),
389 $this->ctrl->getLinkTarget($this,
'properties')
392 if ($this->object->get360Mode() &&
393 $this->object->get360SelfRaters() &&
394 $this->object->isAppraisee(
$ilUser->getId()) &&
395 !$this->object->isAppraiseeClosed(
$ilUser->getId())) {
396 $this->tabs_gui->addTab(
397 "survey_360_edit_raters",
398 $this->lng->txt(
"survey_360_edit_raters"),
399 $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui',
'editRaters')
408 !in_array(
"constraints", $hidden_tabs) &&
411 $this->tabs_gui->addTab(
413 $this->lng->txt(
"constraints"),
414 $this->ctrl->getLinkTargetByClass(
"ilsurveyconstraintsgui",
"constraints")
419 switch ($this->object->getMode()) {
423 if ($this->object->getSkillService() && $skmg_set->isActivated()) {
424 $this->tabs_gui->addTab(
425 "survey_competences",
426 $this->lng->txt(
"survey_competences"),
427 $this->ctrl->getLinkTargetByClass(
"ilsurveyskillgui",
"listQuestionAssignment")
430 $this->tabs_gui->addTab(
431 "survey_360_appraisees",
432 $this->lng->txt(
"survey_360_appraisees"),
433 $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui',
'listAppraisees')
439 if ($this->object->getSkillService() && $skmg_set->isActivated()) {
440 $this->tabs_gui->addTab(
441 "survey_competences",
442 $this->lng->txt(
"survey_competences"),
443 $this->ctrl->getLinkTargetByClass(
"ilsurveyskillgui",
"listQuestionAssignment")
446 $this->tabs_gui->addTab(
448 $this->lng->txt(
"maintenance"),
449 $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui',
'maintenance')
455 $this->tabs_gui->addTab(
457 $this->lng->txt(
"maintenance"),
458 $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui',
'maintenance')
468 $this->tabs_gui->addTab(
470 $this->lng->txt(
"svy_results"),
471 $this->ctrl->getLinkTargetByClass(
"ilsurveyevaluationgui",
"evaluation")
477 $this->tabs_gui->addTarget(
479 $this->ctrl->getLinkTargetByClass(array(
"ilobjsurveygui",
"illearningprogressgui"),
""),
481 array(
"illplistofobjectsgui",
"illplistofsettingsgui",
"illearningprogressgui",
"illplistofprogressgui")
486 if (!in_array(
"meta_data", $hidden_tabs)) {
489 $mdtab = $mdgui->getTab();
491 $this->tabs_gui->addTab(
493 $this->lng->txt(
"meta_data"),
499 if (!in_array(
"export", $hidden_tabs)) {
501 $this->tabs_gui->addTab(
503 $this->lng->txt(
"export"),
504 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
511 $this->tabs_gui->addTab(
513 $this->lng->txt(
"perm_settings"),
514 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm")
537 if ($form->checkInput()) {
540 if (!$this->object->get360Mode()) {
541 if ($form->getInput(
"tut")) {
544 $tut_logins = $form->getInput(
"tut_ids");
545 foreach ($tut_logins as $tut_login) {
547 if ($tut_id &&
$rbacsystem->checkAccessOfUser($tut_id,
"write", $this->object->getRefId())) {
548 $tut_ids[] = $tut_id;
552 $tut_ids = $form->getItemByPostVar(
"tut_ids");
553 $tut_ids->setAlert($this->lng->txt(
"survey_notification_tutor_recipients_invalid"));
557 if ($form->getInput(
"tut_res")) {
558 $end = $form->getItemByPostVar(
"end_date");
559 if (!$end->getDate()) {
560 $tut_res = $form->getItemByPostVar(
"tut_res");
561 $tut_res->setAlert($this->lng->txt(
"svy_notification_tutor_results_alert"));
566 $tut_res_ids = array();
567 $tut_logins = $form->getInput(
"tut_res_ids");
568 foreach ($tut_logins as $tut_login) {
570 if ($tut_id &&
$rbacsystem->checkAccessOfUser($tut_id,
"write", $this->object->getRefId())) {
571 $tut_res_ids[] = $tut_id;
575 $tut_res_ids = $form->getItemByPostVar(
"tut_res_ids");
576 $tut_res_ids->setAlert($this->lng->txt(
"survey_notification_tutor_recipients_invalid"));
583 if ($form->getInput(
"rmd")) {
584 $rmd_start = $form->getItemByPostVar(
"rmd_start")->getDate();
585 $rmd_end = $form->getItemByPostVar(
"rmd_end")->getDate();
589 $rmd_start = $rmd_end;
593 $this->
object->setReminderStatus(
true);
594 $this->
object->setReminderStart($rmd_start);
595 $this->
object->setReminderEnd($rmd_end);
596 $this->
object->setReminderFrequency($form->getInput(
"rmd_freq"));
597 if (!$this->object->get360Mode()) {
598 $this->
object->setReminderTarget($form->getInput(
"rmd_grp"));
599 $this->
object->setReminderTemplate(($form->getInput(
"rmdt") > 0)
600 ? $form->getInput(
"rmdt")
603 if ($form->getInput(
"remind_appraisees") && $form->getInput(
"remind_raters")) {
605 } elseif ($form->getInput(
"remind_appraisees")) {
607 } elseif ($form->getInput(
"remind_raters")) {
610 $this->
object->setReminderTarget(0);
614 $this->
object->setReminderStatus(
false);
617 if (!$this->object->get360Mode()) {
618 if ($form->getInput(
"tut")) {
619 $this->
object->setTutorNotificationStatus(
true);
620 $this->
object->setTutorNotificationRecipients($tut_ids);
621 $this->
object->setTutorNotificationTarget($form->getInput(
"tut_grp"));
623 $this->
object->setTutorNotificationStatus(
false);
626 if ($form->getInput(
"tut_res")) {
627 $this->
object->setTutorResultsStatus(
true);
628 $this->
object->setTutorResultsRecipients($tut_res_ids);
630 $this->
object->setTutorResultsStatus(
false);
635 if (
$_POST[
'online'] && count($this->object->questions) == 0) {
640 $template_settings =
null;
641 $template = $this->
object->getTemplate();
644 $template_settings = $template->getSettings();
647 $md_obj =
new ilMD($this->object->getId(), 0,
"svy");
648 $md_section = $md_obj->getGeneral();
652 $md_section->update();
655 $md_desc_ids = $md_section->getDescriptionIds();
657 $md_desc = $md_section->getDescription(array_pop($md_desc_ids));
662 $this->
object->setViewOwnResults(
$_POST[
"view_own"]);
663 $this->
object->setMailOwnResults(
$_POST[
"mail_own"]);
664 $this->
object->setMailConfirmation(
$_POST[
"mail_confirm"]);
669 $this->
object->setOfflineStatus((
bool) !
$_POST[
'online']);
670 $this->
object->update();
673 $period = $form->getItemByPostVar(
"access_period");
674 if ($period->getStart() && $period->getEnd()) {
675 $this->
object->setActivationLimited(
true);
676 $this->
object->setActivationVisibility(
$_POST[
"access_visiblity"]);
677 $this->
object->setActivationStartDate($period->getStart()->get(
IL_CAL_UNIX));
678 $this->
object->setActivationEndDate($period->getEnd()->get(
IL_CAL_UNIX));
680 $this->
object->setActivationLimited(
false);
684 $obj_service->commonSettings()->legacyForm($form, $this->
object)->saveTileImage();
687 if (!$template_settings[
"enabled_start_date"][
"hide"]) {
688 $start = $form->getItemByPostVar(
"start_date");
689 if ($start->getDate()) {
691 $this->
object->setStartDateAndTime($datetime[0], $datetime[1]);
693 $this->
object->setStartDate(
null);
697 if (!$template_settings[
"enabled_end_date"][
"hide"]) {
698 $end = $form->getItemByPostVar(
"end_date");
699 if ($end->getDate()) {
701 $this->
object->setEndDateAndTime($datetime[0], $datetime[1]);
703 $this->
object->setEndDate(
null);
708 $introduction =
$_POST[
"introduction"];
709 $this->
object->setIntroduction($introduction);
711 $this->
object->setOutro($outro);
713 if (!$template_settings[
"show_question_titles"][
"hide"]) {
714 $this->
object->setShowQuestionTitles(
$_POST[
"show_question_titles"]);
717 if (!$template_settings[
"use_pool"][
"hide"]) {
718 $this->
object->setPoolUsage(
$_POST[
"use_pool"]);
721 $this->
object->setMailNotification(
$_POST[
'mailnotification']);
722 $this->
object->setMailAddresses(
$_POST[
'mailaddresses']);
723 $this->
object->setMailParticipantData(
$_POST[
'mailparticipantdata']);
725 switch ($this->object->getMode()) {
727 $this->
object->set360SelfEvaluation((
bool)
$_POST[
"self_eval"]);
728 $this->
object->set360SelfAppraisee((
bool) $_POST[
"self_appr"]);
729 $this->
object->set360SelfRaters((
bool) $_POST[
"self_rate"]);
730 $this->
object->set360Results((
int) $_POST[
"ts_res"]);;
731 $this->
object->setSkillService((
int) $_POST[
"skill_service"]);
734 $this->
object->setSelfEvaluationResults($_POST[
"self_eval_res"]);
735 $this->
object->setSkillService((
int) $_POST[
"skill_service"]);
738 if (!$template_settings[
"evaluation_access"][
"hide"]) {
739 $this->
object->setEvaluationAccess($_POST[
"evaluation_access"]);
744 $hide_codes = $template_settings[
"acc_codes"][
"hide"];
745 $hide_anon = $template_settings[
"anonymization_options"][
"hide"];
746 if (!$hide_codes || !$hide_anon) {
747 $current = $this->
object->getAnonymize();
751 $codes = (bool)
$_POST[
"acc_codes"];
757 $anon = ((string)
$_POST[
"anonymization_options"] ==
"statanon");
777 $this->
object->setAnonymousUserList($_POST[
"anon_list"]);
781 unset(
$_SESSION[
"anonymous_id"][$this->object->getId()]);
787 $this->
object->saveToDb();
790 $this->object->getId(),
797 if (strcmp(
$_SESSION[
"info"],
"") != 0) {
798 ilUtil::sendSuccess(
$_SESSION[
"info"] .
"<br />" . $this->lng->txt(
"settings_saved"),
true);
800 ilUtil::sendSuccess($this->lng->txt(
"settings_saved"),
true);
802 $this->ctrl->redirect($this,
"properties");
809 $form->setValuesByPost();
822 $template_settings = $hide_rte_switch =
null;
823 $template = $this->
object->getTemplate();
827 $template_settings = $template->getSettings();
828 $hide_rte_switch = $template_settings[
"rte_switch"][
"hide"];
832 $form->setFormAction($this->ctrl->getFormAction($this));
833 $form->setTableWidth(
"100%");
834 $form->setId(
"survey_properties");
838 $header->setTitle($this->lng->txt(
"settings"));
839 $form->addItem($header);
844 $md_obj =
new ilMD($this->object->getId(), 0,
"svy");
845 $md_section = $md_obj->getGeneral();
848 $title->setRequired(
true);
849 $title->setValue($md_section->getTitle());
850 $form->addItem($title);
852 $ids = $md_section->getDescriptionIds();
854 $desc_obj = $md_section->getDescription(array_pop($ids));
859 $desc->setValue($desc_obj->getDescription());
860 $form->addItem($desc);
864 $pool_usage =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_question_pool_usage"),
"use_pool");
865 $opt =
new ilRadioOption($this->lng->txt(
"survey_question_pool_usage_active"), 1);
866 $opt->setInfo($this->lng->txt(
"survey_question_pool_usage_active_info"));
867 $pool_usage->addOption($opt);
868 $opt =
new ilRadioOption($this->lng->txt(
"survey_question_pool_usage_inactive"), 0);
869 $opt->setInfo($this->lng->txt(
"survey_question_pool_usage_inactive_info"));
870 $pool_usage->addOption($opt);
871 $pool_usage->setValue($this->object->getPoolUsage());
872 $form->addItem($pool_usage);
875 if ($this->object->get360Mode()) {
876 $self_eval =
new ilCheckboxInputGUI($this->lng->txt(
"survey_360_self_evaluation"),
"self_eval");
877 $self_eval->setInfo($this->lng->txt(
"survey_360_self_evaluation_info"));
878 $self_eval->setChecked($this->object->get360SelfEvaluation());
879 $form->addItem($self_eval);
881 $self_rate =
new ilCheckboxInputGUI($this->lng->txt(
"survey_360_self_raters"),
"self_rate");
882 $self_rate->setInfo($this->lng->txt(
"survey_360_self_raters_info"));
883 $self_rate->setChecked($this->object->get360SelfRaters());
884 $form->addItem($self_rate);
886 $self_appr =
new ilCheckboxInputGUI($this->lng->txt(
"survey_360_self_appraisee"),
"self_appr");
887 $self_appr->setInfo($this->lng->txt(
"survey_360_self_appraisee_info"));
888 $self_appr->setChecked($this->object->get360SelfAppraisee());
889 $form->addItem($self_appr);
894 $this->lng->loadLanguageModule(
'rep');
897 $section->setTitle($this->lng->txt(
'rep_activation_availability'));
901 $act_obj_info = $act_ref_info =
"";
903 $act_obj_info =
' ' . $this->lng->txt(
'rep_activation_online_object_info');
904 $act_ref_info = $this->lng->txt(
'rep_activation_access_ref_info');
908 $online->setInfo($this->lng->txt(
'svy_activation_online_info') . $act_obj_info);
909 $online->setChecked(!$this->object->getOfflineStatus());
910 $form->addItem($online);
913 $dur->setShowTime(
true);
914 $date = $this->
object->getActivationStartDate();
918 $date = $this->
object->getActivationEndDate();
922 $form->addItem($dur);
924 $visible =
new ilCheckboxInputGUI($this->lng->txt(
'rep_activation_limited_visibility'),
'access_visiblity');
925 $visible->setInfo($this->lng->txt(
'svy_activation_limited_visibility_info'));
926 $visible->setChecked($this->object->getActivationVisibility());
927 $dur->addSubItem($visible);
931 $section->setTitle($this->lng->txt(
'obj_presentation'));
935 $obj_service->commonSettings()->legacyForm($form, $this->
object)->addTileImage();
940 $section->setTitle($this->lng->txt(
'svy_settings_section_before_start'));
945 $intro->setValue($this->object->prepareTextareaOutput($this->object->getIntroduction()));
949 $intro->setUseRte(
true);
950 $intro->setInfo($this->lng->txt(
"survey_introduction_info"));
952 $intro->addPlugin(
"latex");
953 $intro->addButton(
"latex");
954 $intro->addButton(
"pastelatex");
955 $intro->setRTESupport($this->object->getId(),
"svy",
"survey",
null, $hide_rte_switch);
957 $form->addItem($intro);
963 $section->setTitle($this->lng->txt(
'svy_settings_section_access'));
967 $start = $this->
object->getStartDate();
970 $startingtime->setShowTime(
true);
974 $form->addItem($startingtime);
977 $end = $this->
object->getEndDate();
980 $endingtime->setShowTime(
true);
984 $form->addItem($endingtime);
987 if (!$this->object->get360Mode()) {
989 $codes->setInfo($this->lng->txt(
"survey_access_codes_info"));
990 $codes->setChecked(!$this->object->isAccessibleWithoutCode());
991 $form->addItem($codes);
994 $codes->setDisabled(
true);
1002 $section->setTitle($this->lng->txt(
'svy_settings_section_question_behaviour'));
1006 $show_question_titles =
new ilCheckboxInputGUI($this->lng->txt(
"svy_show_questiontitles"),
"show_question_titles");
1007 $show_question_titles->setValue(1);
1008 $show_question_titles->setChecked($this->object->getShowQuestionTitles());
1009 $form->addItem($show_question_titles);
1015 $info->setTitle($this->lng->txt(
"svy_settings_section_finishing"));
1016 $form->addItem($info);
1018 $view_own =
new ilCheckboxInputGUI($this->lng->txt(
"svy_results_view_own"),
"view_own");
1019 $view_own->setInfo($this->lng->txt(
"svy_results_view_own_info"));
1020 $view_own->setChecked($this->object->hasViewOwnResults());
1021 $form->addItem($view_own);
1023 $mail_confirm =
new ilCheckboxInputGUI($this->lng->txt(
"svy_results_mail_confirm"),
"mail_confirm");
1024 $mail_confirm->setInfo($this->lng->txt(
"svy_results_mail_confirm_info"));
1025 $mail_confirm->setChecked($this->object->hasMailConfirmation());
1026 $form->addItem($mail_confirm);
1028 $mail_own =
new ilCheckboxInputGUI($this->lng->txt(
"svy_results_mail_own"),
"mail_own");
1029 $mail_own->setInfo($this->lng->txt(
"svy_results_mail_own_info"));
1030 $mail_own->setChecked($this->object->hasMailOwnResults());
1031 $mail_confirm->addSubItem($mail_own);
1035 $finalstatement->setValue($this->object->prepareTextareaOutput($this->object->getOutro()));
1036 $finalstatement->setRows(10);
1037 $finalstatement->setCols(80);
1039 $finalstatement->setUseRte(
true);
1041 $finalstatement->addPlugin(
"latex");
1042 $finalstatement->addButton(
"latex");
1043 $finalstatement->addButton(
"pastelatex");
1044 $finalstatement->setRTESupport($this->object->getId(),
"svy",
"survey",
null, $hide_rte_switch);
1046 $form->addItem($finalstatement);
1049 $mailnotification =
new ilCheckboxInputGUI($this->lng->txt(
"mailnotification"),
"mailnotification");
1051 $mailnotification->setInfo($this->lng->txt(
"svy_result_mail_notification_info"));
1052 $mailnotification->setValue(1);
1053 $mailnotification->setChecked($this->object->getMailNotification());
1056 $mailaddresses =
new ilTextInputGUI($this->lng->txt(
"mailaddresses"),
"mailaddresses");
1057 $mailaddresses->setValue($this->object->getMailAddresses());
1058 $mailaddresses->setSize(80);
1059 $mailaddresses->setInfo($this->lng->txt(
'mailaddresses_info'));
1060 $mailaddresses->setRequired(
true);
1063 $participantdata =
new ilTextAreaInputGUI($this->lng->txt(
"mailparticipantdata"),
"mailparticipantdata");
1064 $participantdata->setValue($this->object->getMailParticipantData());
1065 $participantdata->setRows(6);
1066 $participantdata->setCols(80);
1067 $participantdata->setUseRte(
false);
1068 $participantdata->setInfo($this->lng->txt(
"mailparticipantdata_info"));
1071 $placeholders = array(
1072 "FIRST_NAME" =>
"firstname",
1073 "LAST_NAME" =>
"lastname",
1077 foreach ($placeholders as $placeholder => $caption) {
1078 $txt[] =
"[" . strtoupper($placeholder) .
"]: " . $this->lng->txt($caption);
1081 $participantdatainfo =
new ilNonEditableValueGUI($this->lng->txt(
"mailparticipantdata_placeholder"),
"",
true);
1082 $participantdatainfo->setValue(
$txt);
1084 $mailnotification->addSubItem($mailaddresses);
1085 $mailnotification->addSubItem($participantdata);
1086 $mailnotification->addSubItem($participantdatainfo);
1087 $form->addItem($mailnotification);
1090 if (!$this->object->get360Mode()) {
1093 $has_parent =
$tree->checkForParentType($this->object->getRefId(),
"grp");
1095 $has_parent =
$tree->checkForParentType($this->object->getRefId(),
"crs");
1097 $num_inv = count($this->invitation_manager->getAllForSurvey($this->object->getSurveyId()));
1100 $tut =
new ilCheckboxInputGUI($this->lng->txt(
"survey_notification_tutor_setting"),
"tut");
1101 $tut->setChecked($this->object->getTutorNotificationStatus());
1102 $form->addItem($tut);
1104 $tut_logins = array();
1105 $tuts = $this->
object->getTutorNotificationRecipients();
1107 foreach ($tuts as $tut_id) {
1109 if ($tmp[
"login"]) {
1110 $tut_logins[] = $tmp[
"login"];
1114 $tut_ids =
new ilTextInputGUI($this->lng->txt(
"survey_notification_tutor_recipients"),
"tut_ids");
1115 $tut_ids->setDataSource($this->ctrl->getLinkTarget($this,
"doAutoComplete",
"",
true));
1116 $tut_ids->setRequired(
true);
1117 $tut_ids->setMulti(
true);
1118 $tut_ids->setMultiValues($tut_logins);
1119 $tut_ids->setValue(array_shift($tut_logins));
1120 $tut->addSubItem($tut_ids);
1122 $tut_grp =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_notification_target_group"),
"tut_grp");
1123 $tut_grp->setRequired(
true);
1124 $tut_grp->setValue($this->object->getTutorNotificationTarget());
1125 $tut->addSubItem($tut_grp);
1128 $this->lng->txt(
"survey_notification_target_group_parent_course"),
1132 $tut_grp_crs->setInfo($this->lng->txt(
"survey_notification_target_group_parent_course_inactive"));
1134 $tut_grp_crs->setInfo(sprintf(
1135 $this->lng->txt(
"survey_notification_target_group_invited_info"),
1136 count($this->object->getNotificationTargetUserIds(
false))
1139 $tut_grp->addOption($tut_grp_crs);
1142 $this->lng->txt(
"survey_notification_target_group_invited"),
1145 $tut_grp_inv->setInfo(sprintf($this->lng->txt(
"survey_notification_target_group_invited_info"), $num_inv));
1146 $tut_grp->addOption($tut_grp_inv);
1148 $tut_res =
new ilCheckboxInputGUI($this->lng->txt(
"svy_notification_tutor_results"),
"tut_res");
1149 $tut_res->setInfo($this->lng->txt(
"svy_notification_tutor_results_info"));
1150 $tut_res->setChecked($this->object->getTutorResultsStatus());
1151 $form->addItem($tut_res);
1153 $tut_res_logins = array();
1154 $tuts = $this->
object->getTutorResultsRecipients();
1156 foreach ($tuts as $tut_id) {
1158 if ($tmp[
"login"]) {
1159 $tut_res_logins[] = $tmp[
"login"];
1163 $tut_res_ids =
new ilTextInputGUI($this->lng->txt(
"survey_notification_tutor_recipients"),
"tut_res_ids");
1164 $tut_res_ids->setDataSource($this->ctrl->getLinkTarget($this,
"doAutoComplete",
"",
true));
1165 $tut_res_ids->setRequired(
true);
1166 $tut_res_ids->setMulti(
true);
1167 $tut_res_ids->setMultiValues($tut_res_logins);
1168 $tut_res_ids->setValue(array_shift($tut_res_logins));
1169 $tut_res->addSubItem($tut_res_ids);
1176 $info->setTitle($this->lng->txt(
"svy_settings_section_reminders"));
1177 $form->addItem($info);
1180 $rmd->setChecked($this->object->getReminderStatus());
1181 $form->addItem($rmd);
1183 $rmd_start =
new ilDateTimeInputGUI($this->lng->txt(
"survey_reminder_start"),
"rmd_start");
1184 $rmd_start->setRequired(
true);
1185 $start = $this->
object->getReminderStart();
1187 $rmd_start->setDate($start);
1189 $rmd->addSubItem($rmd_start);
1191 $end = $this->
object->getReminderEnd();
1192 $rmd_end =
new ilDateTimeInputGUI($this->lng->txt(
"survey_reminder_end"),
"rmd_end");
1194 $rmd_end->setDate($end);
1196 $rmd->addSubItem($rmd_end);
1198 $rmd_freq =
new ilNumberInputGUI($this->lng->txt(
"survey_reminder_frequency"),
"rmd_freq");
1199 $rmd_freq->setRequired(
true);
1200 $rmd_freq->setSize(3);
1201 $rmd_freq->setSuffix($this->lng->txt(
"survey_reminder_frequency_days"));
1202 $rmd_freq->setValue($this->object->getReminderFrequency());
1203 $rmd_freq->setMinValue(1);
1204 $rmd->addSubItem($rmd_freq);
1207 if (!$this->object->get360Mode()) {
1208 $rmd_grp =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_notification_target_group"),
"rmd_grp");
1209 $rmd_grp->setRequired(
true);
1210 $rmd_grp->setValue($this->object->getReminderTarget());
1211 $rmd->addSubItem($rmd_grp);
1214 $this->lng->txt(
"survey_notification_target_group_parent_course"),
1218 $rmd_grp_crs->setInfo($this->lng->txt(
"survey_notification_target_group_parent_course_inactive"));
1220 $rmd_grp_crs->setInfo(sprintf(
1221 $this->lng->txt(
"survey_notification_target_group_invited_info"),
1222 count($this->object->getNotificationTargetUserIds(
false))
1225 $rmd_grp->addOption($rmd_grp_crs);
1228 $this->lng->txt(
"survey_notification_target_group_invited"),
1231 $rmd_grp_inv->setInfo(sprintf($this->lng->txt(
"survey_notification_target_group_invited_info"), $num_inv));
1232 $rmd_grp->addOption($rmd_grp_inv);
1234 $mtmpl = $this->
object->getReminderMailTemplates();
1237 $rmdt->setRequired(
true);
1238 $rmdt->addOption(
new ilRadioOption($this->lng->txt(
"svy_reminder_mail_template_none"), -1));
1239 foreach ($mtmpl as $mtmpl_id => $mtmpl_caption) {
1241 $rmdt->addOption($option);
1244 $reminderTemplateValue = -1;
1245 if ($this->object->getReminderTemplate()) {
1246 $reminderTemplateValue = $this->
object->getReminderTemplate();
1248 $rmdt->setValue($reminderTemplateValue);
1249 $rmd->addSubItem($rmdt);
1253 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"survey_notification_target_group"),
"remind_appraisees");
1254 $cb->setOptionTitle($this->lng->txt(
"survey_360_appraisees"));
1255 $cb->setInfo($this->lng->txt(
"survey_360_appraisees_remind_info"));
1257 $cb->setChecked(in_array(
1258 $this->object->getReminderTarget(),
1261 $rmd->addSubItem($cb);
1265 $cb->setOptionTitle($this->lng->txt(
"survey_360_raters"));
1266 $cb->setInfo($this->lng->txt(
"survey_360_raters_remind_info"));
1268 $cb->setChecked(in_array(
1269 $this->object->getReminderTarget(),
1272 $rmd->addSubItem($cb);
1279 $results->setTitle($this->lng->txt(
"results"));
1283 switch ($this->object->getMode()) {
1286 $ts_results->setValue($this->object->get360Results());
1289 $option->setInfo($this->lng->txt(
"survey_360_results_none_info"));
1290 $ts_results->addOption($option);
1293 $option->setInfo($this->lng->txt(
"survey_360_results_own_info"));
1294 $ts_results->addOption($option);
1297 $option->setInfo($this->lng->txt(
"survey_360_results_all_info"));
1298 $ts_results->addOption($option);
1300 $form->addItem($ts_results);
1305 $evaluation_access =
new ilRadioGroupInputGUI($this->lng->txt(
'evaluation_access'),
"self_eval_res");
1306 $evaluation_access->setValue($this->object->getSelfEvaluationResults());
1309 $evaluation_access->addOption($option);
1312 $evaluation_access->addOption($option);
1315 $evaluation_access->addOption($option);
1317 $form->addItem($evaluation_access);
1321 $evaluation_access =
new ilRadioGroupInputGUI($this->lng->txt(
'evaluation_access'),
"evaluation_access");
1324 $option->setInfo($this->lng->txt(
"svy_evaluation_access_off_info"));
1325 $evaluation_access->addOption($option);
1328 $option->setInfo($this->lng->txt(
"svy_evaluation_access_all_info"));
1329 $evaluation_access->addOption($option);
1332 $option->setInfo($this->lng->txt(
"svy_evaluation_access_participants_info"));
1333 $evaluation_access->addOption($option);
1335 $evaluation_access->setValue($this->object->getEvaluationAccess());
1336 $form->addItem($evaluation_access);
1338 $anonymization_options =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_results_anonymization"),
"anonymization_options");
1340 $option =
new ilCheckboxOption($this->lng->txt(
"survey_results_personalized"),
"statpers");
1341 $option->setInfo($this->lng->txt(
"survey_results_personalized_info"));
1342 $anonymization_options->addOption($option);
1344 $option =
new ilCheckboxOption($this->lng->txt(
"survey_results_anonymized"),
"statanon");
1345 $option->setInfo($this->lng->txt(
"survey_results_anonymized_info"));
1346 $anonymization_options->addOption($option);
1347 $anonymization_options->setValue($this->object->hasAnonymizedResults()
1350 $form->addItem($anonymization_options);
1352 $surveySetting =
new ilSetting(
"survey");
1353 if ($surveySetting->get(
"anonymous_participants",
false)) {
1355 if ($surveySetting->get(
"anonymous_participants_min", 0)) {
1356 $min =
" (" . $this->lng->txt(
"svy_anonymous_participants_min") .
": " .
1357 $surveySetting->get(
"anonymous_participants_min") .
")";
1360 $anon_list =
new ilCheckboxInputGUI($this->lng->txt(
"svy_anonymous_participants_svy"),
"anon_list");
1361 $anon_list->setInfo($this->lng->txt(
"svy_anonymous_participants_svy_info") . $min);
1362 $anon_list->setChecked($this->object->hasAnonymousUserList());
1363 $option->addSubItem($anon_list);
1366 if ($this->object->_hasDatasets($this->object->getSurveyId())) {
1367 $anonymization_options->setDisabled(
true);
1369 $anon_list->setDisabled(
true);
1378 $svy_mode = $this->
object->getMode();
1381 $other->setTitle($this->lng->txt(
"other"));
1382 $form->addItem($other);
1384 $skill_service =
new ilCheckboxInputGUI($this->lng->txt(
"survey_activate_skill_service"),
"skill_service");
1385 $skill_service->setInfo($this->lng->txt(
"survey_activate_skill_service_info"));
1386 $skill_service->setChecked($this->object->getSkillService());
1387 $form->addItem($skill_service);
1391 ->getObjectPositionSettingsByType($this->object->getType());
1393 if ($position_settings->isActive()) {
1396 $feat->setTitle($this->lng->txt(
'obj_features'));
1397 $form->addItem($feat);
1401 $this->object->getId(),
1409 $form->addCommandButton(
"saveProperties", $this->lng->txt(
"save"));
1412 if ($template_settings) {
1413 foreach ($template_settings as $id => $item) {
1414 if ($item[
"hide"]) {
1415 if ($id ==
"enabled_end_date") {
1418 if ($id ==
"enabled_start_date") {
1421 $form->removeItemByPostVar($id,
true);
1434 if ($a_section ==
'settings') {
1435 $this->tabs_gui->addSubTabTarget(
1437 $this->ctrl->getLinkTarget($this,
'properties')
1441 if ($lti_settings->hasSettingsAccess()) {
1442 $this->tabs_gui->addSubTabTarget(
1444 $this->ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
1464 $ilTabs->activateTab(
"settings");
1465 $ilTabs->activateSubTab(
'settings');
1467 if ($this->object->get360Mode()) {
1468 $ilHelp->setScreenId(
"settings_360");
1477 if ($this->object->getTemplate()) {
1478 $link = $this->ctrl->getLinkTarget($this,
"confirmResetTemplate");
1479 $link =
"<a href=\"" . $link .
"\">" . $this->lng->txt(
"survey_using_template_link") .
"</a>";
1480 $message =
"<div style=\"margin-top:10px\">" .
1482 $this->lng->txt(
"survey_using_template"),
1489 $this->tpl->setContent($a_form->getHTML() .
$message);
1494 $fields = array(
'login',
'firstname',
'lastname',
'email');
1497 $auto->setSearchFields($fields);
1498 $auto->setResultField(
'login');
1499 $auto->enableFieldSearchableCheck(
true);
1500 $auto->setMoreLinkAvailable(
true);
1502 if (($_REQUEST[
'fetchall'])) {
1516 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_confirm_resettemplate.html",
"Modules/Survey");
1517 $this->tpl->setCurrentBlock(
"adm_content");
1518 $this->tpl->setVariable(
"BTN_CONFIRM_REMOVE", $this->lng->txt(
"confirm"));
1519 $this->tpl->setVariable(
"BTN_CANCEL_REMOVE", $this->lng->txt(
"cancel"));
1520 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"resetTemplateObject"));
1521 $this->tpl->parseCurrentBlock();
1529 $this->
object->setTemplate(
null);
1530 $this->
object->saveToDB();
1532 ilUtil::sendSuccess($this->lng->txt(
"survey_template_reset"),
true);
1533 $this->ctrl->redirect($this,
"properties");
1545 $form->setTarget(
"_top");
1546 $form->setFormAction($this->ctrl->getFormAction($this));
1547 $form->setTitle($this->lng->txt(
"import_svy"));
1549 $fi =
new ilFileInputGUI($this->lng->txt(
"import_file"),
"importfile");
1550 $fi->setSuffixes(array(
"zip"));
1551 $fi->setRequired(
true);
1552 $form->addItem($fi);
1555 $questionspools = $svy->getAvailableQuestionpools(
true,
true,
true);
1557 $pools =
new ilSelectInputGUI($this->lng->txt(
"select_questionpool_short"),
"spl");
1558 $pools->setOptions(array(
"" => $this->lng->txt(
"dont_use_questionpool")) + $questionspools);
1559 $pools->setRequired(
false);
1560 $form->addItem($pools);
1562 $form->addCommandButton(
"importSurvey", $this->lng->txt(
"import"));
1563 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
1575 $parent_id =
$_GET[
"ref_id"];
1576 $new_type = $_REQUEST[
"new_type"];
1581 $this->lng->loadLanguageModule($new_type);
1582 $this->ctrl->setParameter($this,
"new_type", $new_type);
1585 if ($form->checkInput()) {
1587 $newObj->setType($new_type);
1588 $newObj->setTitle(
"dummy");
1589 $newObj->create(
true);
1594 $this->log->debug(
"form->getInput(spl) = " . $form->getInput(
"spl"));
1596 $error = $newObj->importObject($_FILES[
"importfile"], $form->getInput(
"spl"));
1597 if (strlen($error)) {
1603 ilUtil::sendSuccess($this->lng->txt(
"object_imported"),
true);
1605 "&baseClass=ilObjSurveyGUI");
1611 $tpl->addJavaScript(
"./Modules/Scorm2004/scripts/questions/jquery.js");
1614 $this->tpl->setCurrentBlock(
"template_option");
1615 $this->tpl->setVariable(
"VAL_TEMPLATE_OPTION",
"");
1616 $this->tpl->setVariable(
"TXT_TEMPLATE_OPTION", $this->lng->txt(
"none"));
1617 $this->tpl->parseCurrentBlock();
1619 foreach ($templates as $item) {
1620 $this->tpl->setCurrentBlock(
"template_option");
1621 $this->tpl->setVariable(
"VAL_TEMPLATE_OPTION", $item[
"id"]);
1622 $this->tpl->setVariable(
"TXT_TEMPLATE_OPTION", $item[
"title"]);
1623 $this->tpl->parseCurrentBlock();
1625 $desc = str_replace(
"\n",
"", nl2br($item[
"description"]));
1626 $desc = str_replace(
"\r",
"", $desc);
1628 $this->tpl->setCurrentBlock(
"js_data");
1629 $this->tpl->setVariable(
"JS_DATA_ID", $item[
"id"]);
1630 $this->tpl->setVariable(
"JS_DATA_TEXT", $desc);
1631 $this->tpl->parseCurrentBlock();
1634 $this->tpl->setCurrentBlock(
"templates");
1635 $this->tpl->setVariable(
"TXT_TEMPLATE", $this->lng->txt(
"svy_settings_template"));
1636 $this->tpl->parseCurrentBlock();
1641 $form->setValuesByPost();
1642 $tpl->setContent($form->getHtml());
1657 $this->ctrl->setCmd(
"showSummary");
1658 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1672 if (!$this->external_rater_360) {
1678 $ilTabs->activateTab(
"info_short");
1683 $info->enablePrivateNotes();
1686 $is_appraisee =
false;
1689 if ($this->object->get360Mode() &&
1690 $this->object->isAppraisee(
$ilUser->getId())) {
1691 $is_appraisee =
true;
1693 $info->addSection($this->lng->txt(
"survey_360_appraisee_info"));
1695 $appr_data = $this->
object->getAppraiseesData();
1696 $appr_data = $appr_data[
$ilUser->getId()];
1697 $info->addProperty($this->lng->txt(
"survey_360_raters_status_info"), $appr_data[
"finished"]);
1699 if (!$appr_data[
"closed"]) {
1701 $button->setCaption(
"survey_360_appraisee_close_action");
1702 $button->setUrl($this->ctrl->getLinkTargetByClass(
"ilsurveyparticipantsgui",
"confirmappraiseeclose"));
1703 $close_button_360 =
'<div>' . $button->render() .
'</div>';
1705 $txt =
"survey_360_appraisee_close_action_info";
1706 if ($this->object->getSkillService()) {
1710 $this->lng->txt(
"status"),
1711 $close_button_360 . $this->lng->txt(
$txt)
1718 $this->lng->txt(
"status"),
1720 $this->lng->txt(
"survey_360_appraisee_close_action_status"),
1731 $code_input =
false;
1732 $anonymous_code =
$_POST[
"anonymous_id"];
1733 if ($anonymous_code) {
1736 if (!$this->object->checkSurveyCode($anonymous_code)) {
1737 $anonymous_code =
null;
1740 $this->
object->bindSurveyCodeToUser(
$ilUser->getId(), $anonymous_code);
1743 if ($anonymous_code) {
1744 $_SESSION[
"anonymous_id"][$this->
object->getId()] = $anonymous_code;
1746 $anonymous_code =
$_SESSION[
"anonymous_id"][$this->
object->getId()];
1747 if ($anonymous_code) {
1753 if ($this->object->getAnonymize() && !$anonymous_code) {
1754 $anonymous_code = $this->
object->findCodeForUser(
$ilUser->getId());
1758 $participant_status = $this->
object->getUserSurveyExecutionStatus($anonymous_code);
1759 if ($participant_status) {
1760 $anonymous_code = $participant_status[
"code"];
1761 $participant_status = $participant_status[
"runs"];
1765 if (!$this->object->isAccessibleWithoutCode() &&
1768 (!$anonymous_code || !$this->object->isAnonymousKey($anonymous_code))) {
1769 $anonymous_code =
null;
1774 $_SESSION[
"anonymous_id"][$this->
object->getId()] = $anonymous_code;
1776 $survey_started = $this->
object->isSurveyStarted(
$ilUser->getId(), $anonymous_code);
1778 $showButtons = $big_button =
false;
1781 if (!$this->object->get360Mode() &&
1782 ($survey_started === 1 &&
1783 !(!$this->object->isAccessibleWithoutCode() && !$anonymous_code &&
$ilUser->getId() == ANONYMOUS_USER_ID))) {
1786 if (
$ilUser->getId() != ANONYMOUS_USER_ID) {
1787 if ($this->object->hasViewOwnResults()) {
1789 $button->setCaption(
"svy_view_own_results");
1790 $button->setUrl($this->ctrl->getLinkTarget($this,
"viewUserResults"));
1791 $ilToolbar->addButtonInstance($button);
1795 if ($this->object->hasMailConfirmation()) {
1796 if ($this->object->hasViewOwnResults()) {
1797 $ilToolbar->addSeparator();
1800 if (
$ilUser->getId() == ANONYMOUS_USER_ID ||
1802 require_once
"Services/Form/classes/class.ilTextInputGUI.php";
1805 $mail->setValue(
$ilUser->getEmail());
1806 $ilToolbar->addInputItem($mail,
true);
1809 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"mailUserResults"));
1812 $button->setCaption(
"svy_mail_send_confirmation");
1813 $button->setCommand(
"mailUserResults");
1814 $ilToolbar->addButtonInstance($button);
1819 $canStart = $this->
object->canStartSurvey(
null, $this->external_rater_360);
1821 $showButtons = $canStart[
"result"];
1822 if (!$showButtons) {
1823 if ($canStart[
"edit_settings"] &&
1824 $ilAccess->checkAccess(
"write",
"", $this->ref_id)) {
1825 $canStart[
"messages"][] =
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"properties") .
"\">» " .
1826 $this->lng->txt(
"survey_edit_settings") .
"</a>";
1834 if (!$is_appraisee &&
1836 !$this->object->isAccessibleWithoutCode()) {
1837 $info->setFormAction($this->ctrl->getFormAction($this,
"infoScreen"));
1838 $info->addSection($this->lng->txt(
"anonymization"));
1839 $info->addProperty(
"", $this->lng->txt(
"anonymize_anonymous_introduction"));
1840 $info->addPropertyTextinput($this->lng->txt(
"enter_anonymous_id"),
"anonymous_id",
"", 8,
"infoScreen", $this->lng->txt(
"submit"),
true);
1843 if (!$this->object->get360Mode()) {
1844 if ($anonymous_code) {
1845 $info->addHiddenElement(
"anonymous_id", $anonymous_code);
1847 if ($survey_started === 0) {
1848 $big_button = array(
"resume", $this->lng->txt(
"resume_survey"));
1849 } elseif ($survey_started ===
false) {
1850 $big_button = array(
"start", $this->lng->txt(
"start_survey"));
1855 $appr_ids = array();
1858 if ($anonymous_code) {
1859 $anonymous_id = $this->
object->getAnonymousIdByCode($anonymous_code);
1860 if ($anonymous_id) {
1861 $appr_ids = $this->
object->getAppraiseesToRate(0, $anonymous_id);
1867 if (!$appr_ids &&
$ilUser->getId() != ANONYMOUS_USER_ID) {
1868 $appr_ids = $this->
object->getAppraiseesToRate(
$ilUser->getId());
1871 if (
sizeof($appr_ids)) {
1873 $active_appraisees = array();
1874 if ($participant_status) {
1875 foreach ($participant_status as $item) {
1876 $active_appraisees[$item[
"appr_id"]] = $item[
"finished"];
1882 foreach ($appr_ids as $appr_id) {
1883 if ($this->object->isAppraiseeClosed($appr_id)) {
1885 $list[$appr_id] = $this->lng->txt(
"survey_360_appraisee_is_closed");
1886 } elseif (array_key_exists($appr_id, $active_appraisees)) {
1888 if ($active_appraisees[$appr_id]) {
1889 $list[$appr_id] = $this->lng->txt(
"already_completed_survey");
1893 $list[$appr_id] = array(
"resume", $this->lng->txt(
"resume_survey"));
1897 $list[$appr_id] = array(
"start", $this->lng->txt(
"start_survey"));
1901 $info->addSection($this->lng->txt(
"survey_360_rate_other_appraisees"));
1903 foreach ($list as $appr_id => $item) {
1906 if (!is_array($item)) {
1907 $info->addProperty($appr_name, $item);
1909 $this->ctrl->setParameter($output_gui,
"appr_id", $appr_id);
1910 $href = $this->ctrl->getLinkTarget($output_gui, $item[0]);
1911 $this->ctrl->setParameter($output_gui,
"appr_id",
"");
1914 $button->setCaption($item[1],
false);
1915 $button->setUrl($href);
1916 $big_button_360 =
'<div>' . $button->render() .
'</div>';
1918 $info->addProperty($appr_name, $big_button_360);
1921 } elseif (!$is_appraisee) {
1927 if ($this->object->get360Mode() &&
1928 $this->object->get360SelfAppraisee() &&
1929 !$this->object->isAppraisee(
$ilUser->getId()) &&
1930 $ilUser->getId() != ANONYMOUS_USER_ID) {
1931 $link = $this->ctrl->getLinkTargetByClass(
"ilsurveyparticipantsgui",
"addSelfAppraisee");
1932 $link =
'<a href="' . $link .
'">' . $this->lng->txt(
"survey_360_add_self_appraisee") .
'</a>';
1933 $info->addProperty(
" ", $link);
1938 $ilToolbar->setFormAction($this->ctrl->getFormAction($output_gui,
"infoScreen"));
1941 $button->setCaption($big_button[1],
false);
1942 $button->setCommand($big_button[0]);
1943 $button->setPrimary(
true);
1944 $ilToolbar->addButtonInstance($button);
1946 $ilToolbar->setCloseFormTag(
false);
1947 $info->setOpenFormTag(
false);
1956 if (strlen($this->object->getIntroduction())) {
1957 $introduction = $this->
object->getIntroduction();
1958 $info->addSection($this->lng->txt(
"introduction"));
1959 $info->addProperty(
"", $this->object->prepareTextareaOutput($introduction) .
1960 "<br />" . $info->getHiddenToggleButton());
1962 $info->addSection(
"");
1963 $info->addProperty(
"", $info->getHiddenToggleButton());
1966 $info->hideFurtherSections(
false);
1968 if (!$this->object->get360Mode()) {
1969 $info->addSection($this->lng->txt(
"svy_general_properties"));
1972 $this->lng->txt(
"survey_results_anonymization"),
1973 !$this->object->hasAnonymizedResults()
1974 ? $this->lng->txt(
"survey_results_personalized_info")
1975 : $this->lng->txt(
"survey_results_anonymized_info")
1980 $info->addProperty($this->lng->txt(
"evaluation_access"), $this->lng->txt(
"evaluation_access_info"));
1984 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1986 $this->ctrl->forwardCommand($info);
1992 switch ($this->ctrl->getCmd()) {
1997 case "redirectQuestion":
1998 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
2001 case "checkEvaluationAccess":
2002 case "evaluationdetails":
2003 case "evaluationuser":
2004 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTargetByClass(
"ilsurveyevaluationgui",
"evaluation"),
"",
$_GET[
"ref_id"]);
2009 case "importSurvey":
2013 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
2016 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
2019 if ((
int)
$_GET[
"q_id"] && !(
int) $_REQUEST[
"new_for_survey"]) {
2022 $q_id = (int)
$_GET[
"q_id"];
2024 $this->ctrl->setParameterByClass($q_type,
"q_id", $q_id);
2025 $ilLocator->addItem(
2027 $this->ctrl->getLinkTargetByClass(array(
"ilSurveyEditorGUI", $q_type),
"editQuestion")
2041 public static function _goto($a_target, $a_access_code =
"")
2045 $ilAccess =
$DIC->access();
2049 if (strlen($a_access_code)) {
2051 $_GET[
"baseClass"] =
"ilObjSurveyGUI";
2052 $_GET[
"cmd"] =
"infoScreen";
2053 $_GET[
"ref_id"] = $a_target;
2054 include(
"ilias.php");
2058 if ($ilAccess->checkAccess(
"visible",
"", $a_target) ||
2059 $ilAccess->checkAccess(
"read",
"", $a_target)) {
2060 $_GET[
"baseClass"] =
"ilObjSurveyGUI";
2061 $_GET[
"cmd"] =
"infoScreen";
2062 $_GET[
"ref_id"] = $a_target;
2063 include(
"ilias.php");
2065 } elseif ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID)) {
2067 $lng->txt(
"msg_no_perm_read_item"),
2076 $rtpl =
new ilTemplate(
"tpl.svy_view_user_results.html",
true,
true,
"Modules/Survey");
2078 $show_titles = (bool) $this->object->getShowQuestionTitles();
2080 foreach ($this->object->getSurveyPages() as $page) {
2081 if (count($page) > 0) {
2083 if (count($page) > 1) {
2084 if ((
bool) $page[0][
"questionblock_show_blocktitle"]) {
2085 $rtpl->setVariable(
"BLOCK_TITLE", trim($page[0][
"questionblock_title"]));
2090 foreach ($page as $question) {
2091 $question_gui = $this->
object->getQuestionGUI($question[
"type_tag"], $question[
"question_id"]);
2092 if (is_object($question_gui)) {
2093 $rtpl->setCurrentBlock(
"question_bl");
2096 if (strlen($question[
"heading"])) {
2097 $rtpl->setVariable(
"HEADING", trim($question[
"heading"]));
2102 $question_gui->getPrintView(
2104 (
bool) $question[
"questionblock_show_questiontext"],
2105 $this->object->getId(),
2106 $this->object->loadWorkingData($question[
"question_id"], $a_active_id)
2110 $rtpl->parseCurrentBlock();
2114 $rtpl->setCurrentBlock(
"block_bl");
2115 $rtpl->parseCurrentBlock();
2119 return $rtpl->get();
2128 $anonymous_code =
$_SESSION[
"anonymous_id"][$this->
object->getId()];
2129 $active_id = $this->
object->getActiveID(
$ilUser->getId(), $anonymous_code, 0);
2130 if ($this->object->isSurveyStarted(
$ilUser->getId(), $anonymous_code) !== 1 ||
2132 $this->ctrl->redirect($this,
"infoScreen");
2135 $ilTabs->clearTargets();
2136 $ilTabs->setBackTarget(
2137 $this->lng->txt(
"btn_back"),
2138 $this->ctrl->getLinkTarget($this,
"infoScreen")
2142 $tpl->setContent($html);
2149 $show_titles = (bool) $this->object->getShowQuestionTitles();
2151 foreach ($this->object->getSurveyPages() as $page) {
2152 if (count($page) > 0) {
2153 $res[] =
"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
2156 if (count($page) > 1) {
2157 if ((
bool) $page[0][
"questionblock_show_blocktitle"]) {
2158 $res[$this->lng->txt(
"questionblock")] = trim($page[0][
"questionblock_title"]) .
"\n";
2164 $page_res = array();
2166 foreach ($page as $question) {
2167 $question_gui = $this->
object->getQuestionGUI($question[
"type_tag"], $question[
"question_id"]);
2168 if (is_object($question_gui)) {
2169 $question_parts = array();
2172 if (strlen($question[
"heading"])) {
2173 $question_parts[$this->lng->txt(
"heading")] = trim($question[
"heading"]);
2177 $question_parts[$this->lng->txt(
"title")] = trim($question[
"title"]);
2180 if ((
bool) $question[
"questionblock_show_questiontext"]) {
2181 $question_parts[$this->lng->txt(
"question")] = trim(strip_tags($question_gui->object->getQuestionText()));
2184 $answers = $question_gui->getParsedAnswers(
2185 $this->object->loadWorkingData($question[
"question_id"], $a_active_id),
2189 if (
sizeof($answers)) {
2191 if (
sizeof($answers) > 1 ||
2192 get_class($question_gui) ==
"SurveyTextQuestionGUI") {
2197 foreach ($answers as $answer) {
2199 if ($answer[
"textanswer"]) {
2200 $text =
' ("' . $answer[
"textanswer"] .
'")';
2202 if (!isset($answer[
"cols"])) {
2203 if (isset($answer[
"title"])) {
2204 $parts[] = $answer[
"title"] . $text;
2205 } elseif (isset($answer[
"value"])) {
2206 $parts[] = $answer[
"value"];
2208 $parts[] = substr($text, 2, -1);
2214 foreach ($answer[
"cols"] as $col) {
2215 $tmp[] = $col[
"title"];
2217 $parts[] = $answer[
"title"] .
": " . implode(
", ", $tmp) . $text;
2220 $question_parts[$this->lng->txt(
"answer")] =
2221 ($multiline ?
"\n" :
"") . implode(
"\n", $parts);
2225 foreach ($question_parts as
$type => $value) {
2226 $tmp[] =
$type .
": " . $value;
2228 $page_res[] = implode(
"\n", $tmp);
2232 $res[] = implode(
"\n\n-------------------------------\n\n", $page_res);
2236 $res[] =
"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
2238 return implode(
"\n",
$res);
2241 public function sendUserResultsMail($a_active_id, $a_recipient)
2245 $finished = $this->
object->getSurveyParticipants(array($a_active_id));
2246 $finished = array_pop($finished);
2249 require_once
"Services/Mail/classes/class.ilMail.php";
2250 require_once
"Services/Link/classes/class.ilLink.php";
2253 $body .= $this->lng->txt(
"svy_mail_own_results_body") .
"\n";
2254 $body .=
"\n" . $this->lng->txt(
"obj_svy") .
": " . $this->
object->getTitle() .
"\n";
2256 $body .=
"\n" . $this->lng->txt(
"survey_results_finished") .
": " . $finished .
"\n\n";
2258 if ($this->object->hasMailOwnResults()) {
2259 $subject =
"svy_mail_own_results_subject";
2262 $subject =
"svy_mail_confirmation_subject";
2269 $senderFactory =
$GLOBALS[
"DIC"][
"mail.mime.sender.factory"];
2272 $mmail->From($senderFactory->system());
2273 $mmail->To($a_recipient);
2274 $mmail->Subject(sprintf($this->lng->txt($subject), $this->object->getTitle()),
true);
2275 $mmail->Body($body);
2283 $anonymous_code =
$_SESSION[
"anonymous_id"][$this->
object->getId()];
2284 $active_id = $this->
object->getActiveID(
$ilUser->getId(), $anonymous_code, 0);
2285 if ($this->object->isSurveyStarted(
$ilUser->getId(), $anonymous_code) !== 1 ||
2287 $this->ctrl->redirect($this,
"infoScreen");
2290 $recipient =
$_POST[
"mail"];
2292 $recipient =
$ilUser->getEmail();
2295 $this->ctrl->redirect($this,
"infoScreen");
2298 $this->sendUserResultsMail($active_id, $recipient);
2300 ilUtil::sendSuccess($this->lng->txt(
"mail_sent"),
true);
2301 $this->ctrl->redirect($this,
"infoScreen");
2313 return $access->checkRbacOrPositionPermissionAccess(
2315 $a_position_permission,
2316 $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