35 protected \ILIAS\Survey\InternalGUIService
$gui;
37 protected \ILIAS\Survey\PrintView\GUIService
$print;
45 protected \ILIAS\DI\UIServices
$ui;
58 protected \ILIAS\Survey\Evaluation\EvaluationGUIRequest
$request;
66 $this->
tabs = $DIC->tabs();
67 $this->
access = $DIC->access();
68 $this->
user = $DIC->user();
69 $this->rbacsystem =
$DIC->rbac()->system();
70 $this->tree =
$DIC->repositoryTree();
71 $this->
ui = $DIC->ui();
74 $ilCtrl =
$DIC->ctrl();
78 $this->
ctrl = $ilCtrl;
79 $this->
object = $a_object;
81 $this->array_panels = array();
83 $this->request =
$DIC->survey()->internal()->gui()->evaluation($this->
object)->request();
85 $this->
ctrl->saveParameter($this, [
"appr_id",
"rater_id"]);
86 $this->evaluation_manager =
$DIC
92 $DIC->user()->getId(),
93 $this->request->getAppraiseeId(),
94 $this->request->getRaterId()
98 $this->evaluation_manager->getCurrentAppraisee()
101 $this->ui_modifier =
$DIC->survey()
104 ->modeUIModifier($this->
object->getMode());
105 $this->print =
$DIC->survey()
109 $this->access_manager =
$DIC->survey()
113 $this->
object->getRefId(),
114 $DIC->user()->getId()
116 $this->skill_profile_service =
$DIC->skills()->profile();
117 $this->gui =
$DIC->survey()->internal()->gui();
123 if ($this->
object->getSkillService() && $skmg_set->isActivated()) {
124 $cmd = $this->
ctrl->getCmd(
"competenceEval");
126 $cmd = $this->
ctrl->getCmd(
"evaluation");
129 $next_class = $this->
ctrl->getNextClass($this);
131 $this->log->debug($cmd);
133 switch ($next_class) {
136 $ret = (string) $this->$cmd();
150 if ($this->
object->getSkillService() && $skmg_set->isActivated()) {
151 $ilTabs->addSubTabTarget(
152 "svy_eval_competences",
153 $this->
ctrl->getLinkTarget($this,
"competenceEval"),
154 array(
"competenceEval")
159 $ilTabs->addSubTabTarget(
160 "svy_eval_cumulated",
161 $this->
ctrl->getLinkTarget($this,
"evaluation"),
162 array(
"evaluation",
"checkEvaluationAccess")
166 $ilTabs->addSubTabTarget(
168 $this->
ctrl->getLinkTarget($this,
"evaluationdetails"),
169 array(
"evaluationdetails")
173 $ilTabs->addSubTabTarget(
175 $this->
ctrl->getLinkTarget($this,
"evaluationuser"),
176 array(
"evaluationuser")
180 if ($this->
object->getCalculateSumScore()) {
181 $ilTabs->addSubTabTarget(
183 $this->
ctrl->getLinkTarget($this,
"sumscore"),
192 $this->appr_id = $a_val;
197 return $this->appr_id;
202 $ilUser = $this->user;
204 if ($this->
object->getAnonymize() === 1 &&
205 $this->evaluation_manager->getAnonEvaluationAccess() === $this->request->getRefId()) {
213 if ($this->
object->getAnonymize() === 1) {
214 $this->evaluation_manager->setAnonEvaluationAccess($this->request->getRefId());
219 if ($this->
object->getAnonymize() === 1) {
221 $surveycode = $this->
object->getUserAccessCode($ilUser->getId());
222 if ($this->
object->isAnonymizedParticipant($surveycode)) {
223 $this->evaluation_manager->setAnonEvaluationAccess($this->request->getRefId());
228 $this->tpl->setVariable(
"TABS",
"");
229 $this->tpl->addBlockFile(
232 "tpl.il_svy_svy_evaluation_checkaccess.html",
233 "components/ILIAS/Survey"
235 $this->tpl->setCurrentBlock(
"adm_content");
236 $this->tpl->setVariable(
237 "AUTHENTICATION_NEEDED",
238 $this->
lng->txt(
"svy_check_evaluation_authentication_needed")
240 $this->tpl->setVariable(
"FORM_ACTION", $this->
ctrl->getFormAction($this,
"checkEvaluationAccess"));
241 $this->tpl->setVariable(
242 "EVALUATION_CHECKACCESS_INTRODUCTION",
243 $this->
lng->txt(
"svy_check_evaluation_access_introduction")
245 $this->tpl->setVariable(
"VALUE_CHECK", $this->
lng->txt(
"ok"));
246 $this->tpl->setVariable(
"VALUE_CANCEL", $this->
lng->txt(
"cancel"));
247 $this->tpl->setVariable(
"TEXT_SURVEY_CODE", $this->
lng->txt(
"survey_code"));
248 $this->tpl->parseCurrentBlock();
251 $this->evaluation_manager->clearAnonEvaluationAccess();
260 $surveycode = $this->request->getSurveyCode();
261 if ($this->
object->isAnonymizedParticipant($surveycode)) {
262 $this->evaluation_manager->setAnonEvaluationAccess($this->request->getRefId());
265 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"svy_check_evaluation_wrong_key",
true));
266 $this->cancelEvaluationAccess();
275 $ilCtrl = $this->ctrl;
278 $ilCtrl->setParameterByClass(
283 $ilCtrl->redirectByClass(
"ilrepositorygui",
"frameset");
291 $this->evaluation(1);
297 $finished_ids = null;
298 if ($this->
object->get360Mode()) {
299 $appr_id = $this->request->getAppraiseeId();
301 $this->
ctrl->redirect($this, $details ?
"evaluationdetails" :
"evaluation");
303 $finished_ids = $this->
object->getFinishedIdsForAppraiseeId($appr_id);
304 if (!count($finished_ids)) {
305 $finished_ids = array(-1);
310 $title_row = array();
311 $do_title = $do_label =
true;
312 switch ($this->request->getExportLabel()) {
314 $title_row[] = $this->
lng->txt(
"label");
319 $title_row[] = $this->
lng->txt(
"title");
324 $title_row[] = $this->
lng->txt(
"title");
325 $title_row[] = $this->
lng->txt(
"label");
328 $title_row[] = $this->
lng->txt(
"question");
329 $title_row[] = $this->
lng->txt(
"question_type");
330 $title_row[] = $this->
lng->txt(
"users_answered");
331 $title_row[] = $this->
lng->txt(
"users_skipped");
332 $title_row[] = $this->
lng->txt(
"mode");
333 $title_row[] = $this->
lng->txt(
"mode_text");
334 $title_row[] = $this->
lng->txt(
"mode_nr_of_selections");
335 $title_row[] = $this->
lng->txt(
"median");
336 $title_row[] = $this->
lng->txt(
"arithmetic_mean");
341 switch ($this->request->getExportFormat()) {
344 $excel->addSheet($this->
lng->txt(
"svy_eval_cumulated"));
345 $excel->setCellArray(array($title_row),
"A1");
346 $excel->setBold(
"A1:" . $excel->getColumnCoord(count($title_row) - 1) .
"1");
349 case self::TYPE_SPSS:
350 $csvfile = array($title_row);
357 foreach ($this->
object->getSurveyQuestions() as $qdata) {
359 $q_res = $q_eval->getResults();
360 $ov_rows = $q_eval->exportResults($q_res, $do_title, $do_label);
362 switch ($this->request->getExportFormat()) {
364 $excel->setActiveSheet(0);
365 foreach ($ov_rows as $row) {
366 foreach ($row as $col => $value) {
367 $excel->setCell($ov_row, $col, $value);
373 case self::TYPE_SPSS:
374 foreach ($ov_rows as $row) {
381 switch ($this->request->getExportFormat()) {
383 $this->exportResultsDetailsExcel(
398 ? $this->
lng->txt(
"svy_eval_cumulated")
399 : $this->
lng->txt(
"svy_eval_detail");
401 $surveyname = $this->
object->getTitle() .
" " . $type .
" " . date(
"Y-m-d");
402 $surveyname = preg_replace(
"/\s/",
"_", trim($surveyname));
406 switch ($this->request->getExportFormat()) {
408 $excel->sendToClient($surveyname);
411 case self::TYPE_SPSS:
414 foreach ($csvfile as $csvrow) {
415 $csvrow = $this->processCSVRow($csvrow,
true, $separator);
416 $csv .= implode($separator, $csvrow) .
"\n";
436 $question_res = $a_results;
438 if (is_array($question_res)) {
439 $question_res = $question_res[0][1];
442 $question = $question_res->getQuestion();
444 $a_excel->
addSheet($question_index .
"_" . $question->getTitle());
451 $kv[$this->
lng->txt(
"title")] = $question->getTitle();
454 $kv[$this->
lng->txt(
"label")] = $question->label;
458 $kv[$this->
lng->txt(
"question")] = $question->getQuestiontext();
466 $kv[$this->
lng->txt(
"users_answered")] = $question_res->getUsersAnswered();
467 $kv[$this->
lng->txt(
"users_skipped")] = $question_res->getUsersSkipped();
471 foreach ($kv as $key => $value) {
472 $a_excel->
setCell($excel_row, 0, $key);
473 $a_excel->
setCell($excel_row++, 1, $value);
477 $this->parseResultsToExcel(
486 $this->parseResultsToExcel(
498 foreach ($a_results as $row_results) {
499 $row_title = $row_results[0];
501 $a_excel->
setCell($excel_row, 0, $this->
lng->txt(
"row"));
502 $a_excel->
setCell($excel_row++, 1, $row_title);
504 $this->parseResultsToExcel(
509 is_array($texts[$row_title] ??
false)
510 ? array(
"" => $texts[$row_title])
518 $a_excel->
setCell($excel_row++, 0, $this->
lng->txt(
"overview"));
522 $cats = $question->getColumns();
523 foreach ($cats->getCategories() as $cat) {
530 foreach ($a_results as $row_results) {
531 $row_title = $row_results[0];
533 $a_excel->
setCell($excel_row, 0, $row_title);
535 $vars = $row_results[1]->getVariables();
537 foreach ($vars as $var) {
546 $a_excel->
setBold(
"A1:A" . $excel_row);
553 ?array $a_grid =
null,
554 ?array $a_text_answers =
null,
555 bool $a_include_mode =
true
559 if ($a_include_mode) {
574 if ($a_results->
getMean() !==
null) {
575 $kv[$this->
lng->txt(
"arithmetic_mean")] = $a_results->
getMean();
579 foreach ($kv as $key => $value) {
580 $a_excel->
setCell($a_excel_row, 0, $key);
581 $a_excel->
setCell($a_excel_row++, 1, $value);
587 $a_excel->
setColors(
"B" . $a_excel_row .
":E" . $a_excel_row, self::EXCEL_SUBTITLE);
588 $a_excel->
setCell($a_excel_row, 0, $this->
lng->txt(
"svy_categories"));
589 foreach ($a_grid[
"cols"] as $col_idx => $col) {
590 $a_excel->
setCell($a_excel_row, $col_idx + 1, $col);
595 foreach ($a_grid[
"rows"] as $cols) {
596 foreach ($cols as $col_idx => $col) {
597 $a_excel->
setCell($a_excel_row, $col_idx + 1, $col);
604 if ($a_text_answers) {
606 $a_excel->
setCell($a_excel_row, 0, $this->
lng->txt(
"freetext_answers"));
609 if (!is_array($a_text_answers[
""] ??
null)) {
610 $a_excel->
setColors(
"B" . $a_excel_row .
":C" . $a_excel_row, self::EXCEL_SUBTITLE);
611 $a_excel->
setCell($a_excel_row, 1, $this->
lng->txt(
"title"));
612 $a_excel->
setCell($a_excel_row++, 2, $this->
lng->txt(
"answer"));
615 $a_excel->
setColors(
"B" . $a_excel_row .
":B" . $a_excel_row, self::EXCEL_SUBTITLE);
616 $a_excel->
setCell($a_excel_row++, 1, $this->
lng->txt(
"answer"));
619 foreach ($a_text_answers as $var => $items) {
620 foreach ($items as $item) {
621 if (!is_array($a_text_answers[
""] ??
null)) {
622 $a_excel->
setCell($a_excel_row, 1, $var);
623 $a_excel->
setCell($a_excel_row++, 2, $item);
625 $a_excel->
setCell($a_excel_row++, 1, $item);
634 if ($this->request->getExportFormat() !==
'') {
635 $this->exportCumulatedResults(0);
637 $this->
ctrl->redirect($this,
'evaluation');
643 if ($this->request->getExportFormat() !==
'') {
644 $this->exportCumulatedResults(1);
646 $this->
ctrl->redirect($this,
'evaluation');
652 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'use_browser_print_function'),
true);
653 $this->
ctrl->redirect($this,
'evaluation');
661 $toolbar = $this->gui->toolbar();
662 $ui_fac = $this->gui->ui()->factory();
665 $modal = $this->getExportModal();
666 $button = $ui_fac->button()->standard(
669 )->withOnClick($modal->getShowSignal());
671 $toolbar->addComponent($button);
672 $toolbar->addComponent($modal);
679 $ui_fac = $this->gui->ui()->factory();
681 $post_url = $ctrl->
getFormAction($this,
"validateAndSubmitExportForm");
683 $inputs[
"export_format"] = $ui_fac->input()->field()->select(
684 $lng->txt(
"filetype"),
691 ->withRequired(
true);
693 $inputs[
"export_label"] = $ui_fac->input()->field()->select(
696 "label_only" =>
$lng->txt(
"export_label_only"),
697 "title_only" =>
$lng->txt(
"export_title_only"),
698 "title_label" =>
$lng->txt(
"export_title_label")
702 ->withRequired(
true);
704 $modal = $ui_fac->modal()->roundtrip(
705 $lng->txt(
"svy_export_format"),
710 ->withSubmitLabel(
$lng->txt(
"export"));
720 $toolbar = $this->gui->toolbar();
721 $request = $this->request;
722 $ui_request = $this->gui->http()->request();
724 $export_cmd = $request->getExportCmd();
726 $modal = $this->getExportModal();
727 if (
"POST" === $ui_request->getMethod()) {
728 $modal = $modal->withRequest($ui_request);
729 $data = $modal->getData();
733 $ctrl->
redirect($this, $export_cmd);
735 switch ($export_cmd) {
740 case "exportDetailData":
742 $this->evaluationdetails();
744 case "exportEvaluationUser":
745 $toolbar->addComponent($modal->withOnLoad($modal->getShowSignal()));
747 $this->evaluationuser();
753 switch ($export_cmd) {
755 $ctrl->
redirect($this,
"evaluation");
757 case "exportDetailData":
758 $ctrl->
redirect($this,
"evaluationdetails");
760 case "exportEvaluationUser":
761 $ctrl->
redirect($this,
"evaluationuser");
768 if ($this->
object->getSkillService() && $skmg_set->isActivated()) {
769 $this->competenceEval();
772 $this->evaluationdetails();
785 $ui_factory = $ui->factory();
786 $ui_renderer = $ui->renderer();
788 $this->
lng->loadLanguageModule(
"survey");
790 $this->log->debug(
"check access");
793 $this->
tabs->activateSubTab(
"svy_eval_cumulated");
795 $this->
tabs->activateSubTab(
"svy_eval_detail");
799 if (!$this->hasResultsAccess()) {
800 if (!$this->
access->checkAccess(
'read',
'', $this->object->getRefId())) {
801 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"));
805 switch ($this->
object->getEvaluationAccess()) {
808 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"));
815 if (!$this->checkAnonymizedEvaluationAccess()) {
816 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"));
823 $this->log->debug(
"check access ok");
826 $appr_id = $this->evaluation_manager->getCurrentAppraisee();
829 $eval_tpl =
new ilTemplate(
"tpl.il_svy_svy_evaluation.html",
true,
true,
"components/ILIAS/Survey");
832 $toolbar_components = $this->ui_modifier->setResultsDetailToolbar(
834 $this->
user->getId(),
838 $toolbar_components = $this->ui_modifier->setResultsOverviewToolbar(
840 $this->
user->getId(),
844 foreach ($toolbar_components as $component) {
845 $this->gui->toolbar()->addComponent($component);
848 if (!$this->
object->get360Mode() || $appr_id) {
852 "tpl.il_svy_svy_results_details.html",
855 "components/ILIAS/Survey/Evaluation"
857 $this->
lng->loadLanguageModule(
"content");
859 $finished_ids = $this->evaluation_manager->getFilteredFinishedIds();
861 $listing = $this->gui->listing();
864 foreach ($this->
object->getSurveyQuestions() as $qdata) {
866 $q_res = $q_eval->getResults();
870 $panels = array_merge(
872 $this->ui_modifier->getDetailPanels(
873 $this->object->getSurveyParticipants(),
880 if ($qdata[
"questionblock_id"] &&
881 $qdata[
"questionblock_id"] != $this->last_questionblock_id) {
883 if ($qblock[
"show_blocktitle"]) {
885 $this->
ui->factory()->legacy()->content($qdata[
"questionblock_title"]),
886 "q" . $qdata[
"questionblock_id"]
890 $this->
ui->factory()->legacy()->content(
""),
891 "q" . $qdata[
"questionblock_id"]
894 $this->last_questionblock_id = $qdata[
"questionblock_id"];
896 $anchor_id =
"svyrdq" . $qdata[
"question_id"];
898 $this->
ui->factory()->link()->standard($qdata[
"title"],
"#" . $anchor_id),
899 (
string) $qdata[
"question_id"],
900 $qdata[
"questionblock_id"] ?
"q" . $qdata[
"questionblock_id"] :
"0"
907 $panel_toc = $ui_factory->panel()->standard(
908 $this->
lng->txt(
'cont_toc'),
909 $ui_factory->legacy()->content($listing->render())
911 $render_toc = $ui_renderer->render($panel_toc);
912 $dtmpl->setVariable(
"PANEL_TOC", $render_toc);
916 $panel_report = $ui_factory->panel()->report($report_title, $panels);
917 $render_report = $ui_renderer->render($panel_report);
918 $dtmpl->setVariable(
"PANEL_REPORT", $render_report);
921 $eval_tpl->setVariable(
'DETAIL', $dtmpl->get());
927 $eval_tpl->setVariable(
'CUMULATED', $table_gui->getHTML());
936 foreach ($path_full as
$data) {
937 $path .=
" » ";
944 $this->lng->txt(
"path") =>
$path,
945 $this->lng->txt(
"svy_results") => !$details
946 ? $this->lng->txt(
"svy_eval_cumulated")
947 : $this->lng->txt(
"svy_eval_detail"),
950 $eval_tpl->setCurrentBlock(
"print_header_bl");
951 foreach ($props as $key => $value) {
952 $eval_tpl->setVariable(
"HEADER_PROP_KEY", $key);
953 $eval_tpl->setVariable(
"HEADER_PROP_VALUE", $value);
954 $eval_tpl->parseCurrentBlock();
957 $this->log->debug(
"end");
959 $this->tpl->setContent($eval_tpl->get());
972 bool $quoteAll =
false,
973 string $separator =
";"
975 $resultarray = array();
976 foreach ($row as $rowindex => $entry) {
977 if (is_array($entry)) {
978 $entry = implode(
"/", $entry);
984 if (strpos($entry ??
"",
"\"") !==
false) {
985 $entry = str_replace(
"\"",
"\"\"", (
string) $entry);
988 if (strpos($entry ??
"", $separator) !==
false) {
992 $entry = str_replace(chr(13) . chr(10), chr(10), (
string) $entry);
995 $resultarray[$rowindex] =
"\"" . $entry .
"\"";
998 $resultarray[$rowindex] = $entry;
1001 return $resultarray;
1008 $title_row = $title_row2 = array();
1009 $title_row[] = $this->
lng->txt(
"lastname");
1010 $title_row[] = $this->
lng->txt(
"firstname");
1011 $title_row[] = $this->
lng->txt(
"login");
1012 $title_row[] = $this->
lng->txt(
'workingtime');
1013 $title_row[] = $this->
lng->txt(
'survey_results_finished');
1019 if ($this->
object->canExportSurveyCode()) {
1020 $title_row[] = $this->
lng->txt(
"codes");
1024 $questions = array();
1026 foreach ($this->
object->getSurveyQuestions() as $qdata) {
1028 $q_res = $q_eval->getResults();
1030 $questions[$qdata[
"question_id"]] = array($q_eval, $q_res);
1032 $question = is_array($q_res)
1033 ? $q_res[0][1]->getQuestion()
1034 : $q_res->getQuestion();
1036 $do_title = $do_label =
true;
1037 switch ($this->request->getExportLabel()) {
1039 $title_row[] = $question->label;
1045 $title_row[] = $question->getTitle();
1051 $title_row[] = $question->getTitle();
1052 $title_row2[] = $question->label;
1056 $q_eval->getUserSpecificVariableTitles($title_row, $title_row2, $do_title, $do_label);
1062 $rows[] = $title_row;
1063 if (implode(
"", $title_row2)) {
1064 $rows[] = $title_row2;
1070 $finished_ids =
null;
1071 if ($this->
object->get360Mode()) {
1072 $appr_id = $this->request->getAppraiseeId();
1074 $this->
ctrl->redirect($this,
"evaluationuser");
1076 $finished_ids = $this->
object->getFinishedIdsForAppraiseeId($appr_id);
1077 if (!count($finished_ids)) {
1078 $finished_ids = array(-1);
1083 $participants = $this->access_manager->canReadResultOfParticipants($finished_ids);
1085 foreach ($participants as $user) {
1089 $row[] = trim($user[
"lastname"] ??
"")
1091 : ($user[
"name"] ??
"");
1092 $row[] = $user[
"firstname"] ??
"";
1093 $row[] = $user[
"login"] ??
"";
1095 if ($this->
object->canExportSurveyCode()) {
1099 $row[] = $this->
object->getWorkingtimeForParticipant(
$user_id);
1101 if ($user[
"finished"] ??
false) {
1103 $row[] = ($this->request->getExportFormat() === self::TYPE_XLS)
1110 foreach ($questions as $item) {
1114 $q_eval->addUserSpecificResults($row,
$user_id, $q_res);
1121 $surveyname = $this->
object->getTitle() .
" " . $this->
lng->txt(
"svy_eval_user") .
" " . date(
"Y-m-d");
1122 $surveyname = preg_replace(
"/\s/",
"_", trim($surveyname));
1125 switch ($this->request->getExportFormat()) {
1126 case self::TYPE_XLS:
1128 $excel->addSheet($this->
lng->txt(
"svy_eval_user"));
1130 foreach ($rows as $row_idx => $row) {
1131 foreach ($row as $col_idx => $col) {
1132 $excel->setCell($row_idx + 1, $col_idx, $col);
1135 $excel->setBold(
"A1:" . $excel->getColumnCoord(count($row) - 1) .
"1");
1138 $excel->sendToClient($surveyname);
1141 case self::TYPE_SPSS:
1144 foreach ($rows as $csvrow) {
1145 $csvrow = str_replace(
"\n",
" ", $this->processCSVRow($csvrow,
true, $separator));
1146 $csv .= implode($separator, $csvrow) .
"\n";
1158 if (!$this->hasResultsAccess() &&
1160 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_permission"),
true);
1161 $this->
ctrl->redirectByClass(
"ilObjSurveyGUI",
"infoScreen");
1164 $toolbar_components = $this->ui_modifier->setResultsParticipantToolbar(
1166 $this->
user->getId()
1168 foreach ($toolbar_components as $component) {
1169 $this->gui->toolbar()->addComponent($component);
1175 if ($this->
object->get360Mode()) {
1176 $appr_id = $this->getAppraiseeId();
1179 if (!$this->
object->get360Mode() || $appr_id) {
1180 $this->buildExportButtonAndModal(
"exportEvaluationUser");
1182 $this->gui->toolbar()->addSeparator();
1184 $pv = $this->print->resultsDetails($this->
object->getRefId());
1185 $modal_elements = $pv->getModalElements(
1186 $this->
ctrl->getLinkTargetByClass(
1187 "ilSurveyEvaluationGUI",
1188 "printResultsPerUserSelection"
1192 $this->gui->toolbar()->addComponent($modal_elements->button);
1193 $this->gui->toolbar()->addComponent($modal_elements->modal);
1195 $data = $this->evaluation_manager->getUserSpecificResults();
1199 $table_gui->setData(
$data);
1200 $this->tpl->setContent($table_gui->getHTML());
1206 $ilCtrl = $this->ctrl;
1208 $ilTabs = $this->tabs;
1210 $survey = $this->object;
1212 $ilTabs->activateSubTab(
"svy_eval_competences");
1213 $ilTabs->activateTab(
"svy_results");
1215 $appr_id = $this->getAppraiseeId();
1217 if ($appr_id === 0) {
1218 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"svy_no_appraisees_found"));
1222 $toolbar_components = $this->ui_modifier->setResultsCompetenceToolbar(
1224 $this->
user->getId()
1226 foreach ($toolbar_components as $component) {
1227 $this->gui->toolbar()->addComponent($component);
1231 $eval_modes = array();
1235 $opts = $sskill->getAllAssignedSkillsAsOptions();
1237 foreach ($opts as
$id => $o) {
1238 $idarr = explode(
":",
$id);
1239 $skills[
$id] = array(
1242 "profiles" => array(),
1243 "base_skill" => $idarr[0],
1244 "tref_id" => $idarr[1]
1250 $profiles = $this->skill_profile_service->getProfilesOfUser($appr_id);
1251 foreach ($profiles as $p) {
1252 $prof_levels = $this->skill_profile_service->getSkillLevels($p->getId());
1253 foreach ($prof_levels as $pl) {
1254 if (isset($skills[$pl->getBaseSkillId() .
":" . $pl->getTrefId()])) {
1255 $skills[$pl->getBaseSkillId() .
":" . $pl->getTrefId()][
"profiles"][] =
1258 $eval_modes[
"gap_" . $p->getId()] =
1259 $lng->txt(
"svy_gap_analysis") .
": " . $p->getTitle();
1266 foreach ($skills as $sk) {
1267 if (count($sk[
"profiles"]) === 0) {
1268 $eval_modes[
"skills_of_survey"] =
$lng->txt(
"svy_all_survey_competences");
1273 $comp_eval_mode = $this->request->getCompEvalMode();
1275 if (!isset($eval_modes[$comp_eval_mode])) {
1276 $comp_eval_mode = key($eval_modes);
1277 $ilCtrl->setParameter($this,
"comp_eval_mode", $comp_eval_mode);
1280 $ilCtrl->saveParameter($this,
"comp_eval_mode");
1282 $dropdown_items = [];
1283 foreach ($eval_modes as $mode_key => $mode_label) {
1284 $ilCtrl->setParameter($this,
"comp_eval_mode", $mode_key);
1285 $dropdown_items[] = $this->
ui->factory()->button()->shy(
1287 $ilCtrl->getLinkTarget($this,
"competenceEval")
1290 $ilCtrl->setParameter($this,
"comp_eval_mode", $comp_eval_mode);
1292 $this->gui->toolbar()->addComponent(
1293 $this->
ui->factory()->dropdown()->standard($dropdown_items)
1294 ->withLabel($eval_modes[$comp_eval_mode] ??
$lng->txt(
"svy_analysis"))
1298 $rater = $this->evaluation_manager->getCurrentRater(
1301 if ($rater !==
"") {
1302 if (strpos($rater ??
"",
"u") === 0) {
1303 $rater = substr($rater, 1);
1305 $pskills_gui->setTriggerUserFilter($rater);
1306 $pskills_gui->setHistoryView(
true);
1309 if (strpos($comp_eval_mode ??
"",
"gap_") === 0) {
1311 $profile_id = (
int) substr($comp_eval_mode, 4);
1313 $pskills_gui->setProfileId($profile_id);
1314 $pskills_gui->setGapAnalysisActualStatusModePerObject($survey->getId(),
$lng->txt(
"skmg_eval_type_1"));
1315 if ($survey->getFinishedIdForAppraiseeIdAndRaterId($appr_id, $appr_id) > 0) {
1317 $self_levels = array();
1318 foreach ($sskill->determineSkillLevelsForAppraisee($appr_id,
true) as $sl) {
1319 $self_levels[$sl[
"base_skill_id"]][$sl[
"tref_id"]] = $sl[
"new_level_id"] ?? 0;
1321 $pskills_gui->setGapAnalysisSelfEvalLevels($self_levels);
1323 $html = $pskills_gui->getGapAnalysisHTML($appr_id);
1325 $pskills_gui->setGapAnalysisActualStatusModePerObject($survey->getId(),
$lng->txt(
"skmg_eval_type_1"));
1326 if ($survey->getFinishedIdForAppraiseeIdAndRaterId($appr_id, $appr_id) > 0) {
1328 $self_levels = array();
1329 foreach ($sskill->determineSkillLevelsForAppraisee($appr_id,
true) as $sl) {
1330 $self_levels[$sl[
"base_skill_id"]][$sl[
"tref_id"]] = $sl[
"new_level_id"] ?? 0;
1332 $pskills_gui->setGapAnalysisSelfEvalLevels($self_levels);
1335 foreach ($skills as $skill) {
1337 "base_skill_id" => (
int) $skill[
"base_skill"],
1338 "tref_id" => (
int) $skill[
"tref_id"]
1341 $html = $pskills_gui->getGapAnalysisHTML($appr_id, $sk);
1352 return $this->
access->checkRbacOrPositionPermissionAccess(
1355 $this->
object->getRefId()
1364 if (!$this->hasResultsAccess() &&
1366 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_permission"),
true);
1367 $this->
ctrl->redirectByClass(
"ilObjSurveyGUI",
"infoScreen");
1370 $this->tpl->setOnScreenMessage(
1372 $this->
lng->txt(
"svy_max_sum_score") .
": " . $this->object->getMaxSumScore()
1376 $this->
lng->txt(
"print"),
1378 )->onClick(
"window.print(); return false;")->toToolbar();
1380 $finished_ids =
null;
1382 $sum_scores = $this->getSumScores($finished_ids);
1384 $table_gui->setSumScores($sum_scores);
1385 $this->tpl->setContent($table_gui->getHTML());
1392 ?array $a_finished_ids =
null
1395 foreach ($this->access_manager->canReadResultOfParticipants($a_finished_ids) as $p) {
1396 $sum_scores[$p[
"active_id"]] = [
1397 "username" => $p[
"sortname"],
1402 foreach ($this->
object->getSurveyQuestions() as $qdata) {
1404 foreach ($q_eval->getSumScores() as $finished_id => $sum_score) {
1405 if ($sum_score ===
null) {
1406 $sum_scores[$finished_id][
"score"] =
null;
1408 if ($sum_scores[$finished_id][
"score"] !==
null) {
1409 $sum_scores[$finished_id][
"score"] += (
int) $sum_score;
1421 $view = $this->print->resultsOverview($this->
object->getRefId());
1430 $this->
ctrl->setParameterByClass(
1431 "ilSurveyEvaluationGUI",
1433 $this->request->getVW()
1435 $this->
ctrl->setParameterByClass(
1436 "ilSurveyEvaluationGUI",
1438 $this->request->getCP()
1440 $view = $this->print->resultsDetails($this->
object->getRefId());
1446 $view = $this->print->resultsDetails($this->
object->getRefId());
1447 $view->sendPrintView();
1455 $view = $this->print->resultsPerUser($this->
object->getRefId());
1461 $view = $this->print->resultsPerUser($this->
object->getRefId());
1462 $view->sendPrintView();
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getExportGrid($a_results)
Get grid data.
getTextAnswers($a_results)
Get text answers.
static _instanciateQuestionEvaluation(int $question_id, ?array $a_finished_ids=null)
static _getQuestionTypeName(string $type_tag)
Return the translation for a given question type.
Class ilCtrl provides processing control methods.
getFormAction(object $a_gui_obj, ?string $a_fallback_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
static setUseRelativeDates(bool $a_status)
set use relative dates
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
setBold(string $a_coords)
Set cell(s) to bold.
addSheet(string $a_name, bool $a_activate=true)
Add sheet.
getCoordByColumnAndRow(int $pColumn=1, int $pRow=1)
Get cell coordinate (e.g.
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)
Set cell value.
static getASCIIFilename(string $a_filename)
static _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
static getLogger(string $a_component_id)
Get component logger.
Component logger with individual log levels by component id.
static _hasEvaluationAccess(int $a_obj_id, int $user_id)
const EVALUATION_ACCESS_PARTICIPANTS
static _getQuestionblock(int $questionblock_id)
get question block properties
const EVALUATION_ACCESS_ALL
const EVALUATION_ACCESS_OFF
static _lookupObjId(int $ref_id)
Personal skills GUI class.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
Skill management settings.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Survey evaluation graphical output.
printResultsOverviewSelection()
evaluation(int $details=0)
exportCumulatedResults(int $details=0)
processCSVRow(array $row, bool $quoteAll=false, string $separator=";")
Processes an array as a CSV row and converts the array values to correct CSV values.
ILIAS Survey Access AccessManager $access_manager
sumscore()
Show sum score table.
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)
setEvalSubtabs()
Set the tabs for the evaluation output.
string $last_questionblock_id
cancelEvaluationAccess()
Cancels the input of the survey access code for evaluation access.
checkAnonymizedEvaluationAccess()
validateAndSubmitExportForm()
ilGlobalTemplateInterface $tpl
ILIAS Survey PrintView GUIService $print
ILIAS Skill Service SkillProfileService $skill_profile_service
__construct(ilObjSurvey $a_object)
buildExportButtonAndModal(string $export_cmd)
getSumScores(?array $a_finished_ids=null)
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)
evaluationdetails()
Show the detailed evaluation.
hasResultsAccess()
Check if user can view results granted by rbac or positions.
ILIAS Survey Mode UIModifier $ui_modifier
checkEvaluationAccess()
Checks the evaluation access after entering the survey access code.
printResultsPerUserSelection()
evaluationuser()
Print the survey evaluation for a selected user.
ILIAS Survey Evaluation EvaluationManager $evaluation_manager
printResultsDetailsSelection()
ILIAS Survey InternalGUIService $gui
ILIAS Survey Evaluation EvaluationGUIRequest $request
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
activateSubTab(string $a_id)
special template class to simplify handling of ITX/PEAR
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
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...
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
setContent(string $a_html)
Sets content for standard template.
This describes commonalities between the different modals.
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...