From c9b3b554dbd4cd9991207247bc29e21470221d4c Mon Sep 17 00:00:00 2001 From: Maximilian Becker Date: Tue, 5 Jul 2022 13:57:42 +0200 Subject: [PATCH] T&A fix 22130 PR #4703 --- Modules/Test/classes/class.ilTestExport.php | 21 ++++++++++++++++--- .../tables/class.ilEvaluationAllTableGUI.php | 19 +++++++++++++++-- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/Modules/Test/classes/class.ilTestExport.php b/Modules/Test/classes/class.ilTestExport.php index d4e8f0476d11..842d9e4c6207 100755 --- a/Modules/Test/classes/class.ilTestExport.php +++ b/Modules/Test/classes/class.ilTestExport.php @@ -1,5 +1,20 @@ getUserId()); foreach ($additionalFields as $fieldname) { if (strcmp($fieldname, 'gender') == 0) { - $worksheet->setCell($row, $col++, $this->lng->txt('gender_' . $userfields[$fieldname])); + $worksheet->setCell($row, $col++, strlen($userfields[$fieldname]) ? $this->lng->txt('gender_' . $userfields[$fieldname]) : ''); } elseif (strcmp($fieldname, "exam_id") == 0) { $worksheet->setCell($row, $col++, $userdata->getExamIdFromScoredPass()); } else { @@ -959,7 +974,7 @@ public function exportToCSV($deliver = true, $filterby = "", $filtertext = "", $ $userfields = ilObjUser::_lookupFields($userdata->getUserID()); foreach ($additionalFields as $fieldname) { if (strcmp($fieldname, "gender") == 0) { - array_push($datarow2, $this->lng->txt("gender_" . $userfields[$fieldname])); + array_push($datarow2, strlen($userfields[$fieldname]) ? $this->lng->txt('gender_' . $userfields[$fieldname]) : ''); } elseif (strcmp($fieldname, "exam_id") == 0) { array_push($datarow2, $userdata->getExamIdFromScoredPass()); } else { diff --git a/Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php b/Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php index 714725fde906..a457ca76ec31 100644 --- a/Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php +++ b/Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php @@ -1,5 +1,20 @@ anonymity) { if (strcmp($c, 'gender') == 0) { $this->tpl->setCurrentBlock('gender'); - $this->tpl->setVariable("GENDER", $this->lng->txt('gender_' . $a_set['gender'])); + $this->tpl->setVariable("GENDER", strlen($data['gender']) ? $this->lng->txt('gender_' . $a_set['gender']) : ' '); $this->tpl->parseCurrentBlock(); } if (strcmp($c, 'email') == 0) {