33 protected \ILIAS\Survey\PrintView\GUIService
$print;
41 protected \ILIAS\DI\UIServices
$ui;
55 protected \ILIAS\Survey\Evaluation\EvaluationGUIRequest
$request;
63 $this->
tabs = $DIC->tabs();
64 $this->
access = $DIC->access();
65 $this->
user = $DIC->user();
66 $this->rbacsystem = $DIC->rbac()->system();
67 $this->tree = $DIC->repositoryTree();
68 $this->
toolbar = $DIC->toolbar();
69 $this->
ui = $DIC->ui();
70 $lng = $DIC->language();
72 $ilCtrl = $DIC->ctrl();
76 $this->
ctrl = $ilCtrl;
77 $this->
object = $a_object;
79 $this->array_panels = array();
81 $this->request = $DIC->survey()->internal()->gui()->evaluation($this->
object)->request();
83 $this->
ctrl->saveParameter($this, [
"appr_id",
"rater_id"]);
84 $this->evaluation_manager = $DIC
90 $DIC->user()->getId(),
91 $this->request->getAppraiseeId(),
92 $this->request->getRaterId()
96 $this->evaluation_manager->getCurrentAppraisee()
99 $this->ui_modifier = $DIC->survey()
102 ->modeUIModifier($this->
object->getMode());
103 $this->print = $DIC->survey()
107 $this->access_manager = $DIC->survey()
111 $this->
object->getRefId(),
112 $DIC->user()->getId()
114 $this->skill_profile_service = $DIC->skills()->profile();
120 if ($this->
object->getSkillService() && $skmg_set->isActivated()) {
121 $cmd = $this->
ctrl->getCmd(
"competenceEval");
123 $cmd = $this->
ctrl->getCmd(
"evaluation");
126 $next_class = $this->
ctrl->getNextClass($this);
128 $this->log->debug($cmd);
130 switch ($next_class) {
133 $ret = (string) $this->$cmd();
147 if ($this->
object->getSkillService() && $skmg_set->isActivated()) {
148 $ilTabs->addSubTabTarget(
149 "svy_eval_competences",
150 $this->
ctrl->getLinkTarget($this,
"competenceEval"),
151 array(
"competenceEval")
156 $ilTabs->addSubTabTarget(
157 "svy_eval_cumulated",
158 $this->
ctrl->getLinkTarget($this,
"evaluation"),
159 array(
"evaluation",
"checkEvaluationAccess")
163 $ilTabs->addSubTabTarget(
165 $this->
ctrl->getLinkTarget($this,
"evaluationdetails"),
166 array(
"evaluationdetails")
170 $ilTabs->addSubTabTarget(
172 $this->
ctrl->getLinkTarget($this,
"evaluationuser"),
173 array(
"evaluationuser")
177 if ($this->
object->getCalculateSumScore()) {
178 $ilTabs->addSubTabTarget(
180 $this->
ctrl->getLinkTarget($this,
"sumscore"),
190 $this->appr_id = $a_val;
202 if ($this->
object->getAnonymize() === 1 &&
203 $this->evaluation_manager->getAnonEvaluationAccess() === $this->request->getRefId()) {
211 if ($this->
object->getAnonymize() === 1) {
212 $this->evaluation_manager->setAnonEvaluationAccess($this->request->getRefId());
217 if ($this->
object->getAnonymize() === 1) {
219 $surveycode = $this->
object->getUserAccessCode(
$ilUser->getId());
220 if ($this->
object->isAnonymizedParticipant($surveycode)) {
221 $this->evaluation_manager->setAnonEvaluationAccess($this->request->getRefId());
234 $this->tpl->setVariable(
"TABS",
"");
235 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_evaluation_checkaccess.html",
"Modules/Survey");
236 $this->tpl->setCurrentBlock(
"adm_content");
237 $this->tpl->setVariable(
"AUTHENTICATION_NEEDED", $this->
lng->txt(
"svy_check_evaluation_authentication_needed"));
238 $this->tpl->setVariable(
"FORM_ACTION", $this->
ctrl->getFormAction($this,
"checkEvaluationAccess"));
239 $this->tpl->setVariable(
"EVALUATION_CHECKACCESS_INTRODUCTION", $this->
lng->txt(
"svy_check_evaluation_access_introduction"));
240 $this->tpl->setVariable(
"VALUE_CHECK", $this->
lng->txt(
"ok"));
241 $this->tpl->setVariable(
"VALUE_CANCEL", $this->
lng->txt(
"cancel"));
242 $this->tpl->setVariable(
"TEXT_SURVEY_CODE", $this->
lng->txt(
"survey_code"));
243 $this->tpl->parseCurrentBlock();
246 $this->evaluation_manager->clearAnonEvaluationAccess();
255 $surveycode = $this->request->getSurveyCode();
256 if ($this->
object->isAnonymizedParticipant($surveycode)) {
257 $this->evaluation_manager->setAnonEvaluationAccess($this->request->getRefId());
260 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"svy_check_evaluation_wrong_key",
true));
273 $ilCtrl->setParameterByClass(
278 $ilCtrl->redirectByClass(
"ilrepositorygui",
"frameset");
292 $finished_ids = null;
293 if ($this->
object->get360Mode()) {
294 $appr_id = $this->request->getAppraiseeId();
296 $this->
ctrl->redirect($this,
$details ?
"evaluationdetails" :
"evaluation");
298 $finished_ids = $this->
object->getFinishedIdsForAppraiseeId($appr_id);
299 if (!count($finished_ids)) {
300 $finished_ids = array(-1);
305 $title_row = array();
306 $do_title = $do_label =
true;
307 switch ($this->request->getExportLabel()) {
309 $title_row[] = $this->
lng->txt(
"label");
314 $title_row[] = $this->
lng->txt(
"title");
319 $title_row[] = $this->
lng->txt(
"title");
320 $title_row[] = $this->
lng->txt(
"label");
323 $title_row[] = $this->
lng->txt(
"question");
324 $title_row[] = $this->
lng->txt(
"question_type");
325 $title_row[] = $this->
lng->txt(
"users_answered");
326 $title_row[] = $this->
lng->txt(
"users_skipped");
327 $title_row[] = $this->
lng->txt(
"mode");
328 $title_row[] = $this->
lng->txt(
"mode_text");
329 $title_row[] = $this->
lng->txt(
"mode_nr_of_selections");
330 $title_row[] = $this->
lng->txt(
"median");
331 $title_row[] = $this->
lng->txt(
"arithmetic_mean");
336 switch ($this->request->getExportFormat()) {
339 $excel->addSheet($this->
lng->txt(
"svy_eval_cumulated"));
340 $excel->setCellArray(array($title_row),
"A1");
341 $excel->setBold(
"A1:" . $excel->getColumnCoord(count($title_row) - 1) .
"1");
345 $csvfile = array($title_row);
352 foreach ($this->
object->getSurveyQuestions() as $qdata) {
354 $q_res = $q_eval->getResults();
355 $ov_rows = $q_eval->exportResults($q_res, $do_title, $do_label);
357 switch ($this->request->getExportFormat()) {
359 $excel->setActiveSheet(0);
360 foreach ($ov_rows as $row) {
361 foreach ($row as $col => $value) {
362 $excel->setCell($ov_row, $col, $value);
369 foreach ($ov_rows as $row) {
376 switch ($this->request->getExportFormat()) {
386 ? $this->
lng->txt(
"svy_eval_cumulated")
387 : $this->
lng->txt(
"svy_eval_detail");
389 $surveyname = $this->
object->getTitle() .
" " .
$type .
" " . date(
"Y-m-d");
390 $surveyname = preg_replace(
"/\s/",
"_", trim($surveyname));
394 switch ($this->request->getExportFormat()) {
396 $excel->sendToClient($surveyname);
402 foreach ($csvfile as $csvrow) {
404 $csv .= implode($separator, $csvrow) .
"\n";
423 $question_res = $a_results;
425 if (is_array($question_res)) {
426 $question_res = $question_res[0][1];
429 $question = $question_res->getQuestion();
431 $a_excel->
addSheet($question->getTitle());
439 $kv[$this->
lng->txt(
"title")] = $question->getTitle();
442 $kv[$this->
lng->txt(
"label")] = $question->label;
446 $kv[$this->
lng->txt(
"question")] = $question->getQuestiontext();
454 $kv[$this->
lng->txt(
"users_answered")] = $question_res->getUsersAnswered();
455 $kv[$this->
lng->txt(
"users_skipped")] = $question_res->getUsersSkipped();
459 foreach ($kv as
$key => $value) {
461 $a_excel->
setCell($excel_row++, 1, $value);
486 foreach ($a_results as $row_results) {
487 $row_title = $row_results[0];
489 $a_excel->
setCell($excel_row, 0, $this->
lng->txt(
"row"));
490 $a_excel->
setCell($excel_row++, 1, $row_title);
497 is_array($texts[$row_title] ??
false)
498 ? array(
"" => $texts[$row_title])
506 $a_excel->
setCell($excel_row++, 0, $this->
lng->txt(
"overview"));
510 $cats = $question->getColumns();
511 foreach ($cats->getCategories() as $cat) {
513 $a_excel->
setCell($excel_row, 1 + $counter, $cat->title);
518 foreach ($a_results as $row_results) {
519 $row_title = $row_results[0];
521 $a_excel->
setCell($excel_row, 0, $row_title);
523 $vars = $row_results[1]->getVariables();
525 foreach ($vars as $var) {
526 $a_excel->
setCell($excel_row, ++$counter, $var->abs);
534 $a_excel->
setBold(
"A1:A" . $excel_row);
541 array $a_grid = null,
542 array $a_text_answers = null,
543 bool $a_include_mode =
true 547 if ($a_include_mode) {
562 if ($a_results->
getMean() !== null) {
563 $kv[$this->
lng->txt(
"arithmetic_mean")] = $a_results->
getMean();
567 foreach ($kv as
$key => $value) {
569 $a_excel->
setCell($a_excel_row++, 1, $value);
575 $a_excel->
setColors(
"B" . $a_excel_row .
":E" . $a_excel_row, self::EXCEL_SUBTITLE);
576 $a_excel->
setCell($a_excel_row, 0, $this->
lng->txt(
"categories"));
577 foreach ($a_grid[
"cols"] as $col_idx => $col) {
578 $a_excel->
setCell($a_excel_row, $col_idx + 1, $col);
583 foreach ($a_grid[
"rows"] as
$cols) {
584 foreach ($cols as $col_idx => $col) {
585 $a_excel->
setCell($a_excel_row, $col_idx + 1, $col);
592 if ($a_text_answers) {
594 $a_excel->
setCell($a_excel_row, 0, $this->
lng->txt(
"freetext_answers"));
597 if (!is_array($a_text_answers[
""] ?? null)) {
598 $a_excel->
setColors(
"B" . $a_excel_row .
":C" . $a_excel_row, self::EXCEL_SUBTITLE);
599 $a_excel->
setCell($a_excel_row, 1, $this->
lng->txt(
"title"));
600 $a_excel->
setCell($a_excel_row++, 2, $this->
lng->txt(
"answer"));
604 $a_excel->
setColors(
"B" . $a_excel_row .
":B" . $a_excel_row, self::EXCEL_SUBTITLE);
605 $a_excel->
setCell($a_excel_row++, 1, $this->
lng->txt(
"answer"));
608 foreach ($a_text_answers as $var => $items) {
609 foreach ($items as $item) {
610 if (!is_array($a_text_answers[
""] ?? null)) {
611 $a_excel->
setCell($a_excel_row, 1, $var);
612 $a_excel->
setCell($a_excel_row++, 2, $item);
614 $a_excel->
setCell($a_excel_row++, 1, $item);
623 if ($this->request->getExportFormat() !==
'') {
626 $this->
ctrl->redirect($this,
'evaluation');
632 if ($this->request->getExportFormat() !==
'') {
635 $this->
ctrl->redirect($this,
'evaluation');
641 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'use_browser_print_function'),
true);
642 $this->
ctrl->redirect($this,
'evaluation');
655 $form_id =
"svymdfrm";
658 $tpl->
addOnLoadCode(
'$("#form_' . $form_id .
'").submit(function() { $("#' . $a_id .
'").modal("hide"); });');
661 $modal->setId($a_id);
662 $modal->setHeading(($this->
lng->txt(
"svy_export_format")));
665 $form->setId($form_id);
666 $form->setFormAction($this->
ctrl->getFormAction($this, $a_cmd));
670 self::TYPE_XLS => $this->
lng->txt(
'exp_type_excel'),
676 $label->setOptions(array(
677 'label_only' => $this->
lng->txt(
'export_label_only'),
678 'title_only' => $this->
lng->txt(
'export_title_only'),
679 'title_label' => $this->
lng->txt(
'export_title_label')
681 $form->addItem($label);
683 $form->addCommandButton($a_cmd, $this->
lng->txt(
"export"));
684 $form->setPreventDoubleSubmission(
false);
686 $modal->setBody($form->getHTML());
688 return $modal->getHTML();
694 if ($this->
object->getSkillService() && $skmg_set->isActivated()) {
712 $ui_factory = $ui->factory();
713 $ui_renderer = $ui->renderer();
715 $this->
lng->loadLanguageModule(
"survey");
717 $this->log->debug(
"check access");
721 if (!$this->
access->checkAccess(
'read',
'', $this->object->getRefId())) {
722 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"));
726 switch ($this->
object->getEvaluationAccess()) {
729 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"));
737 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"));
744 $this->log->debug(
"check access ok");
747 $appr_id = $this->evaluation_manager->getCurrentAppraisee();
748 $ilToolbar->setFormAction($this->
ctrl->getFormAction($this));
751 $eval_tpl =
new ilTemplate(
"tpl.il_svy_svy_evaluation.html",
true,
true,
"Modules/Survey");
755 $this->ui_modifier->setResultsDetailToolbar(
761 $this->ui_modifier->setResultsOverviewToolbar(
771 $dtmpl =
new ilTemplate(
"tpl.il_svy_svy_results_details.html",
true,
true,
"Modules/Survey/Evaluation");
772 $toc_tpl =
new ilTemplate(
"tpl.svy_results_table_contents.html",
true,
true,
"Modules/Survey/Evaluation");
773 $this->
lng->loadLanguageModule(
"content");
774 $toc_tpl->setVariable(
"TITLE_TOC", $this->
lng->txt(
'cont_toc'));
777 $finished_ids = $this->evaluation_manager->getFilteredFinishedIds();
783 foreach ($this->
object->getSurveyQuestions() as $qdata) {
785 $q_res = $q_eval->getResults();
789 $panels = array_merge(
791 $this->ui_modifier->getDetailPanels(
792 $this->object->getSurveyParticipants(),
799 if ($qdata[
"questionblock_id"] &&
800 $qdata[
"questionblock_id"] != $this->last_questionblock_id) {
802 if ($qblock[
"show_blocktitle"]) {
803 $list->addListNode($qdata[
"questionblock_title"],
"q" . $qdata[
"questionblock_id"]);
805 $list->addListNode(
"",
"q" . $qdata[
"questionblock_id"]);
807 $this->last_questionblock_id = $qdata[
"questionblock_id"];
809 $anchor_id =
"svyrdq" . $qdata[
"question_id"];
810 $list->addListNode(
"<a href='#" . $anchor_id .
"'>" . $qdata[
"title"] .
"</a>", $qdata[
"question_id"], $qdata[
"questionblock_id"] ?
811 "q" . $qdata[
"questionblock_id"] : 0);
816 $list->setListClass(
"il_Explorer");
817 $toc_tpl->setVariable(
"LIST", $list->getHTML());
820 $panel_toc = $ui_factory->panel()->standard(
"", $ui_factory->legacy($toc_tpl->get()));
821 $render_toc = $ui_renderer->render($panel_toc);
822 $dtmpl->setVariable(
"PANEL_TOC", $render_toc);
826 $panel_report = $ui_factory->panel()->report($report_title, $panels);
827 $render_report = $ui_renderer->render($panel_report);
828 $dtmpl->setVariable(
"PANEL_REPORT", $render_report);
831 $eval_tpl->setVariable(
'DETAIL', $dtmpl->get());
838 $eval_tpl->setVariable(
'CUMULATED', $table_gui->getHTML());
847 foreach ($path_full as
$data) {
848 $path .=
" » ";
849 $path .= $data[
'title'];
857 ? $this->
lng->txt(
"svy_eval_cumulated")
858 : $this->
lng->txt(
"svy_eval_detail"),
861 $eval_tpl->setCurrentBlock(
"print_header_bl");
862 foreach ($props as
$key => $value) {
863 $eval_tpl->setVariable(
"HEADER_PROP_KEY",
$key);
864 $eval_tpl->setVariable(
"HEADER_PROP_VALUE", $value);
865 $eval_tpl->parseCurrentBlock();
868 $this->log->debug(
"end");
870 $this->tpl->setContent($eval_tpl->get());
883 bool $quoteAll =
false,
884 string $separator =
";" 886 $resultarray = array();
887 foreach ($row as $rowindex => $entry) {
888 if (is_array($entry)) {
889 $entry = implode(
"/", $entry);
895 if (strpos($entry,
"\"") !==
false) {
896 $entry = str_replace(
"\"",
"\"\"", $entry);
899 if (strpos($entry, $separator) !==
false) {
903 $entry = str_replace(chr(13) . chr(10), chr(10), $entry);
905 $resultarray[$rowindex] = utf8_decode(
"\"" . $entry .
"\"");
907 $resultarray[$rowindex] = utf8_decode($entry);
917 $title_row = $title_row2 = array();
918 $title_row[] = $this->
lng->txt(
"lastname");
919 $title_row[] = $this->
lng->txt(
"firstname");
920 $title_row[] = $this->
lng->txt(
"login");
921 $title_row[] = $this->
lng->txt(
'workingtime');
922 $title_row[] = $this->
lng->txt(
'survey_results_finished');
928 if ($this->
object->canExportSurveyCode()) {
929 $title_row[] = $this->
lng->txt(
"codes");
933 $questions = array();
935 foreach ($this->
object->getSurveyQuestions() as $qdata) {
937 $q_res = $q_eval->getResults();
939 $questions[$qdata[
"question_id"]] = array($q_eval, $q_res);
941 $question = is_array($q_res)
942 ? $q_res[0][1]->getQuestion()
943 : $q_res->getQuestion();
945 $do_title = $do_label =
true;
946 switch ($this->request->getExportLabel()) {
948 $title_row[] = $question->label;
954 $title_row[] = $question->getTitle();
960 $title_row[] = $question->getTitle();
961 $title_row2[] = $question->label;
965 $q_eval->getUserSpecificVariableTitles($title_row, $title_row2, $do_title, $do_label);
971 $rows[] = $title_row;
972 if (implode(
"", $title_row2)) {
973 $rows[] = $title_row2;
979 $finished_ids = null;
980 if ($this->
object->get360Mode()) {
981 $appr_id = $this->request->getAppraiseeId();
983 $this->
ctrl->redirect($this,
"evaluationuser");
985 $finished_ids = $this->
object->getFinishedIdsForAppraiseeId($appr_id);
986 if (!count($finished_ids)) {
987 $finished_ids = array(-1);
992 $participants = $this->access_manager->canReadResultOfParticipants($finished_ids);
994 foreach ($participants as $user) {
995 $user_id = $user[
"active_id"];
998 $row[] = trim($user[
"lastname"] ??
"")
1000 : ($user[
"name"] ??
"");
1001 $row[] = $user[
"firstname"] ??
"";
1002 $row[] = $user[
"login"] ??
"";
1004 if ($this->
object->canExportSurveyCode()) {
1008 $row[] = $this->
object->getWorkingtimeForParticipant($user_id);
1010 if ($user[
"finished"] ??
false) {
1012 $row[] = ($this->request->getExportFormat() === self::TYPE_XLS)
1019 foreach ($questions as $item) {
1023 $q_eval->addUserSpecificResults($row, $user_id, $q_res);
1030 $surveyname = $this->
object->getTitle() .
" " . $this->
lng->txt(
"svy_eval_user") .
" " . date(
"Y-m-d");
1031 $surveyname = preg_replace(
"/\s/",
"_", trim($surveyname));
1034 switch ($this->request->getExportFormat()) {
1035 case self::TYPE_XLS:
1037 $excel->addSheet($this->
lng->txt(
"svy_eval_user"));
1039 foreach (
$rows as $row_idx => $row) {
1040 foreach ($row as $col_idx => $col) {
1041 $excel->setCell($row_idx + 1, $col_idx, $col);
1044 $excel->setBold(
"A1:" . $excel->getColumnCoord(count($row) - 1) .
"1");
1047 $excel->sendToClient($surveyname);
1053 foreach (
$rows as $csvrow) {
1054 $csvrow = str_replace(
"\n",
" ", $this->
processCSVRow($csvrow,
true, $separator));
1055 $csv .= implode($separator, $csvrow) .
"\n";
1071 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_permission"),
true);
1072 $this->
ctrl->redirectByClass(
"ilObjSurveyGUI",
"infoScreen");
1075 $ilToolbar->setFormAction($this->
ctrl->getFormAction($this,
"evaluationuser"));
1081 if ($this->
object->get360Mode()) {
1086 $modal_id =
"svy_ev_exp";
1090 $button->setCaption(
"export");
1091 $button->setOnClick(
'$(\'#' . $modal_id .
'\').modal(\
'show\')');
1092 $ilToolbar->addButtonInstance($button);
1094 $ilToolbar->addSeparator();
1096 $pv = $this->print->resultsDetails($this->
object->getRefId());
1097 $modal_elements = $pv->getModalElements(
1098 $this->
ctrl->getLinkTargetByClass(
1099 "ilSurveyEvaluationGUI",
1100 "printResultsPerUserSelection" 1103 $ilToolbar->addComponent($modal_elements->button);
1104 $ilToolbar->addComponent($modal_elements->modal);
1106 $data = $this->evaluation_manager->getUserSpecificResults();
1110 $table_gui->setData(
$data);
1111 $this->tpl->setContent($table_gui->getHTML() . $modal);
1124 $ilTabs->activateSubTab(
"svy_eval_competences");
1125 $ilTabs->activateTab(
"svy_results");
1127 $ilToolbar->setFormAction($this->
ctrl->getFormAction($this,
"competenceEval"));
1131 if ($appr_id === 0) {
1132 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"svy_no_appraisees_found"));
1136 $this->ui_modifier->setResultsCompetenceToolbar(
1139 $this->
user->getId()
1143 $eval_modes = array();
1147 $opts = $sskill->getAllAssignedSkillsAsOptions();
1149 foreach ($opts as
$id => $o) {
1150 $idarr = explode(
":",
$id);
1151 $skills[
$id] = array(
"id" =>
$id,
"title" => $o,
"profiles" => array(),
1152 "base_skill" => $idarr[0],
"tref_id" => $idarr[1]);
1157 $profiles = $this->skill_profile_service->getProfilesOfUser($appr_id);
1158 foreach ($profiles as $p) {
1159 $prof = $this->skill_profile_service->getById($p[
"id"]);
1160 $prof_levels = $prof->getSkillLevels();
1161 foreach ($prof_levels as $pl) {
1162 if (isset($skills[$pl[
"base_skill_id"] .
":" . $pl[
"tref_id"]])) {
1163 $skills[$pl[
"base_skill_id"] .
":" . $pl[
"tref_id"]][
"profiles"][] =
1166 $eval_modes[
"gap_" . $p[
"id"]] =
1167 $lng->
txt(
"svy_gap_analysis") .
": " . $prof->getTitle();
1174 foreach ($skills as $sk) {
1175 if (count($sk[
"profiles"]) === 0) {
1176 $eval_modes[
"skills_of_survey"] = $lng->
txt(
"svy_all_survey_competences");
1181 $comp_eval_mode = $this->request->getCompEvalMode();
1183 if (!isset($eval_modes[$comp_eval_mode])) {
1184 $comp_eval_mode = key($eval_modes);
1185 $ilCtrl->setParameter($this,
"comp_eval_mode", $comp_eval_mode);
1188 $ilCtrl->saveParameter($this,
"comp_eval_mode");
1191 $mode_sel->setOptions($eval_modes);
1192 $mode_sel->setValue($comp_eval_mode);
1193 $ilToolbar->addInputItem($mode_sel,
true);
1195 $ilToolbar->addFormButton($lng->
txt(
"select"),
"competenceEval");
1198 $rater = $this->evaluation_manager->getCurrentRater();
1199 if ($rater !==
"") {
1200 if (strpos($rater,
"u") === 0) {
1201 $rater = substr($rater, 1);
1203 $pskills_gui->setTriggerUserFilter([$rater]);
1206 if (strpos($comp_eval_mode,
"gap_") === 0) {
1208 $profile_id = (
int) substr($comp_eval_mode, 4);
1210 $pskills_gui->setProfileId($profile_id);
1211 $pskills_gui->setGapAnalysisActualStatusModePerObject($survey->getId(), $lng->
txt(
"skmg_eval_type_1"));
1212 if ($survey->getFinishedIdForAppraiseeIdAndRaterId($appr_id, $appr_id) > 0) {
1214 $self_levels = array();
1215 foreach ($sskill->determineSkillLevelsForAppraisee($appr_id,
true) as $sl) {
1216 $self_levels[$sl[
"base_skill_id"]][$sl[
"tref_id"]] = $sl[
"new_level_id"] ?? 0;
1218 $pskills_gui->setGapAnalysisSelfEvalLevels($self_levels);
1220 $html = $pskills_gui->getGapAnalysisHTML($appr_id);
1222 $pskills_gui->setGapAnalysisActualStatusModePerObject($survey->getId(), $lng->
txt(
"skmg_eval_type_1"));
1223 if ($survey->getFinishedIdForAppraiseeIdAndRaterId($appr_id, $appr_id) > 0) {
1225 $self_levels = array();
1226 foreach ($sskill->determineSkillLevelsForAppraisee($appr_id,
true) as $sl) {
1227 $self_levels[$sl[
"base_skill_id"]][$sl[
"tref_id"]] = $sl[
"new_level_id"] ?? 0;
1229 $pskills_gui->setGapAnalysisSelfEvalLevels($self_levels);
1232 foreach ($skills as $skill) {
1234 "base_skill_id" => (
int) $skill[
"base_skill"],
1235 "tref_id" => (
int) $skill[
"tref_id"]
1238 $html = $pskills_gui->getGapAnalysisHTML($appr_id, $sk);
1249 return $this->
access->checkRbacOrPositionPermissionAccess(
'read_results',
'access_results', $this->
object->getRefId());
1261 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_permission"),
true);
1262 $this->
ctrl->redirectByClass(
"ilObjSurveyGUI",
"infoScreen");
1265 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"svy_max_sum_score") .
": " . $this->
object->getMaxSumScore());
1267 $ilToolbar->setFormAction($this->
ctrl->getFormAction($this,
"evaluationuser"));
1269 $modal_id =
"svy_ev_exp";
1273 $button->setCaption(
"print");
1274 $button->setOnClick(
"window.print(); return false;");
1275 $button->setOmitPreventDoubleSubmission(
true);
1276 $ilToolbar->addButtonInstance($button);
1278 $finished_ids = null;
1283 $this->tpl->setContent($table_gui->getHTML() . $modal);
1290 ?array $a_finished_ids = null
1293 foreach ($this->access_manager->canReadResultOfParticipants($a_finished_ids) as $p) {
1294 $sum_scores[$p[
"active_id"]] = [
1295 "username" => $p[
"sortname"],
1300 foreach ($this->
object->getSurveyQuestions() as $qdata) {
1302 foreach ($q_eval->getSumScores() as $finished_id => $sum_score) {
1303 if ($sum_score === null) {
1304 $sum_scores[$finished_id][
"score"] = null;
1306 if ($sum_scores[$finished_id][
"score"] !== null) {
1307 $sum_scores[$finished_id][
"score"] += (
int) $sum_score;
1319 $view = $this->print->resultsOverview($this->
object->getRefId());
1328 $this->
ctrl->setParameterByClass(
1329 "ilSurveyEvaluationGUI",
1331 $this->request->getVW()
1333 $this->
ctrl->setParameterByClass(
1334 "ilSurveyEvaluationGUI",
1336 $this->request->getCP()
1338 $view = $this->print->resultsDetails($this->
object->getRefId());
1344 $view = $this->print->resultsDetails($this->
object->getRefId());
1345 $view->sendPrintView();
1353 $view = $this->print->resultsPerUser($this->
object->getRefId());
1359 $view = $this->print->resultsPerUser($this->
object->getRefId());
1360 $view->sendPrintView();
getExportGrid($a_results)
Get grid data.
printResultsDetailsSelection()
setAppraiseeId(int $a_val)
setEvalSubtabs()
Set the tabs for the evaluation output.
evaluationuser()
Print the survey evaluation for a selected user.
static getLogger(string $a_component_id)
Get component logger.
const EVALUATION_ACCESS_OFF
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
exportResultsDetailsExcel(ilExcel $a_excel, SurveyQuestionEvaluation $a_eval, $a_results, bool $a_do_title, bool $a_do_label)
Export details (excel only)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const EVALUATION_ACCESS_PARTICIPANTS
cancelEvaluationAccess()
Cancels the input of the survey access code for evaluation access.
ILIAS Skill Service SkillProfileService $skill_profile_service
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getQuestionblock(int $questionblock_id)
get question block properties
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
static _getQuestionTypeName(string $type_tag)
Return the translation for a given question type.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setCell(int $a_row, int $a_col, $a_value, ?string $a_datatype=null)
Set cell value.
ILIAS Survey Evaluation EvaluationManager $evaluation_manager
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
printResultsPerUserSelection()
ILIAS Survey Access AccessManager $access_manager
checkEvaluationAccess()
Checks the evaluation access after entering the survey access code.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getPathFull(int $a_endnode_id, int $a_startnode_id=0)
get path from a given startnode to a given endnode if startnode is not given the rootnode is startnod...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjId(int $ref_id)
static _instanciateQuestionEvaluation(int $question_id, array $a_finished_ids=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getASCIIFilename(string $a_filename)
hasResultsAccess()
Check if user can view results granted by rbac or positions.
Personal skills GUI class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setBold(string $a_coords)
Set cell(s) to bold.
exportCumulatedResults(int $details=0)
setContent(string $a_html)
Sets content for standard template.
getCoordByColumnAndRow(int $pColumn=1, int $pRow=1)
Get cell coordinate (e.g.
static _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
Get static link.
parseResultsToExcel(ilExcel $a_excel, ilSurveyEvaluationResults $a_results, int &$a_excel_row, array $a_grid=null, array $a_text_answers=null, bool $a_include_mode=true)
ILIAS Survey Mode UIModifier $ui_modifier
checkAnonymizedEvaluationAccess()
addSheet(string $a_name, bool $a_activate=true)
Add sheet.
setSumScores(array $scores)
ILIAS Survey Evaluation EvaluationGUIRequest $request
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
evaluation(int $details=0)
static _hasEvaluationAccess(int $a_obj_id, int $user_id)
processCSVRow(array $row, bool $quoteAll=false, string $separator=";")
Processes an array as a CSV row and converts the array values to correct CSV values.
const EVALUATION_ACCESS_ALL
buildExportModal(string $a_id, string $a_cmd)
get modal html
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getSumScores(?array $a_finished_ids=null)
setColors(string $a_coords, string $a_background, string $a_font=null)
Set cell(s) colors.
evaluationdetails()
Show the detailed evaluation.
static setUseRelativeDates(bool $a_status)
set use relative dates
sumscore()
Show sum score table.
ILIAS Survey PrintView GUIService $print
printResultsOverviewSelection()
ilGlobalTemplateInterface $tpl
__construct(ilObjSurvey $a_object)
getTextAnswers($a_results)
Get text answers.