Search in sources :

Example 26 with BadResourceException

use of uk.ac.ed.ph.jqtiplus.provision.BadResourceException in project openolat by klemens.

the class QTI21StatisticResourceResult method buildRecursively.

private TreeNode buildRecursively(AssessmentItemRef itemRef, TreeNode parentNode) {
    GenericTreeNode itemNode = new GenericTreeNode();
    ResolvedAssessmentItem resolvedAssessmentItem = resolvedAssessmentTest.getResolvedAssessmentItem(itemRef);
    BadResourceException ex = resolvedAssessmentItem.getItemLookup().getBadResourceException();
    if (ex == null) {
        AssessmentItem assessmentItem = resolvedAssessmentItem.getItemLookup().getRootNodeHolder().getRootNode();
        itemNode.setTitle(assessmentItem.getTitle());
        QTI21QuestionType type = QTI21QuestionType.getTypeRelax(assessmentItem);
        if (type != null) {
            itemNode.setIconCssClass("o_icon ".concat(type.getCssClass()));
        } else {
            itemNode.setIconCssClass("o_icon o_mi_qtiunkown");
        }
        itemNode.setUserObject(itemRef);
        parentNode.addChild(itemNode);
    }
    return itemNode;
}
Also used : BadResourceException(uk.ac.ed.ph.jqtiplus.provision.BadResourceException) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) ResolvedAssessmentItem(uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentItem) QTI21QuestionType(org.olat.ims.qti21.model.QTI21QuestionType) ResolvedAssessmentItem(uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentItem) AssessmentItem(uk.ac.ed.ph.jqtiplus.node.item.AssessmentItem)

Aggregations

BadResourceException (uk.ac.ed.ph.jqtiplus.provision.BadResourceException)26 PathResourceLocator (org.olat.fileresource.types.ImsQTI21Resource.PathResourceLocator)20 JqtiExtensionManager (uk.ac.ed.ph.jqtiplus.JqtiExtensionManager)20 AssessmentObjectXmlLoader (uk.ac.ed.ph.jqtiplus.reading.AssessmentObjectXmlLoader)20 QtiXmlReader (uk.ac.ed.ph.jqtiplus.reading.QtiXmlReader)20 ResourceLocator (uk.ac.ed.ph.jqtiplus.xmlutils.locators.ResourceLocator)20 ItemValidationResult (uk.ac.ed.ph.jqtiplus.validation.ItemValidationResult)14 File (java.io.File)10 URISyntaxException (java.net.URISyntaxException)10 ResolvedAssessmentItem (uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentItem)10 IOException (java.io.IOException)8 URL (java.net.URL)8 Test (org.junit.Test)8 AssessmentItem (uk.ac.ed.ph.jqtiplus.node.item.AssessmentItem)8 TestValidationResult (uk.ac.ed.ph.jqtiplus.validation.TestValidationResult)8 InputStream (java.io.InputStream)6 Writer (java.io.Writer)6 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)6 SAXParser (javax.xml.parsers.SAXParser)6 XMLOutputFactory (javax.xml.stream.XMLOutputFactory)6