Skip to content

Commit

Permalink
T&A fix 22130 PR #4703
Browse files Browse the repository at this point in the history
  • Loading branch information
mbecker-databay committed Jul 5, 2022
1 parent e5bb395 commit c9b3b55
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 5 deletions.
21 changes: 18 additions & 3 deletions Modules/Test/classes/class.ilTestExport.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
<?php
/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

require_once './Modules/Test/classes/inc.AssessmentConstants.php';
require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
Expand Down Expand Up @@ -467,7 +482,7 @@ public function exportToExcel($deliver = true, $filterby = "", $filtertext = "",
$userfields = ilObjUser::_lookupFields($userdata->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 {
Expand Down Expand Up @@ -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 {
Expand Down
19 changes: 17 additions & 2 deletions Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
<?php
/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/


include_once("./Services/Table/classes/class.ilTable2GUI.php");
Expand Down Expand Up @@ -266,7 +281,7 @@ protected function fillRow(array $a_set) : void
if (!$this->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']) : '&nbsp;');
$this->tpl->parseCurrentBlock();
}
if (strcmp($c, 'email') == 0) {
Expand Down

0 comments on commit c9b3b55

Please sign in to comment.