Skip to content

Commit

Permalink
Merge branch 'release-48.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Jan 29, 2024
2 parents 09ca5bd + 1e4788c commit b45217e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion models/classes/class.QtiTestConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* Copyright (c) 2013 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
*/

use qtism\common\datatypes\QtiPair;
use qtism\data\storage\xml\XmlDocument;
use qtism\data\QtiComponent;
use qtism\data\QtiComponentCollection;
Expand Down Expand Up @@ -146,7 +147,9 @@ private function componentToArray(QtiComponent $component)
$value = $this->getValue($component, $property);
if ($value !== null) {
$key = $property->getName();
if ($value instanceof QtiComponentCollection) {
if ($value instanceof QtiPair) {
$array[$property->getName()] = (string) $value;
} elseif ($value instanceof QtiComponentCollection) {
$array[$key] = [];
foreach ($value as $item) {
$array[$key][] = $this->componentToArray($item);
Expand Down

0 comments on commit b45217e

Please sign in to comment.