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

OO-2736: show change log if score is visible

parent 295a0c67
No related branches found
No related tags found
No related merge requests found
...@@ -42,7 +42,6 @@ import org.olat.core.gui.control.generic.iframe.IFrameDisplayController; ...@@ -42,7 +42,6 @@ import org.olat.core.gui.control.generic.iframe.IFrameDisplayController;
import org.olat.core.gui.media.MediaResource; import org.olat.core.gui.media.MediaResource;
import org.olat.core.gui.media.NotFoundMediaResource; import org.olat.core.gui.media.NotFoundMediaResource;
import org.olat.core.gui.translator.Translator; import org.olat.core.gui.translator.Translator;
import org.olat.core.id.Identity;
import org.olat.core.id.OLATResourceable; import org.olat.core.id.OLATResourceable;
import org.olat.core.logging.activity.ThreadLocalUserActivityLogger; import org.olat.core.logging.activity.ThreadLocalUserActivityLogger;
import org.olat.core.util.Formatter; import org.olat.core.util.Formatter;
...@@ -227,6 +226,7 @@ public class QTI21AssessmentRunController extends BasicController implements Gen ...@@ -227,6 +226,7 @@ public class QTI21AssessmentRunController extends BasicController implements Gen
mainVC.contextPut("hasPassedValue", (scoreEval.getPassed() == null ? Boolean.FALSE : Boolean.TRUE)); mainVC.contextPut("hasPassedValue", (scoreEval.getPassed() == null ? Boolean.FALSE : Boolean.TRUE));
mainVC.contextPut("passed", scoreEval.getPassed()); mainVC.contextPut("passed", scoreEval.getPassed());
mainVC.contextPut("attempts", attempts); //at least one attempt mainVC.contextPut("attempts", attempts); //at least one attempt
mainVC.contextPut("showChangeLog", Boolean.TRUE);
} }
} else if(courseNode instanceof IQTESTCourseNode) { } else if(courseNode instanceof IQTESTCourseNode) {
IQTESTCourseNode testCourseNode = (IQTESTCourseNode)courseNode; IQTESTCourseNode testCourseNode = (IQTESTCourseNode)courseNode;
...@@ -238,6 +238,7 @@ public class QTI21AssessmentRunController extends BasicController implements Gen ...@@ -238,6 +238,7 @@ public class QTI21AssessmentRunController extends BasicController implements Gen
mainVC.contextPut("passed", Boolean.FALSE); mainVC.contextPut("passed", Boolean.FALSE);
mainVC.contextPut("comment", null); mainVC.contextPut("comment", null);
mainVC.contextPut("attempts", 0); mainVC.contextPut("attempts", 0);
mainVC.contextPut("showChangeLog", Boolean.FALSE);
} else { } else {
Boolean passed = assessmentEntry.getPassed(); Boolean passed = assessmentEntry.getPassed();
//block if test passed (and config set to check it) //block if test passed (and config set to check it)
...@@ -248,7 +249,6 @@ public class QTI21AssessmentRunController extends BasicController implements Gen ...@@ -248,7 +249,6 @@ public class QTI21AssessmentRunController extends BasicController implements Gen
} }
mainVC.contextPut("blockAfterSuccess", blocked); mainVC.contextPut("blockAfterSuccess", blocked);
Identity identity = userCourseEnv.getIdentityEnvironment().getIdentity();
boolean resultsVisible = assessmentEntry.getUserVisibility() == null || assessmentEntry.getUserVisibility().booleanValue(); boolean resultsVisible = assessmentEntry.getUserVisibility() == null || assessmentEntry.getUserVisibility().booleanValue();
mainVC.contextPut("resultsVisible", resultsVisible); mainVC.contextPut("resultsVisible", resultsVisible);
mainVC.contextPut("score", AssessmentHelper.getRoundedScore(assessmentEntry.getScore())); mainVC.contextPut("score", AssessmentHelper.getRoundedScore(assessmentEntry.getScore()));
...@@ -262,11 +262,8 @@ public class QTI21AssessmentRunController extends BasicController implements Gen ...@@ -262,11 +262,8 @@ public class QTI21AssessmentRunController extends BasicController implements Gen
} }
Integer attempts = assessmentEntry.getAttempts(); Integer attempts = assessmentEntry.getAttempts();
mainVC.contextPut("attempts", attempts == null ? new Integer(0) : attempts); mainVC.contextPut("attempts", attempts == null ? new Integer(0) : attempts);
boolean showChangelog = (!anonym && resultsVisible && isResultVisible(config));
if(!anonym) { mainVC.contextPut("showChangeLog", showChangelog);
UserNodeAuditManager am = userCourseEnv.getCourseEnvironment().getAuditManager();
mainVC.contextPut("log", am.getUserNodeLog(courseNode, identity));
}
if(deliveryOptions.isDigitalSignature()) { if(deliveryOptions.isDigitalSignature()) {
AssessmentTestSession session = qtiService.getAssessmentTestSession(assessmentEntry.getAssessmentId()); AssessmentTestSession session = qtiService.getAssessmentTestSession(assessmentEntry.getAssessmentId());
...@@ -305,7 +302,7 @@ public class QTI21AssessmentRunController extends BasicController implements Gen ...@@ -305,7 +302,7 @@ public class QTI21AssessmentRunController extends BasicController implements Gen
} }
/** /**
* WARNING! The variables showResultsOnHomePage, showResultsVisible and showChangelog are not used * WARNING! The variables showResultsOnHomePage and showResultsVisible are not used
* in the velocity template and the CONFIG_KEY_RESULT_ON_HOME_PAGE is not editable * in the velocity template and the CONFIG_KEY_RESULT_ON_HOME_PAGE is not editable
* in the configuration of the course element for QTI 2.1!!!! * in the configuration of the course element for QTI 2.1!!!!
* *
...@@ -345,9 +342,10 @@ public class QTI21AssessmentRunController extends BasicController implements Gen ...@@ -345,9 +342,10 @@ public class QTI21AssessmentRunController extends BasicController implements Gen
} }
} }
UserNodeAuditManager am = userCourseEnv.getCourseEnvironment().getAuditManager(); if(!anonym) {
mainVC.contextPut("log", am.getUserNodeLog(courseNode, getIdentity())); UserNodeAuditManager am = userCourseEnv.getCourseEnvironment().getAuditManager();
mainVC.contextPut("showChangelog", showResultsOnHomePage); mainVC.contextPut("log", am.getUserNodeLog(courseNode, getIdentity()));
}
} }
private boolean isResultVisible(ModuleConfiguration modConfig) { private boolean isResultVisible(ModuleConfiguration modConfig) {
......
...@@ -169,8 +169,7 @@ ...@@ -169,8 +169,7 @@
<div class="o_button_group">$r.render("start")</div> <div class="o_button_group">$r.render("start")</div>
#end #end
#if($r.isNotNull($log) && $r.isNotNull($showChangeLog) && $showChangeLog)
#if($r.isNotNull($log)) ##&& $showChangelog (in QTI 1.2)
<div class="o_box"> <div class="o_box">
#o_togglebox_start("o_course_run_log" $r.translate("log.title")) #o_togglebox_start("o_course_run_log" $r.translate("log.title"))
<pre class="small">$log</pre> <pre class="small">$log</pre>
......
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