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

OO-4094: restrict access to change log for assessed users

parent e27e1ce3
No related branches found
No related tags found
No related merge requests found
......@@ -250,7 +250,7 @@ public abstract class GTAAbstractController extends BasicController implements G
resetTask(ureq, task);
nodeLog();
nodeLog(task);
collapsedContents(task);
}
......@@ -460,7 +460,7 @@ public abstract class GTAAbstractController extends BasicController implements G
return assignedTask;
}
protected void nodeLog() {
protected void nodeLog(@SuppressWarnings("unused") Task assignedTask) {
if(businessGroupTask) {
String groupLog = courseEnv.getAuditManager().getUserNodeLog(gtaNode, assessedGroup);
if(StringHelper.containsNonWhitespace(groupLog)) {
......
......@@ -67,6 +67,7 @@ import org.olat.course.nodes.gta.model.TaskDefinition;
import org.olat.course.nodes.gta.ui.events.SubmitEvent;
import org.olat.course.nodes.gta.ui.events.TaskMultiUserEvent;
import org.olat.course.nodes.ms.MSCourseNodeRunController;
import org.olat.course.run.scoring.AssessmentEvaluation;
import org.olat.course.run.userview.UserCourseEnvironment;
import org.olat.group.BusinessGroup;
import org.olat.modules.assessment.Role;
......@@ -696,17 +697,34 @@ public class GTAParticipantController extends GTAAbstractController implements A
}
@Override
protected void nodeLog() {
if(businessGroupTask) {
String userLog = courseEnv.getAuditManager().getUserNodeLog(gtaNode, getIdentity());
if(StringHelper.containsNonWhitespace(userLog)) {
mainVC.contextPut("userLog", userLog);
protected void nodeLog(Task assignedTask) {
if(isResultVisible(assignedTask)) {
if(businessGroupTask) {
String userLog = courseEnv.getAuditManager().getUserNodeLog(gtaNode, getIdentity());
if(StringHelper.containsNonWhitespace(userLog)) {
mainVC.contextPut("userLog", userLog);
} else {
mainVC.contextRemove("userLog");
}
} else {
mainVC.contextRemove("userLog");
super.nodeLog(assignedTask);
}
} else {
mainVC.contextRemove("userLog");
}
}
private boolean isResultVisible(Task assignedTask) {
boolean isVisible = false;
if(config.getBooleanSafe(GTACourseNode.GTASK_GRADING)) {
if (assignedTask != null && (assignedTask.getTaskStatus() == TaskProcess.grading || assignedTask.getTaskStatus() == TaskProcess.graded)) {
AssessmentEvaluation eval = gtaNode.getUserScoreEvaluation(getAssessedUserCourseEnvironment());
isVisible = eval.getUserVisible() == null || eval.getUserVisible().booleanValue();
}
} else {
super.nodeLog();
isVisible = true;
}
return isVisible;
}
private TaskDefinition getTaskDefinition(Task task) {
......
......@@ -382,7 +382,7 @@ public class GroupAssessmentController extends FormBasicController {
}
}
if(withScore || withPassed || withPassed) {
if(withScore || withPassed) {
Boolean userVisible = scoreEval.getUserVisible();
if(userVisible == null) {
userVisible = Boolean.TRUE;
......
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