ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
class.ilSurveyEvaluationGUI.php
Go to the documentation of this file.
1<?php
2
21
31{
32 public const TYPE_XLS = "excel";
33 public const TYPE_SPSS = "csv";
34 public const EXCEL_SUBTITLE = "DDDDDD";
35 protected \ILIAS\Survey\InternalGUIService $gui;
36 protected \ILIAS\Survey\Access\AccessManager $access_manager;
37 protected \ILIAS\Survey\PrintView\GUIService $print;
41 protected string $last_questionblock_id = "";
42 protected array $array_panels;
43
44 protected ilLogger $log;
45 protected \ILIAS\DI\UIServices $ui;
46 protected \ILIAS\Survey\Evaluation\EvaluationManager $evaluation_manager;
47 protected ilTabsGUI $tabs;
49 protected ilObjUser $user;
51 protected ilTree $tree;
53 protected ilLanguage $lng;
55 protected ilCtrl $ctrl;
56 protected ?int $appr_id = null;
58 protected \ILIAS\Survey\Evaluation\EvaluationGUIRequest $request;
59 protected \ILIAS\Skill\Service\SkillProfileService $skill_profile_service;
60
61 public function __construct(
62 ilObjSurvey $a_object
63 ) {
64 global $DIC;
65
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();
72 $lng = $DIC->language();
73 $tpl = $DIC["tpl"];
74 $ilCtrl = $DIC->ctrl();
75
76 $this->lng = $lng;
77 $this->tpl = $tpl;
78 $this->ctrl = $ilCtrl;
79 $this->object = $a_object;
80 $this->log = ilLoggerFactory::getLogger("svy");
81 $this->array_panels = array();
82
83 $this->request = $DIC->survey()->internal()->gui()->evaluation($this->object)->request();
84
85 $this->ctrl->saveParameter($this, ["appr_id", "rater_id"]);
86 $this->evaluation_manager = $DIC
87 ->survey()
88 ->internal()
89 ->domain()
90 ->evaluation(
91 $this->object,
92 $DIC->user()->getId(),
93 $this->request->getAppraiseeId(),
94 $this->request->getRaterId()
95 );
96
97 $this->setAppraiseeId(
98 $this->evaluation_manager->getCurrentAppraisee()
99 );
100
101 $this->ui_modifier = $DIC->survey()
102 ->internal()
103 ->gui()
104 ->modeUIModifier($this->object->getMode());
105 $this->print = $DIC->survey()
106 ->internal()
107 ->gui()
108 ->print();
109 $this->access_manager = $DIC->survey()
110 ->internal()
111 ->domain()
112 ->access(
113 $this->object->getRefId(),
114 $DIC->user()->getId()
115 );
116 $this->skill_profile_service = $DIC->skills()->profile();
117 $this->gui = $DIC->survey()->internal()->gui();
118 }
119
120 public function executeCommand(): string
121 {
122 $skmg_set = new ilSkillManagementSettings();
123 if ($this->object->getSkillService() && $skmg_set->isActivated()) {
124 $cmd = $this->ctrl->getCmd("competenceEval");
125 } else {
126 $cmd = $this->ctrl->getCmd("evaluation");
127 }
128
129 $next_class = $this->ctrl->getNextClass($this);
130
131 $this->log->debug($cmd);
132
133 switch ($next_class) {
134 default:
135 $this->setEvalSubtabs();
136 $ret = (string) $this->$cmd();
137 break;
138 }
139 return $ret;
140 }
141
145 public function setEvalSubtabs(): void
146 {
147 $ilTabs = $this->tabs;
148
149 $skmg_set = new ilSkillManagementSettings();
150 if ($this->object->getSkillService() && $skmg_set->isActivated()) {
151 $ilTabs->addSubTabTarget(
152 "svy_eval_competences",
153 $this->ctrl->getLinkTarget($this, "competenceEval"),
154 array("competenceEval")
155 );
156 }
157
158 if ($this->object->getMode() !== ilObjSurvey::MODE_IND_FEEDB) {
159 $ilTabs->addSubTabTarget(
160 "svy_eval_cumulated",
161 $this->ctrl->getLinkTarget($this, "evaluation"),
162 array("evaluation", "checkEvaluationAccess")
163 );
164 }
165
166 $ilTabs->addSubTabTarget(
167 "svy_eval_detail",
168 $this->ctrl->getLinkTarget($this, "evaluationdetails"),
169 array("evaluationdetails")
170 );
171
172 if ($this->hasResultsAccess() && $this->object->getMode() !== ilObjSurvey::MODE_IND_FEEDB) {
173 $ilTabs->addSubTabTarget(
174 "svy_eval_user",
175 $this->ctrl->getLinkTarget($this, "evaluationuser"),
176 array("evaluationuser")
177 );
178 }
179
180 if ($this->object->getCalculateSumScore()) {
181 $ilTabs->addSubTabTarget(
182 "svy_sum_score",
183 $this->ctrl->getLinkTarget($this, "sumscore"),
184 array("sumscore")
185 );
186 }
187 }
188
189 public function setAppraiseeId(
190 int $a_val
191 ): void {
192 $this->appr_id = $a_val;
193 }
194
195 public function getAppraiseeId(): int
196 {
197 return $this->appr_id;
198 }
199
200 public function checkAnonymizedEvaluationAccess(): bool
201 {
202 $ilUser = $this->user;
203
204 if ($this->object->getAnonymize() === 1 &&
205 $this->evaluation_manager->getAnonEvaluationAccess() === $this->request->getRefId()) {
206 return true;
207 }
208
210 ilObject::_lookupObjId($this->request->getRefId()),
211 $ilUser->getId()
212 )) {
213 if ($this->object->getAnonymize() === 1) {
214 $this->evaluation_manager->setAnonEvaluationAccess($this->request->getRefId());
215 }
216 return true;
217 }
218
219 if ($this->object->getAnonymize() === 1) {
220 // autocode
221 $surveycode = $this->object->getUserAccessCode($ilUser->getId());
222 if ($this->object->isAnonymizedParticipant($surveycode)) {
223 $this->evaluation_manager->setAnonEvaluationAccess($this->request->getRefId());
224 return true;
225 }
226
227 // code needed
228 $this->tpl->setVariable("TABS", "");
229 $this->tpl->addBlockFile(
230 "ADM_CONTENT",
231 "adm_content",
232 "tpl.il_svy_svy_evaluation_checkaccess.html",
233 "components/ILIAS/Survey"
234 );
235 $this->tpl->setCurrentBlock("adm_content");
236 $this->tpl->setVariable(
237 "AUTHENTICATION_NEEDED",
238 $this->lng->txt("svy_check_evaluation_authentication_needed")
239 );
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")
244 );
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();
249 }
250
251 $this->evaluation_manager->clearAnonEvaluationAccess();
252 return false;
253 }
254
258 public function checkEvaluationAccess(): void
259 {
260 $surveycode = $this->request->getSurveyCode();
261 if ($this->object->isAnonymizedParticipant($surveycode)) {
262 $this->evaluation_manager->setAnonEvaluationAccess($this->request->getRefId());
263 $this->evaluation();
264 } else {
265 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("svy_check_evaluation_wrong_key", true));
266 $this->cancelEvaluationAccess();
267 }
268 }
269
273 public function cancelEvaluationAccess(): void
274 {
275 $ilCtrl = $this->ctrl;
276 $tree = $this->tree;
277 $path = $tree->getPathFull($this->object->getRefId());
278 $ilCtrl->setParameterByClass(
279 "ilrepositorygui",
280 "ref_id",
281 $path[count($path) - 2]["child"]
282 );
283 $ilCtrl->redirectByClass("ilrepositorygui", "frameset");
284 }
285
289 protected function evaluationdetails(): void
290 {
291 $this->evaluation(1);
292 }
293
294 public function exportCumulatedResults(
295 int $details = 0
296 ): void {
297 $finished_ids = null;
298 if ($this->object->get360Mode()) {
299 $appr_id = $this->request->getAppraiseeId();
300 if (!$appr_id) {
301 $this->ctrl->redirect($this, $details ? "evaluationdetails" : "evaluation");
302 }
303 $finished_ids = $this->object->getFinishedIdsForAppraiseeId($appr_id);
304 if (!count($finished_ids)) {
305 $finished_ids = array(-1);
306 }
307 }
308
309 // titles
310 $title_row = array();
311 $do_title = $do_label = true;
312 switch ($this->request->getExportLabel()) {
313 case 'label_only':
314 $title_row[] = $this->lng->txt("label");
315 $do_title = false;
316 break;
317
318 case 'title_only':
319 $title_row[] = $this->lng->txt("title");
320 $do_label = false;
321 break;
322
323 default:
324 $title_row[] = $this->lng->txt("title");
325 $title_row[] = $this->lng->txt("label");
326 break;
327 }
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");
337
338 // creating container
339 $excel = null;
340 $csvfile = null;
341 switch ($this->request->getExportFormat()) {
342 case self::TYPE_XLS:
343 $excel = new ilExcel();
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");
347 break;
348
349 case self::TYPE_SPSS:
350 $csvfile = array($title_row);
351 break;
352 }
353
354 // parse answer data in evaluation results
355 $ov_row = 2;
356 $question_index = 1;
357 foreach ($this->object->getSurveyQuestions() as $qdata) {
358 $q_eval = SurveyQuestion::_instanciateQuestionEvaluation($qdata["question_id"], $finished_ids);
359 $q_res = $q_eval->getResults();
360 $ov_rows = $q_eval->exportResults($q_res, $do_title, $do_label);
361
362 switch ($this->request->getExportFormat()) {
363 case self::TYPE_XLS:
364 $excel->setActiveSheet(0);
365 foreach ($ov_rows as $row) {
366 foreach ($row as $col => $value) {
367 $excel->setCell($ov_row, $col, $value);
368 }
369 $ov_row++;
370 }
371 break;
372
373 case self::TYPE_SPSS:
374 foreach ($ov_rows as $row) {
375 $csvfile[] = $row;
376 }
377 break;
378 }
379
380 if ($details) {
381 switch ($this->request->getExportFormat()) {
382 case self::TYPE_XLS:
383 $this->exportResultsDetailsExcel(
384 $excel,
385 $q_eval,
386 $q_res,
387 $do_title,
388 $do_label,
389 $question_index++
390 );
391 break;
392 }
393 }
394 }
395
396 // #11179
397 $type = !$details
398 ? $this->lng->txt("svy_eval_cumulated")
399 : $this->lng->txt("svy_eval_detail");
400
401 $surveyname = $this->object->getTitle() . " " . $type . " " . date("Y-m-d");
402 $surveyname = preg_replace("/\s/", "_", trim($surveyname));
403 $surveyname = ilFileUtils::getASCIIFilename($surveyname);
404
405 // send to client
406 switch ($this->request->getExportFormat()) {
407 case self::TYPE_XLS:
408 $excel->sendToClient($surveyname);
409 break;
410
411 case self::TYPE_SPSS:
412 $csv = "";
413 $separator = ";";
414 foreach ($csvfile as $csvrow) {
415 $csvrow = $this->processCSVRow($csvrow, true, $separator);
416 $csv .= implode($separator, $csvrow) . "\n";
417 }
418 ilUtil::deliverData($csv, $surveyname . ".csv");
419 exit();
420 }
421 }
422
428 protected function exportResultsDetailsExcel(
429 ilExcel $a_excel,
431 $a_results,
432 bool $a_do_title,
433 bool $a_do_label,
434 int $question_index
435 ): void {
436 $question_res = $a_results;
437 $matrix = false;
438 if (is_array($question_res)) {
439 $question_res = $question_res[0][1];
440 $matrix = true;
441 }
442 $question = $question_res->getQuestion();
443
444 $a_excel->addSheet($question_index . "_" . $question->getTitle());
445
446 // question "overview"
447
448 $kv = array();
449
450 if ($a_do_title) {
451 $kv[$this->lng->txt("title")] = $question->getTitle();
452 }
453 if ($a_do_label) {
454 $kv[$this->lng->txt("label")] = $question->label;
455 }
456
457 // question
458 $kv[$this->lng->txt("question")] = $question->getQuestiontext();
459
460 // question type
461 $kv[$this->lng->txt("question_type")] = SurveyQuestion::_getQuestionTypeName($question->getQuestionType());
462
463 // :TODO: present subtypes (hrz/vrt, mc/sc mtx, metric scale)?
464
465 // answered and skipped users
466 $kv[$this->lng->txt("users_answered")] = $question_res->getUsersAnswered();
467 $kv[$this->lng->txt("users_skipped")] = $question_res->getUsersSkipped(); // #0021671
468
469 $excel_row = 1;
470
471 foreach ($kv as $key => $value) {
472 $a_excel->setCell($excel_row, 0, $key);
473 $a_excel->setCell($excel_row++, 1, $value);
474 }
475
476 if (!$matrix) {
477 $this->parseResultsToExcel(
478 $a_excel,
479 $question_res,
480 $excel_row,
481 $a_eval->getExportGrid($a_results),
482 $a_eval->getTextAnswers($a_results)
483 );
484 } else {
485 // question
486 $this->parseResultsToExcel(
487 $a_excel,
488 $question_res,
489 $excel_row,
490 null,
491 null,
492 false
493 );
494
495 $texts = $a_eval->getTextAnswers($a_results);
496
497 // "rows"
498 foreach ($a_results as $row_results) {
499 $row_title = $row_results[0];
500
501 $a_excel->setCell($excel_row, 0, $this->lng->txt("row"));
502 $a_excel->setCell($excel_row++, 1, $row_title);
503
504 $this->parseResultsToExcel(
505 $a_excel,
506 $row_results[1],
507 $excel_row,
508 $a_eval->getExportGrid($row_results[1]),
509 is_array($texts[$row_title] ?? false)
510 ? array("" => $texts[$row_title])
511 : null
512 );
513 }
514 }
515
516 // matrix question: overview #21438
517 if ($matrix) {
518 $a_excel->setCell($excel_row++, 0, $this->lng->txt("overview"));
519
520 // title row with variables
521 $counter = 0;
522 $cats = $question->getColumns();
523 foreach ($cats->getCategories() as $cat) {
524 $a_excel->setColors($a_excel->getCoordByColumnAndRow(1 + $counter, $excel_row), self::EXCEL_SUBTITLE);
525 $a_excel->setCell($excel_row, 1 + $counter, $cat->title);
526 $counter++;
527 }
528 $excel_row++;
529
530 foreach ($a_results as $row_results) {
531 $row_title = $row_results[0];
532 $counter = 0;
533 $a_excel->setCell($excel_row, 0, $row_title);
534
535 $vars = $row_results[1]->getVariables();
536 if ($vars) {
537 foreach ($vars as $var) {
538 $a_excel->setCell($excel_row, ++$counter, $var->abs);
539 }
540 }
541 $excel_row++;
542 }
543 }
544
545 // 1st column is bold
546 $a_excel->setBold("A1:A" . $excel_row);
547 }
548
549 protected function parseResultsToExcel(
550 ilExcel $a_excel,
551 ilSurveyEvaluationResults $a_results,
552 int &$a_excel_row,
553 ?array $a_grid = null,
554 ?array $a_text_answers = null,
555 bool $a_include_mode = true
556 ): void {
557 $kv = array();
558
559 if ($a_include_mode) {
560 if ($a_results->getModeValue() !== null) {
561 // :TODO:
562 $kv[$this->lng->txt("mode")] = is_array($a_results->getModeValue())
563 ? implode(", ", $a_results->getModeValue())
564 : $a_results->getModeValue();
565
566 $kv[$this->lng->txt("mode_text")] = $a_results->getModeValueAsText();
567 $kv[$this->lng->txt("mode_nr_of_selections")] = $a_results->getModeNrOfSelections();
568 }
569
570 if ($a_results->getMedian() !== null) {
571 $kv[$this->lng->txt("median")] = $a_results->getMedianAsText();
572 }
573
574 if ($a_results->getMean() !== null) {
575 $kv[$this->lng->txt("arithmetic_mean")] = $a_results->getMean();
576 }
577 }
578
579 foreach ($kv as $key => $value) {
580 $a_excel->setCell($a_excel_row, 0, $key);
581 $a_excel->setCell($a_excel_row++, 1, $value);
582 }
583
584 // grid
585 if ($a_grid) {
586 // header
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);
591 }
592 $a_excel_row++;
593
594 // rows
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);
598 }
599 $a_excel_row++;
600 }
601 }
602
603 // text answers
604 if ($a_text_answers) {
605 // "given_answers" ?
606 $a_excel->setCell($a_excel_row, 0, $this->lng->txt("freetext_answers"));
607
608 // mc/sc
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"));
613 } // mtx (row), txt
614 else {
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"));
617 }
618
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);
624 } else {
625 $a_excel->setCell($a_excel_row++, 1, $item);
626 }
627 }
628 }
629 }
630 }
631
632 public function exportData(): void
633 {
634 if ($this->request->getExportFormat() !== '') {
635 $this->exportCumulatedResults(0);
636 } else {
637 $this->ctrl->redirect($this, 'evaluation');
638 }
639 }
640
641 public function exportDetailData(): void
642 {
643 if ($this->request->getExportFormat() !== '') {
644 $this->exportCumulatedResults(1);
645 } else {
646 $this->ctrl->redirect($this, 'evaluation');
647 }
648 }
649
650 public function printEvaluation(): void
651 {
652 $this->tpl->setOnScreenMessage('info', $this->lng->txt('use_browser_print_function'), true);
653 $this->ctrl->redirect($this, 'evaluation');
654 }
655
656 protected function buildExportButtonAndModal(
657 string $export_cmd
658 ): void {
659 $lng = $this->lng;
660 $ctrl = $this->ctrl;
661 $toolbar = $this->gui->toolbar();
662 $ui_fac = $this->gui->ui()->factory();
663
664 $ctrl->setParameter($this, "export_cmd", $export_cmd);
665 $modal = $this->getExportModal();
666 $button = $ui_fac->button()->standard(
667 $lng->txt("export"),
668 "#"
669 )->withOnClick($modal->getShowSignal());
670
671 $toolbar->addComponent($button);
672 $toolbar->addComponent($modal);
673 }
674
676 {
678 $ctrl = $this->ctrl;
679 $ui_fac = $this->gui->ui()->factory();
680
681 $post_url = $ctrl->getFormAction($this, "validateAndSubmitExportForm");
682
683 $inputs["export_format"] = $ui_fac->input()->field()->select(
684 $lng->txt("filetype"),
685 [
686 \ilSurveyEvaluationGUI::TYPE_XLS => $lng->txt("exp_type_excel"),
687 \ilSurveyEvaluationGUI::TYPE_SPSS => $lng->txt("exp_type_csv")
688 ]
689 )
690 //->withValue(\ilSurveyEvaluationGUI::TYPE_XLS)
691 ->withRequired(true);
692
693 $inputs["export_label"] = $ui_fac->input()->field()->select(
694 $lng->txt("title"),
695 [
696 "label_only" => $lng->txt("export_label_only"),
697 "title_only" => $lng->txt("export_title_only"),
698 "title_label" => $lng->txt("export_title_label")
699 ]
700 )
701 //->withValue("label_only")
702 ->withRequired(true);
703
704 $modal = $ui_fac->modal()->roundtrip(
705 $lng->txt("svy_export_format"),
706 null,
707 $inputs,
708 $post_url
709 )
710 ->withSubmitLabel($lng->txt("export"));
711
712 return $modal;
713 }
714
715 protected function validateAndSubmitExportForm(): void
716 {
718 $ctrl = $this->ctrl;
719 $tabs = $this->tabs;
720 $toolbar = $this->gui->toolbar();
721 $request = $this->request;
722 $ui_request = $this->gui->http()->request();
723
724 $export_cmd = $request->getExportCmd();
725 $ctrl->setParameter($this, "export_cmd", $export_cmd);
726 $modal = $this->getExportModal();
727 if ("POST" === $ui_request->getMethod()) {
728 $modal = $modal->withRequest($ui_request);
729 $data = $modal->getData();
730 if ($data) {
731 $ctrl->setParameter($this, "export_format", $data["export_format"]);
732 $ctrl->setParameter($this, "export_label", $data["export_label"]);
733 $ctrl->redirect($this, $export_cmd);
734 } else {
735 switch ($export_cmd) {
736 case "exportData":
737 $tabs->activateSubTab("svy_eval_cumulated");
738 $this->evaluation();
739 return;
740 case "exportDetailData":
741 $tabs->activateSubTab("svy_eval_detail");
742 $this->evaluationdetails();
743 return;
744 case "exportEvaluationUser":
745 $toolbar->addComponent($modal->withOnLoad($modal->getShowSignal()));
746 $tabs->activateSubTab("svy_eval_user");
747 $this->evaluationuser();
748 return;
749 }
750 }
751 }
752
753 switch ($export_cmd) {
754 case "exportData":
755 $ctrl->redirect($this, "evaluation");
756 // no break
757 case "exportDetailData":
758 $ctrl->redirect($this, "evaluationdetails");
759 // no break
760 case "exportEvaluationUser":
761 $ctrl->redirect($this, "evaluationuser");
762 }
763 }
764
765 protected function openEvaluation(): void
766 {
767 $skmg_set = new ilSkillManagementSettings();
768 if ($this->object->getSkillService() && $skmg_set->isActivated()) {
769 $this->competenceEval();
770 } else {
771 if ($this->object->getMode() === ilObjSurvey::MODE_IND_FEEDB) {
772 $this->evaluationdetails();
773 } else {
774 $this->evaluation();
775 }
776 }
777 }
778
779 public function evaluation(
780 int $details = 0
781 ): void {
782 $tree = $this->tree;
783 $ui = $this->ui;
784
785 $ui_factory = $ui->factory();
786 $ui_renderer = $ui->renderer();
787
788 $this->lng->loadLanguageModule("survey");
789
790 $this->log->debug("check access");
791
792 if ($details == 0) {
793 $this->tabs->activateSubTab("svy_eval_cumulated");
794 } else {
795 $this->tabs->activateSubTab("svy_eval_detail");
796 }
797
798 // auth
799 if (!$this->hasResultsAccess()) {
800 if (!$this->access->checkAccess('read', '', $this->object->getRefId())) {
801 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("permission_denied"));
802 return;
803 }
804
805 switch ($this->object->getEvaluationAccess()) {
807 if ($this->object->getMode() !== ilObjSurvey::MODE_IND_FEEDB) {
808 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("permission_denied"));
809 return;
810 }
811 break;
812
815 if (!$this->checkAnonymizedEvaluationAccess()) {
816 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("permission_denied"));
817 return;
818 }
819 break;
820 }
821 }
822
823 $this->log->debug("check access ok");
824 // setup toolbar
825
826 $appr_id = $this->evaluation_manager->getCurrentAppraisee();
827 $results = array();
828
829 $eval_tpl = new ilTemplate("tpl.il_svy_svy_evaluation.html", true, true, "components/ILIAS/Survey");
830
831 if ($details) {
832 $toolbar_components = $this->ui_modifier->setResultsDetailToolbar(
833 $this->object,
834 $this->user->getId(),
835 $eval_tpl
836 );
837 } else {
838 $toolbar_components = $this->ui_modifier->setResultsOverviewToolbar(
839 $this->object,
840 $this->user->getId(),
841 $eval_tpl
842 );
843 }
844 foreach ($toolbar_components as $component) {
845 $this->gui->toolbar()->addComponent($component);
846 }
847
848 if (!$this->object->get360Mode() || $appr_id) {
849 if ($details) {
850 //templates: results, table of contents
851 $dtmpl = new ilTemplate(
852 "tpl.il_svy_svy_results_details.html",
853 true,
854 true,
855 "components/ILIAS/Survey/Evaluation"
856 );
857 $this->lng->loadLanguageModule("content");
858 }
859 $finished_ids = $this->evaluation_manager->getFilteredFinishedIds();
860 // parse answer data in evaluation results
861 $listing = $this->gui->listing();
862
863 $panels = [];
864 foreach ($this->object->getSurveyQuestions() as $qdata) {
865 $q_eval = SurveyQuestion::_instanciateQuestionEvaluation($qdata["question_id"], $finished_ids);
866 $q_res = $q_eval->getResults();
867 $results[] = $q_res;
868
869 if ($details) {
870 $panels = array_merge(
871 $panels,
872 $this->ui_modifier->getDetailPanels(
873 $this->object->getSurveyParticipants(),
874 $this->request,
875 $q_eval
876 )
877 );
878
879 // TABLE OF CONTENTS
880 if ($qdata["questionblock_id"] &&
881 $qdata["questionblock_id"] != $this->last_questionblock_id) {
882 $qblock = ilObjSurvey::_getQuestionblock($qdata["questionblock_id"]);
883 if ($qblock["show_blocktitle"]) {
884 $listing->node(
885 $this->ui->factory()->legacy()->content($qdata["questionblock_title"]),
886 "q" . $qdata["questionblock_id"]
887 );
888 } else {
889 $listing->node(
890 $this->ui->factory()->legacy()->content(""),
891 "q" . $qdata["questionblock_id"]
892 );
893 }
894 $this->last_questionblock_id = $qdata["questionblock_id"];
895 }
896 $anchor_id = "svyrdq" . $qdata["question_id"];
897 $listing->node(
898 $this->ui->factory()->link()->standard($qdata["title"], "#" . $anchor_id),
899 (string) $qdata["question_id"],
900 $qdata["questionblock_id"] ? "q" . $qdata["questionblock_id"] : "0"
901 );
902 }
903 }
904
905 if ($details) {
906 //TABLE OF CONTENTS
907 $panel_toc = $ui_factory->panel()->standard(
908 $this->lng->txt('cont_toc'),
909 $ui_factory->legacy()->content($listing->render())
910 );
911 $render_toc = $ui_renderer->render($panel_toc);
912 $dtmpl->setVariable("PANEL_TOC", $render_toc);
913
914 //REPORT
915 $report_title = "";
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);
919
920 //print the main template
921 $eval_tpl->setVariable('DETAIL', $dtmpl->get());
922 }
923 }
924
925 if (!$details) {
926 $table_gui = new ilSurveyResultsCumulatedTableGUI($this, 'evaluation', $results);
927 $eval_tpl->setVariable('CUMULATED', $table_gui->getHTML());
928 }
929
930 //
931 // print header
932 //
933
934 $path = "";
935 $path_full = $tree->getPathFull($this->object->getRefId());
936 foreach ($path_full as $data) {
937 $path .= " &raquo; ";
938 $path .= $data['title'];
939 }
940
942 $props = array(
943 $this->lng->txt("link") => ilLink::_getStaticLink($this->object->getRefId()),
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"),
948 $this->lng->txt("date") => ilDatePresentation::formatDate(new ilDateTime(time(), IL_CAL_UNIX)),
949 );
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();
955 }
956
957 $this->log->debug("end");
958
959 $this->tpl->setContent($eval_tpl->get());
960 }
961
970 public function processCSVRow(
971 array $row,
972 bool $quoteAll = false,
973 string $separator = ";"
974 ): array {
975 $resultarray = array();
976 foreach ($row as $rowindex => $entry) {
977 if (is_array($entry)) {
978 $entry = implode("/", $entry);
979 }
980 $surround = false;
981 if ($quoteAll) {
982 $surround = true;
983 }
984 if (strpos($entry ?? "", "\"") !== false) {
985 $entry = str_replace("\"", "\"\"", (string) $entry);
986 $surround = true;
987 }
988 if (strpos($entry ?? "", $separator) !== false) {
989 $surround = true;
990 }
991 // replace all CR LF with LF (for Excel for Windows compatibility
992 $entry = str_replace(chr(13) . chr(10), chr(10), (string) $entry);
993 if ($surround) {
994 //$resultarray[$rowindex] = utf8_decode("\"" . $entry . "\"");
995 $resultarray[$rowindex] = "\"" . $entry . "\"";
996 } else {
997 //$resultarray[$rowindex] = utf8_decode($entry);
998 $resultarray[$rowindex] = $entry;
999 }
1000 }
1001 return $resultarray;
1002 }
1003
1004 public function exportEvaluationUser(): void
1005 {
1006 // build title row(s)
1007
1008 $title_row = $title_row2 = array();
1009 $title_row[] = $this->lng->txt("lastname"); // #12756
1010 $title_row[] = $this->lng->txt("firstname");
1011 $title_row[] = $this->lng->txt("login");
1012 $title_row[] = $this->lng->txt('workingtime'); // #13622
1013 $title_row[] = $this->lng->txt('survey_results_finished');
1014 $title_row2[] = "";
1015 $title_row2[] = "";
1016 $title_row2[] = "";
1017 $title_row2[] = "";
1018 $title_row2[] = "";
1019 if ($this->object->canExportSurveyCode()) {
1020 $title_row[] = $this->lng->txt("codes");
1021 $title_row2[] = "";
1022 }
1023
1024 $questions = array();
1025
1026 foreach ($this->object->getSurveyQuestions() as $qdata) {
1027 $q_eval = SurveyQuestion::_instanciateQuestionEvaluation($qdata["question_id"], null);
1028 $q_res = $q_eval->getResults();
1029
1030 $questions[$qdata["question_id"]] = array($q_eval, $q_res);
1031
1032 $question = is_array($q_res)
1033 ? $q_res[0][1]->getQuestion()
1034 : $q_res->getQuestion();
1035
1036 $do_title = $do_label = true;
1037 switch ($this->request->getExportLabel()) {
1038 case "label_only":
1039 $title_row[] = $question->label;
1040 $title_row2[] = "";
1041 $do_title = false;
1042 break;
1043
1044 case "title_only":
1045 $title_row[] = $question->getTitle();
1046 $title_row2[] = "";
1047 $do_label = false;
1048 break;
1049
1050 default:
1051 $title_row[] = $question->getTitle();
1052 $title_row2[] = $question->label;
1053 break;
1054 }
1055
1056 $q_eval->getUserSpecificVariableTitles($title_row, $title_row2, $do_title, $do_label);
1057 }
1058
1059 $rows = array();
1060
1061 // add title row(s)
1062 $rows[] = $title_row;
1063 if (implode("", $title_row2)) {
1064 $rows[] = $title_row2;
1065 }
1066
1067 // #13620
1069
1070 $finished_ids = null;
1071 if ($this->object->get360Mode()) {
1072 $appr_id = $this->request->getAppraiseeId();
1073 if (!$appr_id) {
1074 $this->ctrl->redirect($this, "evaluationuser");
1075 }
1076 $finished_ids = $this->object->getFinishedIdsForAppraiseeId($appr_id);
1077 if (!count($finished_ids)) {
1078 $finished_ids = array(-1);
1079 }
1080 }
1081
1082 //$participants = $this->object->getSurveyParticipants($finished_ids);
1083 $participants = $this->access_manager->canReadResultOfParticipants($finished_ids);
1084
1085 foreach ($participants as $user) {
1086 $user_id = $user["active_id"];
1087
1088 $row = array();
1089 $row[] = trim($user["lastname"] ?? "")
1090 ? $user["lastname"]
1091 : ($user["name"] ?? ""); // anonymous
1092 $row[] = $user["firstname"] ?? "";
1093 $row[] = $user["login"] ?? ""; // #10579
1094
1095 if ($this->object->canExportSurveyCode()) {
1096 $row[] = $user_id;
1097 }
1098
1099 $row[] = $this->object->getWorkingtimeForParticipant($user_id);
1100
1101 if ($user["finished"] ?? false) {
1102 $dt = new ilDateTime($user["finished_tstamp"], IL_CAL_UNIX);
1103 $row[] = ($this->request->getExportFormat() === self::TYPE_XLS)
1104 ? $dt
1106 } else {
1107 $row[] = "-"; // :TODO:
1108 }
1109
1110 foreach ($questions as $item) {
1111 $q_eval = $item[0];
1112 $q_res = $item[1];
1113
1114 $q_eval->addUserSpecificResults($row, $user_id, $q_res);
1115 }
1116
1117 $rows[] = $row;
1118 }
1119
1120 // #11179
1121 $surveyname = $this->object->getTitle() . " " . $this->lng->txt("svy_eval_user") . " " . date("Y-m-d");
1122 $surveyname = preg_replace("/\s/", "_", trim($surveyname));
1123 $surveyname = ilFileUtils::getASCIIFilename($surveyname);
1124
1125 switch ($this->request->getExportFormat()) {
1126 case self::TYPE_XLS:
1127 $excel = new ilExcel();
1128 $excel->addSheet($this->lng->txt("svy_eval_user"));
1129
1130 foreach ($rows as $row_idx => $row) {
1131 foreach ($row as $col_idx => $col) {
1132 $excel->setCell($row_idx + 1, $col_idx, $col);
1133 }
1134 if (!$row_idx) {
1135 $excel->setBold("A1:" . $excel->getColumnCoord(count($row) - 1) . "1");
1136 }
1137 }
1138 $excel->sendToClient($surveyname);
1139
1140 // no break
1141 case self::TYPE_SPSS:
1142 $csv = "";
1143 $separator = ";";
1144 foreach ($rows as $csvrow) {
1145 $csvrow = str_replace("\n", " ", $this->processCSVRow($csvrow, true, $separator));
1146 $csv .= implode($separator, $csvrow) . "\n";
1147 }
1148 ilUtil::deliverData($csv, "$surveyname.csv");
1149 exit();
1150 }
1151 }
1152
1156 public function evaluationuser(): void
1157 {
1158 if (!$this->hasResultsAccess() &&
1159 $this->object->getMode() !== ilObjSurvey::MODE_SELF_EVAL) {
1160 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_permission"), true);
1161 $this->ctrl->redirectByClass("ilObjSurveyGUI", "infoScreen");
1162 }
1163
1164 $toolbar_components = $this->ui_modifier->setResultsParticipantToolbar(
1165 $this->object,
1166 $this->user->getId()
1167 );
1168 foreach ($toolbar_components as $component) {
1169 $this->gui->toolbar()->addComponent($component);
1170 }
1171
1172 $appr_id = null;
1173 $data = [];
1174
1175 if ($this->object->get360Mode()) {
1176 $appr_id = $this->getAppraiseeId();
1177 }
1178
1179 if (!$this->object->get360Mode() || $appr_id) {
1180 $this->buildExportButtonAndModal("exportEvaluationUser");
1181
1182 $this->gui->toolbar()->addSeparator();
1183
1184 $pv = $this->print->resultsDetails($this->object->getRefId());
1185 $modal_elements = $pv->getModalElements(
1186 $this->ctrl->getLinkTargetByClass(
1187 "ilSurveyEvaluationGUI",
1188 "printResultsPerUserSelection"
1189 )
1190 );
1191
1192 $this->gui->toolbar()->addComponent($modal_elements->button);
1193 $this->gui->toolbar()->addComponent($modal_elements->modal);
1194
1195 $data = $this->evaluation_manager->getUserSpecificResults();
1196 }
1197
1198 $table_gui = new ilSurveyResultsUserTableGUI($this, 'evaluationuser');
1199 $table_gui->setData($data);
1200 $this->tpl->setContent($table_gui->getHTML());
1201 }
1202
1203 public function competenceEval(): void
1204 {
1205 $lng = $this->lng;
1206 $ilCtrl = $this->ctrl;
1207 $tpl = $this->tpl;
1208 $ilTabs = $this->tabs;
1209
1210 $survey = $this->object;
1211
1212 $ilTabs->activateSubTab("svy_eval_competences");
1213 $ilTabs->activateTab("svy_results");
1214
1215 $appr_id = $this->getAppraiseeId();
1216
1217 if ($appr_id === 0) {
1218 $this->tpl->setOnScreenMessage('info', $this->lng->txt("svy_no_appraisees_found"));
1219 return;
1220 }
1221
1222 $toolbar_components = $this->ui_modifier->setResultsCompetenceToolbar(
1223 $this->object,
1224 $this->user->getId()
1225 );
1226 foreach ($toolbar_components as $component) {
1227 $this->gui->toolbar()->addComponent($component);
1228 }
1229
1230 // evaluation modes
1231 $eval_modes = array();
1232
1233 // get all competences of survey
1234 $sskill = new ilSurveySkill($survey);
1235 $opts = $sskill->getAllAssignedSkillsAsOptions();
1236 $skills = array();
1237 foreach ($opts as $id => $o) {
1238 $idarr = explode(":", $id);
1239 $skills[$id] = array(
1240 "id" => $id,
1241 "title" => $o,
1242 "profiles" => array(),
1243 "base_skill" => $idarr[0],
1244 "tref_id" => $idarr[1]
1245 );
1246 }
1247
1248 // get matching user competence profiles
1249 // -> add gap analysis to profile
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"][] =
1256 $p->getId();
1257
1258 $eval_modes["gap_" . $p->getId()] =
1259 $lng->txt("svy_gap_analysis") . ": " . $p->getTitle();
1260 }
1261 }
1262 }
1263
1264 // if one competence does not match any profiles
1265 // -> add "competences of survey" alternative
1266 foreach ($skills as $sk) {
1267 if (count($sk["profiles"]) === 0) {
1268 $eval_modes["skills_of_survey"] = $lng->txt("svy_all_survey_competences");
1269 }
1270 }
1271
1272 // final determination of current evaluation mode
1273 $comp_eval_mode = $this->request->getCompEvalMode();
1274
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);
1278 }
1279
1280 $ilCtrl->saveParameter($this, "comp_eval_mode");
1281
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(
1286 $mode_label,
1287 $ilCtrl->getLinkTarget($this, "competenceEval")
1288 );
1289 }
1290 $ilCtrl->setParameter($this, "comp_eval_mode", $comp_eval_mode);
1291
1292 $this->gui->toolbar()->addComponent(
1293 $this->ui->factory()->dropdown()->standard($dropdown_items)
1294 ->withLabel($eval_modes[$comp_eval_mode] ?? $lng->txt("svy_analysis"))
1295 );
1296
1297 $pskills_gui = new ilPersonalSkillsGUI();
1298 $rater = $this->evaluation_manager->getCurrentRater(
1299 $this->object->getMode() === ilObjSurvey::MODE_IND_FEEDB
1300 );
1301 if ($rater !== "") {
1302 if (strpos($rater ?? "", "u") === 0) {
1303 $rater = substr($rater, 1);
1304 }
1305 $pskills_gui->setTriggerUserFilter($rater);
1306 $pskills_gui->setHistoryView(true);
1307 }
1308
1309 if (strpos($comp_eval_mode ?? "", "gap_") === 0) {
1310 // gap analysis
1311 $profile_id = (int) substr($comp_eval_mode, 4);
1312
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) {
1316 $sskill = new ilSurveySkill($survey);
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;
1320 }
1321 $pskills_gui->setGapAnalysisSelfEvalLevels($self_levels);
1322 }
1323 $html = $pskills_gui->getGapAnalysisHTML($appr_id);
1324 } else { // must be all survey competences
1325 $pskills_gui->setGapAnalysisActualStatusModePerObject($survey->getId(), $lng->txt("skmg_eval_type_1"));
1326 if ($survey->getFinishedIdForAppraiseeIdAndRaterId($appr_id, $appr_id) > 0) {
1327 $sskill = new ilSurveySkill($survey);
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;
1331 }
1332 $pskills_gui->setGapAnalysisSelfEvalLevels($self_levels);
1333 }
1334 $sk = array();
1335 foreach ($skills as $skill) {
1336 $sk[] = array(
1337 "base_skill_id" => (int) $skill["base_skill"],
1338 "tref_id" => (int) $skill["tref_id"]
1339 );
1340 }
1341 $html = $pskills_gui->getGapAnalysisHTML($appr_id, $sk);
1342 }
1343 $tpl->setContent($html);
1344 }
1345
1350 protected function hasResultsAccess(): bool
1351 {
1352 return $this->access->checkRbacOrPositionPermissionAccess(
1353 'read_results',
1354 'access_results',
1355 $this->object->getRefId()
1356 );
1357 }
1358
1362 public function sumscore(): void
1363 {
1364 if (!$this->hasResultsAccess() &&
1365 $this->object->getMode() !== ilObjSurvey::MODE_SELF_EVAL) {
1366 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_permission"), true);
1367 $this->ctrl->redirectByClass("ilObjSurveyGUI", "infoScreen");
1368 }
1369
1370 $this->tpl->setOnScreenMessage(
1371 'info',
1372 $this->lng->txt("svy_max_sum_score") . ": " . $this->object->getMaxSumScore()
1373 );
1374
1375 $this->gui->button(
1376 $this->lng->txt("print"),
1377 "#"
1378 )->onClick("window.print(); return false;")->toToolbar();
1379
1380 $finished_ids = null;
1381
1382 $sum_scores = $this->getSumScores($finished_ids);
1383 $table_gui = new ilSumScoreTableGUI($this, 'sumscore', $this->object->hasAnonymizedResults());
1384 $table_gui->setSumScores($sum_scores);
1385 $this->tpl->setContent($table_gui->getHTML());
1386 }
1387
1391 protected function getSumScores(
1392 ?array $a_finished_ids = null
1393 ): array {
1394 $sum_scores = [];
1395 foreach ($this->access_manager->canReadResultOfParticipants($a_finished_ids) as $p) {
1396 $sum_scores[$p["active_id"]] = [
1397 "username" => $p["sortname"],
1398 "score" => 0
1399 ];
1400 }
1401
1402 foreach ($this->object->getSurveyQuestions() as $qdata) {
1403 $q_eval = SurveyQuestion::_instanciateQuestionEvaluation($qdata["question_id"], $a_finished_ids);
1404 foreach ($q_eval->getSumScores() as $finished_id => $sum_score) {
1405 if ($sum_score === null) {
1406 $sum_scores[$finished_id]["score"] = null;
1407 }
1408 if ($sum_scores[$finished_id]["score"] !== null) {
1409 $sum_scores[$finished_id]["score"] += (int) $sum_score;
1410 }
1411 }
1412 }
1413 return $sum_scores;
1414 }
1415
1419 public function printResultsOverviewSelection(): void
1420 {
1421 $view = $this->print->resultsOverview($this->object->getRefId());
1422 $view->sendForm();
1423 }
1424
1428 public function printResultsDetailsSelection(): void
1429 {
1430 $this->ctrl->setParameterByClass(
1431 "ilSurveyEvaluationGUI",
1432 "vw",
1433 $this->request->getVW()
1434 );
1435 $this->ctrl->setParameterByClass(
1436 "ilSurveyEvaluationGUI",
1437 "cp",
1438 $this->request->getCP()
1439 );
1440 $view = $this->print->resultsDetails($this->object->getRefId());
1441 $view->sendForm();
1442 }
1443
1444 public function printResultsDetails(): void
1445 {
1446 $view = $this->print->resultsDetails($this->object->getRefId());
1447 $view->sendPrintView();
1448 }
1449
1453 public function printResultsPerUserSelection(): void
1454 {
1455 $view = $this->print->resultsPerUser($this->object->getRefId());
1456 $view->sendForm();
1457 }
1458
1459 public function printResultsPerUser(): void
1460 {
1461 $view = $this->print->resultsPerUser($this->object->getRefId());
1462 $view->sendPrintView();
1463 }
1464}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
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.
const IL_CAL_UNIX
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)
language handling
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
User class.
static _lookupObjId(int $ref_id)
Personal skills GUI class.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Survey evaluation graphical output.
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
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.
cancelEvaluationAccess()
Cancels the input of the survey access code for evaluation access.
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)
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.
evaluationuser()
Print the survey evaluation for a selected user.
ILIAS Survey Evaluation EvaluationManager $evaluation_manager
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")
exit
setContent(string $a_html)
Sets content for standard template.
This describes commonalities between all forms.
Definition: Form.php:34
This describes commonalities between the different modals.
Definition: Modal.php:35
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
$path
Definition: ltiservices.php:30
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Factory.php:21
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Factory.php:21
global $lng
Definition: privfeed.php:31
$results
global $DIC
Definition: shib_login.php:26
$counter