use of org.olat.course.Structure in project OpenOLAT by OpenOLAT.
the class AssessmentNotificationsHandler method getCourseTestNodes.
/**
* Utility method.<br>
* Build (recursively) the list of all test nodes belonging to the specified
* <code>ICourse</code>.<br>
* The returned <code>List</code> is empty if course has no
* AssessableCourseNode. Structure course node are excluded from the list.<br>
* <br>
* <b>PRE CONDITIONS</b>
* <ul>
* <li> <code>course != null</code>
* </ul>
* <br>
* <b>POST CONDITIONS</b>
* <ul>
* <li> The returned list, if not empty, contains ONLY instances of type
* <code>AssessableCourseNode</code>
* </ul>
*/
private List<AssessableCourseNode> getCourseTestNodes(ICourse course) {
List<AssessableCourseNode> assessableNodes = new ArrayList<AssessableCourseNode>();
Structure courseStruct = course.getRunStructure();
CourseNode rootNode = courseStruct.getRootNode();
getCourseTestNodes(rootNode, assessableNodes);
return assessableNodes;
}
use of org.olat.course.Structure in project OpenOLAT by OpenOLAT.
the class DENCourseNodeNotificationHandler method getCourseDENNodes.
/**
* @param course
* @return
*/
private List<DENCourseNode> getCourseDENNodes(ICourse course) {
List<DENCourseNode> denNodes = new ArrayList<DENCourseNode>(10);
Structure courseStruct = course.getRunStructure();
CourseNode rootNode = courseStruct.getRootNode();
getCourseDENNodes(rootNode, denNodes);
return denNodes;
}
use of org.olat.course.Structure in project OpenOLAT by OpenOLAT.
the class PublishProcess method calculatePublishSet.
/**
* @param nodesIdsToPublish
* @param resultingCourseRun
* @param editorModelDeletedNodes
* @param editorModelInsertedNodes
* @param editorModelModifiedNodes
*/
private void calculatePublishSet(List<String> nodesIdsToPublish) {
/*
* START NEW STYLE PUBLISH ................................................. -
* visit each node (breadth first) - if node is selected to be published ->
* publish and take into account if the node exists already in the
* runstructure (keep ident or not). And also if node should get deleted add
* it to a list of nodes to be deleted. This is needed for a later clean-up
* and archive. ............................. - if node is not selected to
* be published, but exists already in the runstructure it must be added to
* the tmp-runstructure as it is in the existing runstructure.
* ..................................................
*/
// start point for node publish visitor
CourseEditorTreeNode editorRoot = (CourseEditorTreeNode) editorTreeModel.getRootNode();
// the active runstructure and the new created runstructure
Structure existingCourseRun = course.getRunStructure();
// breadth first!
boolean visitChildrenFirst = false;
/*
* the tree is visited and the book keeping lists are filled. the visitor
* itself does not delete or modify neither runstructure nor editor tree
* model. The whole complexity of published is encapsulated in the visitor.
*/
Visitor nodePublishV = new NodePublishVisitor(editorRoot, nodesIdsToPublish, existingCourseRun);
TreeVisitor tv = new TreeVisitor(nodePublishV, editorRoot, visitChildrenFirst);
tv.visitAll();
}
use of org.olat.course.Structure in project openolat by klemens.
the class BulkAssessmentOverviewController method reloadTaskModel.
private void reloadTaskModel() {
List<Task> tasks = taskManager.getTasks(courseEntry.getOlatResource());
List<TaskData> taskDatas = new ArrayList<TaskData>(tasks.size());
ICourse course = CourseFactory.loadCourse(courseEntry);
Structure structure = course.getRunStructure();
for (Task task : tasks) {
String fullName = null;
if (task.getCreator() != null) {
fullName = userManager.getUserDisplayName(task.getCreator());
}
BulkAssessmentTask runnable = taskManager.getPersistedRunnableTask(task, BulkAssessmentTask.class);
AssessableCourseNode courseNode = (AssessableCourseNode) structure.getNode(runnable.getCourseNodeIdent());
taskDatas.add(new TaskData(task, runnable, courseNode, fullName));
}
taskModel.setObjects(taskDatas);
taskListEl.reset();
flc.contextPut("hasScheduledTasks", Boolean.valueOf(taskDatas.size() > 0));
}
use of org.olat.course.Structure in project openolat by klemens.
the class CourseEditorTreeModel method createStructureForPreview.
/**
* @return a deep clone of the current (run) structure of this editortreemodel
*/
public Structure createStructureForPreview() {
CourseEditorTreeNode cetn = (CourseEditorTreeNode) getRootNode();
CourseNode clone = buildUp(cetn);
Structure structure = new Structure();
structure.setRootNode(clone);
return structure;
}
Aggregations