4include_once
"./Services/Object/classes/class.ilObjectGUI.php";
55 $this->lng =
$DIC->language();
56 $this->nav_history =
$DIC[
"ilNavigationHistory"];
57 $this->tabs =
$DIC->tabs();
58 $this->
user = $DIC->user();
59 $this->help =
$DIC[
"ilHelp"];
60 $this->rbacsystem =
$DIC->rbac()->system();
61 $this->tree =
$DIC->repositoryTree();
62 $this->tpl =
$DIC[
"tpl"];
63 $this->toolbar =
$DIC->toolbar();
64 $this->access =
$DIC->access();
65 $this->locator =
$DIC[
"ilLocator"];
70 $lng->loadLanguageModule(
"survey");
71 $lng->loadLanguageModule(
"svy");
73 $this->ctrl->saveParameter($this,
"ref_id");
77 parent::__construct(
"", (
int)
$_GET[
"ref_id"],
true,
false);
85 $this->external_rater_360 =
false;
86 if (!$this->creation_mode &&
87 $this->object->get360Mode() &&
88 $_SESSION[
"anonymous_id"][$this->object->getId()] &&
90 $this->object->getRefId(),
91 $_SESSION[
"anonymous_id"][$this->object->getId()]
93 $this->external_rater_360 =
true;
96 if (!$this->external_rater_360) {
105 $this->ctrl->setParameterByClass(
"ilobjsurveygui",
"ref_id", $this->ref_id);
106 $link = $this->ctrl->getLinkTargetByClass(
"ilobjsurveygui",
"");
107 $ilNavigationHistory->addItem($this->ref_id, $link,
"svy");
111 $cmd = $this->ctrl->getCmd(
"properties");
114 if ($cmd ==
"saveTags") {
115 $this->ctrl->setCmdClass(
"ilinfoscreengui");
119 if (!$this->ctrl->getCmdClass() && $cmd ==
"questionsrepo") {
120 $_REQUEST[
"pgov"] = 1;
121 $this->ctrl->setCmd(
"questions");
122 $this->ctrl->setCmdClass(
"ilsurveyeditorgui");
125 $next_class = $this->ctrl->getNextClass($this);
126 $this->ctrl->setReturn($this,
"properties");
130 $this->log->debug(
"next_class= $next_class");
131 switch ($next_class) {
132 case 'illtiproviderobjectsettinggui':
134 $ilTabs->activateTab(
"settings");
135 $ilTabs->activateSubTab(
'lti_provider');
137 $lti_gui->setCustomRolesForSelection(
$GLOBALS[
'DIC']->rbac()->review()->getLocalRoles($this->object->getRefId()));
138 $lti_gui->offerLTIRolesForSelection(
false);
139 $this->ctrl->forwardCommand($lti_gui);
143 case "ilinfoscreengui":
145 $this->ctrl->getCmdClass(),
146 array(
'ilpublicuserprofilegui',
'ilobjportfoliogui')
152 $ilTabs->clearTargets();
153 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
155 $this->ctrl->forwardCommand(
$info);
159 case 'ilobjectmetadatagui':
161 $ilTabs->activateTab(
"meta_data");
163 include_once
'Services/Object/classes/class.ilObjectMetaDataGUI.php';
165 $this->ctrl->forwardCommand($md_gui);
168 case "ilsurveyevaluationgui":
169 $ilTabs->activateTab(
"svy_results");
171 include_once(
"./Modules/Survey/classes/class.ilSurveyEvaluationGUI.php");
173 $this->ctrl->forwardCommand($eval_gui);
176 case "ilsurveyexecutiongui":
177 $ilTabs->clearTargets();
178 include_once(
"./Modules/Survey/classes/class.ilSurveyExecutionGUI.php");
180 $this->ctrl->forwardCommand($exec_gui);
183 case 'ilpermissiongui':
184 $ilTabs->activateTab(
"perm_settings");
186 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
188 $this->ctrl->forwardCommand($perm_gui);
191 case 'ilobjectcopygui':
192 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
195 $this->ctrl->forwardCommand($cp);
198 case "ilcommonactiondispatchergui":
199 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
201 $this->ctrl->forwardCommand($gui);
205 case 'ilsurveyskillgui':
206 $ilTabs->activateTab(
"survey_competences");
207 include_once(
"./Modules/Survey/classes/class.ilSurveySkillGUI.php");
209 $this->ctrl->forwardCommand($gui);
212 case 'ilsurveyskilldeterminationgui':
213 $ilTabs->activateTab(
"maintenance");
214 include_once(
"./Modules/Survey/classes/class.ilSurveySkillDeterminationGUI.php");
216 $this->ctrl->forwardCommand($gui);
219 case 'ilsurveyeditorgui':
221 $ilTabs->activateTab(
"survey_questions");
222 include_once(
"./Modules/Survey/classes/class.ilSurveyEditorGUI.php");
224 $this->ctrl->forwardCommand($gui);
227 case 'ilsurveyconstraintsgui':
229 $ilTabs->activateTab(
"constraints");
230 include_once(
"./Modules/Survey/classes/class.ilSurveyConstraintsGUI.php");
232 $this->ctrl->forwardCommand($gui);
235 case 'ilsurveyparticipantsgui':
236 if (!$this->object->get360Mode()) {
237 $ilTabs->activateTab(
"maintenance");
239 $ilTabs->activateTab(
"survey_360_appraisees");
241 include_once(
"./Modules/Survey/classes/class.ilSurveyParticipantsGUI.php");
243 $this->ctrl->forwardCommand($gui);
246 case "illearningprogressgui":
247 $ilTabs->activateTab(
"learning_progress");
248 include_once(
"./Services/Tracking/classes/class.ilLearningProgressGUI.php");
251 $this->object->getRefId()
253 $this->ctrl->forwardCommand($new_gui);
257 $ilTabs->activateTab(
"export");
258 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
260 $exp_gui->addFormat(
"xml");
261 $this->ctrl->forwardCommand($exp_gui);
268 $this->log->debug(
"Default cmd= $cmd");
274 if (strtolower(
$_GET[
"baseClass"]) !=
"iladministrationgui" &&
289 include_once(
"./Modules/Survey/classes/class.ilSurveyEvaluationGUI.php");
291 $this->ctrl->setCmdClass(get_class($eval_gui));
292 $this->ctrl->redirect($eval_gui,
"evaluation");
297 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
300 foreach ($templates as $item) {
301 $a_options[
"svytpl_" . $item[
"id"]] = array($item[
"title"],
302 nl2br(trim($item[
"description"])));
307 $a_options[
"svy360_1"] = array($this->lng->txt(
"survey_360_mode"),
308 $this->lng->txt(
"survey_360_mode_info"));
318 $a_new_object->loadFromDb();
322 $a_new_object->applySettingsTemplate(
$tpl);
326 if ($a_new_object->get360Mode()) {
331 $a_new_object->saveToDB();
336 $a_new_object->
getRefId() .
"&cmd=properties");
353 $ilHelp->setScreenIdComponent(
"svy");
355 $hidden_tabs = array();
356 $template = $this->
object->getTemplate();
358 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
360 $hidden_tabs =
$template->getHiddenTabs();
364 $this->tabs_gui->addTab(
366 $this->lng->txt(
"survey_questions"),
367 $this->ctrl->getLinkTargetByClass(array(
"ilsurveyeditorgui",
"ilsurveypagegui"),
"renderPage")
372 $this->tabs_gui->addTab(
374 $this->lng->txt(
"info_short"),
375 $this->ctrl->getLinkTarget($this,
'infoScreen')
381 $this->tabs_gui->addTab(
383 $this->lng->txt(
"settings"),
384 $this->ctrl->getLinkTarget($this,
'properties')
387 if ($this->object->get360Mode() &&
388 $this->object->get360SelfRaters() &&
389 $this->object->isAppraisee(
$ilUser->getId()) &&
390 !$this->object->isAppraiseeClosed(
$ilUser->getId())) {
391 $this->tabs_gui->addTab(
392 "survey_360_edit_raters",
393 $this->lng->txt(
"survey_360_edit_raters"),
394 $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui',
'editRaters')
403 !in_array(
"constraints", $hidden_tabs) &&
404 !$this->object->get360Mode()) {
406 $this->tabs_gui->addTab(
408 $this->lng->txt(
"constraints"),
409 $this->ctrl->getLinkTargetByClass(
"ilsurveyconstraintsgui",
"constraints")
415 if ($this->object->get360Mode()) {
417 include_once(
"./Services/Skill/classes/class.ilSkillManagementSettings.php");
419 if ($this->object->get360SkillService() && $skmg_set->isActivated()) {
420 $this->tabs_gui->addTab(
421 "survey_competences",
422 $this->lng->txt(
"survey_competences"),
423 $this->ctrl->getLinkTargetByClass(
"ilsurveyskillgui",
"listQuestionAssignment")
427 $this->tabs_gui->addTab(
428 "survey_360_appraisees",
429 $this->lng->txt(
"survey_360_appraisees"),
430 $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui',
'listAppraisees')
434 $this->tabs_gui->addTab(
436 $this->lng->txt(
"maintenance"),
437 $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui',
'maintenance')
442 include_once
"./Modules/Survey/classes/class.ilObjSurveyAccess.php";
446 $this->tabs_gui->addTab(
448 $this->lng->txt(
"svy_results"),
449 $this->ctrl->getLinkTargetByClass(
"ilsurveyevaluationgui",
"evaluation")
454 include_once
"./Services/Tracking/classes/class.ilLearningProgressAccess.php";
456 $this->tabs_gui->addTarget(
458 $this->ctrl->getLinkTargetByClass(array(
"ilobjsurveygui",
"illearningprogressgui"),
""),
460 array(
"illplistofobjectsgui",
"illplistofsettingsgui",
"illearningprogressgui",
"illplistofprogressgui")
465 if (!in_array(
"meta_data", $hidden_tabs)) {
467 include_once
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
469 $mdtab = $mdgui->getTab();
471 $this->tabs_gui->addTab(
473 $this->lng->txt(
"meta_data"),
479 if (!in_array(
"export", $hidden_tabs)) {
481 $this->tabs_gui->addTab(
483 $this->lng->txt(
"export"),
484 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
491 $this->tabs_gui->addTab(
493 $this->lng->txt(
"perm_settings"),
494 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm")
516 if (
$form->checkInput()) {
519 if (!$this->object->get360Mode()) {
520 if (
$form->getInput(
"tut")) {
523 $tut_logins =
$form->getInput(
"tut_ids");
524 foreach ($tut_logins as $tut_login) {
526 if ($tut_id &&
$rbacsystem->checkAccessOfUser($tut_id,
"write", $this->object->getRefId())) {
527 $tut_ids[] = $tut_id;
531 $tut_ids =
$form->getItemByPostVar(
"tut_ids");
532 $tut_ids->setAlert($this->lng->txt(
"survey_notification_tutor_recipients_invalid"));
539 if (
$form->getInput(
"rmd")) {
540 $rmd_start =
$form->getItemByPostVar(
"rmd_start")->getDate();
541 $rmd_end =
$form->getItemByPostVar(
"rmd_end")->getDate();
545 $rmd_start = $rmd_end;
549 $this->
object->setReminderStatus(
true);
550 $this->
object->setReminderStart($rmd_start);
551 $this->
object->setReminderEnd($rmd_end);
552 $this->
object->setReminderFrequency(
$form->getInput(
"rmd_freq"));
553 if (!$this->object->get360Mode()) {
554 $this->
object->setReminderTarget(
$form->getInput(
"rmd_grp"));
555 $this->
object->setReminderTemplate((
$form->getInput(
"rmdt") > 0)
556 ?
$form->getInput(
"rmdt")
559 if (
$form->getInput(
"remind_appraisees") &&
$form->getInput(
"remind_raters")) {
561 } elseif (
$form->getInput(
"remind_appraisees")) {
563 } elseif (
$form->getInput(
"remind_raters")) {
566 $this->
object->setReminderTarget(0);
570 $this->
object->setReminderStatus(
false);
573 if (!$this->object->get360Mode()) {
574 if (
$form->getInput(
"tut")) {
575 $this->
object->setTutorNotificationStatus(
true);
576 $this->
object->setTutorNotificationRecipients($tut_ids);
577 $this->
object->setTutorNotificationTarget(
$form->getInput(
"tut_grp"));
579 $this->
object->setTutorNotificationStatus(
false);
584 if (
$_POST[
'online'] && count($this->object->questions) == 0) {
589 $template_settings =
null;
590 $template = $this->
object->getTemplate();
592 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
594 $template_settings =
$template->getSettings();
597 include_once
'Services/MetaData/classes/class.ilMD.php';
598 $md_obj =
new ilMD($this->object->getId(), 0,
"svy");
599 $md_section = $md_obj->getGeneral();
603 $md_section->update();
606 $md_desc_ids = $md_section->getDescriptionIds();
608 $md_desc = $md_section->getDescription(array_pop($md_desc_ids));
613 $this->
object->setViewOwnResults(
$_POST[
"view_own"]);
614 $this->
object->setMailOwnResults(
$_POST[
"mail_own"]);
615 $this->
object->setMailConfirmation(
$_POST[
"mail_confirm"]);
620 $this->
object->update();
622 $this->
object->setStatus(
$_POST[
'online']);
625 $period =
$form->getItemByPostVar(
"access_period");
626 if ($period->getStart() && $period->getEnd()) {
627 $this->
object->setActivationLimited(
true);
628 $this->
object->setActivationVisibility(
$_POST[
"access_visiblity"]);
629 $this->
object->setActivationStartDate($period->getStart()->get(
IL_CAL_UNIX));
630 $this->
object->setActivationEndDate($period->getEnd()->get(
IL_CAL_UNIX));
632 $this->
object->setActivationLimited(
false);
635 if (!$template_settings[
"enabled_start_date"][
"hide"]) {
636 $start =
$form->getItemByPostVar(
"start_date");
637 if ($start->getDate()) {
639 $this->
object->setStartDateAndTime($datetime[0], $datetime[1]);
641 $this->
object->setStartDate(
null);
645 if (!$template_settings[
"enabled_end_date"][
"hide"]) {
646 $end =
$form->getItemByPostVar(
"end_date");
647 if (
$end->getDate()) {
649 $this->
object->setEndDateAndTime($datetime[0], $datetime[1]);
651 $this->
object->setEndDate(
null);
656 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
657 $introduction =
$_POST[
"introduction"];
658 $this->
object->setIntroduction($introduction);
660 $this->
object->setOutro($outro);
662 if (!$template_settings[
"show_question_titles"][
"hide"]) {
663 $this->
object->setShowQuestionTitles(
$_POST[
"show_question_titles"]);
666 if (!$template_settings[
"use_pool"][
"hide"]) {
667 $this->
object->setPoolUsage(
$_POST[
"use_pool"]);
670 $this->
object->setMailNotification(
$_POST[
'mailnotification']);
671 $this->
object->setMailAddresses(
$_POST[
'mailaddresses']);
672 $this->
object->setMailParticipantData(
$_POST[
'mailparticipantdata']);
675 if ($this->object->get360Mode()) {
676 $this->
object->set360SelfEvaluation((
bool)
$_POST[
"self_eval"]);
677 $this->
object->set360SelfAppraisee((
bool) $_POST[
"self_appr"]);
678 $this->
object->set360SelfRaters((
bool) $_POST[
"self_rate"]);
679 $this->
object->set360Results((
int) $_POST[
"ts_res"]);
681 $this->
object->set360SkillService((
int) $_POST[
"skill_service"]);
683 if (!$template_settings[
"evaluation_access"][
"hide"]) {
684 $this->
object->setEvaluationAccess(
$_POST[
"evaluation_access"]);
689 $hide_codes = $template_settings[
"acc_codes"][
"hide"];
690 $hide_anon = $template_settings[
"anonymization_options"][
"hide"];
691 if (!$hide_codes || !$hide_anon) {
692 $current = $this->
object->getAnonymize();
696 $codes = (bool)
$_POST[
"acc_codes"];
702 $anon = ((string)
$_POST[
"anonymization_options"] ==
"statanon");
722 $this->
object->setAnonymousUserList(
$_POST[
"anon_list"]);
726 unset(
$_SESSION[
"anonymous_id"][$this->object->getId()]);
731 $this->
object->saveToDb();
733 if (strcmp(
$_SESSION[
"info"],
"") != 0) {
738 $this->ctrl->redirect($this,
"properties");
745 $form->setValuesByPost();
756 $template_settings = $hide_rte_switch =
null;
757 $template = $this->
object->getTemplate();
759 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
762 $template_settings =
$template->getSettings();
763 $hide_rte_switch = $template_settings[
"rte_switch"][
"hide"];
766 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
768 $form->setFormAction($this->ctrl->getFormAction($this));
769 $form->setTableWidth(
"100%");
770 $form->setId(
"survey_properties");
774 $header->setTitle($this->lng->txt(
"settings"));
780 include_once
'Services/MetaData/classes/class.ilMD.php';
781 $md_obj =
new ilMD($this->object->getId(), 0,
"svy");
782 $md_section = $md_obj->getGeneral();
785 $title->setRequired(
true);
786 $title->setValue($md_section->getTitle());
789 $ids = $md_section->getDescriptionIds();
791 $desc_obj = $md_section->getDescription(array_pop($ids));
796 $desc->setValue($desc_obj->getDescription());
797 $form->addItem($desc);
801 $pool_usage =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_question_pool_usage"),
"use_pool");
802 $opt =
new ilRadioOption($this->lng->txt(
"survey_question_pool_usage_active"), 1);
803 $opt->setInfo($this->lng->txt(
"survey_question_pool_usage_active_info"));
804 $pool_usage->addOption($opt);
805 $opt =
new ilRadioOption($this->lng->txt(
"survey_question_pool_usage_inactive"), 0);
806 $opt->setInfo($this->lng->txt(
"survey_question_pool_usage_inactive_info"));
807 $pool_usage->addOption($opt);
808 $pool_usage->setValue($this->object->getPoolUsage());
809 $form->addItem($pool_usage);
812 if ($this->object->get360Mode()) {
813 $self_eval =
new ilCheckboxInputGUI($this->lng->txt(
"survey_360_self_evaluation"),
"self_eval");
814 $self_eval->setInfo($this->lng->txt(
"survey_360_self_evaluation_info"));
815 $self_eval->setChecked($this->object->get360SelfEvaluation());
816 $form->addItem($self_eval);
818 $self_rate =
new ilCheckboxInputGUI($this->lng->txt(
"survey_360_self_raters"),
"self_rate");
819 $self_rate->setInfo($this->lng->txt(
"survey_360_self_raters_info"));
820 $self_rate->setChecked($this->object->get360SelfRaters());
821 $form->addItem($self_rate);
823 $self_appr =
new ilCheckboxInputGUI($this->lng->txt(
"survey_360_self_appraisee"),
"self_appr");
824 $self_appr->setInfo($this->lng->txt(
"survey_360_self_appraisee_info"));
825 $self_appr->setChecked($this->object->get360SelfAppraisee());
826 $form->addItem($self_appr);
832 include_once
"Services/Object/classes/class.ilObjectActivation.php";
833 $this->lng->loadLanguageModule(
'rep');
836 $section->setTitle($this->lng->txt(
'rep_activation_availability'));
840 $act_obj_info = $act_ref_info =
"";
842 $act_obj_info =
' ' . $this->lng->txt(
'rep_activation_online_object_info');
843 $act_ref_info = $this->lng->txt(
'rep_activation_access_ref_info');
847 $online->setInfo($this->lng->txt(
'svy_activation_online_info') . $act_obj_info);
848 $online->setChecked($this->object->isOnline());
849 $form->addItem($online);
851 include_once
"Services/Form/classes/class.ilDateDurationInputGUI.php";
853 $dur->setShowTime(
true);
854 $date = $this->
object->getActivationStartDate();
858 $date = $this->
object->getActivationEndDate();
862 $form->addItem($dur);
864 $visible =
new ilCheckboxInputGUI($this->lng->txt(
'rep_activation_limited_visibility'),
'access_visiblity');
865 $visible->setInfo($this->lng->txt(
'svy_activation_limited_visibility_info'));
866 $visible->setChecked($this->object->getActivationVisibility());
867 $dur->addSubItem($visible);
873 $section->setTitle($this->lng->txt(
'svy_settings_section_before_start'));
878 $intro->setValue($this->object->prepareTextareaOutput($this->object->getIntroduction()));
881 $intro->setUseRte(
true);
882 $intro->setInfo($this->lng->txt(
"survey_introduction_info"));
883 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
885 $intro->addPlugin(
"latex");
886 $intro->addButton(
"latex");
887 $intro->addButton(
"pastelatex");
888 $intro->setRTESupport($this->object->getId(),
"svy",
"survey",
null, $hide_rte_switch);
889 $form->addItem($intro);
895 $section->setTitle($this->lng->txt(
'svy_settings_section_access'));
899 $start = $this->
object->getStartDate();
902 $startingtime->setShowTime(
true);
906 $form->addItem($startingtime);
909 $end = $this->
object->getEndDate();
912 $endingtime->setShowTime(
true);
916 $form->addItem($endingtime);
919 if (!$this->object->get360Mode()) {
921 $codes->setInfo($this->lng->txt(
"survey_access_codes_info"));
922 $codes->setChecked(!$this->object->isAccessibleWithoutCode());
923 $form->addItem($codes);
926 $codes->setDisabled(
true);
934 $section->setTitle($this->lng->txt(
'svy_settings_section_question_behaviour'));
938 $show_question_titles =
new ilCheckboxInputGUI($this->lng->txt(
"svy_show_questiontitles"),
"show_question_titles");
939 $show_question_titles->setValue(1);
940 $show_question_titles->setChecked($this->object->getShowQuestionTitles());
941 $form->addItem($show_question_titles);
947 $info->setTitle($this->lng->txt(
"svy_settings_section_finishing"));
950 $view_own =
new ilCheckboxInputGUI($this->lng->txt(
"svy_results_view_own"),
"view_own");
951 $view_own->setInfo($this->lng->txt(
"svy_results_view_own_info"));
952 $view_own->setChecked($this->object->hasViewOwnResults());
953 $form->addItem($view_own);
955 $mail_confirm =
new ilCheckboxInputGUI($this->lng->txt(
"svy_results_mail_confirm"),
"mail_confirm");
956 $mail_confirm->setInfo($this->lng->txt(
"svy_results_mail_confirm_info"));
957 $mail_confirm->setChecked($this->object->hasMailConfirmation());
958 $form->addItem($mail_confirm);
960 $mail_own =
new ilCheckboxInputGUI($this->lng->txt(
"svy_results_mail_own"),
"mail_own");
961 $mail_own->setInfo($this->lng->txt(
"svy_results_mail_own_info"));
962 $mail_own->setChecked($this->object->hasMailOwnResults());
963 $mail_confirm->addSubItem($mail_own);
967 $finalstatement->setValue($this->object->prepareTextareaOutput($this->object->getOutro()));
968 $finalstatement->setRows(10);
969 $finalstatement->setCols(80);
970 $finalstatement->setUseRte(
true);
972 $finalstatement->addPlugin(
"latex");
973 $finalstatement->addButton(
"latex");
974 $finalstatement->addButton(
"pastelatex");
975 $finalstatement->setRTESupport($this->object->getId(),
"svy",
"survey",
null, $hide_rte_switch);
976 $form->addItem($finalstatement);
979 $mailnotification =
new ilCheckboxInputGUI($this->lng->txt(
"mailnotification"),
"mailnotification");
981 $mailnotification->setInfo($this->lng->txt(
"svy_result_mail_notification_info"));
982 $mailnotification->setValue(1);
983 $mailnotification->setChecked($this->object->getMailNotification());
986 $mailaddresses =
new ilTextInputGUI($this->lng->txt(
"mailaddresses"),
"mailaddresses");
987 $mailaddresses->setValue($this->object->getMailAddresses());
988 $mailaddresses->setSize(80);
989 $mailaddresses->setInfo($this->lng->txt(
'mailaddresses_info'));
990 $mailaddresses->setRequired(
true);
993 $participantdata =
new ilTextAreaInputGUI($this->lng->txt(
"mailparticipantdata"),
"mailparticipantdata");
994 $participantdata->setValue($this->object->getMailParticipantData());
995 $participantdata->setRows(6);
996 $participantdata->setCols(80);
997 $participantdata->setUseRte(
false);
998 $participantdata->setInfo($this->lng->txt(
"mailparticipantdata_info"));
1001 $placeholders = array(
1002 "FIRST_NAME" =>
"firstname",
1003 "LAST_NAME" =>
"lastname",
1007 foreach ($placeholders as $placeholder => $caption) {
1008 $txt[] =
"[" . strtoupper($placeholder) .
"]: " . $this->lng->txt($caption);
1011 $participantdatainfo =
new ilNonEditableValueGUI($this->lng->txt(
"mailparticipantdata_placeholder"),
"",
true);
1012 $participantdatainfo->setValue(
$txt);
1014 $mailnotification->addSubItem($mailaddresses);
1015 $mailnotification->addSubItem($participantdata);
1016 $mailnotification->addSubItem($participantdatainfo);
1017 $form->addItem($mailnotification);
1020 if (!$this->object->get360Mode()) {
1023 $has_parent =
$tree->checkForParentType($this->object->getRefId(),
"grp");
1025 $has_parent =
$tree->checkForParentType($this->object->getRefId(),
"crs");
1027 $num_inv =
sizeof($this->
object->getInvitedUsers());
1030 $tut =
new ilCheckboxInputGUI($this->lng->txt(
"survey_notification_tutor_setting"),
"tut");
1031 $tut->setChecked($this->object->getTutorNotificationStatus());
1032 $form->addItem($tut);
1034 $tut_logins = array();
1035 $tuts = $this->
object->getTutorNotificationRecipients();
1037 foreach ($tuts as $tut_id) {
1039 if ($tmp[
"login"]) {
1040 $tut_logins[] = $tmp[
"login"];
1044 $tut_ids =
new ilTextInputGUI($this->lng->txt(
"survey_notification_tutor_recipients"),
"tut_ids");
1045 $tut_ids->setDataSource($this->ctrl->getLinkTarget($this,
"doAutoComplete",
"",
true));
1046 $tut_ids->setRequired(
true);
1047 $tut_ids->setMulti(
true);
1048 $tut_ids->setMultiValues($tut_logins);
1049 $tut_ids->setValue(array_shift($tut_logins));
1050 $tut->addSubItem($tut_ids);
1052 $tut_grp =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_notification_target_group"),
"tut_grp");
1053 $tut_grp->setRequired(
true);
1054 $tut_grp->setValue($this->object->getTutorNotificationTarget());
1055 $tut->addSubItem($tut_grp);
1058 $this->lng->txt(
"survey_notification_target_group_parent_course"),
1062 $tut_grp_crs->setInfo($this->lng->txt(
"survey_notification_target_group_parent_course_inactive"));
1064 $tut_grp_crs->setInfo(
sprintf(
1065 $this->lng->txt(
"survey_notification_target_group_invited_info"),
1066 count($this->object->getNotificationTargetUserIds(
false))
1069 $tut_grp->addOption($tut_grp_crs);
1072 $this->lng->txt(
"survey_notification_target_group_invited"),
1075 $tut_grp_inv->setInfo(
sprintf($this->lng->txt(
"survey_notification_target_group_invited_info"), $num_inv));
1076 $tut_grp->addOption($tut_grp_inv);
1083 $info->setTitle($this->lng->txt(
"svy_settings_section_reminders"));
1087 $rmd->setChecked($this->object->getReminderStatus());
1088 $form->addItem($rmd);
1090 $rmd_start =
new ilDateTimeInputGUI($this->lng->txt(
"survey_reminder_start"),
"rmd_start");
1091 $rmd_start->setRequired(
true);
1092 $start = $this->
object->getReminderStart();
1094 $rmd_start->setDate($start);
1096 $rmd->addSubItem($rmd_start);
1098 $end = $this->
object->getReminderEnd();
1099 $rmd_end =
new ilDateTimeInputGUI($this->lng->txt(
"survey_reminder_end"),
"rmd_end");
1101 $rmd_end->setDate(
$end);
1103 $rmd->addSubItem($rmd_end);
1105 $rmd_freq =
new ilNumberInputGUI($this->lng->txt(
"survey_reminder_frequency"),
"rmd_freq");
1106 $rmd_freq->setRequired(
true);
1107 $rmd_freq->setSize(3);
1108 $rmd_freq->setSuffix($this->lng->txt(
"survey_reminder_frequency_days"));
1109 $rmd_freq->setValue($this->object->getReminderFrequency());
1110 $rmd_freq->setMinValue(1);
1111 $rmd->addSubItem($rmd_freq);
1114 if (!$this->object->get360Mode()) {
1115 $rmd_grp =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_notification_target_group"),
"rmd_grp");
1116 $rmd_grp->setRequired(
true);
1117 $rmd_grp->setValue($this->object->getReminderTarget());
1118 $rmd->addSubItem($rmd_grp);
1121 $this->lng->txt(
"survey_notification_target_group_parent_course"),
1125 $rmd_grp_crs->setInfo($this->lng->txt(
"survey_notification_target_group_parent_course_inactive"));
1127 $rmd_grp_crs->setInfo(
sprintf(
1128 $this->lng->txt(
"survey_notification_target_group_invited_info"),
1129 count($this->object->getNotificationTargetUserIds(
false))
1132 $rmd_grp->addOption($rmd_grp_crs);
1135 $this->lng->txt(
"survey_notification_target_group_invited"),
1138 $rmd_grp_inv->setInfo(
sprintf($this->lng->txt(
"survey_notification_target_group_invited_info"), $num_inv));
1139 $rmd_grp->addOption($rmd_grp_inv);
1141 $mtmpl = $this->
object->getReminderMailTemplates();
1144 $rmdt->setRequired(
true);
1145 $rmdt->addOption(
new ilRadioOption($this->lng->txt(
"svy_reminder_mail_template_none"), -1));
1146 foreach ($mtmpl as $mtmpl_id => $mtmpl_caption) {
1148 $rmdt->addOption($option);
1150 $rmdt->setValue($this->object->getReminderTemplate()
1151 ? $this->object->getReminderTemplate()
1153 $rmd->addSubItem($rmdt);
1157 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"survey_notification_target_group"),
"remind_appraisees");
1158 $cb->setOptionTitle($this->lng->txt(
"survey_360_appraisees"));
1159 $cb->setInfo($this->lng->txt(
"survey_360_appraisees_remind_info"));
1161 $cb->setChecked(in_array(
1162 $this->object->getReminderTarget(),
1165 $rmd->addSubItem($cb);
1169 $cb->setOptionTitle($this->lng->txt(
"survey_360_raters"));
1170 $cb->setInfo($this->lng->txt(
"survey_360_raters_remind_info"));
1172 $cb->setChecked(in_array(
1173 $this->object->getReminderTarget(),
1176 $rmd->addSubItem($cb);
1183 $results->setTitle($this->lng->txt(
"results"));
1187 if (!$this->object->get360Mode()) {
1188 $evaluation_access =
new ilRadioGroupInputGUI($this->lng->txt(
'evaluation_access'),
"evaluation_access");
1191 $option->setInfo($this->lng->txt(
"svy_evaluation_access_off_info"));
1192 $evaluation_access->addOption($option);
1195 $option->setInfo($this->lng->txt(
"svy_evaluation_access_all_info"));
1196 $evaluation_access->addOption($option);
1199 $option->setInfo($this->lng->txt(
"svy_evaluation_access_participants_info"));
1200 $evaluation_access->addOption($option);
1202 $evaluation_access->setValue($this->object->getEvaluationAccess());
1203 $form->addItem($evaluation_access);
1206 $anonymization_options =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_results_anonymization"),
"anonymization_options");
1208 $option =
new ilCheckboxOption($this->lng->txt(
"survey_results_personalized"),
"statpers");
1209 $option->setInfo($this->lng->txt(
"survey_results_personalized_info"));
1210 $anonymization_options->addOption($option);
1212 $option =
new ilCheckboxOption($this->lng->txt(
"survey_results_anonymized"),
"statanon");
1213 $option->setInfo($this->lng->txt(
"survey_results_anonymized_info"));
1214 $anonymization_options->addOption($option);
1215 $anonymization_options->setValue($this->object->hasAnonymizedResults()
1218 $form->addItem($anonymization_options);
1220 $surveySetting =
new ilSetting(
"survey");
1221 if ($surveySetting->get(
"anonymous_participants",
false)) {
1223 if ($surveySetting->get(
"anonymous_participants_min", 0)) {
1224 $min =
" (" . $this->lng->txt(
"svy_anonymous_participants_min") .
": " .
1225 $surveySetting->get(
"anonymous_participants_min") .
")";
1228 $anon_list =
new ilCheckboxInputGUI($this->lng->txt(
"svy_anonymous_participants_svy"),
"anon_list");
1229 $anon_list->setInfo($this->lng->txt(
"svy_anonymous_participants_svy_info") . $min);
1230 $anon_list->setChecked($this->object->hasAnonymousUserList());
1231 $option->addSubItem($anon_list);
1234 if ($this->object->_hasDatasets($this->object->getSurveyId())) {
1235 $anonymization_options->setDisabled(
true);
1237 $anon_list->setDisabled(
true);
1244 $ts_results->setValue($this->object->get360Results());
1247 $option->setInfo($this->lng->txt(
"survey_360_results_none_info"));
1248 $ts_results->addOption($option);
1251 $option->setInfo($this->lng->txt(
"survey_360_results_own_info"));
1252 $ts_results->addOption($option);
1255 $option->setInfo($this->lng->txt(
"survey_360_results_all_info"));
1256 $ts_results->addOption($option);
1257 $form->addItem($ts_results);
1263 include_once(
"./Services/Skill/classes/class.ilSkillManagementSettings.php");
1265 if ($this->object->get360Mode() && $skmg_set->isActivated()) {
1267 $other->setTitle($this->lng->txt(
"other"));
1268 $form->addItem($other);
1270 $skill_service =
new ilCheckboxInputGUI($this->lng->txt(
"survey_activate_skill_service"),
"skill_service");
1271 $skill_service->setInfo($this->lng->txt(
"survey_activate_skill_service_info"));
1272 $skill_service->setChecked($this->object->get360SkillService());
1273 $form->addItem($skill_service);
1277 $form->addCommandButton(
"saveProperties", $this->lng->txt(
"save"));
1280 if ($template_settings) {
1281 foreach ($template_settings as
$id => $item) {
1282 if ($item[
"hide"]) {
1283 if (
$id ==
"enabled_end_date") {
1286 if (
$id ==
"enabled_start_date") {
1289 $form->removeItemByPostVar(
$id,
true);
1302 if ($a_section ==
'settings') {
1303 $this->tabs_gui->addSubTabTarget(
1305 $this->ctrl->getLinkTarget($this,
'properties')
1309 if ($lti_settings->hasSettingsAccess()) {
1310 $this->tabs_gui->addSubTabTarget(
1312 $this->ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
1332 $ilTabs->activateTab(
"settings");
1333 $ilTabs->activateSubTab(
'settings');
1335 if ($this->object->get360Mode()) {
1336 $ilHelp->setScreenId(
"settings_360");
1345 if ($this->object->getTemplate()) {
1346 $link = $this->ctrl->getLinkTarget($this,
"confirmResetTemplate");
1347 $link =
"<a href=\"" . $link .
"\">" . $this->lng->txt(
"survey_using_template_link") .
"</a>";
1348 $message =
"<div style=\"margin-top:10px\">" .
1349 $this->tpl->getMessageHTML(
sprintf(
1350 $this->lng->txt(
"survey_using_template"),
1357 $this->tpl->setContent($a_form->getHTML() .
$message);
1362 $fields = array(
'login',
'firstname',
'lastname',
'email');
1364 include_once
'./Services/User/classes/class.ilUserAutoComplete.php';
1366 $auto->setSearchFields($fields);
1367 $auto->setResultField(
'login');
1368 $auto->enableFieldSearchableCheck(
true);
1369 $auto->setMoreLinkAvailable(
true);
1371 if (($_REQUEST[
'fetchall'])) {
1385 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_confirm_resettemplate.html",
"Modules/Survey");
1386 $this->tpl->setCurrentBlock(
"adm_content");
1387 $this->tpl->setVariable(
"BTN_CONFIRM_REMOVE", $this->lng->txt(
"confirm"));
1388 $this->tpl->setVariable(
"BTN_CANCEL_REMOVE", $this->lng->txt(
"cancel"));
1389 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"resetTemplateObject"));
1390 $this->tpl->parseCurrentBlock();
1398 $this->
object->setTemplate(
null);
1399 $this->
object->saveToDB();
1402 $this->ctrl->redirect($this,
"properties");
1413 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1415 $form->setTarget(
"_top");
1416 $form->setFormAction($this->ctrl->getFormAction($this));
1417 $form->setTitle($this->lng->txt(
"import_svy"));
1419 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
1420 $fi =
new ilFileInputGUI($this->lng->txt(
"import_file"),
"importfile");
1421 $fi->setSuffixes(array(
"zip"));
1422 $fi->setRequired(
true);
1423 $form->addItem($fi);
1425 include_once(
"./Modules/Survey/classes/class.ilObjSurvey.php");
1427 $questionspools = $svy->getAvailableQuestionpools(
true,
true,
true);
1429 $pools =
new ilSelectInputGUI($this->lng->txt(
"select_questionpool_short"),
"spl");
1430 $pools->setOptions(array(
""=>$this->lng->txt(
"dont_use_questionpool")) + $questionspools);
1431 $pools->setRequired(
false);
1432 $form->addItem($pools);
1434 $form->addCommandButton(
"importSurvey", $this->lng->txt(
"import"));
1435 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
1447 $parent_id =
$_GET[
"ref_id"];
1448 $new_type = $_REQUEST[
"new_type"];
1453 $this->lng->loadLanguageModule($new_type);
1454 $this->ctrl->setParameter($this,
"new_type", $new_type);
1457 if (
$form->checkInput()) {
1458 include_once(
"./Modules/Survey/classes/class.ilObjSurvey.php");
1460 $newObj->setType($new_type);
1461 $newObj->setTitle(
"dummy");
1462 $newObj->setDescription(
"dummy");
1463 $newObj->create(
true);
1468 $this->log->debug(
"form->getInput(spl) = " .
$form->getInput(
"spl"));
1470 $error = $newObj->importObject($_FILES[
"importfile"],
$form->getInput(
"spl"));
1479 "&baseClass=ilObjSurveyGUI");
1482 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
1486 $tpl->addJavaScript(
"./Modules/Scorm2004/scripts/questions/jquery.js");
1489 $this->tpl->setCurrentBlock(
"template_option");
1490 $this->tpl->setVariable(
"VAL_TEMPLATE_OPTION",
"");
1491 $this->tpl->setVariable(
"TXT_TEMPLATE_OPTION", $this->lng->txt(
"none"));
1492 $this->tpl->parseCurrentBlock();
1494 foreach ($templates as $item) {
1495 $this->tpl->setCurrentBlock(
"template_option");
1496 $this->tpl->setVariable(
"VAL_TEMPLATE_OPTION", $item[
"id"]);
1497 $this->tpl->setVariable(
"TXT_TEMPLATE_OPTION", $item[
"title"]);
1498 $this->tpl->parseCurrentBlock();
1500 $desc = str_replace(
"\n",
"", nl2br($item[
"description"]));
1501 $desc = str_replace(
"\r",
"", $desc);
1503 $this->tpl->setCurrentBlock(
"js_data");
1504 $this->tpl->setVariable(
"JS_DATA_ID", $item[
"id"]);
1505 $this->tpl->setVariable(
"JS_DATA_TEXT", $desc);
1506 $this->tpl->parseCurrentBlock();
1509 $this->tpl->setCurrentBlock(
"templates");
1510 $this->tpl->setVariable(
"TXT_TEMPLATE", $this->lng->txt(
"svy_settings_template"));
1511 $this->tpl->parseCurrentBlock();
1516 $form->setValuesByPost();
1532 $this->ctrl->setCmd(
"showSummary");
1533 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1547 if (!$this->external_rater_360) {
1553 $ilTabs->activateTab(
"info_short");
1555 include_once
"./Modules/Survey/classes/class.ilSurveyExecutionGUI.php";
1558 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1560 $info->enablePrivateNotes();
1563 $is_appraisee =
false;
1566 if ($this->object->get360Mode() &&
1567 $this->object->isAppraisee(
$ilUser->getId())) {
1568 $is_appraisee =
true;
1570 $info->addSection($this->lng->txt(
"survey_360_appraisee_info"));
1572 $appr_data = $this->
object->getAppraiseesData();
1573 $appr_data = $appr_data[
$ilUser->getId()];
1574 $info->addProperty($this->lng->txt(
"survey_360_raters_status_info"), $appr_data[
"finished"]);
1576 if (!$appr_data[
"closed"]) {
1577 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
1579 $button->setCaption(
"survey_360_appraisee_close_action");
1580 $button->setUrl($this->ctrl->getLinkTargetByClass(
"ilsurveyparticipantsgui",
"confirmappraiseeclose"));
1581 $close_button_360 =
'<div>' . $button->render() .
'</div>';
1583 $txt =
"survey_360_appraisee_close_action_info";
1584 if ($this->object->get360SkillService()) {
1588 $this->lng->txt(
"status"),
1589 $close_button_360 . $this->lng->txt(
$txt)
1596 $this->lng->txt(
"status"),
1598 $this->lng->txt(
"survey_360_appraisee_close_action_status"),
1609 $code_input =
false;
1610 $anonymous_code =
$_POST[
"anonymous_id"];
1611 if ($anonymous_code) {
1614 if (!$this->object->checkSurveyCode($anonymous_code)) {
1615 $anonymous_code =
null;
1618 $this->
object->bindSurveyCodeToUser(
$ilUser->getId(), $anonymous_code);
1621 if ($anonymous_code) {
1622 $_SESSION[
"anonymous_id"][$this->
object->getId()] = $anonymous_code;
1624 $anonymous_code =
$_SESSION[
"anonymous_id"][$this->
object->getId()];
1625 if ($anonymous_code) {
1631 if ($this->object->getAnonymize() && !$anonymous_code) {
1632 $anonymous_code = $this->
object->findCodeForUser(
$ilUser->getId());
1636 $participant_status = $this->
object->getUserSurveyExecutionStatus($anonymous_code);
1637 if ($participant_status) {
1638 $anonymous_code = $participant_status[
"code"];
1639 $participant_status = $participant_status[
"runs"];
1643 if (!$this->object->isAccessibleWithoutCode() &&
1646 (!$anonymous_code || !$this->object->isAnonymousKey($anonymous_code))) {
1647 $anonymous_code =
null;
1652 $_SESSION[
"anonymous_id"][$this->
object->getId()] = $anonymous_code;
1653 $survey_started = $this->
object->isSurveyStarted(
$ilUser->getId(), $anonymous_code);
1655 $showButtons = $big_button =
false;
1658 if (!$this->object->get360Mode() &&
1659 ($survey_started === 1 &&
1660 !(!$this->object->isAccessibleWithoutCode() && !$anonymous_code &&
$ilUser->getId() == ANONYMOUS_USER_ID))) {
1663 if (
$ilUser->getId() != ANONYMOUS_USER_ID) {
1664 if ($this->object->hasViewOwnResults()) {
1665 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
1667 $button->setCaption(
"svy_view_own_results");
1668 $button->setUrl($this->ctrl->getLinkTarget($this,
"viewUserResults"));
1669 $ilToolbar->addButtonInstance($button);
1673 if ($this->object->hasMailConfirmation()) {
1674 if ($this->object->hasViewOwnResults()) {
1675 $ilToolbar->addSeparator();
1678 if (
$ilUser->getId() == ANONYMOUS_USER_ID ||
1680 require_once
"Services/Form/classes/class.ilTextInputGUI.php";
1683 $mail->setValue(
$ilUser->getEmail());
1684 $ilToolbar->addInputItem($mail,
true);
1687 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"mailUserResults"));
1689 include_once
"Services/UIComponent/Button/classes/class.ilSubmitButton.php";
1691 $button->setCaption(
"svy_mail_send_confirmation");
1692 $button->setCommand(
"mailUserResults");
1693 $ilToolbar->addButtonInstance($button);
1698 $canStart = $this->
object->canStartSurvey(
null, $this->external_rater_360);
1700 $showButtons = $canStart[
"result"];
1701 if (!$showButtons) {
1702 if ($canStart[
"edit_settings"] &&
1703 $ilAccess->checkAccess(
"write",
"", $this->ref_id)) {
1704 $canStart[
"messages"][] =
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"properties") .
"\">» " .
1705 $this->lng->txt(
"survey_edit_settings") .
"</a>";
1713 if (!$is_appraisee &&
1715 !$this->object->isAccessibleWithoutCode()) {
1716 $info->setFormAction($this->ctrl->getFormAction($this,
"infoScreen"));
1717 $info->addSection($this->lng->txt(
"anonymization"));
1718 $info->addProperty(
"", $this->lng->txt(
"anonymize_anonymous_introduction"));
1719 $info->addPropertyTextinput($this->lng->txt(
"enter_anonymous_id"),
"anonymous_id",
"", 8,
"infoScreen", $this->lng->txt(
"submit"),
true);
1722 if (!$this->object->get360Mode()) {
1723 if ($anonymous_code) {
1724 $info->addHiddenElement(
"anonymous_id", $anonymous_code);
1726 if ($survey_started === 0) {
1727 $big_button = array(
"resume", $this->lng->txt(
"resume_survey"));
1728 } elseif ($survey_started ===
false) {
1729 $big_button = array(
"start", $this->lng->txt(
"start_survey"));
1734 $appr_ids = array();
1737 if ($anonymous_code) {
1738 $anonymous_id = $this->
object->getAnonymousIdByCode($anonymous_code);
1739 if ($anonymous_id) {
1740 $appr_ids = $this->
object->getAppraiseesToRate(0, $anonymous_id);
1746 if (!$appr_ids &&
$ilUser->getId() != ANONYMOUS_USER_ID) {
1747 $appr_ids = $this->
object->getAppraiseesToRate(
$ilUser->getId());
1750 if (
sizeof($appr_ids)) {
1752 $active_appraisees = array();
1753 if ($participant_status) {
1754 foreach ($participant_status as $item) {
1755 $active_appraisees[$item[
"appr_id"]] = $item[
"finished"];
1761 foreach ($appr_ids as $appr_id) {
1762 if ($this->object->isAppraiseeClosed($appr_id)) {
1764 $list[$appr_id] = $this->lng->txt(
"survey_360_appraisee_is_closed");
1765 } elseif (array_key_exists($appr_id, $active_appraisees)) {
1767 if ($active_appraisees[$appr_id]) {
1768 $list[$appr_id] = $this->lng->txt(
"already_completed_survey");
1772 $list[$appr_id] = array(
"resume", $this->lng->txt(
"resume_survey"));
1776 $list[$appr_id] = array(
"start", $this->lng->txt(
"start_survey"));
1780 $info->addSection($this->lng->txt(
"survey_360_rate_other_appraisees"));
1782 include_once
"Services/User/classes/class.ilUserUtil.php";
1783 foreach (
$list as $appr_id => $item) {
1786 if (!is_array($item)) {
1787 $info->addProperty($appr_name, $item);
1789 $this->ctrl->setParameter($output_gui,
"appr_id", $appr_id);
1790 $href = $this->ctrl->getLinkTarget($output_gui, $item[0]);
1791 $this->ctrl->setParameter($output_gui,
"appr_id",
"");
1793 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
1795 $button->setCaption($item[1],
false);
1796 $button->setUrl($href);
1797 $big_button_360 =
'<div>' . $button->render() .
'</div>';
1799 $info->addProperty($appr_name, $big_button_360);
1802 } elseif (!$is_appraisee) {
1808 if ($this->object->get360Mode() &&
1809 $this->object->get360SelfAppraisee() &&
1810 !$this->object->isAppraisee(
$ilUser->getId()) &&
1811 $ilUser->getId() != ANONYMOUS_USER_ID) {
1812 $link = $this->ctrl->getLinkTargetByClass(
"ilsurveyparticipantsgui",
"addSelfAppraisee");
1813 $link =
'<a href="' . $link .
'">' . $this->lng->txt(
"survey_360_add_self_appraisee") .
'</a>';
1814 $info->addProperty(
" ", $link);
1819 $ilToolbar->setFormAction($this->ctrl->getFormAction($output_gui,
"infoScreen"));
1821 include_once
"Services/UIComponent/Button/classes/class.ilSubmitButton.php";
1823 $button->setCaption($big_button[1],
false);
1824 $button->setCommand($big_button[0]);
1825 $button->setPrimary(
true);
1826 $ilToolbar->addButtonInstance($button);
1828 $ilToolbar->setCloseFormTag(
false);
1829 $info->setOpenFormTag(
false);
1838 if (strlen($this->object->getIntroduction())) {
1839 $introduction = $this->
object->getIntroduction();
1840 $info->addSection($this->lng->txt(
"introduction"));
1841 $info->addProperty(
"", $this->object->prepareTextareaOutput($introduction) .
1842 "<br />" .
$info->getHiddenToggleButton());
1844 $info->addSection(
"");
1845 $info->addProperty(
"",
$info->getHiddenToggleButton());
1848 $info->hideFurtherSections(
false);
1850 if (!$this->object->get360Mode()) {
1851 $info->addSection($this->lng->txt(
"svy_general_properties"));
1854 $this->lng->txt(
"survey_results_anonymization"),
1855 !$this->object->hasAnonymizedResults()
1856 ? $this->lng->txt(
"survey_results_personalized_info")
1857 : $this->lng->txt(
"survey_results_anonymized_info")
1860 include_once
"./Modules/Survey/classes/class.ilObjSurveyAccess.php";
1863 $info->addProperty($this->lng->txt(
"evaluation_access"), $this->lng->txt(
"evaluation_access_info"));
1867 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1869 $this->ctrl->forwardCommand(
$info);
1875 switch ($this->ctrl->getCmd()) {
1880 case "redirectQuestion":
1881 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
1884 case "checkEvaluationAccess":
1885 case "evaluationdetails":
1886 case "evaluationuser":
1887 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTargetByClass(
"ilsurveyevaluationgui",
"evaluation"),
"",
$_GET[
"ref_id"]);
1892 case "importSurvey":
1896 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
1899 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
1902 if ((
int)
$_GET[
"q_id"] && !(
int) $_REQUEST[
"new_for_survey"]) {
1905 $q_id = (int)
$_GET[
"q_id"];
1906 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
1908 $this->ctrl->setParameterByClass($q_type,
"q_id", $q_id);
1909 $ilLocator->addItem(
1911 $this->ctrl->getLinkTargetByClass(array(
"ilSurveyEditorGUI", $q_type),
"editQuestion")
1925 public static function _goto($a_target, $a_access_code =
"")
1929 $ilAccess =
$DIC->access();
1933 if (strlen($a_access_code)) {
1935 $_GET[
"baseClass"] =
"ilObjSurveyGUI";
1936 $_GET[
"cmd"] =
"infoScreen";
1937 $_GET[
"ref_id"] = $a_target;
1938 include(
"ilias.php");
1942 if ($ilAccess->checkAccess(
"visible",
"", $a_target) ||
1943 $ilAccess->checkAccess(
"read",
"", $a_target)) {
1944 $_GET[
"baseClass"] =
"ilObjSurveyGUI";
1945 $_GET[
"cmd"] =
"infoScreen";
1946 $_GET[
"ref_id"] = $a_target;
1947 include(
"ilias.php");
1949 } elseif ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID)) {
1951 $lng->txt(
"msg_no_perm_read_item"),
1960 $rtpl =
new ilTemplate(
"tpl.svy_view_user_results.html",
true,
true,
"Modules/Survey");
1962 $show_titles = (bool) $this->object->getShowQuestionTitles();
1964 foreach ($this->object->getSurveyPages() as $page) {
1965 if (count($page) > 0) {
1967 if (count($page) > 1) {
1968 if ((
bool) $page[0][
"questionblock_show_blocktitle"]) {
1969 $rtpl->setVariable(
"BLOCK_TITLE", trim($page[0][
"questionblock_title"]));
1974 foreach ($page as $question) {
1975 $question_gui = $this->
object->getQuestionGUI($question[
"type_tag"], $question[
"question_id"]);
1976 if (is_object($question_gui)) {
1977 $rtpl->setCurrentBlock(
"question_bl");
1980 if (strlen($question[
"heading"])) {
1981 $rtpl->setVariable(
"HEADING", trim($question[
"heading"]));
1986 $question_gui->getPrintView(
1988 (
bool) $question[
"questionblock_show_questiontext"],
1989 $this->object->getId(),
1990 $this->object->loadWorkingData($question[
"question_id"], $a_active_id)
1994 $rtpl->parseCurrentBlock();
1998 $rtpl->setCurrentBlock(
"block_bl");
1999 $rtpl->parseCurrentBlock();
2003 return $rtpl->get();
2012 $anonymous_code =
$_SESSION[
"anonymous_id"][$this->
object->getId()];
2013 $active_id = $this->
object->getActiveID(
$ilUser->getId(), $anonymous_code, 0);
2014 if ($this->object->isSurveyStarted(
$ilUser->getId(), $anonymous_code) !== 1 ||
2016 $this->ctrl->redirect($this,
"infoScreen");
2019 $ilTabs->clearTargets();
2020 $ilTabs->setBackTarget(
2021 $this->lng->txt(
"btn_back"),
2022 $this->ctrl->getLinkTarget($this,
"infoScreen")
2033 $show_titles = (bool) $this->object->getShowQuestionTitles();
2035 foreach ($this->object->getSurveyPages() as $page) {
2036 if (count($page) > 0) {
2037 $res[] =
"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
2040 if (count($page) > 1) {
2041 if ((
bool) $page[0][
"questionblock_show_blocktitle"]) {
2042 $res[$this->lng->txt(
"questionblock")] = trim($page[0][
"questionblock_title"]) .
"\n";
2048 $page_res = array();
2050 foreach ($page as $question) {
2051 $question_gui = $this->
object->getQuestionGUI($question[
"type_tag"], $question[
"question_id"]);
2052 if (is_object($question_gui)) {
2053 $question_parts = array();
2056 if (strlen($question[
"heading"])) {
2057 $question_parts[$this->lng->txt(
"heading")] = trim($question[
"heading"]);
2061 $question_parts[$this->lng->txt(
"title")] = trim($question[
"title"]);
2064 if ((
bool) $question[
"questionblock_show_questiontext"]) {
2065 $question_parts[$this->lng->txt(
"question")] = trim(strip_tags($question_gui->object->getQuestionText()));
2068 $answers = $question_gui->getParsedAnswers(
2069 $this->object->loadWorkingData($question[
"question_id"], $a_active_id),
2073 if (
sizeof($answers)) {
2075 if (
sizeof($answers) > 1 ||
2076 get_class($question_gui) ==
"SurveyTextQuestionGUI") {
2081 foreach ($answers as $answer) {
2083 if ($answer[
"textanswer"]) {
2084 $text =
' ("' . $answer[
"textanswer"] .
'")';
2086 if (!isset($answer[
"cols"])) {
2087 if (isset($answer[
"title"])) {
2088 $parts[] = $answer[
"title"] .
$text;
2089 } elseif (isset($answer[
"value"])) {
2090 $parts[] = $answer[
"value"];
2092 $parts[] = substr(
$text, 2, -1);
2098 foreach ($answer[
"cols"] as $col) {
2099 $tmp[] = $col[
"title"];
2101 $parts[] = $answer[
"title"] .
": " . implode(
", ", $tmp) .
$text;
2104 $question_parts[$this->lng->txt(
"answer")] =
2105 ($multiline ?
"\n" :
"") . implode(
"\n", $parts);
2109 foreach ($question_parts as
$type => $value) {
2110 $tmp[] =
$type .
": " . $value;
2112 $page_res[] = implode(
"\n", $tmp);
2116 $res[] = implode(
"\n\n-------------------------------\n\n", $page_res);
2120 $res[] =
"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
2122 return implode(
"\n",
$res);
2129 $finished = $this->
object->getSurveyParticipants(array($a_active_id));
2130 $finished = array_pop($finished);
2133 require_once
"Services/Mail/classes/class.ilMail.php";
2134 require_once
"Services/Link/classes/class.ilLink.php";
2137 $body .= $this->lng->txt(
"svy_mail_own_results_body") .
"\n";
2138 $body .=
"\n" . $this->lng->txt(
"obj_svy") .
": " . $this->
object->getTitle() .
"\n";
2140 $body .=
"\n" . $this->lng->txt(
"survey_results_finished") .
": " . $finished .
"\n\n";
2142 if ($this->object->hasMailOwnResults()) {
2143 $subject =
"svy_mail_own_results_subject";
2146 $subject =
"svy_mail_confirmation_subject";
2152 require_once
"Services/Mail/classes/class.ilMail.php";
2153 $mail =
new ilMail(ANONYMOUS_USER_ID);
2154 $mail->sendMimeMail(
2158 sprintf($this->lng->txt($subject), $this->object->getTitle()),
2169 $anonymous_code =
$_SESSION[
"anonymous_id"][$this->
object->getId()];
2170 $active_id = $this->
object->getActiveID(
$ilUser->getId(), $anonymous_code, 0);
2171 if ($this->object->isSurveyStarted(
$ilUser->getId(), $anonymous_code) !== 1 ||
2173 $this->ctrl->redirect($this,
"infoScreen");
2176 $recipient =
$_POST[
"mail"];
2178 $recipient =
$ilUser->getEmail();
2181 $this->ctrl->redirect($this,
"infoScreen");
2187 $this->ctrl->redirect($this,
"infoScreen");
sprintf('%.4f', $callTime)
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)
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.
This class handles base functions for mail handling.
static _getInstallationSignature()
static getSalutation($a_usr_id, ilLanguage $a_language=null)
This class represents a non editable value in a property form.
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
sendUserResultsMail($a_active_id, $a_recipient)
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)
const EVALUATION_ACCESS_PARTICIPANTS
const NOTIFICATION_INVITED_USERS
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 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.
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
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 sendSuccess($a_info="", $a_keep=false)
Send Success Message 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.
if(!array_key_exists('StateId', $_REQUEST)) $id
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
catch(Exception $e) $message
if(isset($_POST['submit'])) $form
if(isset($_REQUEST['delete'])) $list
foreach($_POST as $key=> $value) $res