Search in sources :

Example 6 with ImsRepositoryResolver

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;
    }
}
Also used : Resolver(org.olat.ims.qti.process.Resolver) ImsRepositoryResolver(org.olat.ims.qti.process.ImsRepositoryResolver) OLATRuntimeException(org.olat.core.logging.OLATRuntimeException) ImsRepositoryResolver(org.olat.ims.qti.process.ImsRepositoryResolver)

Aggregations

ImsRepositoryResolver (org.olat.ims.qti.process.ImsRepositoryResolver)6 Resolver (org.olat.ims.qti.process.Resolver)4 Date (java.util.Date)2 JSAndCSSComponent (org.olat.core.gui.components.htmlheader.jscss.JSAndCSSComponent)2 ProgressBar (org.olat.core.gui.components.progressbar.ProgressBar)2 VelocityContainer (org.olat.core.gui.components.velocity.VelocityContainer)2 WindowControl (org.olat.core.gui.control.WindowControl)2 OLATResourceable (org.olat.core.id.OLATResourceable)2 Roles (org.olat.core.id.Roles)2 AssertException (org.olat.core.logging.AssertException)2 OLATRuntimeException (org.olat.core.logging.OLATRuntimeException)2 Formatter (org.olat.core.util.Formatter)2 QTIChangeLogMessage (org.olat.ims.qti.QTIChangeLogMessage)2 AssessmentContext (org.olat.ims.qti.container.AssessmentContext)2 SectionContext (org.olat.ims.qti.container.SectionContext)2 Navigator (org.olat.ims.qti.navigator.Navigator)2 AssessmentInstance (org.olat.ims.qti.process.AssessmentInstance)2 RepositoryEntry (org.olat.repository.RepositoryEntry)2