diff --git a/webservice/soap/classes/class.ilSoapTestAdministration.php b/webservice/soap/classes/class.ilSoapTestAdministration.php index 2248d28d01d9..60f609cfe8ab 100644 --- a/webservice/soap/classes/class.ilSoapTestAdministration.php +++ b/webservice/soap/classes/class.ilSoapTestAdministration.php @@ -688,13 +688,13 @@ public function getTestResults(string $sid, int $test_ref_id, bool $sum_only) foreach ($data as $row) { $xmlRow = new ilXMLResultSetRow(); $xmlRow->setValue(0, $row["user_id"]); - $xmlRow->setValue(1, $row["login"]); - $xmlRow->setValue(2, $row["firstname"]); - $xmlRow->setValue(3, $row["lastname"]); - $xmlRow->setValue(4, $row["matriculation"]); - $xmlRow->setValue(5, $row["max_points"]); - $xmlRow->setValue(6, $row["reached_points"]); - $xmlRow->setValue(7, $row["passed"]); + $xmlRow->setValue(1, $row["login"] ? (string) $row["login"] : ""); + $xmlRow->setValue(2, $row["firstname"] ? (string) $row["firstname"] : ""); + $xmlRow->setValue(3, $row["lastname"] ? (string) $row["lastname"] : ""); + $xmlRow->setValue(4, $row["matriculation"] ? (string) $row["matriculation"] : ""); + $xmlRow->setValue(5, $row["max_points"] ? (float) $row["max_points"] : ""); + $xmlRow->setValue(6, $row["reached_points"] ? (float) $row["reached_points"] : ""); + $xmlRow->setValue(7, $row["passed"] ? (int) $row["passed"] : 0); $xmlResultSet->addRow($xmlRow); } } else { @@ -708,15 +708,15 @@ public function getTestResults(string $sid, int $test_ref_id, bool $sum_only) foreach ($data as $row) { $xmlRow = new ilXMLResultSetRow(); $xmlRow->setValue(0, $row["user_id"]); - $xmlRow->setValue(1, $row["login"]); - $xmlRow->setValue(2, $row["firstname"]); - $xmlRow->setValue(3, $row["lastname"]); - $xmlRow->setValue(4, $row["matriculation"]); - $xmlRow->setValue(5, $row["question_id"]); - $xmlRow->setValue(6, $row["question_title"]); - $xmlRow->setValue(7, $row["max_points"]); - $xmlRow->setValue(8, $row["reached_points"]); - $xmlRow->setValue(9, $row["passed"]); + $xmlRow->setValue(1, $row["login"] ? (string) $row["login"] : ""); + $xmlRow->setValue(2, $row["firstname"] ? (string) $row["firstname"] : ""); + $xmlRow->setValue(3, $row["lastname"] ? (string) $row["lastname"] : ""); + $xmlRow->setValue(4, $row["matriculation"] ? (string) $row["matriculation"] : ""); + $xmlRow->setValue(5, $row["question_id"] ? (string) $row["question_id"] : ""); + $xmlRow->setValue(6, $row["question_title"] ? (string) $row["question_title"] : ""); + $xmlRow->setValue(7, $row["max_points"] ? (float) $row["max_points"] : ""); + $xmlRow->setValue(8, $row["reached_points"] ? (float) $row["reached_points"] : ""); + $xmlRow->setValue(9, $row["passed"] ? (int) $row["passed"] : 0); $xmlResultSet->addRow($xmlRow); } }