use of org.olat.ims.qti.process.ImsRepositoryResolver in project openolat by klemens.
the class OnyxModule method isOnyxTest.
public static boolean isOnyxTest(final OLATResourceable res) {
if (res.getResourceableTypeName().equals(TestFileResource.TYPE_NAME) || res.getResourceableTypeName().equals(SurveyFileResource.TYPE_NAME)) {
Long resourceId = res.getResourceableId();
Boolean onyx = onyxMap.get(resourceId);
if (onyx == null) {
onyx = Boolean.FALSE;
try {
final Resolver resolver = new ImsRepositoryResolver(res);
// search for qti.xml, it not exists for qti2
if (resolver.getQTIDocument() == null) {
onyx = Boolean.TRUE;
} else {
onyx = Boolean.FALSE;
}
} catch (OLATRuntimeException e) {
log.error("", e);
}
onyxMap.put(resourceId, onyx);
}
return onyx.booleanValue();
} else {
return false;
}
}
Aggregations