Skip to content

Commit

Permalink
[FEAT] QTI import: throw exception for sharedpassage issues in all cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Trungtin Ton committed Aug 17, 2017
1 parent b6745df commit 5a4b086
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Processors/QtiV2/In/SharedPassageMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,17 @@ 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 <rubricBlock> passage");
}
} elseif ($this->isEmptyAllowed()) {
$results = $this->parseXml($xml);
} else {
throw new MappingException('No content found; cannot create sharedpassage (isEmptyAllowed=false)');
}
}

if (empty($results['features'])) {
throw new MappingException("Could not process <rubricBlock> passage");
}

return $results;
}

Expand Down

0 comments on commit 5a4b086

Please sign in to comment.