From 9acd45a45eef0c442d118d8777ebbe60adf35e0b Mon Sep 17 00:00:00 2001 From: Aleh Hutnikau Date: Wed, 18 Nov 2015 12:11:38 +0300 Subject: [PATCH] Check select attribute value --- .../xml/marshalling/AssessmentSectionMarshaller.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qtism/data/storage/xml/marshalling/AssessmentSectionMarshaller.php b/qtism/data/storage/xml/marshalling/AssessmentSectionMarshaller.php index b8ec62ff4..63f3d7550 100644 --- a/qtism/data/storage/xml/marshalling/AssessmentSectionMarshaller.php +++ b/qtism/data/storage/xml/marshalling/AssessmentSectionMarshaller.php @@ -71,8 +71,11 @@ protected function unmarshallChildrenKnown(DOMElement $element, QtiComponentColl // Deal with selection elements. $selectionElements = static::getChildElementsByTagName($element, 'selection'); if (count($selectionElements) == 1) { - $marshaller = $this->getMarshallerFactory()->createMarshaller($selectionElements[0]); - $object->setSelection($marshaller->unmarshall($selectionElements[0])); + $select = intval($selectionElements[0]->getAttribute('select')); + if ($select > 0) { + $marshaller = $this->getMarshallerFactory()->createMarshaller($selectionElements[0]); + $object->setSelection($marshaller->unmarshall($selectionElements[0])); + } } // Deal with ordering elements.