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
}
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);
}
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;
}
Aggregations