Search in sources :

Example 1 with Structure

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;
}
Also used : AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) ArrayList(java.util.ArrayList) CourseNode(org.olat.course.nodes.CourseNode) STCourseNode(org.olat.course.nodes.STCourseNode) AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) ScormCourseNode(org.olat.course.nodes.ScormCourseNode) Structure(org.olat.course.Structure)

Example 2 with Structure

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;
}
Also used : ArrayList(java.util.ArrayList) CourseNode(org.olat.course.nodes.CourseNode) DENCourseNode(de.bps.course.nodes.DENCourseNode) Structure(org.olat.course.Structure) DENCourseNode(de.bps.course.nodes.DENCourseNode)

Example 3 with Structure

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();
}
Also used : TreeVisitor(org.olat.core.util.tree.TreeVisitor) TreeVisitor(org.olat.core.util.tree.TreeVisitor) Visitor(org.olat.core.util.tree.Visitor) CourseEditorTreeNode(org.olat.course.tree.CourseEditorTreeNode) Structure(org.olat.course.Structure)

Example 4 with Structure

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));
}
Also used : AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) Task(org.olat.core.commons.services.taskexecutor.Task) BulkAssessmentTask(org.olat.course.assessment.manager.BulkAssessmentTask) ArrayList(java.util.ArrayList) ICourse(org.olat.course.ICourse) BulkAssessmentTask(org.olat.course.assessment.manager.BulkAssessmentTask) Structure(org.olat.course.Structure)

Example 5 with Structure

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;
}
Also used : CourseNode(org.olat.course.nodes.CourseNode) Structure(org.olat.course.Structure)

Aggregations

Structure (org.olat.course.Structure)22 ICourse (org.olat.course.ICourse)8 CourseNode (org.olat.course.nodes.CourseNode)8 CourseEditorTreeNode (org.olat.course.tree.CourseEditorTreeNode)8 ArrayList (java.util.ArrayList)6 CourseGroupManager (org.olat.course.groupsandrights.CourseGroupManager)6 RepositoryEntry (org.olat.repository.RepositoryEntry)6 HashSet (java.util.HashSet)4 AssessmentManager (org.olat.course.assessment.AssessmentManager)4 UserNodeAuditManager (org.olat.course.auditing.UserNodeAuditManager)4 CourseConfig (org.olat.course.config.CourseConfig)4 AssessableCourseNode (org.olat.course.nodes.AssessableCourseNode)4 CoursePropertyManager (org.olat.course.properties.CoursePropertyManager)4 BusinessGroup (org.olat.group.BusinessGroup)4 BGArea (org.olat.group.area.BGArea)4 DENCourseNode (de.bps.course.nodes.DENCourseNode)2 File (java.io.File)2 FileInputStream (java.io.FileInputStream)2 FileNotFoundException (java.io.FileNotFoundException)2 Date (java.util.Date)2