32 protected \ILIAS\Survey\InternalGUIService
$gui;
34 protected \ILIAS\Survey\PrintView\GUIService
$print;
42 protected \ILIAS\DI\UIServices
$ui;
56 protected \ILIAS\Survey\Evaluation\EvaluationGUIRequest
$request;
64 $this->
tabs = $DIC->tabs();
65 $this->
access = $DIC->access();
66 $this->
user = $DIC->user();
67 $this->rbacsystem = $DIC->rbac()->system();
68 $this->tree = $DIC->repositoryTree();
69 $this->
toolbar = $DIC->toolbar();
70 $this->
ui = $DIC->ui();
71 $lng = $DIC->language();
73 $ilCtrl = $DIC->ctrl();
77 $this->
ctrl = $ilCtrl;
78 $this->
object = $a_object;
80 $this->array_panels = array();
82 $this->request = $DIC->survey()->internal()->gui()->evaluation($this->
object)->request();
84 $this->
ctrl->saveParameter($this, [
"appr_id",
"rater_id"]);
85 $this->evaluation_manager = $DIC
91 $DIC->user()->getId(),
92 $this->request->getAppraiseeId(),
93 $this->request->getRaterId()
97 $this->evaluation_manager->getCurrentAppraisee()
100 $this->ui_modifier = $DIC->survey()
103 ->modeUIModifier($this->
object->getMode());
104 $this->print = $DIC->survey()
108 $this->access_manager = $DIC->survey()
112 $this->
object->getRefId(),
113 $DIC->user()->getId()
115 $this->skill_profile_service = $DIC->skills()->profile();
116 $this->gui = $DIC->survey()->internal()->gui();
122 if ($this->
object->getSkillService() && $skmg_set->isActivated()) {
123 $cmd = $this->
ctrl->getCmd(
"competenceEval");
125 $cmd = $this->
ctrl->getCmd(
"evaluation");
128 $next_class = $this->
ctrl->getNextClass($this);
130 $this->log->debug($cmd);
132 switch ($next_class) {
135 $ret = (string) $this->$cmd();
149 if ($this->
object->getSkillService() && $skmg_set->isActivated()) {
150 $ilTabs->addSubTabTarget(
151 "svy_eval_competences",
152 $this->
ctrl->getLinkTarget($this,
"competenceEval"),
153 array(
"competenceEval")
158 $ilTabs->addSubTabTarget(
159 "svy_eval_cumulated",
160 $this->
ctrl->getLinkTarget($this,
"evaluation"),
161 array(
"evaluation",
"checkEvaluationAccess")
165 $ilTabs->addSubTabTarget(
167 $this->
ctrl->getLinkTarget($this,
"evaluationdetails"),
168 array(
"evaluationdetails")
172 $ilTabs->addSubTabTarget(
174 $this->
ctrl->getLinkTarget($this,
"evaluationuser"),
175 array(
"evaluationuser")
179 if ($this->
object->getCalculateSumScore()) {
180 $ilTabs->addSubTabTarget(
182 $this->
ctrl->getLinkTarget($this,
"sumscore"),
192 $this->appr_id = $a_val;
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(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_evaluation_checkaccess.html",
"Modules/Survey");
230 $this->tpl->setCurrentBlock(
"adm_content");
231 $this->tpl->setVariable(
"AUTHENTICATION_NEEDED", $this->
lng->txt(
"svy_check_evaluation_authentication_needed"));
232 $this->tpl->setVariable(
"FORM_ACTION", $this->
ctrl->getFormAction($this,
"checkEvaluationAccess"));
233 $this->tpl->setVariable(
"EVALUATION_CHECKACCESS_INTRODUCTION", $this->
lng->txt(
"svy_check_evaluation_access_introduction"));
234 $this->tpl->setVariable(
"VALUE_CHECK", $this->
lng->txt(
"ok"));
235 $this->tpl->setVariable(
"VALUE_CANCEL", $this->
lng->txt(
"cancel"));
236 $this->tpl->setVariable(
"TEXT_SURVEY_CODE", $this->
lng->txt(
"survey_code"));
237 $this->tpl->parseCurrentBlock();
240 $this->evaluation_manager->clearAnonEvaluationAccess();
249 $surveycode = $this->request->getSurveyCode();
250 if ($this->
object->isAnonymizedParticipant($surveycode)) {
251 $this->evaluation_manager->setAnonEvaluationAccess($this->request->getRefId());
254 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"svy_check_evaluation_wrong_key",
true));
267 $ilCtrl->setParameterByClass(
272 $ilCtrl->redirectByClass(
"ilrepositorygui",
"frameset");
286 $finished_ids = null;
287 if ($this->
object->get360Mode()) {
288 $appr_id = $this->request->getAppraiseeId();
290 $this->
ctrl->redirect($this,
$details ?
"evaluationdetails" :
"evaluation");
292 $finished_ids = $this->
object->getFinishedIdsForAppraiseeId($appr_id);
293 if (!count($finished_ids)) {
294 $finished_ids = array(-1);
299 $title_row = array();
300 $do_title = $do_label =
true;
301 switch ($this->request->getExportLabel()) {
303 $title_row[] = $this->
lng->txt(
"label");
308 $title_row[] = $this->
lng->txt(
"title");
313 $title_row[] = $this->
lng->txt(
"title");
314 $title_row[] = $this->
lng->txt(
"label");
317 $title_row[] = $this->
lng->txt(
"question");
318 $title_row[] = $this->
lng->txt(
"question_type");
319 $title_row[] = $this->
lng->txt(
"users_answered");
320 $title_row[] = $this->
lng->txt(
"users_skipped");
321 $title_row[] = $this->
lng->txt(
"mode");
322 $title_row[] = $this->
lng->txt(
"mode_text");
323 $title_row[] = $this->
lng->txt(
"mode_nr_of_selections");
324 $title_row[] = $this->
lng->txt(
"median");
325 $title_row[] = $this->
lng->txt(
"arithmetic_mean");
330 switch ($this->request->getExportFormat()) {
333 $excel->addSheet($this->
lng->txt(
"svy_eval_cumulated"));
334 $excel->setCellArray(array($title_row),
"A1");
335 $excel->setBold(
"A1:" . $excel->getColumnCoord(count($title_row) - 1) .
"1");
339 $csvfile = array($title_row);
347 foreach ($this->
object->getSurveyQuestions() as $qdata) {
349 $q_res = $q_eval->getResults();
350 $ov_rows = $q_eval->exportResults($q_res, $do_title, $do_label);
352 switch ($this->request->getExportFormat()) {
354 $excel->setActiveSheet(0);
355 foreach ($ov_rows as $row) {
356 foreach ($row as $col => $value) {
357 $excel->setCell($ov_row, $col, $value);
364 foreach ($ov_rows as $row) {
371 switch ($this->request->getExportFormat()) {
381 ? $this->
lng->txt(
"svy_eval_cumulated")
382 : $this->
lng->txt(
"svy_eval_detail");
384 $surveyname = $this->
object->getTitle() .
" " . $type .
" " . date(
"Y-m-d");
385 $surveyname = preg_replace(
"/\s/",
"_", trim($surveyname));
389 switch ($this->request->getExportFormat()) {
391 $excel->sendToClient($surveyname);
397 foreach ($csvfile as $csvrow) {
399 $csv .= implode($separator, $csvrow) .
"\n";
419 $question_res = $a_results;
421 if (is_array($question_res)) {
422 $question_res = $question_res[0][1];
425 $question = $question_res->getQuestion();
427 $a_excel->
addSheet($question_index .
"_" . $question->getTitle());
435 $kv[$this->
lng->txt(
"title")] = $question->getTitle();
438 $kv[$this->
lng->txt(
"label")] = $question->label;
442 $kv[$this->
lng->txt(
"question")] = $question->getQuestiontext();
450 $kv[$this->
lng->txt(
"users_answered")] = $question_res->getUsersAnswered();
451 $kv[$this->
lng->txt(
"users_skipped")] = $question_res->getUsersSkipped();
455 foreach ($kv as
$key => $value) {
457 $a_excel->
setCell($excel_row++, 1, $value);
482 foreach ($a_results as $row_results) {
483 $row_title = $row_results[0];
485 $a_excel->
setCell($excel_row, 0, $this->
lng->txt(
"row"));
486 $a_excel->
setCell($excel_row++, 1, $row_title);
493 is_array($texts[$row_title] ??
false)
494 ? array(
"" => $texts[$row_title])
502 $a_excel->
setCell($excel_row++, 0, $this->
lng->txt(
"overview"));
506 $cats = $question->getColumns();
507 foreach ($cats->getCategories() as $cat) {
509 $a_excel->
setCell($excel_row, 1 + $counter, $cat->title);
514 foreach ($a_results as $row_results) {
515 $row_title = $row_results[0];
517 $a_excel->
setCell($excel_row, 0, $row_title);
519 $vars = $row_results[1]->getVariables();
521 foreach ($vars as $var) {
522 $a_excel->
setCell($excel_row, ++$counter, $var->abs);
530 $a_excel->
setBold(
"A1:A" . $excel_row);
537 array $a_grid = null,
538 array $a_text_answers = null,
539 bool $a_include_mode =
true 543 if ($a_include_mode) {
558 if ($a_results->
getMean() !== null) {
559 $kv[$this->
lng->txt(
"arithmetic_mean")] = $a_results->
getMean();
563 foreach ($kv as
$key => $value) {
565 $a_excel->
setCell($a_excel_row++, 1, $value);
571 $a_excel->
setColors(
"B" . $a_excel_row .
":E" . $a_excel_row, self::EXCEL_SUBTITLE);
572 $a_excel->
setCell($a_excel_row, 0, $this->
lng->txt(
"categories"));
573 foreach ($a_grid[
"cols"] as $col_idx => $col) {
574 $a_excel->
setCell($a_excel_row, $col_idx + 1, $col);
579 foreach ($a_grid[
"rows"] as $cols) {
580 foreach ($cols as $col_idx => $col) {
581 $a_excel->
setCell($a_excel_row, $col_idx + 1, $col);
588 if ($a_text_answers) {
590 $a_excel->
setCell($a_excel_row, 0, $this->
lng->txt(
"freetext_answers"));
593 if (!is_array($a_text_answers[
""] ?? null)) {
594 $a_excel->
setColors(
"B" . $a_excel_row .
":C" . $a_excel_row, self::EXCEL_SUBTITLE);
595 $a_excel->
setCell($a_excel_row, 1, $this->
lng->txt(
"title"));
596 $a_excel->
setCell($a_excel_row++, 2, $this->
lng->txt(
"answer"));
600 $a_excel->
setColors(
"B" . $a_excel_row .
":B" . $a_excel_row, self::EXCEL_SUBTITLE);
601 $a_excel->
setCell($a_excel_row++, 1, $this->
lng->txt(
"answer"));
604 foreach ($a_text_answers as $var => $items) {
605 foreach ($items as $item) {
606 if (!is_array($a_text_answers[
""] ?? null)) {
607 $a_excel->
setCell($a_excel_row, 1, $var);
608 $a_excel->
setCell($a_excel_row++, 2, $item);
610 $a_excel->
setCell($a_excel_row++, 1, $item);
619 if ($this->request->getExportFormat() !==
'') {
622 $this->
ctrl->redirect($this,
'evaluation');
628 if ($this->request->getExportFormat() !==
'') {
631 $this->
ctrl->redirect($this,
'evaluation');
637 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'use_browser_print_function'),
true);
638 $this->
ctrl->redirect($this,
'evaluation');
651 $form_id =
"svymdfrm";
654 $tpl->
addOnLoadCode(
'$("#form_' . $form_id .
'").submit(function() { $("#' . $a_id .
'").modal("hide"); });');
657 $modal->setId($a_id);
658 $modal->setHeading(($this->
lng->txt(
"svy_export_format")));
661 $form->setId($form_id);
662 $form->setFormAction($this->
ctrl->getFormAction($this, $a_cmd));
666 self::TYPE_XLS => $this->
lng->txt(
'exp_type_excel'),
669 $form->addItem($format);
673 'label_only' => $this->
lng->txt(
'export_label_only'),
674 'title_only' => $this->
lng->txt(
'export_title_only'),
675 'title_label' => $this->
lng->txt(
'export_title_label')
677 $form->addItem($label);
679 $form->addCommandButton($a_cmd, $this->
lng->txt(
"export"));
680 $form->setPreventDoubleSubmission(
false);
682 $modal->setBody($form->getHTML());
684 return $modal->getHTML();
690 if ($this->
object->getSkillService() && $skmg_set->isActivated()) {
708 $ui_factory = $ui->factory();
709 $ui_renderer = $ui->renderer();
711 $this->
lng->loadLanguageModule(
"survey");
713 $this->log->debug(
"check access");
717 if (!$this->
access->checkAccess(
'read',
'', $this->object->getRefId())) {
718 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"));
722 switch ($this->
object->getEvaluationAccess()) {
725 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"));
733 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"));
740 $this->log->debug(
"check access ok");
743 $appr_id = $this->evaluation_manager->getCurrentAppraisee();
744 $ilToolbar->setFormAction($this->
ctrl->getFormAction($this));
747 $eval_tpl =
new ilTemplate(
"tpl.il_svy_svy_evaluation.html",
true,
true,
"Modules/Survey");
751 $this->ui_modifier->setResultsDetailToolbar(
757 $this->ui_modifier->setResultsOverviewToolbar(
767 $dtmpl =
new ilTemplate(
"tpl.il_svy_svy_results_details.html",
true,
true,
"Modules/Survey/Evaluation");
768 $toc_tpl =
new ilTemplate(
"tpl.svy_results_table_contents.html",
true,
true,
"Modules/Survey/Evaluation");
769 $this->
lng->loadLanguageModule(
"content");
770 $toc_tpl->setVariable(
"TITLE_TOC", $this->
lng->txt(
'cont_toc'));
773 $finished_ids = $this->evaluation_manager->getFilteredFinishedIds();
776 $listing = $this->gui->listing();
779 foreach ($this->
object->getSurveyQuestions() as $qdata) {
781 $q_res = $q_eval->getResults();
785 $panels = array_merge(
787 $this->ui_modifier->getDetailPanels(
788 $this->object->getSurveyParticipants(),
795 if ($qdata[
"questionblock_id"] &&
796 $qdata[
"questionblock_id"] != $this->last_questionblock_id) {
798 if ($qblock[
"show_blocktitle"]) {
800 $this->
ui->factory()->legacy($qdata[
"questionblock_title"]),
801 "q" . $qdata[
"questionblock_id"]
805 $this->
ui->factory()->legacy(
""),
806 "q" . $qdata[
"questionblock_id"]
809 $this->last_questionblock_id = $qdata[
"questionblock_id"];
811 $anchor_id =
"svyrdq" . $qdata[
"question_id"];
813 $this->
ui->factory()->link()->standard($qdata[
"title"],
"#" . $anchor_id),
814 (string) $qdata[
"question_id"],
815 $qdata[
"questionblock_id"] ?
"q" . $qdata[
"questionblock_id"] :
"0" 821 $toc_tpl->setVariable(
"LIST", $listing->render());
824 $panel_toc = $ui_factory->panel()->standard(
"", $ui_factory->legacy($toc_tpl->get()));
825 $render_toc = $ui_renderer->render($panel_toc);
826 $dtmpl->setVariable(
"PANEL_TOC", $render_toc);
830 $panel_report = $ui_factory->panel()->report($report_title, $panels);
831 $render_report = $ui_renderer->render($panel_report);
832 $dtmpl->setVariable(
"PANEL_REPORT", $render_report);
835 $eval_tpl->setVariable(
'DETAIL', $dtmpl->get());
842 $eval_tpl->setVariable(
'CUMULATED', $table_gui->getHTML());
851 foreach ($path_full as
$data) {
852 $path .=
" » ";
853 $path .= $data[
'title'];
861 ? $this->
lng->txt(
"svy_eval_cumulated")
862 : $this->
lng->txt(
"svy_eval_detail"),
865 $eval_tpl->setCurrentBlock(
"print_header_bl");
866 foreach ($props as
$key => $value) {
867 $eval_tpl->setVariable(
"HEADER_PROP_KEY",
$key);
868 $eval_tpl->setVariable(
"HEADER_PROP_VALUE", $value);
869 $eval_tpl->parseCurrentBlock();
872 $this->log->debug(
"end");
874 $this->tpl->setContent($eval_tpl->get());
887 bool $quoteAll =
false,
888 string $separator =
";" 890 $resultarray = array();
891 foreach ($row as $rowindex => $entry) {
892 if (is_array($entry)) {
893 $entry = implode(
"/", $entry);
899 if (strpos($entry ??
"",
"\"") !==
false) {
900 $entry = str_replace(
"\"",
"\"\"", (
string) $entry);
903 if (strpos($entry ??
"", $separator) !==
false) {
907 $entry = str_replace(chr(13) . chr(10), chr(10), (
string) $entry);
910 $resultarray[$rowindex] =
"\"" . $entry .
"\"";
913 $resultarray[$rowindex] = $entry;
923 $title_row = $title_row2 = array();
924 $title_row[] = $this->
lng->txt(
"lastname");
925 $title_row[] = $this->
lng->txt(
"firstname");
926 $title_row[] = $this->
lng->txt(
"login");
927 $title_row[] = $this->
lng->txt(
'workingtime');
928 $title_row[] = $this->
lng->txt(
'survey_results_finished');
934 if ($this->
object->canExportSurveyCode()) {
935 $title_row[] = $this->
lng->txt(
"codes");
939 $questions = array();
941 foreach ($this->
object->getSurveyQuestions() as $qdata) {
943 $q_res = $q_eval->getResults();
945 $questions[$qdata[
"question_id"]] = array($q_eval, $q_res);
947 $question = is_array($q_res)
948 ? $q_res[0][1]->getQuestion()
949 : $q_res->getQuestion();
951 $do_title = $do_label =
true;
952 switch ($this->request->getExportLabel()) {
954 $title_row[] = $question->label;
960 $title_row[] = $question->getTitle();
966 $title_row[] = $question->getTitle();
967 $title_row2[] = $question->label;
971 $q_eval->getUserSpecificVariableTitles($title_row, $title_row2, $do_title, $do_label);
977 $rows[] = $title_row;
978 if (implode(
"", $title_row2)) {
979 $rows[] = $title_row2;
985 $finished_ids = null;
986 if ($this->
object->get360Mode()) {
987 $appr_id = $this->request->getAppraiseeId();
989 $this->
ctrl->redirect($this,
"evaluationuser");
991 $finished_ids = $this->
object->getFinishedIdsForAppraiseeId($appr_id);
992 if (!count($finished_ids)) {
993 $finished_ids = array(-1);
998 $participants = $this->access_manager->canReadResultOfParticipants($finished_ids);
1000 foreach ($participants as $user) {
1001 $user_id = $user[
"active_id"];
1004 $row[] = trim($user[
"lastname"] ??
"")
1006 : ($user[
"name"] ??
"");
1007 $row[] = $user[
"firstname"] ??
"";
1008 $row[] = $user[
"login"] ??
"";
1010 if ($this->
object->canExportSurveyCode()) {
1014 $row[] = $this->
object->getWorkingtimeForParticipant($user_id);
1016 if ($user[
"finished"] ??
false) {
1018 $row[] = ($this->request->getExportFormat() === self::TYPE_XLS)
1025 foreach ($questions as $item) {
1029 $q_eval->addUserSpecificResults($row, $user_id, $q_res);
1036 $surveyname = $this->
object->getTitle() .
" " . $this->
lng->txt(
"svy_eval_user") .
" " . date(
"Y-m-d");
1037 $surveyname = preg_replace(
"/\s/",
"_", trim($surveyname));
1040 switch ($this->request->getExportFormat()) {
1041 case self::TYPE_XLS:
1043 $excel->addSheet($this->
lng->txt(
"svy_eval_user"));
1045 foreach ($rows as $row_idx => $row) {
1046 foreach ($row as $col_idx => $col) {
1047 $excel->setCell($row_idx + 1, $col_idx, $col);
1050 $excel->setBold(
"A1:" . $excel->getColumnCoord(count($row) - 1) .
"1");
1053 $excel->sendToClient($surveyname);
1059 foreach ($rows as $csvrow) {
1060 $csvrow = str_replace(
"\n",
" ", $this->
processCSVRow($csvrow,
true, $separator));
1061 $csv .= implode($separator, $csvrow) .
"\n";
1077 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_permission"),
true);
1078 $this->
ctrl->redirectByClass(
"ilObjSurveyGUI",
"infoScreen");
1081 $ilToolbar->setFormAction($this->
ctrl->getFormAction($this,
"evaluationuser"));
1087 if ($this->
object->get360Mode()) {
1092 $modal_id =
"svy_ev_exp";
1096 $this->
lng->txt(
"export"),
1098 )->onClick(
'$(\'#' . $modal_id .
'\').modal(\
'show\')')->toToolbar();
1100 $ilToolbar->addSeparator();
1102 $pv = $this->print->resultsDetails($this->
object->getRefId());
1103 $modal_elements = $pv->getModalElements(
1104 $this->
ctrl->getLinkTargetByClass(
1105 "ilSurveyEvaluationGUI",
1106 "printResultsPerUserSelection" 1109 $ilToolbar->addComponent($modal_elements->button);
1110 $ilToolbar->addComponent($modal_elements->modal);
1112 $data = $this->evaluation_manager->getUserSpecificResults();
1116 $table_gui->setData(
$data);
1117 $this->tpl->setContent($table_gui->getHTML() . $modal);
1130 $ilTabs->activateSubTab(
"svy_eval_competences");
1131 $ilTabs->activateTab(
"svy_results");
1133 $ilToolbar->setFormAction($this->
ctrl->getFormAction($this,
"competenceEval"));
1137 if ($appr_id === 0) {
1138 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"svy_no_appraisees_found"));
1142 $this->ui_modifier->setResultsCompetenceToolbar(
1145 $this->
user->getId()
1149 $eval_modes = array();
1153 $opts = $sskill->getAllAssignedSkillsAsOptions();
1155 foreach ($opts as
$id => $o) {
1156 $idarr = explode(
":",
$id);
1157 $skills[
$id] = array(
"id" =>
$id,
"title" => $o,
"profiles" => array(),
1158 "base_skill" => $idarr[0],
"tref_id" => $idarr[1]);
1163 $profiles = $this->skill_profile_service->getProfilesOfUser($appr_id);
1164 foreach ($profiles as $p) {
1165 $prof_levels = $this->skill_profile_service->getSkillLevels($p->getId());
1166 foreach ($prof_levels as $pl) {
1167 if (isset($skills[$pl->getBaseSkillId() .
":" . $pl->getTrefId()])) {
1168 $skills[$pl->getBaseSkillId() .
":" . $pl->getTrefId()][
"profiles"][] =
1171 $eval_modes[
"gap_" . $p->getId()] =
1172 $lng->
txt(
"svy_gap_analysis") .
": " . $p->getTitle();
1179 foreach ($skills as $sk) {
1180 if (count($sk[
"profiles"]) === 0) {
1181 $eval_modes[
"skills_of_survey"] = $lng->
txt(
"svy_all_survey_competences");
1186 $comp_eval_mode = $this->request->getCompEvalMode();
1188 if (!isset($eval_modes[$comp_eval_mode])) {
1189 $comp_eval_mode = key($eval_modes);
1190 $ilCtrl->setParameter($this,
"comp_eval_mode", $comp_eval_mode);
1193 $ilCtrl->saveParameter($this,
"comp_eval_mode");
1197 $mode_sel->setValue($comp_eval_mode);
1198 $ilToolbar->addInputItem($mode_sel,
true);
1200 $ilToolbar->addFormButton($lng->
txt(
"select"),
"competenceEval");
1203 $rater = $this->evaluation_manager->getCurrentRater();
1204 if ($rater !==
"") {
1205 if (strpos($rater ??
"",
"u") === 0) {
1206 $rater = substr($rater, 1);
1208 $pskills_gui->setTriggerUserFilter([$rater]);
1211 if (strpos($comp_eval_mode ??
"",
"gap_") === 0) {
1213 $profile_id = (
int) substr($comp_eval_mode, 4);
1215 $pskills_gui->setProfileId($profile_id);
1216 $pskills_gui->setGapAnalysisActualStatusModePerObject($survey->getId(), $lng->
txt(
"skmg_eval_type_1"));
1217 if ($survey->getFinishedIdForAppraiseeIdAndRaterId($appr_id, $appr_id) > 0) {
1219 $self_levels = array();
1220 foreach ($sskill->determineSkillLevelsForAppraisee($appr_id,
true) as $sl) {
1221 $self_levels[$sl[
"base_skill_id"]][$sl[
"tref_id"]] = $sl[
"new_level_id"] ?? 0;
1223 $pskills_gui->setGapAnalysisSelfEvalLevels($self_levels);
1225 $html = $pskills_gui->getGapAnalysisHTML($appr_id);
1227 $pskills_gui->setGapAnalysisActualStatusModePerObject($survey->getId(), $lng->
txt(
"skmg_eval_type_1"));
1228 if ($survey->getFinishedIdForAppraiseeIdAndRaterId($appr_id, $appr_id) > 0) {
1230 $self_levels = array();
1231 foreach ($sskill->determineSkillLevelsForAppraisee($appr_id,
true) as $sl) {
1232 $self_levels[$sl[
"base_skill_id"]][$sl[
"tref_id"]] = $sl[
"new_level_id"] ?? 0;
1234 $pskills_gui->setGapAnalysisSelfEvalLevels($self_levels);
1237 foreach ($skills as $skill) {
1239 "base_skill_id" => (
int) $skill[
"base_skill"],
1240 "tref_id" => (
int) $skill[
"tref_id"]
1243 $html = $pskills_gui->getGapAnalysisHTML($appr_id, $sk);
1254 return $this->
access->checkRbacOrPositionPermissionAccess(
'read_results',
'access_results', $this->
object->getRefId());
1266 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_permission"),
true);
1267 $this->
ctrl->redirectByClass(
"ilObjSurveyGUI",
"infoScreen");
1270 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"svy_max_sum_score") .
": " . $this->
object->getMaxSumScore());
1272 $ilToolbar->setFormAction($this->
ctrl->getFormAction($this,
"evaluationuser"));
1274 $modal_id =
"svy_ev_exp";
1278 $this->
lng->txt(
"print"),
1280 )->onClick(
"window.print(); return false;")->toToolbar();
1282 $finished_ids = null;
1287 $this->tpl->setContent($table_gui->getHTML() . $modal);
1294 ?array $a_finished_ids = null
1297 foreach ($this->access_manager->canReadResultOfParticipants($a_finished_ids) as $p) {
1298 $sum_scores[$p[
"active_id"]] = [
1299 "username" => $p[
"sortname"],
1304 foreach ($this->
object->getSurveyQuestions() as $qdata) {
1306 foreach ($q_eval->getSumScores() as $finished_id => $sum_score) {
1307 if ($sum_score === null) {
1308 $sum_scores[$finished_id][
"score"] = null;
1310 if ($sum_scores[$finished_id][
"score"] !== null) {
1311 $sum_scores[$finished_id][
"score"] += (
int) $sum_score;
1323 $view = $this->print->resultsOverview($this->
object->getRefId());
1332 $this->
ctrl->setParameterByClass(
1333 "ilSurveyEvaluationGUI",
1335 $this->request->getVW()
1337 $this->
ctrl->setParameterByClass(
1338 "ilSurveyEvaluationGUI",
1340 $this->request->getCP()
1342 $view = $this->print->resultsDetails($this->
object->getRefId());
1348 $view = $this->print->resultsDetails($this->
object->getRefId());
1349 $view->sendPrintView();
1357 $view = $this->print->resultsPerUser($this->
object->getRefId());
1363 $view = $this->print->resultsPerUser($this->
object->getRefId());
1364 $view->sendPrintView();
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...
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
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="")
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.
ILIAS Survey InternalGUIService $gui
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.