Search in sources :

Example 36 with CourseNodeConfiguration

use of org.olat.course.nodes.CourseNodeConfiguration in project openolat by klemens.

the class NodeEvaluation method build.

/**
 * 1. Calculate if the node should be accessible at all. <br/>
 * 2. If the coursenode is visible, build a treenode.
 */
public void build() {
    // if at least one access	capability is true
    for (Iterator<Boolean> iter = accesses.values().iterator(); iter.hasNext(); ) {
        Boolean entry = iter.next();
        atLeastOneAccessible = atLeastOneAccessible || entry.booleanValue();
    }
    // if the coursenode is visible, build a treenode
    if (isVisible()) {
        gtn = new GenericTreeNode(courseNode.getIdent());
        gtn.setTitle(courseNode.getShortTitle());
        gtn.setAltText(courseNode.getLongTitle());
        String type = courseNode.getType();
        CourseNodeConfiguration cnConfig = CourseNodeFactory.getInstance().getCourseNodeConfigurationEvenForDisabledBB(type);
        if (cnConfig != null) {
            String nodeCssClass = null;
            if (courseNode.getParent() == null) {
                // Spacial case for root node
                nodeCssClass = "o_CourseModule_icon";
            } else {
                nodeCssClass = cnConfig.getIconCSSClass();
            }
            gtn.setIconCssClass(nodeCssClass);
        }
        // the current NodeEval is set into the treenode
        gtn.setUserObject(this);
        // as the userobject
        // all treenodes added here are set to be visible/accessible, since the
        // invisible are not pushed by convention
        gtn.setAccessible(true);
    }
// else treenode is null
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) CourseNodeConfiguration(org.olat.course.nodes.CourseNodeConfiguration)

Example 37 with CourseNodeConfiguration

use of org.olat.course.nodes.CourseNodeConfiguration in project openolat by klemens.

the class QTIStatisticResourceResult method createAssessmentController.

private Controller createAssessmentController(UserRequest ureq, WindowControl wControl, TooledStackedPanel stackPanel, boolean printMode) {
    Controller ctrl;
    if (type == null) {
        Translator translator = Util.createPackageTranslator(QTI12AssessmentStatisticsController.class, ureq.getLocale());
        String text = translator.translate("error.notfound.text");
        ctrl = MessageUIFactory.createErrorMessage(ureq, wControl, null, text);
    } else if (type == QTIType.onyx) {
        ctrl = new QTI21OnyxAssessmentStatisticsController(ureq, wControl, this, printMode);
    } else {
        ctrl = new QTI12AssessmentStatisticsController(ureq, wControl, stackPanel, this, printMode);
    }
    CourseNodeConfiguration cnConfig = CourseNodeFactory.getInstance().getCourseNodeConfigurationEvenForDisabledBB(courseNode.getType());
    String iconCssClass = cnConfig.getIconCSSClass();
    return TitledWrapperHelper.getWrapper(ureq, wControl, ctrl, courseNode, iconCssClass);
}
Also used : QTI21OnyxAssessmentStatisticsController(org.olat.ims.qti.statistics.ui.QTI21OnyxAssessmentStatisticsController) Translator(org.olat.core.gui.translator.Translator) CourseNodeConfiguration(org.olat.course.nodes.CourseNodeConfiguration) QTI21OnyxAssessmentStatisticsController(org.olat.ims.qti.statistics.ui.QTI21OnyxAssessmentStatisticsController) QTI12ItemStatisticsController(org.olat.ims.qti.statistics.ui.QTI12ItemStatisticsController) Controller(org.olat.core.gui.control.Controller) QTI12AssessmentStatisticsController(org.olat.ims.qti.statistics.ui.QTI12AssessmentStatisticsController) QTI12AssessmentStatisticsController(org.olat.ims.qti.statistics.ui.QTI12AssessmentStatisticsController)

Example 38 with CourseNodeConfiguration

use of org.olat.course.nodes.CourseNodeConfiguration in project openolat by klemens.

the class QTI21StatisticResourceResult method createAssessmentController.

private Controller createAssessmentController(UserRequest ureq, WindowControl wControl, TooledStackedPanel stackPanel, boolean printMode) {
    Controller ctrl = new QTI21AssessmentTestStatisticsController(ureq, wControl, stackPanel, this, withFilter, printMode);
    if (courseNode != null) {
        CourseNodeConfiguration cnConfig = CourseNodeFactory.getInstance().getCourseNodeConfigurationEvenForDisabledBB(courseNode.getType());
        String iconCssClass = cnConfig.getIconCSSClass();
        ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, ctrl, courseNode, iconCssClass);
    }
    return ctrl;
}
Also used : CourseNodeConfiguration(org.olat.course.nodes.CourseNodeConfiguration) Controller(org.olat.core.gui.control.Controller)

Aggregations

CourseNodeConfiguration (org.olat.course.nodes.CourseNodeConfiguration)38 CourseNode (org.olat.course.nodes.CourseNode)16 ICourse (org.olat.course.ICourse)10 CourseEditorTreeNode (org.olat.course.tree.CourseEditorTreeNode)8 Controller (org.olat.core.gui.control.Controller)6 CourseEditorTreeModel (org.olat.course.tree.CourseEditorTreeModel)6 ArrayList (java.util.ArrayList)4 UriBuilder (javax.ws.rs.core.UriBuilder)4 HttpResponse (org.apache.http.HttpResponse)4 HttpGet (org.apache.http.client.methods.HttpGet)4 Before (org.junit.Before)4 Test (org.junit.Test)4 PublisherData (org.olat.core.commons.services.notifications.PublisherData)4 SubscriptionContext (org.olat.core.commons.services.notifications.SubscriptionContext)4 SubscriptionInfoVO (org.olat.core.commons.services.notifications.restapi.vo.SubscriptionInfoVO)4 SubscriptionListItemVO (org.olat.core.commons.services.notifications.restapi.vo.SubscriptionListItemVO)4 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)4 Identity (org.olat.core.id.Identity)4 STCourseNode (org.olat.course.nodes.STCourseNode)4 RepositoryEntry (org.olat.repository.RepositoryEntry)4