Skip to content
Snippets Groups Projects
Commit 1a16dc32 authored by uhensler's avatar uhensler
Browse files

OO-4315: Hide learning path progress in conventional course

parent ac636647
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,7 @@ import org.olat.course.editor.ConditionAccessEditConfig;
import org.olat.course.nodeaccess.NodeAccessProvider;
import org.olat.course.nodes.AbstractAccessableCourseNode;
import org.olat.course.nodes.CourseNode;
import org.olat.course.run.CoursePaginationController;
import org.olat.course.run.userview.CourseTreeModelBuilder;
import org.olat.course.run.userview.UserCourseEnvironment;
import org.olat.course.tree.CourseEditorTreeModel;
......@@ -89,6 +90,11 @@ public class ConditionNodeAccessProvider implements NodeAccessProvider {
return "";
}
@Override
public CoursePaginationController getCoursePaginationController(UserRequest ureq, WindowControl wControl) {
return null;
}
@Override
public CourseTreeModelBuilder getCourseTreeModelBuilder(UserCourseEnvironment userCourseEnv) {
return new ConditionCourseTreeModelBuilder(userCourseEnv);
......
......@@ -35,6 +35,7 @@ import org.olat.course.learningpath.ui.LearningPathNodeConfigController;
import org.olat.course.learningpath.ui.TabbableLeaningPathNodeConfigController;
import org.olat.course.nodeaccess.NodeAccessProvider;
import org.olat.course.nodes.CourseNode;
import org.olat.course.run.CoursePaginationController;
import org.olat.course.run.userview.CourseTreeModelBuilder;
import org.olat.course.run.userview.UserCourseEnvironment;
import org.olat.course.tree.CourseEditorTreeModel;
......@@ -98,6 +99,11 @@ public class LearningPathNodeAccessProvider implements NodeAccessProvider {
return "o_lp_tree";
}
@Override
public CoursePaginationController getCoursePaginationController(UserRequest ureq, WindowControl wControl) {
return new CoursePaginationController(ureq, wControl);
}
@Override
public CourseTreeModelBuilder getCourseTreeModelBuilder(UserCourseEnvironment userCourseEnv) {
return new LearningPathCourseTreeModelBuilder(userCourseEnv);
......
......@@ -24,6 +24,7 @@ import org.olat.core.gui.control.WindowControl;
import org.olat.core.gui.control.generic.tabbable.TabbableController;
import org.olat.course.ICourse;
import org.olat.course.nodes.CourseNode;
import org.olat.course.run.CoursePaginationController;
import org.olat.course.run.userview.CourseTreeModelBuilder;
import org.olat.course.run.userview.UserCourseEnvironment;
import org.olat.course.tree.CourseEditorTreeModel;
......@@ -47,6 +48,8 @@ public interface NodeAccessProvider extends NodeAccessProviderIdentifier {
public String getCourseTreeCssClass();
public CoursePaginationController getCoursePaginationController(UserRequest ureq, WindowControl wControl);
public CourseTreeModelBuilder getCourseTreeModelBuilder(UserCourseEnvironment userCourseEnv);
public boolean onNodeVisited(CourseNode courseNode, UserCourseEnvironment userCourseEnvironment);
......
......@@ -27,6 +27,7 @@ import org.olat.core.gui.control.WindowControl;
import org.olat.core.gui.control.generic.tabbable.TabbableController;
import org.olat.course.ICourse;
import org.olat.course.nodes.CourseNode;
import org.olat.course.run.CoursePaginationController;
import org.olat.course.run.userview.CourseTreeModelBuilder;
import org.olat.course.run.userview.UserCourseEnvironment;
import org.olat.course.tree.CourseEditorTreeModel;
......@@ -76,6 +77,16 @@ public interface NodeAccessService {
* @return
*/
public String getCourseTreeCssClass(NodeAccessType type);
/**
* Controller to navigate to the next and the previous course node.
*
* @param ureq
* @param wControl
* @param type
* @return
*/
public CoursePaginationController getCoursePaginationController(UserRequest ureq, WindowControl wControl, NodeAccessType type);
/**
* Builder to build the TreeModel of the complete course run structure.
......
......@@ -33,6 +33,7 @@ import org.olat.course.nodeaccess.NodeAccessProviderIdentifier;
import org.olat.course.nodeaccess.NodeAccessService;
import org.olat.course.nodeaccess.NodeAccessType;
import org.olat.course.nodes.CourseNode;
import org.olat.course.run.CoursePaginationController;
import org.olat.course.run.navigation.NodeVisitedListener;
import org.olat.course.run.userview.CourseTreeModelBuilder;
import org.olat.course.run.userview.UserCourseEnvironment;
......@@ -101,6 +102,11 @@ public class NodeAccessServiceImpl implements NodeAccessService, NodeVisitedList
public String getCourseTreeCssClass(NodeAccessType type) {
return getNodeAccessProvider(type).getCourseTreeCssClass();
}
@Override
public CoursePaginationController getCoursePaginationController(UserRequest ureq, WindowControl wControl, NodeAccessType type) {
return getNodeAccessProvider(type).getCoursePaginationController(ureq, wControl);
}
@Override
public CourseTreeModelBuilder getCourseTreeModelBuilder(UserCourseEnvironment userCourseEnv) {
......
......@@ -40,8 +40,12 @@ public class CourseContentController extends BasicController {
Component row2) {
super(ureq, wControl);
mainVC = createVelocityContainer("content");
mainVC.put("row1", row1);
mainVC.put("row2", row2);
if (row1 != null) {
mainVC.put("row1", row1);
}
if (row2 != null) {
mainVC.put("row2", row2);
}
putInitialPanel(mainVC);
}
......
......@@ -186,12 +186,14 @@ public class RunMainController extends MainLayoutBasicController implements Gene
luTree = new MenuTree(null, "luTreeRun", this);
luTree.setScrollTopOnClick(true);
luTree.setExpandSelectedNode(false);
String treeCssClass =nodeAccessService.getCourseTreeCssClass(NodeAccessType.of(course));
String treeCssClass = nodeAccessService.getCourseTreeCssClass(NodeAccessType.of(course));
luTree.setElementCssClass("o_course_menu " + treeCssClass);
contentP = new Panel("building_block_content");
paginationCtrl = new CoursePaginationController(ureq, getWindowControl());
listenTo(paginationCtrl);
paginationCtrl = nodeAccessService.getCoursePaginationController(ureq, getWindowControl(), NodeAccessType.of(course));
if (paginationCtrl != null) {
listenTo(paginationCtrl);
}
// build up the running structure for this user
// get all group memberships for this course
......@@ -226,6 +228,7 @@ public class RunMainController extends MainLayoutBasicController implements Gene
layoutTree = null;
}
Component paginationCmp = paginationCtrl != null? paginationCtrl.getInitialComponent(): null;
if (glossaryMarkerCtr != null) {
listenTo(glossaryMarkerCtr);
// enable / disable glossary highlighting according to user prefs
......@@ -242,11 +245,10 @@ public class RunMainController extends MainLayoutBasicController implements Gene
} else {
glossaryMarkerCtr.setTextMarkingEnabled(state.booleanValue());
}
contentCtrl = new CourseContentController(ureq, getWindowControl(), paginationCtrl.getInitialComponent(),
contentCtrl = new CourseContentController(ureq, getWindowControl(), paginationCmp,
glossaryMarkerCtr.getInitialComponent());
} else {
contentCtrl = new CourseContentController(ureq, getWindowControl(), paginationCtrl.getInitialComponent(),
contentP);
contentCtrl = new CourseContentController(ureq, getWindowControl(), paginationCmp, contentP);
}
columnLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), layoutTree,
contentCtrl.getInitialComponent(), "courseRun" + course.getResourceableId());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment