ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
ilSurveyEvaluationGUI Class Reference

Survey evaluation graphical output. More...

+ Collaboration diagram for ilSurveyEvaluationGUI:

Public Member Functions

 __construct (ilObjSurvey $a_object)
 
 executeCommand ()
 
 setEvalSubtabs ()
 Set the tabs for the evaluation output. More...
 
 setAppraiseeId (int $a_val)
 
 getAppraiseeId ()
 
 checkAnonymizedEvaluationAccess ()
 
 checkEvaluationAccess ()
 Checks the evaluation access after entering the survey access code. More...
 
 cancelEvaluationAccess ()
 Cancels the input of the survey access code for evaluation access. More...
 
 exportCumulatedResults (int $details=0)
 
 exportData ()
 
 exportDetailData ()
 
 printEvaluation ()
 
 evaluation (int $details=0)
 
 processCSVRow (array $row, bool $quoteAll=false, string $separator=";")
 Processes an array as a CSV row and converts the array values to correct CSV values. More...
 
 exportEvaluationUser ()
 
 evaluationuser ()
 Print the survey evaluation for a selected user. More...
 
 competenceEval ()
 
 sumscore ()
 Show sum score table. More...
 
 printResultsOverviewSelection ()
 
 printResultsDetailsSelection ()
 
 printResultsDetails ()
 
 printResultsPerUserSelection ()
 
 printResultsPerUser ()
 

Data Fields

const TYPE_XLS = "excel"
 
const TYPE_SPSS = "csv"
 
const EXCEL_SUBTITLE = "DDDDDD"
 

Protected Member Functions

 evaluationdetails ()
 Show the detailed evaluation. More...
 
 exportResultsDetailsExcel (ilExcel $a_excel, SurveyQuestionEvaluation $a_eval, $a_results, bool $a_do_title, bool $a_do_label, int $question_index)
 Export details (excel only) More...
 
 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)
 
 buildExportButtonAndModal (string $export_cmd)
 
 getExportModal ()
 
 validateAndSubmitExportForm ()
 
 openEvaluation ()
 
 hasResultsAccess ()
 Check if user can view results granted by rbac or positions. More...
 
 getSumScores (?array $a_finished_ids=null)
 

Protected Attributes

ILIAS Survey InternalGUIService $gui
 
ILIAS Survey Access AccessManager $access_manager
 
ILIAS Survey PrintView GUIService $print
 
string $last_questionblock_id = ""
 
array $array_panels
 
ilLogger $log
 
ILIAS DI UIServices $ui
 
ILIAS Survey Evaluation EvaluationManager $evaluation_manager
 
ilTabsGUI $tabs
 
ilAccessHandler $access
 
ilObjUser $user
 
ilRbacSystem $rbacsystem
 
ilTree $tree
 
ilObjSurvey $object
 
ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
int $appr_id = null
 
ILIAS Survey Mode UIModifier $ui_modifier = null
 
ILIAS Survey Evaluation EvaluationGUIRequest $request
 
ILIAS Skill Service SkillProfileService $skill_profile_service
 

Detailed Description

Survey evaluation graphical output.

The ilSurveyEvaluationGUI class creates the evaluation output for the ilObjSurveyGUI class. This saves some heap space because the ilObjSurveyGUI class will be smaller.

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m

Definition at line 30 of file class.ilSurveyEvaluationGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilSurveyEvaluationGUI::__construct ( ilObjSurvey  $a_object)

Definition at line 61 of file class.ilSurveyEvaluationGUI.php.

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 }
static getLogger(string $a_component_id)
Get component logger.
ilGlobalTemplateInterface $tpl
global $DIC
Definition: shib_login.php:26

References $DIC, $lng, $tpl, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilLoggerFactory\getLogger(), ILIAS\Repository\lng(), ILIAS\Repository\object(), setAppraiseeId(), ILIAS\Repository\tabs(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildExportButtonAndModal()

ilSurveyEvaluationGUI::buildExportButtonAndModal ( string  $export_cmd)
protected

Definition at line 656 of file class.ilSurveyEvaluationGUI.php.

658 : void {
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 }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
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...

◆ cancelEvaluationAccess()

ilSurveyEvaluationGUI::cancelEvaluationAccess ( )

Cancels the input of the survey access code for evaluation access.

Definition at line 273 of file class.ilSurveyEvaluationGUI.php.

273 : void
274 {
275 $ilCtrl = $this->ctrl;
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 }
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...
$path
Definition: ltiservices.php:30

References $path, ilTree\getPathFull(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ checkAnonymizedEvaluationAccess()

ilSurveyEvaluationGUI::checkAnonymizedEvaluationAccess ( )

Definition at line 200 of file class.ilSurveyEvaluationGUI.php.

200 : 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 }
static _hasEvaluationAccess(int $a_obj_id, int $user_id)
static _lookupObjId(int $ref_id)

References ilObjSurveyAccess\_hasEvaluationAccess(), ilObject\_lookupObjId(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ checkEvaluationAccess()

ilSurveyEvaluationGUI::checkEvaluationAccess ( )

Checks the evaluation access after entering the survey access code.

Definition at line 258 of file class.ilSurveyEvaluationGUI.php.

258 : 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 }
cancelEvaluationAccess()
Cancels the input of the survey access code for evaluation access.

References ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ competenceEval()

ilSurveyEvaluationGUI::competenceEval ( )

Definition at line 1203 of file class.ilSurveyEvaluationGUI.php.

1203 : 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 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
Personal skills GUI class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setContent(string $a_html)
Sets content for standard template.

References $id, $lng, ILIAS\Repository\int(), ILIAS\Repository\lng(), ilObjSurvey\MODE_IND_FEEDB, ILIAS\Repository\object(), ILIAS\UICore\GlobalTemplate\setContent(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ evaluation()

ilSurveyEvaluationGUI::evaluation ( int  $details = 0)

Definition at line 779 of file class.ilSurveyEvaluationGUI.php.

781 : void {
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 .= " » ";
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 }
static _instanciateQuestionEvaluation(int $question_id, ?array $a_finished_ids=null)
const IL_CAL_UNIX
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
const EVALUATION_ACCESS_PARTICIPANTS
static _getQuestionblock(int $questionblock_id)
get question block properties
const EVALUATION_ACCESS_ALL
const EVALUATION_ACCESS_OFF
hasResultsAccess()
Check if user can view results granted by rbac or positions.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
$results

References ILIAS\Repository\tabs().

+ Here is the call graph for this function:

◆ evaluationdetails()

ilSurveyEvaluationGUI::evaluationdetails ( )
protected

Show the detailed evaluation.

Definition at line 289 of file class.ilSurveyEvaluationGUI.php.

289 : void
290 {
291 $this->evaluation(1);
292 }

◆ evaluationuser()

ilSurveyEvaluationGUI::evaluationuser ( )

Print the survey evaluation for a selected user.

Definition at line 1156 of file class.ilSurveyEvaluationGUI.php.

1156 : 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 }
buildExportButtonAndModal(string $export_cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $data, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilObjSurvey\MODE_SELF_EVAL, ILIAS\Repository\object(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ executeCommand()

ilSurveyEvaluationGUI::executeCommand ( )

Definition at line 120 of file class.ilSurveyEvaluationGUI.php.

120 : 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 }
setEvalSubtabs()
Set the tabs for the evaluation output.

References ILIAS\Repository\ctrl(), ILIAS\Repository\object(), and setEvalSubtabs().

+ Here is the call graph for this function:

◆ exportCumulatedResults()

ilSurveyEvaluationGUI::exportCumulatedResults ( int  $details = 0)

Definition at line 294 of file class.ilSurveyEvaluationGUI.php.

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:
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 }
static getASCIIFilename(string $a_filename)
processCSVRow(array $row, bool $quoteAll=false, string $separator=";")
Processes an array as a CSV row and converts the array values to correct CSV values.
exportResultsDetailsExcel(ilExcel $a_excel, SurveyQuestionEvaluation $a_eval, $a_results, bool $a_do_title, bool $a_do_label, int $question_index)
Export details (excel only)
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
exit

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ exportData()

ilSurveyEvaluationGUI::exportData ( )

Definition at line 632 of file class.ilSurveyEvaluationGUI.php.

632 : void
633 {
634 if ($this->request->getExportFormat() !== '') {
635 $this->exportCumulatedResults(0);
636 } else {
637 $this->ctrl->redirect($this, 'evaluation');
638 }
639 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ exportDetailData()

ilSurveyEvaluationGUI::exportDetailData ( )

Definition at line 641 of file class.ilSurveyEvaluationGUI.php.

641 : void
642 {
643 if ($this->request->getExportFormat() !== '') {
644 $this->exportCumulatedResults(1);
645 } else {
646 $this->ctrl->redirect($this, 'evaluation');
647 }
648 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ exportEvaluationUser()

ilSurveyEvaluationGUI::exportEvaluationUser ( )

Definition at line 1004 of file class.ilSurveyEvaluationGUI.php.

1004 : 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 }

References $user_id, SurveyQuestion\_instanciateQuestionEvaluation(), ILIAS\Repository\ctrl(), ilUtil\deliverData(), exit, ilDatePresentation\formatDate(), ilFileUtils\getASCIIFilename(), IL_CAL_UNIX, ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilDatePresentation\setUseRelativeDates().

+ Here is the call graph for this function:

◆ exportResultsDetailsExcel()

ilSurveyEvaluationGUI::exportResultsDetailsExcel ( ilExcel  $a_excel,
SurveyQuestionEvaluation  $a_eval,
  $a_results,
bool  $a_do_title,
bool  $a_do_label,
int  $question_index 
)
protected

Export details (excel only)

Parameters
ilSurveyEvaluationResults | array$a_results
Exceptions

PhpOffice\PhpSpreadsheet\Exception

Definition at line 428 of file class.ilSurveyEvaluationGUI.php.

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 }
getExportGrid($a_results)
Get grid data.
getTextAnswers($a_results)
Get text answers.
static _getQuestionTypeName(string $type_tag)
Return the translation for a given question type.
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.
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)
$counter

◆ getAppraiseeId()

ilSurveyEvaluationGUI::getAppraiseeId ( )

Definition at line 195 of file class.ilSurveyEvaluationGUI.php.

195 : int
196 {
197 return $this->appr_id;
198 }

◆ getExportModal()

ilSurveyEvaluationGUI::getExportModal ( )
protected

Definition at line 675 of file class.ilSurveyEvaluationGUI.php.

675 : Modal\RoundTrip|Form\Standard
676 {
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 }
getFormAction(object $a_gui_obj, ?string $a_fallback_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc

References ILIAS\UI\Implementation\Component\Input\$inputs, $lng, ilCtrl\getFormAction(), TYPE_SPSS, and TYPE_XLS.

+ Here is the call graph for this function:

◆ getSumScores()

ilSurveyEvaluationGUI::getSumScores ( ?array  $a_finished_ids = null)
protected
Todo:
move to evaluation manager, use dto

Definition at line 1391 of file class.ilSurveyEvaluationGUI.php.

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 }

◆ hasResultsAccess()

ilSurveyEvaluationGUI::hasResultsAccess ( )
protected

Check if user can view results granted by rbac or positions.

Todo:
move to access manager

Definition at line 1350 of file class.ilSurveyEvaluationGUI.php.

1350 : bool
1351 {
1352 return $this->access->checkRbacOrPositionPermissionAccess(
1353 'read_results',
1354 'access_results',
1355 $this->object->getRefId()
1356 );
1357 }

References ILIAS\Repository\access(), and ILIAS\Repository\object().

Referenced by setEvalSubtabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ openEvaluation()

ilSurveyEvaluationGUI::openEvaluation ( )
protected

Definition at line 765 of file class.ilSurveyEvaluationGUI.php.

765 : 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 }
evaluationdetails()
Show the detailed evaluation.

References ilObjSurvey\MODE_IND_FEEDB, and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ parseResultsToExcel()

ilSurveyEvaluationGUI::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 
)
protected

Definition at line 549 of file class.ilSurveyEvaluationGUI.php.

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 }

References ilSurveyEvaluationResults\getMean(), ilSurveyEvaluationResults\getMedian(), ilSurveyEvaluationResults\getMedianAsText(), ilSurveyEvaluationResults\getModeNrOfSelections(), ilSurveyEvaluationResults\getModeValue(), ilSurveyEvaluationResults\getModeValueAsText(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ printEvaluation()

ilSurveyEvaluationGUI::printEvaluation ( )

Definition at line 650 of file class.ilSurveyEvaluationGUI.php.

650 : void
651 {
652 $this->tpl->setOnScreenMessage('info', $this->lng->txt('use_browser_print_function'), true);
653 $this->ctrl->redirect($this, 'evaluation');
654 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ printResultsDetails()

ilSurveyEvaluationGUI::printResultsDetails ( )

Definition at line 1444 of file class.ilSurveyEvaluationGUI.php.

1444 : void
1445 {
1446 $view = $this->print->resultsDetails($this->object->getRefId());
1447 $view->sendPrintView();
1448 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ printResultsDetailsSelection()

ilSurveyEvaluationGUI::printResultsDetailsSelection ( )
Exceptions

ILIAS\HTTP\Response\Sender\ResponseSendingException

Definition at line 1428 of file class.ilSurveyEvaluationGUI.php.

1428 : 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 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ printResultsOverviewSelection()

ilSurveyEvaluationGUI::printResultsOverviewSelection ( )
Exceptions

ILIAS\HTTP\Response\Sender\ResponseSendingException

Definition at line 1419 of file class.ilSurveyEvaluationGUI.php.

1419 : void
1420 {
1421 $view = $this->print->resultsOverview($this->object->getRefId());
1422 $view->sendForm();
1423 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ printResultsPerUser()

ilSurveyEvaluationGUI::printResultsPerUser ( )

Definition at line 1459 of file class.ilSurveyEvaluationGUI.php.

1459 : void
1460 {
1461 $view = $this->print->resultsPerUser($this->object->getRefId());
1462 $view->sendPrintView();
1463 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ printResultsPerUserSelection()

ilSurveyEvaluationGUI::printResultsPerUserSelection ( )
Exceptions

ILIAS\HTTP\Response\Sender\ResponseSendingException

Definition at line 1453 of file class.ilSurveyEvaluationGUI.php.

1453 : void
1454 {
1455 $view = $this->print->resultsPerUser($this->object->getRefId());
1456 $view->sendForm();
1457 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ processCSVRow()

ilSurveyEvaluationGUI::processCSVRow ( array  $row,
bool  $quoteAll = false,
string  $separator = ";" 
)

Processes an array as a CSV row and converts the array values to correct CSV values.

The "converted" array is returned

Parameters
array$rowThe array containing the values for a CSV row
bool$quoteAllIndicates to quote every value (=TRUE) or only values containing quotes and separators (=FALSE, default)
string$separatorThe value separator in the CSV row (used for quoting) (; = default)
Returns
array The converted array ready for CSV use

Definition at line 970 of file class.ilSurveyEvaluationGUI.php.

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 }

◆ setAppraiseeId()

ilSurveyEvaluationGUI::setAppraiseeId ( int  $a_val)

Definition at line 189 of file class.ilSurveyEvaluationGUI.php.

191 : void {
192 $this->appr_id = $a_val;
193 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setEvalSubtabs()

ilSurveyEvaluationGUI::setEvalSubtabs ( )

Set the tabs for the evaluation output.

Definition at line 145 of file class.ilSurveyEvaluationGUI.php.

145 : 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 }

References $tabs, ILIAS\Repository\ctrl(), hasResultsAccess(), ilObjSurvey\MODE_IND_FEEDB, and ILIAS\Repository\object().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sumscore()

ilSurveyEvaluationGUI::sumscore ( )

Show sum score table.

Definition at line 1362 of file class.ilSurveyEvaluationGUI.php.

1362 : 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 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getSumScores(?array $a_finished_ids=null)

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilObjSurvey\MODE_SELF_EVAL, and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ validateAndSubmitExportForm()

ilSurveyEvaluationGUI::validateAndSubmitExportForm ( )
protected

Definition at line 715 of file class.ilSurveyEvaluationGUI.php.

715 : void
716 {
720 $toolbar = $this->gui->toolbar();
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 }
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
evaluationuser()
Print the survey evaluation for a selected user.
ILIAS Survey Evaluation EvaluationGUIRequest $request
activateSubTab(string $a_id)

References $data, $lng, ilTabsGUI\activateSubTab(), ilCtrl\redirect(), and ilCtrl\setParameter().

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilSurveyEvaluationGUI::$access
protected

Definition at line 48 of file class.ilSurveyEvaluationGUI.php.

◆ $access_manager

ILIAS Survey Access AccessManager ilSurveyEvaluationGUI::$access_manager
protected

Definition at line 36 of file class.ilSurveyEvaluationGUI.php.

◆ $appr_id

int ilSurveyEvaluationGUI::$appr_id = null
protected

Definition at line 56 of file class.ilSurveyEvaluationGUI.php.

◆ $array_panels

array ilSurveyEvaluationGUI::$array_panels
protected

Definition at line 42 of file class.ilSurveyEvaluationGUI.php.

◆ $ctrl

ilCtrl ilSurveyEvaluationGUI::$ctrl
protected

Definition at line 55 of file class.ilSurveyEvaluationGUI.php.

◆ $evaluation_manager

ILIAS Survey Evaluation EvaluationManager ilSurveyEvaluationGUI::$evaluation_manager
protected

Definition at line 46 of file class.ilSurveyEvaluationGUI.php.

◆ $gui

ILIAS Survey InternalGUIService ilSurveyEvaluationGUI::$gui
protected

Definition at line 35 of file class.ilSurveyEvaluationGUI.php.

◆ $last_questionblock_id

string ilSurveyEvaluationGUI::$last_questionblock_id = ""
protected

Definition at line 41 of file class.ilSurveyEvaluationGUI.php.

◆ $lng

ilLanguage ilSurveyEvaluationGUI::$lng
protected

Definition at line 53 of file class.ilSurveyEvaluationGUI.php.

Referenced by __construct().

◆ $log

ilLogger ilSurveyEvaluationGUI::$log
protected

Definition at line 44 of file class.ilSurveyEvaluationGUI.php.

◆ $object

ilObjSurvey ilSurveyEvaluationGUI::$object
protected

Definition at line 52 of file class.ilSurveyEvaluationGUI.php.

◆ $print

ILIAS Survey PrintView GUIService ilSurveyEvaluationGUI::$print
protected

Definition at line 37 of file class.ilSurveyEvaluationGUI.php.

◆ $rbacsystem

ilRbacSystem ilSurveyEvaluationGUI::$rbacsystem
protected

Definition at line 50 of file class.ilSurveyEvaluationGUI.php.

◆ $request

ILIAS Survey Evaluation EvaluationGUIRequest ilSurveyEvaluationGUI::$request
protected

Definition at line 58 of file class.ilSurveyEvaluationGUI.php.

◆ $skill_profile_service

ILIAS Skill Service SkillProfileService ilSurveyEvaluationGUI::$skill_profile_service
protected

Definition at line 59 of file class.ilSurveyEvaluationGUI.php.

◆ $tabs

ilTabsGUI ilSurveyEvaluationGUI::$tabs
protected

Definition at line 47 of file class.ilSurveyEvaluationGUI.php.

Referenced by setEvalSubtabs().

◆ $tpl

ilGlobalTemplateInterface ilSurveyEvaluationGUI::$tpl
protected

Definition at line 54 of file class.ilSurveyEvaluationGUI.php.

Referenced by __construct().

◆ $tree

ilTree ilSurveyEvaluationGUI::$tree
protected

Definition at line 51 of file class.ilSurveyEvaluationGUI.php.

◆ $ui

ILIAS DI UIServices ilSurveyEvaluationGUI::$ui
protected

Definition at line 45 of file class.ilSurveyEvaluationGUI.php.

◆ $ui_modifier

ILIAS Survey Mode UIModifier ilSurveyEvaluationGUI::$ui_modifier = null
protected

Definition at line 57 of file class.ilSurveyEvaluationGUI.php.

◆ $user

ilObjUser ilSurveyEvaluationGUI::$user
protected

Definition at line 49 of file class.ilSurveyEvaluationGUI.php.

◆ EXCEL_SUBTITLE

const ilSurveyEvaluationGUI::EXCEL_SUBTITLE = "DDDDDD"

Definition at line 34 of file class.ilSurveyEvaluationGUI.php.

◆ TYPE_SPSS

const ilSurveyEvaluationGUI::TYPE_SPSS = "csv"

◆ TYPE_XLS

const ilSurveyEvaluationGUI::TYPE_XLS = "excel"

The documentation for this class was generated from the following file: