2525 * The ilSurveyEvaluationGUI class creates the evaluation output for the ilObjSurveyGUI
2626 * class. This saves some heap space because the ilObjSurveyGUI class will be
2727 * smaller.
28- * @author Helmut Schottmüller <helmut.schottmueller@mac.com>
28+ * @author Helmut Schottmüller <helmut.schottmueller@mac.com>
2929 */
3030class ilSurveyEvaluationGUI
3131{
@@ -99,20 +99,20 @@ public function __construct(
9999 );
100100
101101 $ this ->ui_modifier = $ DIC ->survey ()
102- ->internal ()
103- ->gui ()
104- ->modeUIModifier ($ this ->object ->getMode ());
102+ ->internal ()
103+ ->gui ()
104+ ->modeUIModifier ($ this ->object ->getMode ());
105105 $ this ->print = $ DIC ->survey ()
106- ->internal ()
107- ->gui ()
108- ->print ();
106+ ->internal ()
107+ ->gui ()
108+ ->print ();
109109 $ this ->access_manager = $ DIC ->survey ()
110- ->internal ()
111- ->domain ()
112- ->access (
113- $ this ->object ->getRefId (),
114- $ DIC ->user ()->getId ()
115- );
110+ ->internal ()
111+ ->domain ()
112+ ->access (
113+ $ this ->object ->getRefId (),
114+ $ DIC ->user ()->getId ()
115+ );
116116 $ this ->skill_profile_service = $ DIC ->skills ()->profile ();
117117 $ this ->gui = $ DIC ->survey ()->internal ()->gui ();
118118 }
@@ -186,7 +186,6 @@ public function setEvalSubtabs(): void
186186 }
187187 }
188188
189-
190189 public function setAppraiseeId (
191190 int $ a_val
192191 ): void {
@@ -227,11 +226,17 @@ public function checkAnonymizedEvaluationAccess(): bool
227226
228227 // code needed
229228 $ this ->tpl ->setVariable ("TABS " , "" );
230- $ this ->tpl ->addBlockFile ("ADM_CONTENT " , "adm_content " , "tpl.il_svy_svy_evaluation_checkaccess.html " , "components/ILIAS/Survey " );
229+ $ this ->tpl ->addBlockFile (
230+ "ADM_CONTENT " , "adm_content " , "tpl.il_svy_svy_evaluation_checkaccess.html " , "components/ILIAS/Survey "
231+ );
231232 $ this ->tpl ->setCurrentBlock ("adm_content " );
232- $ this ->tpl ->setVariable ("AUTHENTICATION_NEEDED " , $ this ->lng ->txt ("svy_check_evaluation_authentication_needed " ));
233+ $ this ->tpl ->setVariable (
234+ "AUTHENTICATION_NEEDED " , $ this ->lng ->txt ("svy_check_evaluation_authentication_needed " )
235+ );
233236 $ this ->tpl ->setVariable ("FORM_ACTION " , $ this ->ctrl ->getFormAction ($ this , "checkEvaluationAccess " ));
234- $ this ->tpl ->setVariable ("EVALUATION_CHECKACCESS_INTRODUCTION " , $ this ->lng ->txt ("svy_check_evaluation_access_introduction " ));
237+ $ this ->tpl ->setVariable (
238+ "EVALUATION_CHECKACCESS_INTRODUCTION " , $ this ->lng ->txt ("svy_check_evaluation_access_introduction " )
239+ );
235240 $ this ->tpl ->setVariable ("VALUE_CHECK " , $ this ->lng ->txt ("ok " ));
236241 $ this ->tpl ->setVariable ("VALUE_CANCEL " , $ this ->lng ->txt ("cancel " ));
237242 $ this ->tpl ->setVariable ("TEXT_SURVEY_CODE " , $ this ->lng ->txt ("survey_code " ));
@@ -341,7 +346,6 @@ public function exportCumulatedResults(
341346 break ;
342347 }
343348
344-
345349 // parse answer data in evaluation results
346350 $ ov_row = 2 ;
347351 $ question_index = 1 ;
@@ -371,7 +375,9 @@ public function exportCumulatedResults(
371375 if ($ details ) {
372376 switch ($ this ->request ->getExportFormat ()) {
373377 case self ::TYPE_XLS :
374- $ this ->exportResultsDetailsExcel ($ excel , $ q_eval , $ q_res , $ do_title , $ do_label , $ question_index ++);
378+ $ this ->exportResultsDetailsExcel (
379+ $ excel , $ q_eval , $ q_res , $ do_title , $ do_label , $ question_index ++
380+ );
375381 break ;
376382 }
377383 }
@@ -427,7 +433,6 @@ protected function exportResultsDetailsExcel(
427433
428434 $ a_excel ->addSheet ($ question_index . "_ " . $ question ->getTitle ());
429435
430-
431436 // question "overview"
432437
433438 $ kv = array ();
@@ -449,7 +454,7 @@ protected function exportResultsDetailsExcel(
449454
450455 // answered and skipped users
451456 $ kv [$ this ->lng ->txt ("users_answered " )] = $ question_res ->getUsersAnswered ();
452- $ kv [$ this ->lng ->txt ("users_skipped " )] = $ question_res ->getUsersSkipped (); // #0021671
457+ $ kv [$ this ->lng ->txt ("users_skipped " )] = $ question_res ->getUsersSkipped (); // #0021671
453458
454459 $ excel_row = 1 ;
455460
@@ -595,8 +600,7 @@ protected function parseResultsToExcel(
595600 $ a_excel ->setColors ("B " . $ a_excel_row . ":C " . $ a_excel_row , self ::EXCEL_SUBTITLE );
596601 $ a_excel ->setCell ($ a_excel_row , 1 , $ this ->lng ->txt ("title " ));
597602 $ a_excel ->setCell ($ a_excel_row ++, 2 , $ this ->lng ->txt ("answer " ));
598- }
599- // mtx (row), txt
603+ } // mtx (row), txt
600604 else {
601605 $ a_excel ->setColors ("B " . $ a_excel_row . ":B " . $ a_excel_row , self ::EXCEL_SUBTITLE );
602606 $ a_excel ->setCell ($ a_excel_row ++, 1 , $ this ->lng ->txt ("answer " ));
@@ -658,7 +662,7 @@ protected function buildExportButtonAndModal(
658662 $ toolbar ->addComponent ($ modal );
659663 }
660664
661- protected function getExportModal (): Modal \RoundTrip | Form \Standard
665+ protected function getExportModal (): Modal \RoundTrip | Form \Standard
662666 {
663667 $ lng = $ this ->lng ;
664668 $ ctrl = $ this ->ctrl ;
@@ -673,8 +677,8 @@ protected function getExportModal(): Modal\RoundTrip | Form\Standard
673677 \ilSurveyEvaluationGUI::TYPE_SPSS => $ lng ->txt ("exp_type_csv " )
674678 ]
675679 )
676- //->withValue(\ilSurveyEvaluationGUI::TYPE_XLS)
677- ->withRequired (true );
680+ //->withValue(\ilSurveyEvaluationGUI::TYPE_XLS)
681+ ->withRequired (true );
678682
679683 $ inputs ["export_label " ] = $ ui_fac ->input ()->field ()->select (
680684 $ lng ->txt ("title " ),
@@ -684,16 +688,16 @@ protected function getExportModal(): Modal\RoundTrip | Form\Standard
684688 "title_label " => $ lng ->txt ("export_title_label " )
685689 ]
686690 )
687- //->withValue("label_only")
688- ->withRequired (true );
691+ //->withValue("label_only")
692+ ->withRequired (true );
689693
690694 $ modal = $ ui_fac ->modal ()->roundtrip (
691695 $ lng ->txt ("svy_export_format " ),
692696 null ,
693697 $ inputs ,
694698 $ post_url
695699 )
696- ->withSubmitLabel ($ lng ->txt ("export " ));
700+ ->withSubmitLabel ($ lng ->txt ("export " ));
697701
698702 return $ modal ;
699703 }
@@ -739,10 +743,10 @@ protected function validateAndSubmitExportForm(): void
739743 switch ($ export_cmd ) {
740744 case "exportData " :
741745 $ ctrl ->redirect ($ this , "evaluation " );
742- // no break
746+ // no break
743747 case "exportDetailData " :
744748 $ ctrl ->redirect ($ this , "evaluationdetails " );
745- // no break
749+ // no break
746750 case "exportEvaluationUser " :
747751 $ ctrl ->redirect ($ this , "evaluationuser " );
748752 }
@@ -781,7 +785,6 @@ public function evaluation(
781785 $ this ->tabs ->activateSubTab ("svy_eval_detail " );
782786 }
783787
784-
785788 // auth
786789 if (!$ this ->hasResultsAccess ()) {
787790 if (!$ this ->access ->checkAccess ('read ' , '' , $ this ->object ->getRefId ())) {
@@ -815,7 +818,6 @@ public function evaluation(
815818
816819 $ eval_tpl = new ilTemplate ("tpl.il_svy_svy_evaluation.html " , true , true , "components/ILIAS/Survey " );
817820
818-
819821 if ($ details ) {
820822 $ toolbar_components = $ this ->ui_modifier ->setResultsDetailToolbar (
821823 $ this ->object ,
@@ -836,7 +838,9 @@ public function evaluation(
836838 if (!$ this ->object ->get360Mode () || $ appr_id ) {
837839 if ($ details ) {
838840 //templates: results, table of contents
839- $ dtmpl = new ilTemplate ("tpl.il_svy_svy_results_details.html " , true , true , "components/ILIAS/Survey/Evaluation " );
841+ $ dtmpl = new ilTemplate (
842+ "tpl.il_svy_svy_results_details.html " , true , true , "components/ILIAS/Survey/Evaluation "
843+ );
840844 $ this ->lng ->loadLanguageModule ("content " );
841845 }
842846 $ finished_ids = $ this ->evaluation_manager ->getFilteredFinishedIds ();
@@ -887,7 +891,9 @@ public function evaluation(
887891
888892 if ($ details ) {
889893 //TABLE OF CONTENTS
890- $ panel_toc = $ ui_factory ->panel ()->standard ($ this ->lng ->txt ('cont_toc ' ), $ ui_factory ->legacy ()->content ($ listing ->render ()));
894+ $ panel_toc = $ ui_factory ->panel ()->standard (
895+ $ this ->lng ->txt ('cont_toc ' ), $ ui_factory ->legacy ()->content ($ listing ->render ())
896+ );
891897 $ render_toc = $ ui_renderer ->render ($ panel_toc );
892898 $ dtmpl ->setVariable ("PANEL_TOC " , $ render_toc );
893899
@@ -942,8 +948,8 @@ public function evaluation(
942948 /**
943949 * Processes an array as a CSV row and converts the array values to correct CSV
944950 * values. The "converted" array is returned
945- * @param array $row The array containing the values for a CSV row
946- * @param bool $quoteAll Indicates to quote every value (=TRUE) or only values containing quotes and separators (=FALSE, default)
951+ * @param array $row The array containing the values for a CSV row
952+ * @param bool $quoteAll Indicates to quote every value (=TRUE) or only values containing quotes and separators (=FALSE, default)
947953 * @param string $separator The value separator in the CSV row (used for quoting) (; = default)
948954 * @return array The converted array ready for CSV use
949955 */
@@ -1117,7 +1123,7 @@ public function exportEvaluationUser(): void
11171123 }
11181124 $ excel ->sendToClient ($ surveyname );
11191125
1120- // no break
1126+ // no break
11211127 case self ::TYPE_SPSS :
11221128 $ csv = "" ;
11231129 $ separator = "; " ;
@@ -1149,7 +1155,6 @@ public function evaluationuser(): void
11491155 $ this ->gui ->toolbar ()->addComponent ($ component );
11501156 }
11511157
1152-
11531158 $ appr_id = null ;
11541159 $ data = [];
11551160
@@ -1160,7 +1165,6 @@ public function evaluationuser(): void
11601165 if (!$ this ->object ->get360Mode () || $ appr_id ) {
11611166 $ this ->buildExportButtonAndModal ("exportEvaluationUser " );
11621167
1163-
11641168 $ this ->gui ->toolbar ()->addSeparator ();
11651169
11661170 $ pv = $ this ->print ->resultsDetails ($ this ->object ->getRefId ());
@@ -1194,7 +1198,6 @@ public function competenceEval(): void
11941198 $ ilTabs ->activateSubTab ("svy_eval_competences " );
11951199 $ ilTabs ->activateTab ("svy_results " );
11961200
1197-
11981201 $ appr_id = $ this ->getAppraiseeId ();
11991202
12001203 if ($ appr_id === 0 ) {
@@ -1219,8 +1222,13 @@ public function competenceEval(): void
12191222 $ skills = array ();
12201223 foreach ($ opts as $ id => $ o ) {
12211224 $ idarr = explode (": " , $ id );
1222- $ skills [$ id ] = array ("id " => $ id , "title " => $ o , "profiles " => array (),
1223- "base_skill " => $ idarr [0 ], "tref_id " => $ idarr [1 ]);
1225+ $ skills [$ id ] = array (
1226+ "id " => $ id ,
1227+ "title " => $ o ,
1228+ "profiles " => array (),
1229+ "base_skill " => $ idarr [0 ],
1230+ "tref_id " => $ idarr [1 ]
1231+ );
12241232 }
12251233
12261234 // get matching user competence profiles
@@ -1269,10 +1277,9 @@ public function competenceEval(): void
12691277
12701278 $ this ->gui ->toolbar ()->addComponent (
12711279 $ this ->ui ->factory ()->dropdown ()->standard ($ dropdown_items )
1272- ->withLabel ($ eval_modes [$ comp_eval_mode ] ?? $ lng ->txt ("svy_analysis " ))
1280+ ->withLabel ($ eval_modes [$ comp_eval_mode ] ?? $ lng ->txt ("svy_analysis " ))
12731281 );
12741282
1275-
12761283 $ pskills_gui = new ilPersonalSkillsGUI ();
12771284 $ rater = $ this ->evaluation_manager ->getCurrentRater (
12781285 $ this ->object ->getMode () === ilObjSurvey::MODE_IND_FEEDB
@@ -1315,7 +1322,7 @@ public function competenceEval(): void
13151322 $ sk [] = array (
13161323 "base_skill_id " => (int ) $ skill ["base_skill " ],
13171324 "tref_id " => (int ) $ skill ["tref_id " ]
1318- );
1325+ );
13191326 }
13201327 $ html = $ pskills_gui ->getGapAnalysisHTML ($ appr_id , $ sk );
13211328 }
@@ -1328,7 +1335,9 @@ public function competenceEval(): void
13281335 */
13291336 protected function hasResultsAccess (): bool
13301337 {
1331- return $ this ->access ->checkRbacOrPositionPermissionAccess ('read_results ' , 'access_results ' , $ this ->object ->getRefId ());
1338+ return $ this ->access ->checkRbacOrPositionPermissionAccess (
1339+ 'read_results ' , 'access_results ' , $ this ->object ->getRefId ()
1340+ );
13321341 }
13331342
13341343 /**
@@ -1342,7 +1351,9 @@ public function sumscore(): void
13421351 $ this ->ctrl ->redirectByClass ("ilObjSurveyGUI " , "infoScreen " );
13431352 }
13441353
1345- $ this ->tpl ->setOnScreenMessage ('info ' , $ this ->lng ->txt ("svy_max_sum_score " ) . ": " . $ this ->object ->getMaxSumScore ());
1354+ $ this ->tpl ->setOnScreenMessage (
1355+ 'info ' , $ this ->lng ->txt ("svy_max_sum_score " ) . ": " . $ this ->object ->getMaxSumScore ()
1356+ );
13461357
13471358 $ this ->gui ->button (
13481359 $ this ->lng ->txt ("print " ),
0 commit comments