use of uk.ac.ed.ph.jqtiplus.reading.QtiObjectReader in project OpenOLAT by OpenOLAT.
the class QTI21ServiceImpl method getAssessmentResult.
@Override
public AssessmentResult getAssessmentResult(AssessmentTestSession candidateSession) {
File assessmentResultFile = getAssessmentResultFile(candidateSession);
ResourceLocator fileResourceLocator = new PathResourceLocator(assessmentResultFile.getParentFile().toPath());
ResourceLocator inputResourceLocator = ImsQTI21Resource.createResolvingResourceLocator(fileResourceLocator);
URI assessmentResultUri = assessmentResultFile.toURI();
QtiObjectReader qtiObjectReader = qtiXmlReader().createQtiObjectReader(inputResourceLocator, false, false);
try {
QtiObjectReadResult<AssessmentResult> result = qtiObjectReader.lookupRootNode(assessmentResultUri, AssessmentResult.class);
return result.getRootNode();
} catch (XmlResourceNotFoundException | QtiXmlInterpretationException | ClassCastException e) {
log.error("", e);
return null;
}
}
use of uk.ac.ed.ph.jqtiplus.reading.QtiObjectReader in project openolat by klemens.
the class QTI21ServiceImpl method getAssessmentResult.
@Override
public AssessmentResult getAssessmentResult(AssessmentTestSession candidateSession) {
File assessmentResultFile = getAssessmentResultFile(candidateSession);
ResourceLocator fileResourceLocator = new PathResourceLocator(assessmentResultFile.getParentFile().toPath());
ResourceLocator inputResourceLocator = ImsQTI21Resource.createResolvingResourceLocator(fileResourceLocator);
URI assessmentResultUri = assessmentResultFile.toURI();
QtiObjectReader qtiObjectReader = qtiXmlReader().createQtiObjectReader(inputResourceLocator, false, false);
try {
QtiObjectReadResult<AssessmentResult> result = qtiObjectReader.lookupRootNode(assessmentResultUri, AssessmentResult.class);
return result.getRootNode();
} catch (XmlResourceNotFoundException | QtiXmlInterpretationException | ClassCastException e) {
log.error("", e);
return null;
}
}
Aggregations