diff --git a/src/Processors/QtiV2/In/SharedPassageMapper.php b/src/Processors/QtiV2/In/SharedPassageMapper.php index 0a1d131b..2c39d63b 100644 --- a/src/Processors/QtiV2/In/SharedPassageMapper.php +++ b/src/Processors/QtiV2/In/SharedPassageMapper.php @@ -114,9 +114,6 @@ public function parseWithRubricBlockComponent(RubricBlock $rubricBlock) $dom = $this->getDomForXml($xml); $innerContent = $this->getInnerXmlFragmentFromDom($dom); $results = $this->parseXml($dom->saveXML($innerContent)); - if (empty($results['features'])) { - throw new \Exception("Could not process passage"); - } } elseif ($this->isEmptyAllowed()) { $results = $this->parseXml($xml); } else { @@ -124,6 +121,10 @@ public function parseWithRubricBlockComponent(RubricBlock $rubricBlock) } } + if (empty($results['features'])) { + throw new MappingException("Could not process passage"); + } + return $results; }