ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilSurveyEvaluationGUI.php
Go to the documentation of this file.
1 <?php
2 
28 {
29  public const TYPE_XLS = "excel";
30  public const TYPE_SPSS = "csv";
31  public const EXCEL_SUBTITLE = "DDDDDD";
32  protected \ILIAS\Survey\Access\AccessManager $access_manager;
33  protected \ILIAS\Survey\PrintView\GUIService $print;
38  protected array $array_panels;
39 
40  protected ilLogger $log;
41  protected \ILIAS\DI\UIServices $ui;
42  protected \ILIAS\Survey\Evaluation\EvaluationManager $evaluation_manager;
43  protected ilTabsGUI $tabs;
45  protected ilObjUser $user;
47  protected ilTree $tree;
49  protected ilObjSurvey $object;
50  protected ilLanguage $lng;
52  protected ilCtrl $ctrl;
53  protected ?int $appr_id = null;
55  protected \ILIAS\Survey\Evaluation\EvaluationGUIRequest $request;
56  protected \ILIAS\Skill\Service\SkillProfileService $skill_profile_service;
57 
58  public function __construct(
59  ilObjSurvey $a_object
60  ) {
61  global $DIC;
62 
63  $this->tabs = $DIC->tabs();
64  $this->access = $DIC->access();
65  $this->user = $DIC->user();
66  $this->rbacsystem = $DIC->rbac()->system();
67  $this->tree = $DIC->repositoryTree();
68  $this->toolbar = $DIC->toolbar();
69  $this->ui = $DIC->ui();
70  $lng = $DIC->language();
71  $tpl = $DIC["tpl"];
72  $ilCtrl = $DIC->ctrl();
73 
74  $this->lng = $lng;
75  $this->tpl = $tpl;
76  $this->ctrl = $ilCtrl;
77  $this->object = $a_object;
78  $this->log = ilLoggerFactory::getLogger("svy");
79  $this->array_panels = array();
80 
81  $this->request = $DIC->survey()->internal()->gui()->evaluation($this->object)->request();
82 
83  $this->ctrl->saveParameter($this, ["appr_id", "rater_id"]);
84  $this->evaluation_manager = $DIC
85  ->survey()
86  ->internal()
87  ->domain()
88  ->evaluation(
89  $this->object,
90  $DIC->user()->getId(),
91  $this->request->getAppraiseeId(),
92  $this->request->getRaterId()
93  );
94 
95  $this->setAppraiseeId(
96  $this->evaluation_manager->getCurrentAppraisee()
97  );
98 
99  $this->ui_modifier = $DIC->survey()
100  ->internal()
101  ->gui()
102  ->modeUIModifier($this->object->getMode());
103  $this->print = $DIC->survey()
104  ->internal()
105  ->gui()
106  ->print();
107  $this->access_manager = $DIC->survey()
108  ->internal()
109  ->domain()
110  ->access(
111  $this->object->getRefId(),
112  $DIC->user()->getId()
113  );
114  $this->skill_profile_service = $DIC->skills()->profile();
115  }
116 
117  public function executeCommand(): string
118  {
119  $skmg_set = new ilSkillManagementSettings();
120  if ($this->object->getSkillService() && $skmg_set->isActivated()) {
121  $cmd = $this->ctrl->getCmd("competenceEval");
122  } else {
123  $cmd = $this->ctrl->getCmd("evaluation");
124  }
125 
126  $next_class = $this->ctrl->getNextClass($this);
127 
128  $this->log->debug($cmd);
129 
130  switch ($next_class) {
131  default:
132  $this->setEvalSubtabs();
133  $ret = (string) $this->$cmd();
134  break;
135  }
136  return $ret;
137  }
138 
142  public function setEvalSubtabs(): void
143  {
144  $ilTabs = $this->tabs;
145 
146  $skmg_set = new ilSkillManagementSettings();
147  if ($this->object->getSkillService() && $skmg_set->isActivated()) {
148  $ilTabs->addSubTabTarget(
149  "svy_eval_competences",
150  $this->ctrl->getLinkTarget($this, "competenceEval"),
151  array("competenceEval")
152  );
153  }
154 
155  if ($this->object->getMode() !== ilObjSurvey::MODE_IND_FEEDB) {
156  $ilTabs->addSubTabTarget(
157  "svy_eval_cumulated",
158  $this->ctrl->getLinkTarget($this, "evaluation"),
159  array("evaluation", "checkEvaluationAccess")
160  );
161  }
162 
163  $ilTabs->addSubTabTarget(
164  "svy_eval_detail",
165  $this->ctrl->getLinkTarget($this, "evaluationdetails"),
166  array("evaluationdetails")
167  );
168 
169  if ($this->hasResultsAccess() && $this->object->getMode() !== ilObjSurvey::MODE_IND_FEEDB) {
170  $ilTabs->addSubTabTarget(
171  "svy_eval_user",
172  $this->ctrl->getLinkTarget($this, "evaluationuser"),
173  array("evaluationuser")
174  );
175  }
176 
177  if ($this->object->getCalculateSumScore()) {
178  $ilTabs->addSubTabTarget(
179  "svy_sum_score",
180  $this->ctrl->getLinkTarget($this, "sumscore"),
181  array("sumscore")
182  );
183  }
184  }
185 
186 
187  public function setAppraiseeId(
188  int $a_val
189  ): void {
190  $this->appr_id = $a_val;
191  }
192 
193  public function getAppraiseeId(): int
194  {
195  return $this->appr_id;
196  }
197 
198  public function checkAnonymizedEvaluationAccess(): bool
199  {
201 
202  if ($this->object->getAnonymize() === 1 &&
203  $this->evaluation_manager->getAnonEvaluationAccess() === $this->request->getRefId()) {
204  return true;
205  }
206 
208  ilObject::_lookupObjId($this->request->getRefId()),
209  $ilUser->getId()
210  )) {
211  if ($this->object->getAnonymize() === 1) {
212  $this->evaluation_manager->setAnonEvaluationAccess($this->request->getRefId());
213  }
214  return true;
215  }
216 
217  if ($this->object->getAnonymize() === 1) {
218  // autocode
219  $surveycode = $this->object->getUserAccessCode($ilUser->getId());
220  if ($this->object->isAnonymizedParticipant($surveycode)) {
221  $this->evaluation_manager->setAnonEvaluationAccess($this->request->getRefId());
222  return true;
223  }
224 
225  /* try to find code for current (registered) user from existing run
226  if($this->object->findCodeForUser($ilUser->getId()))
227  {
228  $_SESSION["anon_evaluation_access"] = $_GET["ref_id"];
229  return true;
230  }
231  */
232 
233  // code needed
234  $this->tpl->setVariable("TABS", "");
235  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_svy_evaluation_checkaccess.html", "Modules/Survey");
236  $this->tpl->setCurrentBlock("adm_content");
237  $this->tpl->setVariable("AUTHENTICATION_NEEDED", $this->lng->txt("svy_check_evaluation_authentication_needed"));
238  $this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this, "checkEvaluationAccess"));
239  $this->tpl->setVariable("EVALUATION_CHECKACCESS_INTRODUCTION", $this->lng->txt("svy_check_evaluation_access_introduction"));
240  $this->tpl->setVariable("VALUE_CHECK", $this->lng->txt("ok"));
241  $this->tpl->setVariable("VALUE_CANCEL", $this->lng->txt("cancel"));
242  $this->tpl->setVariable("TEXT_SURVEY_CODE", $this->lng->txt("survey_code"));
243  $this->tpl->parseCurrentBlock();
244  }
245 
246  $this->evaluation_manager->clearAnonEvaluationAccess();
247  return false;
248  }
249 
253  public function checkEvaluationAccess(): void
254  {
255  $surveycode = $this->request->getSurveyCode();
256  if ($this->object->isAnonymizedParticipant($surveycode)) {
257  $this->evaluation_manager->setAnonEvaluationAccess($this->request->getRefId());
258  $this->evaluation();
259  } else {
260  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("svy_check_evaluation_wrong_key", true));
261  $this->cancelEvaluationAccess();
262  }
263  }
264 
268  public function cancelEvaluationAccess(): void
269  {
270  $ilCtrl = $this->ctrl;
271  $tree = $this->tree;
272  $path = $tree->getPathFull($this->object->getRefId());
273  $ilCtrl->setParameterByClass(
274  "ilrepositorygui",
275  "ref_id",
276  $path[count($path) - 2]["child"]
277  );
278  $ilCtrl->redirectByClass("ilrepositorygui", "frameset");
279  }
280 
284  protected function evaluationdetails(): void
285  {
286  $this->evaluation(1);
287  }
288 
289  public function exportCumulatedResults(
290  int $details = 0
291  ): void {
292  $finished_ids = null;
293  if ($this->object->get360Mode()) {
294  $appr_id = $this->request->getAppraiseeId();
295  if (!$appr_id) {
296  $this->ctrl->redirect($this, $details ? "evaluationdetails" : "evaluation");
297  }
298  $finished_ids = $this->object->getFinishedIdsForAppraiseeId($appr_id);
299  if (!count($finished_ids)) {
300  $finished_ids = array(-1);
301  }
302  }
303 
304  // titles
305  $title_row = array();
306  $do_title = $do_label = true;
307  switch ($this->request->getExportLabel()) {
308  case 'label_only':
309  $title_row[] = $this->lng->txt("label");
310  $do_title = false;
311  break;
312 
313  case 'title_only':
314  $title_row[] = $this->lng->txt("title");
315  $do_label = false;
316  break;
317 
318  default:
319  $title_row[] = $this->lng->txt("title");
320  $title_row[] = $this->lng->txt("label");
321  break;
322  }
323  $title_row[] = $this->lng->txt("question");
324  $title_row[] = $this->lng->txt("question_type");
325  $title_row[] = $this->lng->txt("users_answered");
326  $title_row[] = $this->lng->txt("users_skipped");
327  $title_row[] = $this->lng->txt("mode");
328  $title_row[] = $this->lng->txt("mode_text");
329  $title_row[] = $this->lng->txt("mode_nr_of_selections");
330  $title_row[] = $this->lng->txt("median");
331  $title_row[] = $this->lng->txt("arithmetic_mean");
332 
333  // creating container
334  $excel = null;
335  $csvfile = null;
336  switch ($this->request->getExportFormat()) {
337  case self::TYPE_XLS:
338  $excel = new ilExcel();
339  $excel->addSheet($this->lng->txt("svy_eval_cumulated"));
340  $excel->setCellArray(array($title_row), "A1");
341  $excel->setBold("A1:" . $excel->getColumnCoord(count($title_row) - 1) . "1");
342  break;
343 
344  case self::TYPE_SPSS:
345  $csvfile = array($title_row);
346  break;
347  }
348 
349 
350  // parse answer data in evaluation results
351  $ov_row = 2;
352  foreach ($this->object->getSurveyQuestions() as $qdata) {
353  $q_eval = SurveyQuestion::_instanciateQuestionEvaluation($qdata["question_id"], $finished_ids);
354  $q_res = $q_eval->getResults();
355  $ov_rows = $q_eval->exportResults($q_res, $do_title, $do_label);
356 
357  switch ($this->request->getExportFormat()) {
358  case self::TYPE_XLS:
359  $excel->setActiveSheet(0);
360  foreach ($ov_rows as $row) {
361  foreach ($row as $col => $value) {
362  $excel->setCell($ov_row, $col, $value);
363  }
364  $ov_row++;
365  }
366  break;
367 
368  case self::TYPE_SPSS:
369  foreach ($ov_rows as $row) {
370  $csvfile[] = $row;
371  }
372  break;
373  }
374 
375  if ($details) {
376  switch ($this->request->getExportFormat()) {
377  case self::TYPE_XLS:
378  $this->exportResultsDetailsExcel($excel, $q_eval, $q_res, $do_title, $do_label);
379  break;
380  }
381  }
382  }
383 
384  // #11179
385  $type = !$details
386  ? $this->lng->txt("svy_eval_cumulated")
387  : $this->lng->txt("svy_eval_detail");
388 
389  $surveyname = $this->object->getTitle() . " " . $type . " " . date("Y-m-d");
390  $surveyname = preg_replace("/\s/", "_", trim($surveyname));
391  $surveyname = ilFileUtils::getASCIIFilename($surveyname);
392 
393  // send to client
394  switch ($this->request->getExportFormat()) {
395  case self::TYPE_XLS:
396  $excel->sendToClient($surveyname);
397  break;
398 
399  case self::TYPE_SPSS:
400  $csv = "";
401  $separator = ";";
402  foreach ($csvfile as $csvrow) {
403  $csvrow = $this->processCSVRow($csvrow, true, $separator);
404  $csv .= implode($separator, $csvrow) . "\n";
405  }
406  ilUtil::deliverData($csv, $surveyname . ".csv");
407  exit();
408  }
409  }
410 
416  protected function exportResultsDetailsExcel(
417  ilExcel $a_excel,
418  SurveyQuestionEvaluation $a_eval,
419  $a_results,
420  bool $a_do_title,
421  bool $a_do_label
422  ): void {
423  $question_res = $a_results;
424  $matrix = false;
425  if (is_array($question_res)) {
426  $question_res = $question_res[0][1];
427  $matrix = true;
428  }
429  $question = $question_res->getQuestion();
430 
431  $a_excel->addSheet($question->getTitle());
432 
433 
434  // question "overview"
435 
436  $kv = array();
437 
438  if ($a_do_title) {
439  $kv[$this->lng->txt("title")] = $question->getTitle();
440  }
441  if ($a_do_label) {
442  $kv[$this->lng->txt("label")] = $question->label;
443  }
444 
445  // question
446  $kv[$this->lng->txt("question")] = $question->getQuestiontext();
447 
448  // question type
449  $kv[$this->lng->txt("question_type")] = SurveyQuestion::_getQuestionTypeName($question->getQuestionType());
450 
451  // :TODO: present subtypes (hrz/vrt, mc/sc mtx, metric scale)?
452 
453  // answered and skipped users
454  $kv[$this->lng->txt("users_answered")] = $question_res->getUsersAnswered();
455  $kv[$this->lng->txt("users_skipped")] = $question_res->getUsersSkipped(); // #0021671
456 
457  $excel_row = 1;
458 
459  foreach ($kv as $key => $value) {
460  $a_excel->setCell($excel_row, 0, $key);
461  $a_excel->setCell($excel_row++, 1, $value);
462  }
463 
464  if (!$matrix) {
465  $this->parseResultsToExcel(
466  $a_excel,
467  $question_res,
468  $excel_row,
469  $a_eval->getExportGrid($a_results),
470  $a_eval->getTextAnswers($a_results)
471  );
472  } else {
473  // question
474  $this->parseResultsToExcel(
475  $a_excel,
476  $question_res,
477  $excel_row,
478  null,
479  null,
480  false
481  );
482 
483  $texts = $a_eval->getTextAnswers($a_results);
484 
485  // "rows"
486  foreach ($a_results as $row_results) {
487  $row_title = $row_results[0];
488 
489  $a_excel->setCell($excel_row, 0, $this->lng->txt("row"));
490  $a_excel->setCell($excel_row++, 1, $row_title);
491 
492  $this->parseResultsToExcel(
493  $a_excel,
494  $row_results[1],
495  $excel_row,
496  $a_eval->getExportGrid($row_results[1]),
497  is_array($texts[$row_title] ?? false)
498  ? array("" => $texts[$row_title])
499  : null
500  );
501  }
502  }
503 
504  // matrix question: overview #21438
505  if ($matrix) {
506  $a_excel->setCell($excel_row++, 0, $this->lng->txt("overview"));
507 
508  // title row with variables
509  $counter = 0;
510  $cats = $question->getColumns();
511  foreach ($cats->getCategories() as $cat) {
512  $a_excel->setColors($a_excel->getCoordByColumnAndRow(1 + $counter, $excel_row), self::EXCEL_SUBTITLE);
513  $a_excel->setCell($excel_row, 1 + $counter, $cat->title);
514  $counter++;
515  }
516  $excel_row++;
517 
518  foreach ($a_results as $row_results) {
519  $row_title = $row_results[0];
520  $counter = 0;
521  $a_excel->setCell($excel_row, 0, $row_title);
522 
523  $vars = $row_results[1]->getVariables();
524  if ($vars) {
525  foreach ($vars as $var) {
526  $a_excel->setCell($excel_row, ++$counter, $var->abs);
527  }
528  }
529  $excel_row++;
530  }
531  }
532 
533  // 1st column is bold
534  $a_excel->setBold("A1:A" . $excel_row);
535  }
536 
537  protected function parseResultsToExcel(
538  ilExcel $a_excel,
539  ilSurveyEvaluationResults $a_results,
540  int &$a_excel_row,
541  array $a_grid = null,
542  array $a_text_answers = null,
543  bool $a_include_mode = true
544  ): void {
545  $kv = array();
546 
547  if ($a_include_mode) {
548  if ($a_results->getModeValue() !== null) {
549  // :TODO:
550  $kv[$this->lng->txt("mode")] = is_array($a_results->getModeValue())
551  ? implode(", ", $a_results->getModeValue())
552  : $a_results->getModeValue();
553 
554  $kv[$this->lng->txt("mode_text")] = $a_results->getModeValueAsText();
555  $kv[$this->lng->txt("mode_nr_of_selections")] = $a_results->getModeNrOfSelections();
556  }
557 
558  if ($a_results->getMedian() !== null) {
559  $kv[$this->lng->txt("median")] = $a_results->getMedianAsText();
560  }
561 
562  if ($a_results->getMean() !== null) {
563  $kv[$this->lng->txt("arithmetic_mean")] = $a_results->getMean();
564  }
565  }
566 
567  foreach ($kv as $key => $value) {
568  $a_excel->setCell($a_excel_row, 0, $key);
569  $a_excel->setCell($a_excel_row++, 1, $value);
570  }
571 
572  // grid
573  if ($a_grid) {
574  // header
575  $a_excel->setColors("B" . $a_excel_row . ":E" . $a_excel_row, self::EXCEL_SUBTITLE);
576  $a_excel->setCell($a_excel_row, 0, $this->lng->txt("categories"));
577  foreach ($a_grid["cols"] as $col_idx => $col) {
578  $a_excel->setCell($a_excel_row, $col_idx + 1, $col);
579  }
580  $a_excel_row++;
581 
582  // rows
583  foreach ($a_grid["rows"] as $cols) {
584  foreach ($cols as $col_idx => $col) {
585  $a_excel->setCell($a_excel_row, $col_idx + 1, $col);
586  }
587  $a_excel_row++;
588  }
589  }
590 
591  // text answers
592  if ($a_text_answers) {
593  // "given_answers" ?
594  $a_excel->setCell($a_excel_row, 0, $this->lng->txt("freetext_answers"));
595 
596  // mc/sc
597  if (!is_array($a_text_answers[""] ?? null)) {
598  $a_excel->setColors("B" . $a_excel_row . ":C" . $a_excel_row, self::EXCEL_SUBTITLE);
599  $a_excel->setCell($a_excel_row, 1, $this->lng->txt("title"));
600  $a_excel->setCell($a_excel_row++, 2, $this->lng->txt("answer"));
601  }
602  // mtx (row), txt
603  else {
604  $a_excel->setColors("B" . $a_excel_row . ":B" . $a_excel_row, self::EXCEL_SUBTITLE);
605  $a_excel->setCell($a_excel_row++, 1, $this->lng->txt("answer"));
606  }
607 
608  foreach ($a_text_answers as $var => $items) {
609  foreach ($items as $item) {
610  if (!is_array($a_text_answers[""] ?? null)) {
611  $a_excel->setCell($a_excel_row, 1, $var);
612  $a_excel->setCell($a_excel_row++, 2, $item);
613  } else {
614  $a_excel->setCell($a_excel_row++, 1, $item);
615  }
616  }
617  }
618  }
619  }
620 
621  public function exportData(): void
622  {
623  if ($this->request->getExportFormat() !== '') {
624  $this->exportCumulatedResults(0);
625  } else {
626  $this->ctrl->redirect($this, 'evaluation');
627  }
628  }
629 
630  public function exportDetailData(): void
631  {
632  if ($this->request->getExportFormat() !== '') {
633  $this->exportCumulatedResults(1);
634  } else {
635  $this->ctrl->redirect($this, 'evaluation');
636  }
637  }
638 
639  public function printEvaluation(): void
640  {
641  $this->tpl->setOnScreenMessage('info', $this->lng->txt('use_browser_print_function'), true);
642  $this->ctrl->redirect($this, 'evaluation');
643  }
644 
649  protected function buildExportModal(
650  string $a_id,
651  string $a_cmd
652  ): string {
653  $tpl = $this->tpl;
654 
655  $form_id = "svymdfrm";
656 
657  // hide modal on form submit
658  $tpl->addOnLoadCode('$("#form_' . $form_id . '").submit(function() { $("#' . $a_id . '").modal("hide"); });');
659 
660  $modal = ilModalGUI::getInstance();
661  $modal->setId($a_id);
662  $modal->setHeading(($this->lng->txt("svy_export_format")));
663 
664  $form = new ilPropertyFormGUI();
665  $form->setId($form_id);
666  $form->setFormAction($this->ctrl->getFormAction($this, $a_cmd));
667 
668  $format = new ilSelectInputGUI($this->lng->txt("filetype"), "export_format");
669  $format->setOptions(array(
670  self::TYPE_XLS => $this->lng->txt('exp_type_excel'),
671  self::TYPE_SPSS => $this->lng->txt('exp_type_csv')
672  ));
673  $form->addItem($format);
674 
675  $label = new ilSelectInputGUI($this->lng->txt("title"), "export_label");
676  $label->setOptions(array(
677  'label_only' => $this->lng->txt('export_label_only'),
678  'title_only' => $this->lng->txt('export_title_only'),
679  'title_label' => $this->lng->txt('export_title_label')
680  ));
681  $form->addItem($label);
682 
683  $form->addCommandButton($a_cmd, $this->lng->txt("export"));
684  $form->setPreventDoubleSubmission(false);
685 
686  $modal->setBody($form->getHTML());
687 
688  return $modal->getHTML();
689  }
690 
691  protected function openEvaluation(): void
692  {
693  $skmg_set = new ilSkillManagementSettings();
694  if ($this->object->getSkillService() && $skmg_set->isActivated()) {
695  $this->competenceEval();
696  } else {
697  if ($this->object->getMode() === ilObjSurvey::MODE_IND_FEEDB) {
698  $this->evaluationdetails();
699  } else {
700  $this->evaluation();
701  }
702  }
703  }
704 
705  public function evaluation(
706  int $details = 0
707  ): void {
708  $ilToolbar = $this->toolbar;
709  $tree = $this->tree;
710  $ui = $this->ui;
711 
712  $ui_factory = $ui->factory();
713  $ui_renderer = $ui->renderer();
714 
715  $this->lng->loadLanguageModule("survey");
716 
717  $this->log->debug("check access");
718 
719  // auth
720  if (!$this->hasResultsAccess()) {
721  if (!$this->access->checkAccess('read', '', $this->object->getRefId())) {
722  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("permission_denied"));
723  return;
724  }
725 
726  switch ($this->object->getEvaluationAccess()) {
728  if ($this->object->getMode() !== ilObjSurvey::MODE_IND_FEEDB) {
729  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("permission_denied"));
730  return;
731  }
732  break;
733 
736  if (!$this->checkAnonymizedEvaluationAccess()) {
737  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("permission_denied"));
738  return;
739  }
740  break;
741  }
742  }
743 
744  $this->log->debug("check access ok");
745  // setup toolbar
746 
747  $appr_id = $this->evaluation_manager->getCurrentAppraisee();
748  $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
749  $results = array();
750 
751  $eval_tpl = new ilTemplate("tpl.il_svy_svy_evaluation.html", true, true, "Modules/Survey");
752 
753 
754  if ($details) {
755  $this->ui_modifier->setResultsDetailToolbar(
756  $this->object,
757  $ilToolbar,
758  $this->user->getId()
759  );
760  } else {
761  $this->ui_modifier->setResultsOverviewToolbar(
762  $this->object,
763  $ilToolbar,
764  $this->user->getId()
765  );
766  }
767 
768  if (!$this->object->get360Mode() || $appr_id) {
769  if ($details) {
770  //templates: results, table of contents
771  $dtmpl = new ilTemplate("tpl.il_svy_svy_results_details.html", true, true, "Modules/Survey/Evaluation");
772  $toc_tpl = new ilTemplate("tpl.svy_results_table_contents.html", true, true, "Modules/Survey/Evaluation");
773  $this->lng->loadLanguageModule("content");
774  $toc_tpl->setVariable("TITLE_TOC", $this->lng->txt('cont_toc'));
775  }
776 
777  $finished_ids = $this->evaluation_manager->getFilteredFinishedIds();
778 
779  // parse answer data in evaluation results
780  $list = new ilNestedList();
781 
782  $panels = [];
783  foreach ($this->object->getSurveyQuestions() as $qdata) {
784  $q_eval = SurveyQuestion::_instanciateQuestionEvaluation($qdata["question_id"], $finished_ids);
785  $q_res = $q_eval->getResults();
786  $results[] = $q_res;
787 
788  if ($details) {
789  $panels = array_merge(
790  $panels,
791  $this->ui_modifier->getDetailPanels(
792  $this->object->getSurveyParticipants(),
794  $q_eval
795  )
796  );
797 
798  // TABLE OF CONTENTS
799  if ($qdata["questionblock_id"] &&
800  $qdata["questionblock_id"] != $this->last_questionblock_id) {
801  $qblock = ilObjSurvey::_getQuestionblock($qdata["questionblock_id"]);
802  if ($qblock["show_blocktitle"]) {
803  $list->addListNode($qdata["questionblock_title"], "q" . $qdata["questionblock_id"]);
804  } else {
805  $list->addListNode("", "q" . $qdata["questionblock_id"]);
806  }
807  $this->last_questionblock_id = $qdata["questionblock_id"];
808  }
809  $anchor_id = "svyrdq" . $qdata["question_id"];
810  $list->addListNode("<a href='#" . $anchor_id . "'>" . $qdata["title"] . "</a>", $qdata["question_id"], $qdata["questionblock_id"] ?
811  "q" . $qdata["questionblock_id"] : 0);
812  }
813  }
814 
815  if ($details) {
816  $list->setListClass("il_Explorer");
817  $toc_tpl->setVariable("LIST", $list->getHTML());
818 
819  //TABLE OF CONTENTS
820  $panel_toc = $ui_factory->panel()->standard("", $ui_factory->legacy($toc_tpl->get()));
821  $render_toc = $ui_renderer->render($panel_toc);
822  $dtmpl->setVariable("PANEL_TOC", $render_toc);
823 
824  //REPORT
825  $report_title = "";
826  $panel_report = $ui_factory->panel()->report($report_title, $panels);
827  $render_report = $ui_renderer->render($panel_report);
828  $dtmpl->setVariable("PANEL_REPORT", $render_report);
829 
830  //print the main template
831  $eval_tpl->setVariable('DETAIL', $dtmpl->get());
832  }
833  }
834 
835  //$eval_tpl->setVariable('MODAL', $modal);
836  if (!$details) {
837  $table_gui = new ilSurveyResultsCumulatedTableGUI($this, 'evaluation', $results);
838  $eval_tpl->setVariable('CUMULATED', $table_gui->getHTML());
839  }
840 
841  //
842  // print header
843  //
844 
845  $path = "";
846  $path_full = $tree->getPathFull($this->object->getRefId());
847  foreach ($path_full as $data) {
848  $path .= " &raquo; ";
849  $path .= $data['title'];
850  }
851 
853  $props = array(
854  $this->lng->txt("link") => ilLink::_getStaticLink($this->object->getRefId()),
855  $this->lng->txt("path") => $path,
856  $this->lng->txt("svy_results") => !$details
857  ? $this->lng->txt("svy_eval_cumulated")
858  : $this->lng->txt("svy_eval_detail"),
859  $this->lng->txt("date") => ilDatePresentation::formatDate(new ilDateTime(time(), IL_CAL_UNIX)),
860  );
861  $eval_tpl->setCurrentBlock("print_header_bl");
862  foreach ($props as $key => $value) {
863  $eval_tpl->setVariable("HEADER_PROP_KEY", $key);
864  $eval_tpl->setVariable("HEADER_PROP_VALUE", $value);
865  $eval_tpl->parseCurrentBlock();
866  }
867 
868  $this->log->debug("end");
869 
870  $this->tpl->setContent($eval_tpl->get());
871  }
872 
881  public function processCSVRow(
882  array $row,
883  bool $quoteAll = false,
884  string $separator = ";"
885  ): array {
886  $resultarray = array();
887  foreach ($row as $rowindex => $entry) {
888  if (is_array($entry)) {
889  $entry = implode("/", $entry);
890  }
891  $surround = false;
892  if ($quoteAll) {
893  $surround = true;
894  }
895  if (strpos($entry, "\"") !== false) {
896  $entry = str_replace("\"", "\"\"", $entry);
897  $surround = true;
898  }
899  if (strpos($entry, $separator) !== false) {
900  $surround = true;
901  }
902  // replace all CR LF with LF (for Excel for Windows compatibility
903  $entry = str_replace(chr(13) . chr(10), chr(10), $entry);
904  if ($surround) {
905  $resultarray[$rowindex] = utf8_decode("\"" . $entry . "\"");
906  } else {
907  $resultarray[$rowindex] = utf8_decode($entry);
908  }
909  }
910  return $resultarray;
911  }
912 
913  public function exportEvaluationUser(): void
914  {
915  // build title row(s)
916 
917  $title_row = $title_row2 = array();
918  $title_row[] = $this->lng->txt("lastname"); // #12756
919  $title_row[] = $this->lng->txt("firstname");
920  $title_row[] = $this->lng->txt("login");
921  $title_row[] = $this->lng->txt('workingtime'); // #13622
922  $title_row[] = $this->lng->txt('survey_results_finished');
923  $title_row2[] = "";
924  $title_row2[] = "";
925  $title_row2[] = "";
926  $title_row2[] = "";
927  $title_row2[] = "";
928  if ($this->object->canExportSurveyCode()) {
929  $title_row[] = $this->lng->txt("codes");
930  $title_row2[] = "";
931  }
932 
933  $questions = array();
934 
935  foreach ($this->object->getSurveyQuestions() as $qdata) {
936  $q_eval = SurveyQuestion::_instanciateQuestionEvaluation($qdata["question_id"], null);
937  $q_res = $q_eval->getResults();
938 
939  $questions[$qdata["question_id"]] = array($q_eval, $q_res);
940 
941  $question = is_array($q_res)
942  ? $q_res[0][1]->getQuestion()
943  : $q_res->getQuestion();
944 
945  $do_title = $do_label = true;
946  switch ($this->request->getExportLabel()) {
947  case "label_only":
948  $title_row[] = $question->label;
949  $title_row2[] = "";
950  $do_title = false;
951  break;
952 
953  case "title_only":
954  $title_row[] = $question->getTitle();
955  $title_row2[] = "";
956  $do_label = false;
957  break;
958 
959  default:
960  $title_row[] = $question->getTitle();
961  $title_row2[] = $question->label;
962  break;
963  }
964 
965  $q_eval->getUserSpecificVariableTitles($title_row, $title_row2, $do_title, $do_label);
966  }
967 
968  $rows = array();
969 
970  // add title row(s)
971  $rows[] = $title_row;
972  if (implode("", $title_row2)) {
973  $rows[] = $title_row2;
974  }
975 
976  // #13620
978 
979  $finished_ids = null;
980  if ($this->object->get360Mode()) {
981  $appr_id = $this->request->getAppraiseeId();
982  if (!$appr_id) {
983  $this->ctrl->redirect($this, "evaluationuser");
984  }
985  $finished_ids = $this->object->getFinishedIdsForAppraiseeId($appr_id);
986  if (!count($finished_ids)) {
987  $finished_ids = array(-1);
988  }
989  }
990 
991  //$participants = $this->object->getSurveyParticipants($finished_ids);
992  $participants = $this->access_manager->canReadResultOfParticipants($finished_ids);
993 
994  foreach ($participants as $user) {
995  $user_id = $user["active_id"];
996 
997  $row = array();
998  $row[] = trim($user["lastname"] ?? "")
999  ? $user["lastname"]
1000  : ($user["name"] ?? ""); // anonymous
1001  $row[] = $user["firstname"] ?? "";
1002  $row[] = $user["login"] ?? ""; // #10579
1003 
1004  if ($this->object->canExportSurveyCode()) {
1005  $row[] = $user_id;
1006  }
1007 
1008  $row[] = $this->object->getWorkingtimeForParticipant($user_id);
1009 
1010  if ($user["finished"] ?? false) {
1011  $dt = new ilDateTime($user["finished_tstamp"], IL_CAL_UNIX);
1012  $row[] = ($this->request->getExportFormat() === self::TYPE_XLS)
1013  ? $dt
1015  } else {
1016  $row[] = "-"; // :TODO:
1017  }
1018 
1019  foreach ($questions as $item) {
1020  $q_eval = $item[0];
1021  $q_res = $item[1];
1022 
1023  $q_eval->addUserSpecificResults($row, $user_id, $q_res);
1024  }
1025 
1026  $rows[] = $row;
1027  }
1028 
1029  // #11179
1030  $surveyname = $this->object->getTitle() . " " . $this->lng->txt("svy_eval_user") . " " . date("Y-m-d");
1031  $surveyname = preg_replace("/\s/", "_", trim($surveyname));
1032  $surveyname = ilFileUtils::getASCIIFilename($surveyname);
1033 
1034  switch ($this->request->getExportFormat()) {
1035  case self::TYPE_XLS:
1036  $excel = new ilExcel();
1037  $excel->addSheet($this->lng->txt("svy_eval_user"));
1038 
1039  foreach ($rows as $row_idx => $row) {
1040  foreach ($row as $col_idx => $col) {
1041  $excel->setCell($row_idx + 1, $col_idx, $col);
1042  }
1043  if (!$row_idx) {
1044  $excel->setBold("A1:" . $excel->getColumnCoord(count($row) - 1) . "1");
1045  }
1046  }
1047  $excel->sendToClient($surveyname);
1048 
1049  // no break
1050  case self::TYPE_SPSS:
1051  $csv = "";
1052  $separator = ";";
1053  foreach ($rows as $csvrow) {
1054  $csvrow = str_replace("\n", " ", $this->processCSVRow($csvrow, true, $separator));
1055  $csv .= implode($separator, $csvrow) . "\n";
1056  }
1057  ilUtil::deliverData($csv, "$surveyname.csv");
1058  exit();
1059  }
1060  }
1061 
1065  public function evaluationuser(): void
1066  {
1067  $ilToolbar = $this->toolbar;
1068 
1069  if (!$this->hasResultsAccess() &&
1070  $this->object->getMode() !== ilObjSurvey::MODE_SELF_EVAL) {
1071  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_permission"), true);
1072  $this->ctrl->redirectByClass("ilObjSurveyGUI", "infoScreen");
1073  }
1074 
1075  $ilToolbar->setFormAction($this->ctrl->getFormAction($this, "evaluationuser"));
1076 
1077  $modal = "";
1078  $appr_id = null;
1079  $data = [];
1080 
1081  if ($this->object->get360Mode()) {
1082  $appr_id = $this->getAppraiseeId();
1083  }
1084 
1085  if (!$this->object->get360Mode() || $appr_id) {
1086  $modal_id = "svy_ev_exp";
1087  $modal = $this->buildExportModal($modal_id, "exportevaluationuser");
1088 
1089  $button = ilLinkButton::getInstance();
1090  $button->setCaption("export");
1091  $button->setOnClick('$(\'#' . $modal_id . '\').modal(\'show\')');
1092  $ilToolbar->addButtonInstance($button);
1093 
1094  $ilToolbar->addSeparator();
1095 
1096  $pv = $this->print->resultsDetails($this->object->getRefId());
1097  $modal_elements = $pv->getModalElements(
1098  $this->ctrl->getLinkTargetByClass(
1099  "ilSurveyEvaluationGUI",
1100  "printResultsPerUserSelection"
1101  )
1102  );
1103  $ilToolbar->addComponent($modal_elements->button);
1104  $ilToolbar->addComponent($modal_elements->modal);
1105 
1106  $data = $this->evaluation_manager->getUserSpecificResults();
1107  }
1108 
1109  $table_gui = new ilSurveyResultsUserTableGUI($this, 'evaluationuser');
1110  $table_gui->setData($data);
1111  $this->tpl->setContent($table_gui->getHTML() . $modal);
1112  }
1113 
1114  public function competenceEval(): void
1115  {
1116  $lng = $this->lng;
1117  $ilCtrl = $this->ctrl;
1118  $ilToolbar = $this->toolbar;
1119  $tpl = $this->tpl;
1120  $ilTabs = $this->tabs;
1121 
1122  $survey = $this->object;
1123 
1124  $ilTabs->activateSubTab("svy_eval_competences");
1125  $ilTabs->activateTab("svy_results");
1126 
1127  $ilToolbar->setFormAction($this->ctrl->getFormAction($this, "competenceEval"));
1128 
1129  $appr_id = $this->getAppraiseeId();
1130 
1131  if ($appr_id === 0) {
1132  $this->tpl->setOnScreenMessage('info', $this->lng->txt("svy_no_appraisees_found"));
1133  return;
1134  }
1135 
1136  $this->ui_modifier->setResultsCompetenceToolbar(
1137  $this->object,
1138  $ilToolbar,
1139  $this->user->getId()
1140  );
1141 
1142  // evaluation modes
1143  $eval_modes = array();
1144 
1145  // get all competences of survey
1146  $sskill = new ilSurveySkill($survey);
1147  $opts = $sskill->getAllAssignedSkillsAsOptions();
1148  $skills = array();
1149  foreach ($opts as $id => $o) {
1150  $idarr = explode(":", $id);
1151  $skills[$id] = array("id" => $id, "title" => $o, "profiles" => array(),
1152  "base_skill" => $idarr[0], "tref_id" => $idarr[1]);
1153  }
1154 
1155  // get matching user competence profiles
1156  // -> add gap analysis to profile
1157  $profiles = $this->skill_profile_service->getProfilesOfUser($appr_id);
1158  foreach ($profiles as $p) {
1159  $prof = $this->skill_profile_service->getById($p["id"]);
1160  $prof_levels = $prof->getSkillLevels();
1161  foreach ($prof_levels as $pl) {
1162  if (isset($skills[$pl["base_skill_id"] . ":" . $pl["tref_id"]])) {
1163  $skills[$pl["base_skill_id"] . ":" . $pl["tref_id"]]["profiles"][] =
1164  $p["id"];
1165 
1166  $eval_modes["gap_" . $p["id"]] =
1167  $lng->txt("svy_gap_analysis") . ": " . $prof->getTitle();
1168  }
1169  }
1170  }
1171 
1172  // if one competence does not match any profiles
1173  // -> add "competences of survey" alternative
1174  foreach ($skills as $sk) {
1175  if (count($sk["profiles"]) === 0) {
1176  $eval_modes["skills_of_survey"] = $lng->txt("svy_all_survey_competences");
1177  }
1178  }
1179 
1180  // final determination of current evaluation mode
1181  $comp_eval_mode = $this->request->getCompEvalMode();
1182 
1183  if (!isset($eval_modes[$comp_eval_mode])) {
1184  $comp_eval_mode = key($eval_modes);
1185  $ilCtrl->setParameter($this, "comp_eval_mode", $comp_eval_mode);
1186  }
1187 
1188  $ilCtrl->saveParameter($this, "comp_eval_mode");
1189 
1190  $mode_sel = new ilSelectInputGUI($lng->txt("svy_analysis"), "comp_eval_mode");
1191  $mode_sel->setOptions($eval_modes);
1192  $mode_sel->setValue($comp_eval_mode);
1193  $ilToolbar->addInputItem($mode_sel, true);
1194 
1195  $ilToolbar->addFormButton($lng->txt("select"), "competenceEval");
1196 
1197  $pskills_gui = new ilPersonalSkillsGUI();
1198  $rater = $this->evaluation_manager->getCurrentRater();
1199  if ($rater !== "") {
1200  if (strpos($rater, "u") === 0) {
1201  $rater = substr($rater, 1);
1202  }
1203  $pskills_gui->setTriggerUserFilter([$rater]);
1204  }
1205 
1206  if (strpos($comp_eval_mode, "gap_") === 0) {
1207  // gap analysis
1208  $profile_id = (int) substr($comp_eval_mode, 4);
1209 
1210  $pskills_gui->setProfileId($profile_id);
1211  $pskills_gui->setGapAnalysisActualStatusModePerObject($survey->getId(), $lng->txt("skmg_eval_type_1"));
1212  if ($survey->getFinishedIdForAppraiseeIdAndRaterId($appr_id, $appr_id) > 0) {
1213  $sskill = new ilSurveySkill($survey);
1214  $self_levels = array();
1215  foreach ($sskill->determineSkillLevelsForAppraisee($appr_id, true) as $sl) {
1216  $self_levels[$sl["base_skill_id"]][$sl["tref_id"]] = $sl["new_level_id"] ?? 0;
1217  }
1218  $pskills_gui->setGapAnalysisSelfEvalLevels($self_levels);
1219  }
1220  $html = $pskills_gui->getGapAnalysisHTML($appr_id);
1221  } else { // must be all survey competences
1222  $pskills_gui->setGapAnalysisActualStatusModePerObject($survey->getId(), $lng->txt("skmg_eval_type_1"));
1223  if ($survey->getFinishedIdForAppraiseeIdAndRaterId($appr_id, $appr_id) > 0) {
1224  $sskill = new ilSurveySkill($survey);
1225  $self_levels = array();
1226  foreach ($sskill->determineSkillLevelsForAppraisee($appr_id, true) as $sl) {
1227  $self_levels[$sl["base_skill_id"]][$sl["tref_id"]] = $sl["new_level_id"] ?? 0;
1228  }
1229  $pskills_gui->setGapAnalysisSelfEvalLevels($self_levels);
1230  }
1231  $sk = array();
1232  foreach ($skills as $skill) {
1233  $sk[] = array(
1234  "base_skill_id" => (int) $skill["base_skill"],
1235  "tref_id" => (int) $skill["tref_id"]
1236  );
1237  }
1238  $html = $pskills_gui->getGapAnalysisHTML($appr_id, $sk);
1239  }
1240  $tpl->setContent($html);
1241  }
1242 
1247  protected function hasResultsAccess(): bool
1248  {
1249  return $this->access->checkRbacOrPositionPermissionAccess('read_results', 'access_results', $this->object->getRefId());
1250  }
1251 
1255  public function sumscore(): void
1256  {
1257  $ilToolbar = $this->toolbar;
1258 
1259  if (!$this->hasResultsAccess() &&
1260  $this->object->getMode() !== ilObjSurvey::MODE_SELF_EVAL) {
1261  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_permission"), true);
1262  $this->ctrl->redirectByClass("ilObjSurveyGUI", "infoScreen");
1263  }
1264 
1265  $this->tpl->setOnScreenMessage('info', $this->lng->txt("svy_max_sum_score") . ": " . $this->object->getMaxSumScore());
1266 
1267  $ilToolbar->setFormAction($this->ctrl->getFormAction($this, "evaluationuser"));
1268 
1269  $modal_id = "svy_ev_exp";
1270  $modal = $this->buildExportModal($modal_id, "exportevaluationuser");
1271 
1272  $button = ilLinkButton::getInstance();
1273  $button->setCaption("print");
1274  $button->setOnClick("window.print(); return false;");
1275  $button->setOmitPreventDoubleSubmission(true);
1276  $ilToolbar->addButtonInstance($button);
1277 
1278  $finished_ids = null;
1279 
1280  $sum_scores = $this->getSumScores($finished_ids);
1281  $table_gui = new ilSumScoreTableGUI($this, 'sumscore', $this->object->hasAnonymizedResults());
1282  $table_gui->setSumScores($sum_scores);
1283  $this->tpl->setContent($table_gui->getHTML() . $modal);
1284  }
1285 
1289  protected function getSumScores(
1290  ?array $a_finished_ids = null
1291  ): array {
1292  $sum_scores = [];
1293  foreach ($this->access_manager->canReadResultOfParticipants($a_finished_ids) as $p) {
1294  $sum_scores[$p["active_id"]] = [
1295  "username" => $p["sortname"],
1296  "score" => 0
1297  ];
1298  }
1299 
1300  foreach ($this->object->getSurveyQuestions() as $qdata) {
1301  $q_eval = SurveyQuestion::_instanciateQuestionEvaluation($qdata["question_id"], $a_finished_ids);
1302  foreach ($q_eval->getSumScores() as $finished_id => $sum_score) {
1303  if ($sum_score === null) {
1304  $sum_scores[$finished_id]["score"] = null;
1305  }
1306  if ($sum_scores[$finished_id]["score"] !== null) {
1307  $sum_scores[$finished_id]["score"] += (int) $sum_score;
1308  }
1309  }
1310  }
1311  return $sum_scores;
1312  }
1313 
1317  public function printResultsOverviewSelection(): void
1318  {
1319  $view = $this->print->resultsOverview($this->object->getRefId());
1320  $view->sendForm();
1321  }
1322 
1326  public function printResultsDetailsSelection(): void
1327  {
1328  $this->ctrl->setParameterByClass(
1329  "ilSurveyEvaluationGUI",
1330  "vw",
1331  $this->request->getVW()
1332  );
1333  $this->ctrl->setParameterByClass(
1334  "ilSurveyEvaluationGUI",
1335  "cp",
1336  $this->request->getCP()
1337  );
1338  $view = $this->print->resultsDetails($this->object->getRefId());
1339  $view->sendForm();
1340  }
1341 
1342  public function printResultsDetails(): void
1343  {
1344  $view = $this->print->resultsDetails($this->object->getRefId());
1345  $view->sendPrintView();
1346  }
1347 
1351  public function printResultsPerUserSelection(): void
1352  {
1353  $view = $this->print->resultsPerUser($this->object->getRefId());
1354  $view->sendForm();
1355  }
1356 
1357  public function printResultsPerUser(): void
1358  {
1359  $view = $this->print->resultsPerUser($this->object->getRefId());
1360  $view->sendPrintView();
1361  }
1362 }
getExportGrid($a_results)
Get grid data.
exit
Definition: login.php:28
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...
$type
exportResultsDetailsExcel(ilExcel $a_excel, SurveyQuestionEvaluation $a_eval, $a_results, bool $a_do_title, bool $a_do_label)
Export details (excel only)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const EVALUATION_ACCESS_PARTICIPANTS
cancelEvaluationAccess()
Cancels the input of the survey access code for evaluation access.
ILIAS Skill Service SkillProfileService $skill_profile_service
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getQuestionblock(int $questionblock_id)
get question block properties
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
static _getQuestionTypeName(string $type_tag)
Return the translation for a given question type.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setCell(int $a_row, int $a_col, $a_value, ?string $a_datatype=null)
Set cell value.
ILIAS Survey Evaluation EvaluationManager $evaluation_manager
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
const IL_CAL_UNIX
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...
$path
Definition: ltiservices.php:32
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)
global $DIC
Definition: feed.php:28
hasResultsAccess()
Check if user can view results granted by rbac or positions.
Personal skills GUI class.
array $details
Details for error message relating to last request processed.
Definition: System.php:109
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.
setContent(string $a_html)
Sets content for standard template.
getCoordByColumnAndRow(int $pColumn=1, int $pRow=1)
Get cell coordinate (e.g.
string $key
Consumer key/client ID value.
Definition: System.php:193
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)
$format
Definition: metadata.php:235
ILIAS Survey Mode UIModifier $ui_modifier
$results
addSheet(string $a_name, bool $a_activate=true)
Add sheet.
ILIAS Survey Evaluation EvaluationGUIRequest $request
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
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.
$rows
Definition: xhr_table.php:10
const EVALUATION_ACCESS_ALL
static getInstance()
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...
$ilUser
Definition: imgupload.php:34
$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...
getSumScores(?array $a_finished_ids=null)
setColors(string $a_coords, string $a_background, string $a_font=null)
Set cell(s) colors.
evaluationdetails()
Show the detailed evaluation.
static setUseRelativeDates(bool $a_status)
set use relative dates
sumscore()
Show sum score table.
$cols
Definition: xhr_table.php:11
ILIAS Survey PrintView GUIService $print
const TYPE_SPSS
ilGlobalTemplateInterface $tpl
__construct(ilObjSurvey $a_object)
getTextAnswers($a_results)
Get text answers.