use of org.olat.course.nodes.CourseNodeConfiguration in project OpenOLAT by OpenOLAT.
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 OpenOLAT.
the class PublishProcess method assemblePublishConfirmation.
String assemblePublishConfirmation() {
List<String> nodeIdsToPublish = originalNodeIdsToPublish;
StringBuilder msg = new StringBuilder();
OLATResourceable courseRunOres = OresHelper.createOLATResourceableInstance(RunMainController.ORES_TYPE_COURSE_RUN, repositoryEntry.getOlatResource().getResourceableId());
// -1: Remove myself from list
int cnt = CoordinatorManager.getInstance().getCoordinator().getEventBus().getListeningIdentityCntFor(courseRunOres) - 1;
if (cnt > 0) {
msg.append(translate("pbl.confirm.users", String.valueOf(cnt)));
} else {
msg.append(translator.translate("pbl.confirm"));
}
if (nodeIdsToPublish != null && nodeIdsToPublish.size() > 0) {
msg.append("<ul class='list-unstyled'>");
CourseEditorTreeModel cetm = course.getEditorTreeModel();
for (int i = 0; i < nodeIdsToPublish.size(); i++) {
msg.append("<li>");
String nodeId = nodeIdsToPublish.get(i);
CourseEditorTreeNode cetn = (CourseEditorTreeNode) cetm.getNodeById(nodeId);
CourseNode cn = cetm.getCourseNode(nodeId);
if (cetn.isDeleted() && !cetn.isNewnode()) {
msg.append("<i class='o_icon o_icon_delete_item'> </i> ");
} else {
CourseNodeConfiguration nodeConfig = CourseNodeFactory.getInstance().getCourseNodeConfigurationEvenForDisabledBB(cn.getType());
if (nodeConfig != null) {
msg.append("<i class='o_icon ").append(nodeConfig.getIconCSSClass()).append("'> </i> ");
}
}
msg.append(cn.getShortTitle()).append("</li>");
}
msg.append("</ul>");
}
return msg.toString();
}
use of org.olat.course.nodes.CourseNodeConfiguration in project OpenOLAT by OpenOLAT.
the class EditorMainController method initNodeEditor.
/**
* Initializes the node edit tabbed pane and its controller for this
* particular node
*
* @param ureq
* @param chosenNode
* @param groupMgr
*/
private void initNodeEditor(UserRequest ureq, CourseNode chosenNode) {
ICourse course = CourseFactory.getCourseEditSession(ores.getResourceableId());
tabbedNodeConfig.removeAll();
// dispose old one, if there was one
removeAsListenerAndDispose(nodeEditCntrllr);
String type = chosenNode.getType();
CourseNodeConfiguration cnConfig = CourseNodeFactory.getInstance().getCourseNodeConfigurationEvenForDisabledBB(type);
if (cnConfig.isEnabled()) {
nodeEditCntrllr = chosenNode.createEditController(ureq, getWindowControl(), stackPanel, course, euce);
listenTo(nodeEditCntrllr);
nodeEditCntrllr.addTabs(tabbedNodeConfig);
}
boolean disabled = !cnConfig.isEnabled();
boolean deprecated = cnConfig.isDeprecated();
main.contextPut("courseNodeDisabled", disabled);
main.contextPut("courseNodeDeprecated", deprecated);
alternativeLink.setVisible((disabled || deprecated) && !cnConfig.getAlternativeCourseNodes().isEmpty());
alternativeLink.setUserObject(chosenNode);
String nodeCssClass = null;
if (this.cetm.getRootNode().getIdent().equals(chosenNode.getIdent())) {
// Special case for root node
nodeCssClass = "o_CourseModule_icon";
} else {
nodeCssClass = cnConfig.getIconCSSClass();
}
main.contextPut("courseNodeCss", nodeCssClass);
main.contextPut("courseNode", chosenNode);
}
use of org.olat.course.nodes.CourseNodeConfiguration in project OpenOLAT by OpenOLAT.
the class MultiSPController method createCourseNode.
private CourseNode createCourseNode(VFSItem item, String type) {
CourseNodeConfiguration newNodeConfig = CourseNodeFactory.getInstance().getCourseNodeConfiguration(type);
CourseNode newNode = newNodeConfig.getInstance();
newNode.setShortTitle(item.getName());
newNode.setLearningObjectives(item.getName());
newNode.setNoAccessExplanation("You don't have access");
return newNode;
}
use of org.olat.course.nodes.CourseNodeConfiguration in project OpenOLAT by OpenOLAT.
the class ChooseNodeController method doCreateNode.
private void doCreateNode(String type) {
ICourse course = CourseFactory.getCourseEditSession(courseOres.getResourceableId());
// user chose a position to insert a new node
CourseNodeConfiguration newNodeConfig = CourseNodeFactory.getInstance().getCourseNodeConfiguration(type);
createdNode = newNodeConfig.getInstance();
// Set some default values
String title = new String(newNodeConfig.getLinkText(getLocale()));
createdNode.setShortTitle(title);
createdNode.setNoAccessExplanation(translate("form.noAccessExplanation.default"));
// Insert it now
CourseEditorTreeModel editorTreeModel = course.getEditorTreeModel();
if (editorTreeModel.getRootNode().equals(currentNode)) {
// root, add as last child
int pos = currentNode.getChildCount();
CourseNode selectedNode = currentNode.getCourseNode();
editorTreeModel.insertCourseNodeAt(createdNode, selectedNode, pos);
} else {
CourseEditorTreeNode parentNode = (CourseEditorTreeNode) currentNode.getParent();
CourseNode selectedNode = parentNode.getCourseNode();
int pos = currentNode.getPosition();
editorTreeModel.insertCourseNodeAt(createdNode, selectedNode, pos + 1);
}
CourseFactory.saveCourseEditorTreeModel(course.getResourceableId());
}
Aggregations