35 protected \ILIAS\Survey\InternalGUIService
$gui;
37 protected \ILIAS\Survey\PrintView\GUIService
$print;
45 protected \ILIAS\DI\UIServices
$ui;
59 protected \ILIAS\Survey\Evaluation\EvaluationGUIRequest
$request;
67 $this->
tabs = $DIC->tabs();
68 $this->
access = $DIC->access();
69 $this->
user = $DIC->user();
70 $this->rbacsystem = $DIC->rbac()->system();
71 $this->tree = $DIC->repositoryTree();
72 $this->
toolbar = $DIC->toolbar();
73 $this->
ui = $DIC->ui();
74 $lng = $DIC->language();
76 $ilCtrl = $DIC->ctrl();
80 $this->
ctrl = $ilCtrl;
81 $this->
object = $a_object;
83 $this->array_panels = array();
85 $this->request = $DIC->survey()->internal()->gui()->evaluation($this->
object)->request();
87 $this->
ctrl->saveParameter($this, [
"appr_id",
"rater_id"]);
88 $this->evaluation_manager = $DIC
94 $DIC->user()->getId(),
95 $this->request->getAppraiseeId(),
96 $this->request->getRaterId()
100 $this->evaluation_manager->getCurrentAppraisee()
103 $this->ui_modifier = $DIC->survey()
106 ->modeUIModifier($this->
object->getMode());
107 $this->print = $DIC->survey()
111 $this->access_manager = $DIC->survey()
115 $this->
object->getRefId(),
116 $DIC->user()->getId()
118 $this->skill_profile_service = $DIC->skills()->profile();
119 $this->gui = $DIC->survey()->internal()->gui();
125 if ($this->
object->getSkillService() && $skmg_set->isActivated()) {
126 $cmd = $this->
ctrl->getCmd(
"competenceEval");
128 $cmd = $this->
ctrl->getCmd(
"evaluation");
131 $next_class = $this->
ctrl->getNextClass($this);
133 $this->log->debug($cmd);
135 switch ($next_class) {
138 $ret = (string) $this->$cmd();
152 if ($this->
object->getSkillService() && $skmg_set->isActivated()) {
153 $ilTabs->addSubTabTarget(
154 "svy_eval_competences",
155 $this->
ctrl->getLinkTarget($this,
"competenceEval"),
156 array(
"competenceEval")
161 $ilTabs->addSubTabTarget(
162 "svy_eval_cumulated",
163 $this->
ctrl->getLinkTarget($this,
"evaluation"),
164 array(
"evaluation",
"checkEvaluationAccess")
168 $ilTabs->addSubTabTarget(
170 $this->
ctrl->getLinkTarget($this,
"evaluationdetails"),
171 array(
"evaluationdetails")
175 $ilTabs->addSubTabTarget(
177 $this->
ctrl->getLinkTarget($this,
"evaluationuser"),
178 array(
"evaluationuser")
182 if ($this->
object->getCalculateSumScore()) {
183 $ilTabs->addSubTabTarget(
185 $this->
ctrl->getLinkTarget($this,
"sumscore"),
195 $this->appr_id = $a_val;
207 if ($this->
object->getAnonymize() === 1 &&
208 $this->evaluation_manager->getAnonEvaluationAccess() === $this->request->getRefId()) {
216 if ($this->
object->getAnonymize() === 1) {
217 $this->evaluation_manager->setAnonEvaluationAccess($this->request->getRefId());
222 if ($this->
object->getAnonymize() === 1) {
224 $surveycode = $this->
object->getUserAccessCode($ilUser->getId());
225 if ($this->
object->isAnonymizedParticipant($surveycode)) {
226 $this->evaluation_manager->setAnonEvaluationAccess($this->request->getRefId());
231 $this->tpl->setVariable(
"TABS",
"");
232 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_evaluation_checkaccess.html",
"components/ILIAS/Survey");
233 $this->tpl->setCurrentBlock(
"adm_content");
234 $this->tpl->setVariable(
"AUTHENTICATION_NEEDED", $this->
lng->txt(
"svy_check_evaluation_authentication_needed"));
235 $this->tpl->setVariable(
"FORM_ACTION", $this->
ctrl->getFormAction($this,
"checkEvaluationAccess"));
236 $this->tpl->setVariable(
"EVALUATION_CHECKACCESS_INTRODUCTION", $this->
lng->txt(
"svy_check_evaluation_access_introduction"));
237 $this->tpl->setVariable(
"VALUE_CHECK", $this->
lng->txt(
"ok"));
238 $this->tpl->setVariable(
"VALUE_CANCEL", $this->
lng->txt(
"cancel"));
239 $this->tpl->setVariable(
"TEXT_SURVEY_CODE", $this->
lng->txt(
"survey_code"));
240 $this->tpl->parseCurrentBlock();
243 $this->evaluation_manager->clearAnonEvaluationAccess();
252 $surveycode = $this->request->getSurveyCode();
253 if ($this->
object->isAnonymizedParticipant($surveycode)) {
254 $this->evaluation_manager->setAnonEvaluationAccess($this->request->getRefId());
257 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"svy_check_evaluation_wrong_key",
true));
270 $ilCtrl->setParameterByClass(
275 $ilCtrl->redirectByClass(
"ilrepositorygui",
"frameset");
289 $finished_ids =
null;
290 if ($this->
object->get360Mode()) {
291 $appr_id = $this->request->getAppraiseeId();
293 $this->
ctrl->redirect($this, $details ?
"evaluationdetails" :
"evaluation");
295 $finished_ids = $this->
object->getFinishedIdsForAppraiseeId($appr_id);
296 if (!count($finished_ids)) {
297 $finished_ids = array(-1);
302 $title_row = array();
303 $do_title = $do_label =
true;
304 switch ($this->request->getExportLabel()) {
306 $title_row[] = $this->
lng->txt(
"label");
311 $title_row[] = $this->
lng->txt(
"title");
316 $title_row[] = $this->
lng->txt(
"title");
317 $title_row[] = $this->
lng->txt(
"label");
320 $title_row[] = $this->
lng->txt(
"question");
321 $title_row[] = $this->
lng->txt(
"question_type");
322 $title_row[] = $this->
lng->txt(
"users_answered");
323 $title_row[] = $this->
lng->txt(
"users_skipped");
324 $title_row[] = $this->
lng->txt(
"mode");
325 $title_row[] = $this->
lng->txt(
"mode_text");
326 $title_row[] = $this->
lng->txt(
"mode_nr_of_selections");
327 $title_row[] = $this->
lng->txt(
"median");
328 $title_row[] = $this->
lng->txt(
"arithmetic_mean");
333 switch ($this->request->getExportFormat()) {
336 $excel->addSheet($this->
lng->txt(
"svy_eval_cumulated"));
337 $excel->setCellArray(array($title_row),
"A1");
338 $excel->setBold(
"A1:" . $excel->getColumnCoord(count($title_row) - 1) .
"1");
341 case self::TYPE_SPSS:
342 $csvfile = array($title_row);
350 foreach ($this->
object->getSurveyQuestions() as $qdata) {
352 $q_res = $q_eval->getResults();
353 $ov_rows = $q_eval->exportResults($q_res, $do_title, $do_label);
355 switch ($this->request->getExportFormat()) {
357 $excel->setActiveSheet(0);
358 foreach ($ov_rows as $row) {
359 foreach ($row as $col => $value) {
360 $excel->setCell($ov_row, $col, $value);
366 case self::TYPE_SPSS:
367 foreach ($ov_rows as $row) {
374 switch ($this->request->getExportFormat()) {
384 ? $this->
lng->txt(
"svy_eval_cumulated")
385 : $this->
lng->txt(
"svy_eval_detail");
387 $surveyname = $this->
object->getTitle() .
" " . $type .
" " . date(
"Y-m-d");
388 $surveyname = preg_replace(
"/\s/",
"_", trim($surveyname));
392 switch ($this->request->getExportFormat()) {
394 $excel->sendToClient($surveyname);
397 case self::TYPE_SPSS:
400 foreach ($csvfile as $csvrow) {
402 $csv .= implode($separator, $csvrow) .
"\n";
422 $question_res = $a_results;
424 if (is_array($question_res)) {
425 $question_res = $question_res[0][1];
428 $question = $question_res->getQuestion();
430 $a_excel->
addSheet($question_index .
"_" . $question->getTitle());
438 $kv[$this->
lng->txt(
"title")] = $question->getTitle();
441 $kv[$this->
lng->txt(
"label")] = $question->label;
445 $kv[$this->
lng->txt(
"question")] = $question->getQuestiontext();
453 $kv[$this->
lng->txt(
"users_answered")] = $question_res->getUsersAnswered();
454 $kv[$this->
lng->txt(
"users_skipped")] = $question_res->getUsersSkipped();
458 foreach ($kv as $key => $value) {
459 $a_excel->
setCell($excel_row, 0, $key);
460 $a_excel->
setCell($excel_row++, 1, $value);
485 foreach ($a_results as $row_results) {
486 $row_title = $row_results[0];
488 $a_excel->
setCell($excel_row, 0, $this->
lng->txt(
"row"));
489 $a_excel->
setCell($excel_row++, 1, $row_title);
496 is_array($texts[$row_title] ??
false)
497 ? array(
"" => $texts[$row_title])
505 $a_excel->
setCell($excel_row++, 0, $this->
lng->txt(
"overview"));
509 $cats = $question->getColumns();
510 foreach ($cats->getCategories() as $cat) {
512 $a_excel->
setCell($excel_row, 1 + $counter, $cat->title);
517 foreach ($a_results as $row_results) {
518 $row_title = $row_results[0];
520 $a_excel->
setCell($excel_row, 0, $row_title);
522 $vars = $row_results[1]->getVariables();
524 foreach ($vars as $var) {
525 $a_excel->
setCell($excel_row, ++$counter, $var->abs);
533 $a_excel->
setBold(
"A1:A" . $excel_row);
540 ?array $a_grid =
null,
541 ?array $a_text_answers =
null,
542 bool $a_include_mode =
true 546 if ($a_include_mode) {
562 $kv[$this->
lng->txt(
"arithmetic_mean")] = $a_results->
getMean();
566 foreach ($kv as $key => $value) {
567 $a_excel->
setCell($a_excel_row, 0, $key);
568 $a_excel->
setCell($a_excel_row++, 1, $value);
574 $a_excel->
setColors(
"B" . $a_excel_row .
":E" . $a_excel_row, self::EXCEL_SUBTITLE);
575 $a_excel->
setCell($a_excel_row, 0, $this->
lng->txt(
"svy_categories"));
576 foreach ($a_grid[
"cols"] as $col_idx => $col) {
577 $a_excel->
setCell($a_excel_row, $col_idx + 1, $col);
582 foreach ($a_grid[
"rows"] as $cols) {
583 foreach ($cols as $col_idx => $col) {
584 $a_excel->
setCell($a_excel_row, $col_idx + 1, $col);
591 if ($a_text_answers) {
593 $a_excel->
setCell($a_excel_row, 0, $this->
lng->txt(
"freetext_answers"));
596 if (!is_array($a_text_answers[
""] ??
null)) {
597 $a_excel->
setColors(
"B" . $a_excel_row .
":C" . $a_excel_row, self::EXCEL_SUBTITLE);
598 $a_excel->
setCell($a_excel_row, 1, $this->
lng->txt(
"title"));
599 $a_excel->
setCell($a_excel_row++, 2, $this->
lng->txt(
"answer"));
603 $a_excel->
setColors(
"B" . $a_excel_row .
":B" . $a_excel_row, self::EXCEL_SUBTITLE);
604 $a_excel->
setCell($a_excel_row++, 1, $this->
lng->txt(
"answer"));
607 foreach ($a_text_answers as $var => $items) {
608 foreach ($items as $item) {
609 if (!is_array($a_text_answers[
""] ?? null)) {
610 $a_excel->
setCell($a_excel_row, 1, $var);
611 $a_excel->
setCell($a_excel_row++, 2, $item);
613 $a_excel->
setCell($a_excel_row++, 1, $item);
622 if ($this->request->getExportFormat() !==
'') {
625 $this->
ctrl->redirect($this,
'evaluation');
631 if ($this->request->getExportFormat() !==
'') {
634 $this->
ctrl->redirect($this,
'evaluation');
640 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'use_browser_print_function'),
true);
641 $this->
ctrl->redirect($this,
'evaluation');
650 $ui_fac = $this->gui->ui()->factory();
654 $button = $ui_fac->button()->standard(
657 )->withOnClick($modal->getShowSignal());
667 $ui_fac = $this->gui->ui()->factory();
669 $post_url = $ctrl->
getFormAction($this,
"validateAndSubmitExportForm");
671 $inputs[
"export_format"] = $ui_fac->input()->field()->select(
672 $lng->
txt(
"filetype"),
679 ->withRequired(
true);
681 $inputs[
"export_label"] = $ui_fac->input()->field()->select(
684 "label_only" => $lng->
txt(
"export_label_only"),
685 "title_only" => $lng->
txt(
"export_title_only"),
686 "title_label" => $lng->
txt(
"export_title_label")
690 ->withRequired(
true);
692 $modal = $ui_fac->modal()->roundtrip(
693 $lng->
txt(
"svy_export_format"),
698 ->withSubmitLabel($lng->
txt(
"export"));
710 $ui_request = $this->gui->http()->request();
712 $export_cmd = $request->getExportCmd();
715 if (
"POST" === $ui_request->getMethod()) {
716 $modal = $modal->withRequest($ui_request);
717 $data = $modal->getData();
721 $ctrl->
redirect($this, $export_cmd);
723 switch ($export_cmd) {
728 case "exportDetailData":
732 case "exportEvaluationUser":
733 $toolbar->
addComponent($modal->withOnLoad($modal->getShowSignal()));
741 switch ($export_cmd) {
743 $ctrl->
redirect($this,
"evaluation");
745 case "exportDetailData":
746 $ctrl->
redirect($this,
"evaluationdetails");
748 case "exportEvaluationUser":
749 $ctrl->
redirect($this,
"evaluationuser");
756 if ($this->
object->getSkillService() && $skmg_set->isActivated()) {
774 $ui_factory = $ui->factory();
775 $ui_renderer = $ui->renderer();
777 $this->
lng->loadLanguageModule(
"survey");
779 $this->log->debug(
"check access");
783 if (!$this->
access->checkAccess(
'read',
'', $this->object->getRefId())) {
784 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"));
788 switch ($this->
object->getEvaluationAccess()) {
791 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"));
799 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"));
806 $this->log->debug(
"check access ok");
809 $appr_id = $this->evaluation_manager->getCurrentAppraisee();
810 $ilToolbar->setFormAction($this->
ctrl->getFormAction($this));
813 $eval_tpl =
new ilTemplate(
"tpl.il_svy_svy_evaluation.html",
true,
true,
"components/ILIAS/Survey");
817 $this->ui_modifier->setResultsDetailToolbar(
820 $this->
user->getId(),
824 $this->ui_modifier->setResultsOverviewToolbar(
827 $this->
user->getId(),
835 $dtmpl =
new ilTemplate(
"tpl.il_svy_svy_results_details.html",
true,
true,
"components/ILIAS/Survey/Evaluation");
836 $toc_tpl =
new ilTemplate(
"tpl.svy_results_table_contents.html",
true,
true,
"components/ILIAS/Survey/Evaluation");
837 $this->
lng->loadLanguageModule(
"content");
838 $toc_tpl->setVariable(
"TITLE_TOC", $this->
lng->txt(
'cont_toc'));
841 $finished_ids = $this->evaluation_manager->getFilteredFinishedIds();
844 $listing = $this->gui->listing();
847 foreach ($this->
object->getSurveyQuestions() as $qdata) {
849 $q_res = $q_eval->getResults();
853 $panels = array_merge(
855 $this->ui_modifier->getDetailPanels(
856 $this->object->getSurveyParticipants(),
863 if ($qdata[
"questionblock_id"] &&
864 $qdata[
"questionblock_id"] != $this->last_questionblock_id) {
866 if ($qblock[
"show_blocktitle"]) {
868 $this->
ui->factory()->legacy()->content($qdata[
"questionblock_title"]),
869 "q" . $qdata[
"questionblock_id"]
873 $this->
ui->factory()->legacy()->content(
""),
874 "q" . $qdata[
"questionblock_id"]
877 $this->last_questionblock_id = $qdata[
"questionblock_id"];
879 $anchor_id =
"svyrdq" . $qdata[
"question_id"];
881 $this->
ui->factory()->link()->standard($qdata[
"title"],
"#" . $anchor_id),
882 (string) $qdata[
"question_id"],
883 $qdata[
"questionblock_id"] ?
"q" . $qdata[
"questionblock_id"] :
"0" 889 $toc_tpl->setVariable(
"LIST", $listing->render());
892 $panel_toc = $ui_factory->panel()->standard(
"", $ui_factory->legacy()->content($toc_tpl->get()));
893 $render_toc = $ui_renderer->render($panel_toc);
894 $dtmpl->setVariable(
"PANEL_TOC", $render_toc);
898 $panel_report = $ui_factory->panel()->report($report_title, $panels);
899 $render_report = $ui_renderer->render($panel_report);
900 $dtmpl->setVariable(
"PANEL_REPORT", $render_report);
903 $eval_tpl->setVariable(
'DETAIL', $dtmpl->get());
910 $eval_tpl->setVariable(
'CUMULATED', $table_gui->getHTML());
919 foreach ($path_full as
$data) {
920 $path .=
" » ";
921 $path .= $data[
'title'];
928 $this->
lng->txt(
"svy_results") => !$details
929 ? $this->
lng->txt(
"svy_eval_cumulated")
930 : $this->
lng->txt(
"svy_eval_detail"),
933 $eval_tpl->setCurrentBlock(
"print_header_bl");
934 foreach ($props as $key => $value) {
935 $eval_tpl->setVariable(
"HEADER_PROP_KEY", $key);
936 $eval_tpl->setVariable(
"HEADER_PROP_VALUE", $value);
937 $eval_tpl->parseCurrentBlock();
940 $this->log->debug(
"end");
942 $this->tpl->setContent($eval_tpl->get());
955 bool $quoteAll =
false,
956 string $separator =
";" 958 $resultarray = array();
959 foreach ($row as $rowindex => $entry) {
960 if (is_array($entry)) {
961 $entry = implode(
"/", $entry);
967 if (strpos($entry ??
"",
"\"") !==
false) {
968 $entry = str_replace(
"\"",
"\"\"", (
string) $entry);
971 if (strpos($entry ??
"", $separator) !==
false) {
975 $entry = str_replace(chr(13) . chr(10), chr(10), (
string) $entry);
978 $resultarray[$rowindex] =
"\"" . $entry .
"\"";
981 $resultarray[$rowindex] = $entry;
991 $title_row = $title_row2 = array();
992 $title_row[] = $this->
lng->txt(
"lastname");
993 $title_row[] = $this->
lng->txt(
"firstname");
994 $title_row[] = $this->
lng->txt(
"login");
995 $title_row[] = $this->
lng->txt(
'workingtime');
996 $title_row[] = $this->
lng->txt(
'survey_results_finished');
1002 if ($this->
object->canExportSurveyCode()) {
1003 $title_row[] = $this->
lng->txt(
"codes");
1007 $questions = array();
1009 foreach ($this->
object->getSurveyQuestions() as $qdata) {
1011 $q_res = $q_eval->getResults();
1013 $questions[$qdata[
"question_id"]] = array($q_eval, $q_res);
1015 $question = is_array($q_res)
1016 ? $q_res[0][1]->getQuestion()
1017 : $q_res->getQuestion();
1019 $do_title = $do_label =
true;
1020 switch ($this->request->getExportLabel()) {
1022 $title_row[] = $question->label;
1028 $title_row[] = $question->getTitle();
1034 $title_row[] = $question->getTitle();
1035 $title_row2[] = $question->label;
1039 $q_eval->getUserSpecificVariableTitles($title_row, $title_row2, $do_title, $do_label);
1045 $rows[] = $title_row;
1046 if (implode(
"", $title_row2)) {
1047 $rows[] = $title_row2;
1053 $finished_ids =
null;
1054 if ($this->
object->get360Mode()) {
1055 $appr_id = $this->request->getAppraiseeId();
1057 $this->
ctrl->redirect($this,
"evaluationuser");
1059 $finished_ids = $this->
object->getFinishedIdsForAppraiseeId($appr_id);
1060 if (!count($finished_ids)) {
1061 $finished_ids = array(-1);
1066 $participants = $this->access_manager->canReadResultOfParticipants($finished_ids);
1068 foreach ($participants as $user) {
1072 $row[] = trim($user[
"lastname"] ??
"")
1074 : ($user[
"name"] ??
"");
1075 $row[] = $user[
"firstname"] ??
"";
1076 $row[] = $user[
"login"] ??
"";
1078 if ($this->
object->canExportSurveyCode()) {
1082 $row[] = $this->
object->getWorkingtimeForParticipant(
$user_id);
1084 if ($user[
"finished"] ??
false) {
1086 $row[] = ($this->request->getExportFormat() === self::TYPE_XLS)
1093 foreach ($questions as $item) {
1097 $q_eval->addUserSpecificResults($row,
$user_id, $q_res);
1104 $surveyname = $this->
object->getTitle() .
" " . $this->
lng->txt(
"svy_eval_user") .
" " . date(
"Y-m-d");
1105 $surveyname = preg_replace(
"/\s/",
"_", trim($surveyname));
1108 switch ($this->request->getExportFormat()) {
1109 case self::TYPE_XLS:
1111 $excel->addSheet($this->
lng->txt(
"svy_eval_user"));
1113 foreach ($rows as $row_idx => $row) {
1114 foreach ($row as $col_idx => $col) {
1115 $excel->setCell($row_idx + 1, $col_idx, $col);
1118 $excel->setBold(
"A1:" . $excel->getColumnCoord(count($row) - 1) .
"1");
1121 $excel->sendToClient($surveyname);
1124 case self::TYPE_SPSS:
1127 foreach ($rows as $csvrow) {
1128 $csvrow = str_replace(
"\n",
" ", $this->
processCSVRow($csvrow,
true, $separator));
1129 $csv .= implode($separator, $csvrow) .
"\n";
1145 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_permission"),
true);
1146 $this->
ctrl->redirectByClass(
"ilObjSurveyGUI",
"infoScreen");
1152 if ($this->
object->get360Mode()) {
1159 $ilToolbar->addSeparator();
1161 $pv = $this->print->resultsDetails($this->
object->getRefId());
1162 $modal_elements = $pv->getModalElements(
1163 $this->
ctrl->getLinkTargetByClass(
1164 "ilSurveyEvaluationGUI",
1165 "printResultsPerUserSelection" 1168 $ilToolbar->addComponent($modal_elements->button);
1169 $ilToolbar->addComponent($modal_elements->modal);
1171 $data = $this->evaluation_manager->getUserSpecificResults();
1175 $table_gui->setData(
$data);
1176 $this->tpl->setContent($table_gui->getHTML());
1189 $ilTabs->activateSubTab(
"svy_eval_competences");
1190 $ilTabs->activateTab(
"svy_results");
1192 $ilToolbar->setFormAction($this->
ctrl->getFormAction($this,
"competenceEval"));
1196 if ($appr_id === 0) {
1197 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"svy_no_appraisees_found"));
1201 $this->ui_modifier->setResultsCompetenceToolbar(
1204 $this->
user->getId()
1208 $eval_modes = array();
1212 $opts = $sskill->getAllAssignedSkillsAsOptions();
1214 foreach ($opts as
$id => $o) {
1215 $idarr = explode(
":",
$id);
1216 $skills[
$id] = array(
"id" =>
$id,
"title" => $o,
"profiles" => array(),
1217 "base_skill" => $idarr[0],
"tref_id" => $idarr[1]);
1222 $profiles = $this->skill_profile_service->getProfilesOfUser($appr_id);
1223 foreach ($profiles as $p) {
1224 $prof_levels = $this->skill_profile_service->getSkillLevels($p->getId());
1225 foreach ($prof_levels as $pl) {
1226 if (isset($skills[$pl->getBaseSkillId() .
":" . $pl->getTrefId()])) {
1227 $skills[$pl->getBaseSkillId() .
":" . $pl->getTrefId()][
"profiles"][] =
1230 $eval_modes[
"gap_" . $p->getId()] =
1231 $lng->
txt(
"svy_gap_analysis") .
": " . $p->getTitle();
1238 foreach ($skills as $sk) {
1239 if (count($sk[
"profiles"]) === 0) {
1240 $eval_modes[
"skills_of_survey"] = $lng->
txt(
"svy_all_survey_competences");
1245 $comp_eval_mode = $this->request->getCompEvalMode();
1247 if (!isset($eval_modes[$comp_eval_mode])) {
1248 $comp_eval_mode = key($eval_modes);
1249 $ilCtrl->setParameter($this,
"comp_eval_mode", $comp_eval_mode);
1252 $ilCtrl->saveParameter($this,
"comp_eval_mode");
1256 $mode_sel->setValue($comp_eval_mode);
1257 $ilToolbar->addInputItem($mode_sel,
true);
1259 $ilToolbar->addFormButton($lng->
txt(
"select"),
"competenceEval");
1262 $rater = $this->evaluation_manager->getCurrentRater(
1265 if ($rater !==
"") {
1266 if (strpos($rater ??
"",
"u") === 0) {
1267 $rater = substr($rater, 1);
1269 $pskills_gui->setTriggerUserFilter($rater);
1270 $pskills_gui->setHistoryView(
true);
1273 if (strpos($comp_eval_mode ??
"",
"gap_") === 0) {
1275 $profile_id = (
int) substr($comp_eval_mode, 4);
1277 $pskills_gui->setProfileId($profile_id);
1278 $pskills_gui->setGapAnalysisActualStatusModePerObject($survey->getId(), $lng->
txt(
"skmg_eval_type_1"));
1279 if ($survey->getFinishedIdForAppraiseeIdAndRaterId($appr_id, $appr_id) > 0) {
1281 $self_levels = array();
1282 foreach ($sskill->determineSkillLevelsForAppraisee($appr_id,
true) as $sl) {
1283 $self_levels[$sl[
"base_skill_id"]][$sl[
"tref_id"]] = $sl[
"new_level_id"] ?? 0;
1285 $pskills_gui->setGapAnalysisSelfEvalLevels($self_levels);
1287 $html = $pskills_gui->getGapAnalysisHTML($appr_id);
1289 $pskills_gui->setGapAnalysisActualStatusModePerObject($survey->getId(), $lng->
txt(
"skmg_eval_type_1"));
1290 if ($survey->getFinishedIdForAppraiseeIdAndRaterId($appr_id, $appr_id) > 0) {
1292 $self_levels = array();
1293 foreach ($sskill->determineSkillLevelsForAppraisee($appr_id,
true) as $sl) {
1294 $self_levels[$sl[
"base_skill_id"]][$sl[
"tref_id"]] = $sl[
"new_level_id"] ?? 0;
1296 $pskills_gui->setGapAnalysisSelfEvalLevels($self_levels);
1299 foreach ($skills as $skill) {
1301 "base_skill_id" => (
int) $skill[
"base_skill"],
1302 "tref_id" => (
int) $skill[
"tref_id"]
1305 $html = $pskills_gui->getGapAnalysisHTML($appr_id, $sk);
1316 return $this->
access->checkRbacOrPositionPermissionAccess(
'read_results',
'access_results', $this->
object->getRefId());
1326 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_permission"),
true);
1327 $this->
ctrl->redirectByClass(
"ilObjSurveyGUI",
"infoScreen");
1330 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"svy_max_sum_score") .
": " . $this->
object->getMaxSumScore());
1333 $this->
lng->txt(
"print"),
1335 )->onClick(
"window.print(); return false;")->toToolbar();
1337 $finished_ids =
null;
1342 $this->tpl->setContent($table_gui->getHTML());
1349 ?array $a_finished_ids =
null 1352 foreach ($this->access_manager->canReadResultOfParticipants($a_finished_ids) as $p) {
1353 $sum_scores[$p[
"active_id"]] = [
1354 "username" => $p[
"sortname"],
1359 foreach ($this->
object->getSurveyQuestions() as $qdata) {
1361 foreach ($q_eval->getSumScores() as $finished_id => $sum_score) {
1362 if ($sum_score ===
null) {
1363 $sum_scores[$finished_id][
"score"] =
null;
1365 if ($sum_scores[$finished_id][
"score"] !==
null) {
1366 $sum_scores[$finished_id][
"score"] += (
int) $sum_score;
1378 $view = $this->print->resultsOverview($this->
object->getRefId());
1387 $this->
ctrl->setParameterByClass(
1388 "ilSurveyEvaluationGUI",
1390 $this->request->getVW()
1392 $this->
ctrl->setParameterByClass(
1393 "ilSurveyEvaluationGUI",
1395 $this->request->getCP()
1397 $view = $this->print->resultsDetails($this->
object->getRefId());
1403 $view = $this->print->resultsDetails($this->
object->getRefId());
1404 $view->sendPrintView();
1412 $view = $this->print->resultsPerUser($this->
object->getRefId());
1418 $view = $this->print->resultsPerUser($this->
object->getRefId());
1419 $view->sendPrintView();
This describes commonalities between the different modals.
static array static setUseRelativeDates(bool $a_status)
set use relative dates
getFormAction(object $a_gui_obj, ?string $a_fallback_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
getExportGrid($a_results)
Get grid data.
printResultsDetailsSelection()
setAppraiseeId(int $a_val)
exportResultsDetailsExcel(ilExcel $a_excel, SurveyQuestionEvaluation $a_eval, $a_results, bool $a_do_title, bool $a_do_label, int $question_index)
Export details (excel only)
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...
Skill management settings.
const EVALUATION_ACCESS_PARTICIPANTS
cancelEvaluationAccess()
Cancels the input of the survey access code for evaluation access.
activateSubTab(string $a_id)
ILIAS Skill Service SkillProfileService $skill_profile_service
static _getQuestionblock(int $questionblock_id)
get question block properties
buildExportButtonAndModal(string $export_cmd)
setContent(string $a_html)
Sets content for standard template.
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...
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getASCIIFilename(string $a_filename)
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)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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...
setColors(string $a_coords, string $a_background, ?string $a_font=null)
Set cell(s) colors.
setCell(int $a_row, int $col, $value, ?string $datatype=null, bool $disable_strip_tags_for_strings=false)
Set cell value.
setBold(string $a_coords)
Set cell(s) to bold.
static _instanciateQuestionEvaluation(int $question_id, ?array $a_finished_ids=null)
exportCumulatedResults(int $details=0)
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
validateAndSubmitExportForm()
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="")
ILIAS Survey Mode UIModifier $ui_modifier
checkAnonymizedEvaluationAccess()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addSheet(string $a_name, bool $a_activate=true)
Add sheet.
setSumScores(array $scores)
ILIAS Survey Evaluation EvaluationGUIRequest $request
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
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
Survey evaluation graphical output.
getSumScores(?array $a_finished_ids=null)
ILIAS Survey InternalGUIService $gui
evaluationdetails()
Show the detailed evaluation.
sumscore()
Show sum score table.
ILIAS Survey PrintView GUIService $print
printResultsOverviewSelection()
ilGlobalTemplateInterface $tpl
__construct(ilObjSurvey $a_object)
getTextAnswers($a_results)
Get text answers.