Skip to content
Snippets Groups Projects
Commit ec208346 authored by srosse's avatar srosse
Browse files

no-jira: use the "no" score accounting in course preview

parent bebccd26
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,8 @@ import org.olat.course.run.RunMainController;
import org.olat.course.run.environment.CourseEnvironment;
import org.olat.course.run.navigation.NavigationHandler;
import org.olat.course.run.navigation.NodeClickedRef;
import org.olat.course.run.scoring.NoEvaluationAccounting;
import org.olat.course.run.scoring.ScoreAccounting;
import org.olat.course.run.userview.UserCourseEnvironment;
import org.olat.course.run.userview.UserCourseEnvironmentImpl;
import org.olat.group.BusinessGroup;
......@@ -92,8 +94,9 @@ public class PreviewRunController extends MainLayoutBasicController {
luTree = new MenuTree(null, "luTreeRun", this);
luTree.setScrollTopOnClick(true);
// build up the running structure for this user;
uce = new UserCourseEnvironmentImpl(identEnv, cenv);
// build up the running structure for this user
ScoreAccounting noScoreAccounting = new NoEvaluationAccounting();
uce = new UserCourseEnvironmentImpl(identEnv, cenv, noScoreAccounting);
navHandler = new NavigationHandler(uce, null, true);
// evaluate scoring
......@@ -149,11 +152,7 @@ public class PreviewRunController extends MainLayoutBasicController {
}
return sb.toString();
}
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
* org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
*/
@Override
public void event(UserRequest ureq, Component source, Event event) {
if (source == luTree) {
......@@ -206,10 +205,7 @@ public class PreviewRunController extends MainLayoutBasicController {
}
}
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
* org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
*/
@Override
public void event(UserRequest ureq, Controller source, Event event) {
if (source == currentNodeController) {
......@@ -266,9 +262,6 @@ public class PreviewRunController extends MainLayoutBasicController {
return true;
}
/**
* @see org.olat.core.gui.control.DefaultController#doDispose(boolean)
*/
@Override
protected void doDispose() {
if (currentNodeController != null) {
......
......@@ -84,6 +84,18 @@ public class UserCourseEnvironmentImpl implements UserCourseEnvironment {
courseReadOnly = courseEnvironment.getCourseGroupManager().getCourseEntry().getEntryStatus() == RepositoryEntryStatusEnum.closed;
}
}
/**
* Constructor used for previewing the course.
*
* @param identityEnvironment The identity environment
* @param courseEnvironment The course environment
* @param scoreAccounting Fix the score accounting implementation
*/
public UserCourseEnvironmentImpl(IdentityEnvironment identityEnvironment, CourseEnvironment courseEnvironment, ScoreAccounting scoreAccounting) {
this(identityEnvironment, courseEnvironment, null, null, null, null, null, null, null, null);
this.scoreAccounting = scoreAccounting;
}
public UserCourseEnvironmentImpl(IdentityEnvironment identityEnvironment, CourseEnvironment courseEnvironment, Boolean courseReadOnly) {
this(identityEnvironment, courseEnvironment, null, null, null, null, null, null, null, courseReadOnly);
......@@ -161,7 +173,7 @@ public class UserCourseEnvironmentImpl implements UserCourseEnvironment {
}
private void initScoreAccounting() {
scoreAccounting = isParticipant()? new AssessmentAccounting(this): new NoEvaluationAccounting();
scoreAccounting = isParticipant() ? new AssessmentAccounting(this): new NoEvaluationAccounting();
}
@Override
......
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