diff --git a/qtism/runtime/pci/json/Unmarshaller.php b/qtism/runtime/pci/json/Unmarshaller.php index 9ee69410e..74cd46f6c 100644 --- a/qtism/runtime/pci/json/Unmarshaller.php +++ b/qtism/runtime/pci/json/Unmarshaller.php @@ -254,6 +254,9 @@ protected function unmarshallUnit(array $unit) case 'identifier': return $this->unmarshallIdentifier($unit); break; + case 'list': + return $this->unmarshallList($unit['base']); + break; default: throw new UnmarshallingException("Unknown QTI baseType '" . $keys[0] . "'"); diff --git a/test/qtismtest/runtime/pci/json/JsonUnmarshallerTest.php b/test/qtismtest/runtime/pci/json/JsonUnmarshallerTest.php index 41740624c..1ac7e8f3d 100644 --- a/test/qtismtest/runtime/pci/json/JsonUnmarshallerTest.php +++ b/test/qtismtest/runtime/pci/json/JsonUnmarshallerTest.php @@ -353,6 +353,22 @@ public function unmarshallRecordProvider() $json = '{ "record" : [ { "name": "A" } ] }'; $returnValue[] = [$record, $json]; + $record = new RecordContainer( + [ + 'A' => new MultipleContainer( + BaseType::STRING, + [ + new QtiString('p'), + new QtiString('a'), + new QtiString('p'), + new QtiString('e'), + new QtiString('r'), + ] + ) + ]); + $json = '{ "record" : [ {"name": "A","list": {"string": ["p","a","p","e","r"]} } ] }'; + $returnValue[] = [$record, $json]; + return $returnValue; }