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

OO-3016: only calculate high score and certification link if they are shown in UI

parent 00e14ad8
No related branches found
No related tags found
No related merge requests found
......@@ -97,7 +97,7 @@ public class STCourseNodeRunController extends BasicController {
myContent = createVelocityContainer("run");
myContent.setDomReplacementWrapperRequired(false); // we provide our own DOM replacement ID
if (se != null){
if (se != null && (stCourseNode.hasScoreConfigured() || stCourseNode.hasPassedConfigured())) {
HighScoreRunController highScoreCtr = new HighScoreRunController(ureq, wControl, userCourseEnv, stCourseNode);
if (highScoreCtr.isViewHighscore()) {
Component highScoreComponent = highScoreCtr.getInitialComponent();
......@@ -175,10 +175,12 @@ public class STCourseNodeRunController extends BasicController {
myContent.contextPut("hasScore", new Boolean(stCourseNode.hasScoreConfigured()));
myContent.contextPut("hasPassed", new Boolean(stCourseNode.hasPassedConfigured()));
CourseConfig cc = userCourseEnv.getCourseEnvironment().getCourseConfig();
if((cc.isEfficencyStatementEnabled() || cc.isCertificateEnabled())
&& userCourseEnv.hasEfficiencyStatementOrCertificate(false)) {
certificationLink = LinkFactory.createButton("certification", myContent, this);
if(stCourseNode.hasScoreConfigured() || stCourseNode.hasPassedConfigured()) {
CourseConfig cc = userCourseEnv.getCourseEnvironment().getCourseConfig();
if((cc.isEfficencyStatementEnabled() || cc.isCertificateEnabled())
&& userCourseEnv.hasEfficiencyStatementOrCertificate(false)) {
certificationLink = LinkFactory.createButton("certification", myContent, this);
}
}
}
......
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