Skip to content

Commit

Permalink
Merge pull request #22 from hutnikau/fix/selection_element
Browse files Browse the repository at this point in the history
Check select attribute value
  • Loading branch information
Jérôme Bogaerts committed Nov 18, 2015
2 parents fd6d0d1 + 9acd45a commit 4d09836
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4d09836

Please sign in to comment.