43 $this->
object = $a_object;
45 $this->array_panels = array();
47 if ($this->object->get360Mode())
58 include_once(
"./Services/Skill/classes/class.ilSkillManagementSettings.php");
60 if ($this->object->get360SkillService() && $skmg_set->isActivated())
62 $cmd = $this->ctrl->getCmd(
"competenceEval");
66 $cmd = $this->ctrl->getCmd(
"evaluation");
69 $next_class = $this->ctrl->getNextClass($this);
75 $this->setEvalSubTabs();
97 include_once(
"./Services/Skill/classes/class.ilSkillManagementSettings.php");
99 if ($this->object->get360SkillService() && $skmg_set->isActivated())
101 $ilTabs->addSubTabTarget(
102 "svy_eval_competences",
103 $this->ctrl->getLinkTarget($this,
"competenceEval"),
104 array(
"competenceEval")
108 $ilTabs->addSubTabTarget(
109 "svy_eval_cumulated",
110 $this->ctrl->getLinkTarget($this,
"evaluation"),
111 array(
"evaluation",
"checkEvaluationAccess")
114 $ilTabs->addSubTabTarget(
116 $this->ctrl->getLinkTarget($this,
"evaluationdetails"),
117 array(
"evaluationdetails")
120 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
122 $ilTabs->addSubTabTarget(
124 $this->ctrl->getLinkTarget($this,
"evaluationuser"),
125 array(
"evaluationuser")
138 $this->appr_id = $a_val;
161 if ($_REQUEST[
"appr_id"] ==
"")
163 $req_appr_id =
$ilUser->getId();
167 $req_appr_id = (int) $_REQUEST[
"appr_id"];
171 if ($req_appr_id > 0)
176 foreach($this->object->getAppraiseesData() as $item)
178 if ($item[
"closed"] &&
179 ($item[
"user_id"] ==
$ilUser->getId() ||
180 $rbacsystem->checkAccess(
"write", $this->object->getRefId()) ||
183 $valid[] = $item[
"user_id"];
186 if(in_array($req_appr_id,
$valid))
197 $this->ctrl->setParameter($this,
"appr_id",
$appr_id);
213 if($this->object->getAnonymize() == 1 &&
219 include_once
"Modules/Survey/classes/class.ilObjSurveyAccess.php";
222 if($this->object->getAnonymize() == 1)
229 if($this->object->getAnonymize() == 1)
232 $surveycode = $this->
object->getUserAccessCode($ilUser->getId());
233 if ($this->object->isAnonymizedParticipant($surveycode))
248 $this->tpl->setVariable(
"TABS",
"");
249 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_evaluation_checkaccess.html",
"Modules/Survey");
250 $this->tpl->setCurrentBlock(
"adm_content");
251 $this->tpl->setVariable(
"AUTHENTICATION_NEEDED", $this->lng->txt(
"svy_check_evaluation_authentication_needed"));
252 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"checkEvaluationAccess"));
253 $this->tpl->setVariable(
"EVALUATION_CHECKACCESS_INTRODUCTION", $this->lng->txt(
"svy_check_evaluation_access_introduction"));
254 $this->tpl->setVariable(
"VALUE_CHECK", $this->lng->txt(
"ok"));
255 $this->tpl->setVariable(
"VALUE_CANCEL", $this->lng->txt(
"cancel"));
256 $this->tpl->setVariable(
"TEXT_SURVEY_CODE", $this->lng->txt(
"survey_code"));
257 $this->tpl->parseCurrentBlock();
260 $_SESSION[
"anon_evaluation_access"] =
null;
273 $surveycode =
$_POST[
"surveycode"];
274 if ($this->object->isAnonymizedParticipant($surveycode))
296 $path = $tree->getPathFull($this->object->getRefID());
297 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
299 $ilCtrl->redirectByClass(
"ilrepositorygui",
"frameset");
316 $finished_ids =
null;
317 if($this->object->get360Mode())
322 $this->ctrl->redirect($this, $details ?
"evaluationdetails" :
"evaluation");
324 $finished_ids = $this->
object->getFinishedIdsForAppraiseeId($appr_id);
325 if(!
sizeof($finished_ids))
327 $finished_ids = array(-1);
332 $title_row = array();
333 $do_title = $do_label =
true;
334 switch (
$_POST[
'export_label'])
337 $title_row[] = $this->lng->txt(
"label");
342 $title_row[] = $this->lng->txt(
"title");
347 $title_row[] = $this->lng->txt(
"title");
348 $title_row[] = $this->lng->txt(
"label");
351 $title_row[] = $this->lng->txt(
"question");
352 $title_row[] = $this->lng->txt(
"question_type");
353 $title_row[] = $this->lng->txt(
"users_answered");
354 $title_row[] = $this->lng->txt(
"users_skipped");
355 $title_row[] = $this->lng->txt(
"mode");
356 $title_row[] = $this->lng->txt(
"mode_text");
357 $title_row[] = $this->lng->txt(
"mode_nr_of_selections");
358 $title_row[] = $this->lng->txt(
"median");
359 $title_row[] = $this->lng->txt(
"arithmetic_mean");
362 switch (
$_POST[
"export_format"])
365 include_once
"Services/Excel/classes/class.ilExcel.php";
367 $excel->addSheet($this->lng->txt(
"svy_eval_cumulated"));
368 $excel->setCellArray(array($title_row),
"A1");
369 $excel->setBold(
"A1:".$excel->getColumnCoord(
sizeof($title_row)-1).
"1");
373 $csvfile = array($title_row);
380 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
381 foreach($this->object->getSurveyQuestions() as $qdata)
384 $q_res = $q_eval->getResults();
385 $ov_rows = $q_eval->exportResults($q_res, $do_title, $do_label);
387 switch (
$_POST[
"export_format"])
390 $excel->setActiveSheet(0);
391 foreach($ov_rows as
$row)
393 foreach(
$row as $col => $value)
395 $excel->setCell($ov_row, $col, $value);
402 foreach($ov_rows as
$row)
411 switch (
$_POST[
"export_format"])
423 ? $this->lng->txt(
"svy_eval_cumulated")
424 : $this->lng->txt(
"svy_eval_detail");
426 $surveyname = $this->
object->getTitle().
" ".$type.
" ".
date(
"Y-m-d");
427 $surveyname = preg_replace(
"/\s/",
"_", trim($surveyname));
431 switch (
$_POST[
"export_format"])
434 $excel->sendToClient($surveyname);
440 foreach ($csvfile as $csvrow)
443 $csv .= join($csvrow, $separator) .
"\n";
462 $question_res = $a_results;
464 if(is_array($question_res))
466 $question_res = $question_res[0][1];
469 $question = $question_res->getQuestion();
471 $a_excel->
addSheet($question->getTitle());
480 $kv[$this->lng->txt(
"title")] = $question->getTitle();
484 $kv[$this->lng->txt(
"label")] = $question->label;
488 $kv[$this->lng->txt(
"question")] = $question->getQuestiontext();
496 $kv[$this->lng->txt(
"users_answered")] = (int)$question_res->getUsersAnswered();
497 $kv[$this->lng->txt(
"users_skipped")] = (int)$question_res->getUsersSkipped();
501 foreach($kv as $key => $value)
503 $a_excel->
setCell($excel_row, 0, $key);
504 $a_excel->
setCell($excel_row++, 1, $value);
532 foreach($a_results as $row_results)
534 $row_title = $row_results[0];
536 $a_excel->
setCell($excel_row, 0, $this->lng->txt(
"row"));
537 $a_excel->
setCell($excel_row++, 1, $row_title);
544 is_array($texts[$row_title])
545 ? array(
""=>$texts[$row_title])
554 $a_excel->
setCell($excel_row++, 0, $this->lng->txt(
"overview"));
558 $cats = $question->getColumns();
559 foreach ($cats->getCategories() as $cat)
567 foreach ($a_results as $row_results)
569 $row_title = $row_results[0];
571 $a_excel->
setCell($excel_row, 0, $row_title);
573 $vars = $row_results[1]->getVariables();
576 foreach($vars as $var)
586 $a_excel->
setBold(
"A1:A".$excel_row);
598 $kv[$this->lng->txt(
"mode")] = is_array($a_results->
getModeValue())
611 if($a_results->
getMean() !==
null)
613 $kv[$this->lng->txt(
"arithmetic_mean")] = $a_results->
getMean();
617 foreach($kv as $key => $value)
619 $a_excel->
setCell($a_excel_row, 0, $key);
620 $a_excel->
setCell($a_excel_row++, 1, $value);
628 $a_excel->
setCell($a_excel_row, 0, $this->lng->txt(
"categories"));
629 foreach($a_grid[
"cols"] as $col_idx => $col)
631 $a_excel->
setCell($a_excel_row, $col_idx+1, $col);
636 foreach($a_grid[
"rows"] as $cols)
638 foreach($cols as $col_idx => $col)
640 $a_excel->
setCell($a_excel_row, $col_idx+1, $col);
650 $a_excel->
setCell($a_excel_row, 0, $this->lng->txt(
"freetext_answers"));
653 if(!is_array($a_text_answers[
""]))
656 $a_excel->
setCell($a_excel_row, 1, $this->lng->txt(
"title"));
657 $a_excel->
setCell($a_excel_row++, 2, $this->lng->txt(
"answer"));
663 $a_excel->
setCell($a_excel_row++, 1, $this->lng->txt(
"answer"));
666 foreach($a_text_answers as $var => $items)
668 foreach($items as $item)
670 if(!is_array($a_text_answers[
""]))
672 $a_excel->
setCell($a_excel_row, 1, $var);
673 $a_excel->
setCell($a_excel_row++, 2, $item);
677 $a_excel->
setCell($a_excel_row++, 1, $item);
686 if (strlen(
$_POST[
"export_format"]))
693 $this->ctrl->redirect($this,
'evaluation');
699 if (strlen(
$_POST[
"export_format"]))
706 $this->ctrl->redirect($this,
'evaluation');
713 $this->ctrl->redirect($this,
'evaluation');
720 $form_id =
"svymdfrm";
723 $tpl->addOnLoadCode(
'$("#form_'.$form_id.
'").submit(function() { $("#'.$a_id.
'").modal("hide"); });');
725 include_once
"Services/UIComponent/Modal/classes/class.ilModalGUI.php";
727 $modal->setId($a_id);
728 $modal->setHeading(($this->lng->txt(
"svy_export_format")));
730 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
732 $form->setId($form_id);
733 $form->setFormAction($this->ctrl->getFormAction($this, $a_cmd));
735 $format =
new ilSelectInputGUI($this->lng->txt(
"filetype"),
"export_format");
736 $format->setOptions(array(
737 self::TYPE_XLS => $this->lng->txt(
'exp_type_excel'),
740 $form->addItem($format,
true);
743 $label->setOptions(array(
744 'label_only' => $this->lng->txt(
'export_label_only'),
745 'title_only' => $this->lng->txt(
'export_title_only'),
746 'title_label'=> $this->lng->txt(
'export_title_label')
748 $form->addItem($label);
750 $form->addCommandButton($a_cmd, $this->lng->txt(
"export"));
751 $form->setPreventDoubleSubmission(
false);
753 $modal->setBody($form->getHTML());
755 return $modal->getHTML();
760 global $rbacsystem, $ilToolbar, $tree,
$DIC;
762 $ui_factory =
$DIC->ui()->factory();
763 $ui_renderer =
$DIC->ui()->renderer();
766 if (!$rbacsystem->checkAccess(
"write",
$_GET[
"ref_id"]))
768 if (!$rbacsystem->checkAccess(
"read",
$_GET[
"ref_id"]))
774 switch ($this->object->getEvaluationAccess())
791 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
792 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
794 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_evaluation.html",
"Modules/Survey");
796 if($this->object->get360Mode())
803 if(!$this->object->get360Mode() ||
$appr_id)
807 $captions =
new ilSelectInputGUI($this->lng->txt(
"svy_eval_captions"),
"cp");
808 $captions->setOptions(array(
809 "ap" => $this->lng->txt(
"svy_eval_captions_abs_perc"),
810 "a" => $this->lng->txt(
"svy_eval_captions_abs"),
811 "p" => $this->lng->txt(
"svy_eval_captions_perc")
813 $captions->setValue(
$_POST[
"cp"]);
814 $ilToolbar->addInputItem($captions,
true);
817 $view->setOptions(array(
818 "tc" => $this->lng->txt(
"svy_eval_view_tables_charts"),
819 "t" => $this->lng->txt(
"svy_eval_view_tables"),
820 "c" => $this->lng->txt(
"svy_eval_view_charts")
822 $view->setValue(
$_POST[
"vw"]);
823 $ilToolbar->addInputItem($view,
true);
825 include_once
"Services/UIComponent/Button/classes/class.ilSubmitButton.php";
827 $button->setCaption(
"ok");
828 $button->setCommand(
"evaluationdetails");
829 $button->setOmitPreventDoubleSubmission(
true);
830 $ilToolbar->addButtonInstance($button);
832 $ilToolbar->addSeparator();
835 $dtmpl =
new ilTemplate(
"tpl.il_svy_svy_results_details.html",
true,
true,
"Modules/Survey");
836 $toc_tpl =
new ilTemplate(
"tpl.svy_results_table_contents.html",
true,
true,
"Modules/Survey");
837 $this->lng->loadLanguageModule(
"content");
838 $toc_tpl->setVariable(
"TITLE_TOC", $this->lng->txt(
'cont_toc'));
841 $modal_id =
"svy_ev_exp";
846 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
848 $button->setCaption(
"export");
849 $button->setOnClick(
'$(\'#'.$modal_id.
'\').modal(\
'show\')');
850 $ilToolbar->addButtonInstance($button);
852 $ilToolbar->addSeparator();
854 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
856 $button->setCaption(
"print");
857 $button->setOnClick(
"if(il.Accordion) { il.Accordion.preparePrint(); } window.print(); return false;");
858 $button->setOmitPreventDoubleSubmission(
true);
859 $ilToolbar->addButtonInstance($button);
861 $finished_ids =
null;
864 $finished_ids = $this->
object->getFinishedIdsForAppraiseeId($appr_id);
865 if(!
sizeof($finished_ids))
867 $finished_ids = array(-1);
871 $details_figure =
$_POST[
"cp"]
874 $details_view =
$_POST[
"vw"]
879 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
880 foreach($this->object->getSurveyQuestions() as $qdata)
883 $q_res = $q_eval->getResults();
889 $this->
renderDetails($details_view, $details_figure, $qdata, $q_eval, $q_res);
892 if($qdata[
"questionblock_id"] &&
893 $qdata[
"questionblock_id"] != $this->last_questionblock_id)
896 if($qblock[
"show_blocktitle"])
898 $toc_tpl->setCurrentBlock(
"toc_bl");
899 $toc_tpl->setVariable(
"TOC_ITEM", $qdata[
"questionblock_title"]);
900 $toc_tpl->parseCurrentBlock();
902 $this->last_questionblock_id = $qdata[
"questionblock_id"];
904 $anchor_id =
"svyrdq".$qdata[
"question_id"];
905 $toc_tpl->setCurrentBlock(
"toc_bl");
906 $toc_tpl->setVariable(
"TOC_ITEM", $qdata[
"title"]);
907 $toc_tpl->setVariable(
"TOC_ID", $anchor_id);
908 $toc_tpl->parseCurrentBlock();
914 $panel_toc = $ui_factory->panel()->standard(
"", $ui_factory->legacy($toc_tpl->get()));
915 $render_toc = $ui_renderer->render($panel_toc);
916 $dtmpl->setVariable(
"PANEL_TOC", $render_toc);
920 $panel_report = $ui_factory->panel()->report($report_title, $this->array_panels);
921 $render_report = $ui_renderer->render($panel_report);
922 $dtmpl->setVariable(
"PANEL_REPORT",$render_report);
925 $this->tpl->setVariable(
'DETAIL', $dtmpl->get());
929 $this->tpl->setVariable(
'MODAL', $modal);
932 include_once
"./Modules/Survey/classes/tables/class.ilSurveyResultsCumulatedTableGUI.php";
934 $this->tpl->setVariable(
'CUMULATED', $table_gui->getHTML());
944 $path_full = $tree->getPathFull($this->object->getRefId());
945 foreach($path_full as
$data)
947 $path .=
" » ";
952 include_once
"Services/Link/classes/class.ilLink.php";
956 $this->lng->txt(
"path") =>
$path,
957 $this->lng->txt(
"svy_results") => !$details
958 ? $this->lng->txt(
"svy_eval_cumulated")
959 : $this->lng->txt(
"svy_eval_detail"),
963 $this->tpl->setCurrentBlock(
"print_header_bl");
964 foreach($props as $key => $value)
966 $this->tpl->setVariable(
"HEADER_PROP_KEY", $key);
967 $this->tpl->setVariable(
"HEADER_PROP_VALUE", $value);
968 $this->tpl->parseCurrentBlock();
989 $ui_factory =
$DIC->ui()->factory();
990 $a_tpl =
new ilTemplate(
"tpl.svy_results_details_panel.html",
true,
true,
"Modules/Survey");
992 $question_res = $a_results;
994 if(is_array($question_res))
996 $question_res = $question_res[0][1];
999 $question = $question_res->getQuestion();
1008 $kv[
"users_answered"] = $question_res->getUsersAnswered();
1009 $kv[
"users_skipped"] = $question_res->getUsersSkipped();
1013 if($question_res->getModeValue() !==
null)
1015 $kv[
"mode"] = wordwrap($question_res->getModeValueAsText(), 50,
"<br />");
1016 $kv[
"mode_nr_of_selections"] = $question_res->getModeNrOfSelections();
1018 if($question_res->getMedian() !==
null)
1020 $kv[
"median"] = $question_res->getMedianAsText();
1022 if($question_res->getMean() !==
null)
1024 $kv[
"arithmetic_mean"] = $question_res->getMean();
1029 $qst_title = $question->getTitle();
1030 $svy_text = nl2br($question->getQuestiontext());
1031 $card_table_tpl =
new ilTemplate(
"tpl.svy_results_details_card.html",
true,
true,
"Modules/Survey");
1032 foreach($kv as $key => $value)
1034 $card_table_tpl->setCurrentBlock(
"question_statistics_card");
1035 $card_table_tpl->setVariable(
"QUESTION_STATISTIC_KEY", $this->lng->txt($key));
1036 $card_table_tpl->setVariable(
"QUESTION_STATISTIC_VALUE", $value);
1037 $card_table_tpl->parseCurrentBlock();
1040 $anchor_id =
"svyrdq".$question->getId();
1041 $title =
"<span id='$anchor_id'>$qst_title</span>";
1042 $panel_qst_card = $ui_factory->panel()->sub(
$title, $ui_factory->legacy($svy_text))
1043 ->withCard($ui_factory->card($svy_type_title)->withSections(array($ui_factory->legacy($card_table_tpl->get()))));
1044 array_push($this->array_panels, $panel_qst_card);
1047 if($a_details_parts ==
"t" ||
1048 $a_details_parts ==
"tc")
1052 ($a_details_figure ==
"ap" || $a_details_figure ==
"a"),
1053 ($a_details_figure ==
"ap" || $a_details_figure ==
"p")
1057 foreach($grid[
"cols"] as $col)
1059 $a_tpl->setCurrentBlock(
"grid_col_header_bl");
1060 $a_tpl->setVariable(
"COL_HEADER", $col);
1061 $a_tpl->parseCurrentBlock();
1063 foreach($grid[
"rows"] as $cols)
1065 foreach($cols as $idx => $col)
1069 $a_tpl->touchBlock(
"grid_col_nowrap_bl");
1072 $a_tpl->setCurrentBlock(
"grid_col_bl");
1073 $a_tpl->setVariable(
"COL_CAPTION", trim($col));
1074 $a_tpl->parseCurrentBlock();
1077 $a_tpl->touchBlock(
"grid_row_bl");
1086 if(array_key_exists(
"", $texts))
1088 $a_tpl->setVariable(
"TEXT_HEADING", $this->lng->txt(
"given_answers"));
1089 foreach($texts[
""] as $item)
1091 $a_tpl->setCurrentBlock(
"text_direct_item_bl");
1092 $a_tpl->setVariable(
"TEXT_DIRECT", nl2br($item));
1093 $a_tpl->parseCurrentBlock();
1098 include_once
"Services/Accordion/classes/class.ilAccordionGUI.php";
1100 $acc->setId(
"svyevaltxt".$question->getId());
1102 $a_tpl->setVariable(
"TEXT_HEADING", $this->lng->txt(
"freetext_answers"));
1104 foreach($texts as $var => $items)
1106 $list = array(
"<ul class=\"small\">");
1107 foreach($items as $item)
1109 $list[] =
"<li>".nl2br($item).
"</li>";
1112 $acc->addItem($var, implode(
"\n", $list));
1115 $a_tpl->setVariable(
"TEXT_ACC", $acc->getHTML());
1120 if($a_details_parts ==
"c" ||
1121 $a_details_parts ==
"tc")
1131 foreach(
$chart[1] as $legend_item)
1133 $r = hexdec(substr($legend_item[1], 1, 2));
1134 $g = hexdec(substr($legend_item[1], 3, 2));
1135 $b = hexdec(substr($legend_item[1], 5, 2));
1137 $a_tpl->setCurrentBlock(
"legend_bl");
1138 $a_tpl->setVariable(
"LEGEND_CAPTION", $legend_item[0]);
1139 $a_tpl->setVariable(
"LEGEND_COLOR", $legend_item[1]);
1140 $a_tpl->setVariable(
"LEGEND_COLOR_SVG",
$r.
",".$g.
",".$b);
1141 $a_tpl->parseCurrentBlock();
1147 $a_tpl->setVariable(
"CHART",
$chart);
1150 $panel = $ui_factory->panel()->sub(
"", $ui_factory->legacy($a_tpl->get()));
1151 array_push($this->array_panels, $panel);
1162 global $ilToolbar, $rbacsystem;
1164 if($this->object->get360Mode())
1171 $options[
""] = $this->lng->txt(
"please_select");
1174 foreach($this->object->getAppraiseesData() as $item)
1178 $options[$item[
"user_id"]] = $item[
"login"];
1185 if ($rbacsystem->checkAccess(
"write", $this->object->getRefId()) ||
1188 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
1189 $appr =
new ilSelectInputGUI($this->lng->txt(
"survey_360_appraisee"),
"appr_id");
1192 $ilToolbar->addInputItem($appr,
true);
1194 include_once
"Services/UIComponent/Button/classes/class.ilSubmitButton.php";
1196 $button->setCaption(
"survey_360_select_appraisee");
1197 $button->setCommand($this->ctrl->getCmd());
1198 $ilToolbar->addButtonInstance($button);
1202 $ilToolbar->addSeparator();
1225 $resultarray = array();
1226 foreach (
$row as $rowindex => $entry)
1228 if(is_array($entry))
1230 $entry = implode(
"/", $entry);
1237 if (strpos($entry,
"\"") !== FALSE)
1239 $entry = str_replace(
"\"",
"\"\"", $entry);
1242 if (strpos($entry, $separator) !== FALSE)
1247 $entry = str_replace(chr(13).chr(10), chr(10), $entry);
1250 $resultarray[$rowindex] = utf8_decode(
"\"" . $entry .
"\"");
1254 $resultarray[$rowindex] = utf8_decode($entry);
1257 return $resultarray;
1265 $title_row = $title_row2 = array();
1266 $title_row[] = $this->lng->txt(
"lastname");
1267 $title_row[] = $this->lng->txt(
"firstname");
1268 $title_row[] = $this->lng->txt(
"login");
1269 $title_row[] = $this->lng->txt(
'workingtime');
1270 $title_row[] = $this->lng->txt(
'survey_results_finished');
1276 if($this->object->canExportSurveyCode())
1278 $title_row[] = $this->lng->txt(
"codes");
1282 $questions = array();
1284 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
1285 foreach($this->object->getSurveyQuestions() as $qdata)
1288 $q_res = $q_eval->getResults();
1290 $questions[$qdata[
"question_id"]] = array($q_eval, $q_res);
1292 $question = is_array($q_res)
1293 ? $q_res[0][1]->getQuestion()
1294 : $q_res->getQuestion();
1296 $do_title = $do_label =
true;
1297 switch(
$_POST[
'export_label'])
1300 $title_row[] = $question->label;
1306 $title_row[] = $question->getTitle();
1312 $title_row[] = $question->getTitle();
1313 $title_row2[] = $question->label;
1317 $q_eval->getUserSpecificVariableTitles($title_row, $title_row2, $do_title, $do_label);
1323 $rows[] = $title_row;
1324 if(implode(
"", $title_row2))
1326 $rows[] = $title_row2;
1332 $finished_ids =
null;
1333 if($this->object->get360Mode())
1338 $this->ctrl->redirect($this,
"evaluationuser");
1340 $finished_ids = $this->
object->getFinishedIdsForAppraiseeId($appr_id);
1341 if(!
sizeof($finished_ids))
1343 $finished_ids = array(-1);
1347 $participants = $this->
object->getSurveyParticipants($finished_ids);
1349 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
1350 foreach($participants as $user)
1352 $user_id = $user[
"active_id"];
1355 $row[] = trim($user[
"lastname"])
1358 $row[] = $user[
"firstname"];
1359 $row[] = $user[
"login"];
1361 if ($this->object->canExportSurveyCode())
1366 $row[] = $this->
object->getWorkingtimeForParticipant($user_id);
1368 if((
bool)$user[
"finished"])
1380 foreach($questions as $item)
1385 $q_eval->addUserSpecificResults(
$row, $user_id, $q_res);
1392 $surveyname = $this->
object->getTitle().
" ".$this->lng->txt(
"svy_eval_user").
" ".
date(
"Y-m-d");
1393 $surveyname = preg_replace(
"/\s/",
"_", trim($surveyname));
1396 switch (
$_POST[
"export_format"])
1399 include_once
"Services/Excel/classes/class.ilExcel.php";
1401 $excel->addSheet($this->lng->txt(
"svy_eval_user"));
1403 foreach($rows as $row_idx =>
$row)
1405 foreach(
$row as $col_idx => $col)
1407 $excel->setCell($row_idx+1, $col_idx, $col);
1411 $excel->setBold(
"A1:".$excel->getColumnCoord(
sizeof(
$row)-1).
"1");
1414 $excel->sendToClient($surveyname);
1419 foreach ($rows as $csvrow)
1421 $csvrow = str_replace(
"\n",
" ", $this->
processCSVRow($csvrow, TRUE, $separator));
1422 $csv .= join($csvrow, $separator) .
"\n";
1438 global $ilAccess, $ilToolbar;
1440 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1443 $this->ctrl->redirectByClass(
"ilObjSurveyGUI",
"infoScreen");
1446 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1447 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"evaluationuser"));
1449 if($this->object->get360Mode())
1456 if(!$this->object->get360Mode() ||
$appr_id)
1458 $modal_id =
"svy_ev_exp";
1461 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
1463 $button->setCaption(
"export");
1464 $button->setOnClick(
'$(\'#'.$modal_id.
'\').modal(\
'show\')');
1465 $ilToolbar->addButtonInstance($button);
1467 $ilToolbar->addSeparator();
1469 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
1471 $button->setCaption(
"print");
1472 $button->setOnClick(
"window.print(); return false;");
1473 $button->setOmitPreventDoubleSubmission(
true);
1474 $ilToolbar->addButtonInstance($button);
1476 $finished_ids =
null;
1479 $finished_ids = $this->
object->getFinishedIdsForAppraiseeId($appr_id);
1480 if(!
sizeof($finished_ids))
1482 $finished_ids = array(-1);
1497 include_once
"./Modules/Survey/classes/tables/class.ilSurveyResultsUserTableGUI.php";
1499 $table_gui->setData(
$data);
1500 $this->tpl->setContent($table_gui->getHTML().$modal);
1507 $participants = $this->
object->getSurveyParticipants($a_finished_ids);
1509 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
1510 foreach($this->object->getSurveyQuestions() as $qdata)
1513 $q_res = $q_eval->getResults();
1515 $question = is_array($q_res)
1516 ? $q_res[0][1]->getQuestion()
1517 : $q_res->getQuestion();
1519 foreach($participants as $user)
1521 $user_id = $user[
"active_id"];
1523 $parsed_results = $q_eval->parseUserSpecificResults($q_res, $user_id);
1525 if(!array_key_exists($user_id,
$data))
1527 $wt = $this->
object->getWorkingtimeForParticipant($user_id);
1529 $finished = $user[
"finished"]
1530 ? $user[
"finished_tstamp"]
1533 $data[$user_id] = array(
1534 "username" => $user[
"sortname"],
1535 "question" => $question->getTitle(),
1536 "results" => $parsed_results,
1537 "workingtime" => $wt,
1538 "finished" => $finished,
1539 "subitems" => array()
1544 $data[$user_id][
"subitems"][] = array(
1546 "question" => $question->getTitle(),
1547 "results" => $parsed_results,
1548 "workingtime" =>
null,
1570 $ilTabs->activateSubtab(
"svy_eval_competences");
1571 $ilTabs->activateTab(
"svy_results");
1573 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"competenceEval"));
1575 if($this->object->get360Mode())
1587 $eval_modes = array();
1590 include_once(
"./Modules/Survey/classes/class.ilSurveySkill.php");
1592 $opts = $sskill->getAllAssignedSkillsAsOptions();
1594 foreach ($opts as $id => $o)
1596 $idarr = explode(
":", $id);
1597 $skills[$id] = array(
"id" => $id,
"title" => $o,
"profiles" => array(),
1598 "base_skill" => $idarr[0],
"tref_id" => $idarr[1]);
1604 include_once(
"./Services/Skill/classes/class.ilSkillProfile.php");
1606 foreach ($profiles as $p)
1609 $prof_levels = $prof->getSkillLevels();
1610 foreach ($prof_levels as $pl)
1612 if (isset($skills[$pl[
"base_skill_id"].
":".$pl[
"tref_id"]]))
1614 $skills[$pl[
"base_skill_id"].
":".$pl[
"tref_id"]][
"profiles"][] =
1617 $eval_modes[
"gap_".$p[
"id"]] =
1618 $lng->txt(
"svy_gap_analysis").
": ".$prof->getTitle();
1628 foreach ($skills as $sk)
1630 if (count($sk[
"profiles"]) == 0)
1632 $eval_modes[
"skills_of_survey"] =
$lng->txt(
"svy_all_survey_competences");
1637 $comp_eval_mode =
$_GET[
"comp_eval_mode"];
1638 if (
$_POST[
"comp_eval_mode"] !=
"")
1640 $comp_eval_mode =
$_POST[
"comp_eval_mode"];
1643 if (!isset($eval_modes[$comp_eval_mode]))
1646 $comp_eval_mode = key($eval_modes);
1647 $ilCtrl->setParameter($this,
"comp_eval_mode", $comp_eval_mode);
1650 $ilCtrl->saveParameter($this,
"comp_eval_mode");
1652 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
1654 $mode_sel->setOptions($eval_modes);
1655 $mode_sel->setValue($comp_eval_mode);
1656 $ilToolbar->addInputItem($mode_sel,
true);
1658 $ilToolbar->addFormButton(
$lng->txt(
"select"),
"competenceEval");
1660 if (substr($comp_eval_mode, 0, 4) ==
"gap_")
1663 $profile_id = (int) substr($comp_eval_mode, 4);
1665 include_once(
"./Services/Skill/classes/class.ilPersonalSkillsGUI.php");
1667 $pskills_gui->setProfileId($profile_id);
1668 $pskills_gui->setGapAnalysisActualStatusModePerObject($survey->getId(),
$lng->txt(
"survey_360_raters"));
1669 if ($survey->getFinishedIdForAppraiseeIdAndRaterId(
$appr_id,
$appr_id) > 0)
1672 $self_levels = array();
1673 foreach ($sskill->determineSkillLevelsForAppraisee(
$appr_id,
true) as $sl)
1675 $self_levels[$sl[
"base_skill_id"]][$sl[
"tref_id"]] = $sl[
"new_level_id"];
1677 $pskills_gui->setGapAnalysisSelfEvalLevels($self_levels);
1685 include_once(
"./Services/Skill/classes/class.ilPersonalSkillsGUI.php");
1687 $pskills_gui->setGapAnalysisActualStatusModePerObject($survey->getId(),
$lng->txt(
"survey_360_raters"));
1688 if ($survey->getFinishedIdForAppraiseeIdAndRaterId(
$appr_id,
$appr_id) > 0)
1691 $self_levels = array();
1692 foreach ($sskill->determineSkillLevelsForAppraisee(
$appr_id,
true) as $sl)
1694 $self_levels[$sl[
"base_skill_id"]][$sl[
"tref_id"]] = $sl[
"new_level_id"];
1696 $pskills_gui->setGapAnalysisSelfEvalLevels($self_levels);
1699 foreach ($skills as $skill)
1702 "base_skill_id" => (
int) $skill[
"base_skill"],
1703 "tref_id" => (
int) $skill[
"tref_id"]
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
An exception for terminatinating execution or to throw for unit testing.
Survey question evaluation.
getChart($a_results)
Get chart.
getExportGrid($a_results)
Get grid data.
getGrid($a_results, $a_abs=true, $a_perc=true)
Get grid data.
getTextAnswers($a_results)
Get text answers.
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
static _instanciateQuestionEvaluation($question_id, array $a_finished_ids=null)
Creates an instance of a question evaluation with a given question id.
Accordion user interface class.
static setUseRelativeDates($a_status)
set use relative dates
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
getCoordByColumnAndRow($pColumn=0, $pRow=1)
Get cell coordinate (e.g.
setCell($a_row, $a_col, $a_value)
Set cell value.
setColors($a_coords, $a_background, $a_font=null)
Set cell(s) colors.
setBold($a_coords)
Set cell(s) to bold.
addSheet($a_name, $a_activate=true)
Add sheet.
static _getStaticLink($a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
static getLogger($a_component_id)
Get component logger.
static getInstance()
Get instance.
static _hasEvaluationAccess($a_obj_id, $user_id)
const EVALUATION_ACCESS_PARTICIPANTS
const EVALUATION_ACCESS_ALL
static _getQuestionblock($questionblock_id)
Returns the database row for a given question block.
const EVALUATION_ACCESS_OFF
static _lookupObjId($a_id)
Personal skills GUI class.
Skill management settings.
static getProfilesOfUser($a_user_id)
Get profiles of a user.
Survey evaluation graphical output.
exportCumulatedResults($details=0)
exportResultsDetailsExcel(ilExcel $a_excel, SurveyQuestionEvaluation $a_eval, $a_results, $a_do_title, $a_do_label)
Export details (excel only)
setEvalSubtabs()
Set the tabs for the evaluation output.
__construct($a_object)
ilSurveyEvaluationGUI constructor
processCSVRow($row, $quoteAll=FALSE, $separator=";")
Processes an array as a CSV row and converts the array values to correct CSV values.
cancelEvaluationAccess()
Cancels the input of the survey access code for evaluation access.
addApprSelectionToToolbar()
Add appraisee selection to toolbar.
checkAnonymizedEvaluationAccess()
Show the detailed evaluation.
renderDetails($a_details_parts, $a_details_figure, array $a_qdata, SurveyQuestionEvaluation $a_eval, $a_results)
Render details.
buildExportModal($a_id, $a_cmd)
setAppraiseeId($a_val)
Set appraisee id.
evaluationdetails()
Show the detailed evaluation.
determineAppraiseeId()
Determine appraisee id.
parseResultsToExcel(ilExcel $a_excel, ilSurveyEvaluationResults $a_results, &$a_excel_row, array $a_grid=null, array $a_text_answers=null, $a_include_mode=true)
checkEvaluationAccess()
Checks the evaluation access after entering the survey access code.
getAppraiseeId()
Get appraisee id.
competenceEval()
Competence Evaluation.
parseUserSpecificResults(array $a_finished_ids=null)
evaluationuser()
Print the survey evaluation for a selected user.
executeCommand()
execute command
Survey evaluation answers.
Skill/Competence handling in surveys.
special template class to simplify handling of ITX/PEAR
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(!is_array($argv)) $options