From 5e23279fd466e7feb089572ba7c896f480351ab2 Mon Sep 17 00:00:00 2001 From: srosse <stephane.rosse@frentix.com> Date: Sat, 21 Mar 2020 13:52:25 +0100 Subject: [PATCH] OO-4560: set to done if the last step of the flow is "Solutions" --- .../java/org/olat/course/nodes/gta/GTAManager.java | 2 +- .../olat/course/nodes/gta/manager/GTAManagerImpl.java | 10 ++++++++-- src/main/java/org/olat/upgrade/OLATUpgrade_11_0_0.java | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/olat/course/nodes/gta/GTAManager.java b/src/main/java/org/olat/course/nodes/gta/GTAManager.java index bfa91c7734a..e54ce74b04e 100644 --- a/src/main/java/org/olat/course/nodes/gta/GTAManager.java +++ b/src/main/java/org/olat/course/nodes/gta/GTAManager.java @@ -219,7 +219,7 @@ public interface GTAManager { * @param cNode * @return */ - public AssessmentEntryStatus convertToAssessmentEntrystatus(Task task, GTACourseNode cNode); + public AssessmentEntryStatus convertToAssessmentEntryStatus(Task task, GTACourseNode cNode); /** * Are users already processing this task? diff --git a/src/main/java/org/olat/course/nodes/gta/manager/GTAManagerImpl.java b/src/main/java/org/olat/course/nodes/gta/manager/GTAManagerImpl.java index 4b9cdb0de41..0db2d79d34d 100644 --- a/src/main/java/org/olat/course/nodes/gta/manager/GTAManagerImpl.java +++ b/src/main/java/org/olat/course/nodes/gta/manager/GTAManagerImpl.java @@ -1741,7 +1741,7 @@ public class GTAManagerImpl implements GTAManager { } @Override - public AssessmentEntryStatus convertToAssessmentEntrystatus(Task task, GTACourseNode cNode) { + public AssessmentEntryStatus convertToAssessmentEntryStatus(Task task, GTACourseNode cNode) { TaskProcess status = task.getTaskStatus(); TaskProcess firstStep = firstStep(cNode); @@ -1752,6 +1752,12 @@ public class GTAManagerImpl implements GTAManager { assessmentStatus = AssessmentEntryStatus.inReview; } else if(status == TaskProcess.graded) { assessmentStatus = AssessmentEntryStatus.done; + } else if(status == TaskProcess.solution) { + if(cNode.getModuleConfiguration().getBooleanSafe(GTACourseNode.GTASK_GRADING)) { + assessmentStatus = AssessmentEntryStatus.inProgress; + } else { + assessmentStatus = AssessmentEntryStatus.done; + } } else { assessmentStatus = AssessmentEntryStatus.inProgress; } @@ -1764,7 +1770,7 @@ public class GTAManagerImpl implements GTAManager { TaskList taskList = getTaskList(taskImpl); RepositoryEntry courseRepoEntry = taskList.getEntry(); ICourse course = CourseFactory.loadCourse(courseRepoEntry); - AssessmentEntryStatus assessmentStatus = convertToAssessmentEntrystatus(taskImpl, cNode); + AssessmentEntryStatus assessmentStatus = convertToAssessmentEntryStatus(taskImpl, cNode); if(GTAType.group.name().equals(cNode.getModuleConfiguration().getStringValue(GTACourseNode.GTASK_TYPE))) { List<Identity> assessedIdentities = businessGroupRelationDao.getMembers(taskImpl.getBusinessGroup(), GroupRoles.participant.name()); for(Identity assessedIdentity:assessedIdentities) { diff --git a/src/main/java/org/olat/upgrade/OLATUpgrade_11_0_0.java b/src/main/java/org/olat/upgrade/OLATUpgrade_11_0_0.java index 9bf635a8675..ecbe9112ce2 100644 --- a/src/main/java/org/olat/upgrade/OLATUpgrade_11_0_0.java +++ b/src/main/java/org/olat/upgrade/OLATUpgrade_11_0_0.java @@ -1024,9 +1024,9 @@ public class OLATUpgrade_11_0_0 extends OLATUpgrade { private void processAssessmentPropertyForGTA(Identity assessedIdentity, AssessmentEntryImpl entry, GTACourseNode cNode, RepositoryEntry courseEntry) { List<Task> tasks = gtaManager.getTasks(assessedIdentity, courseEntry, cNode); - if(tasks != null && tasks.size() > 0) { + if(tasks != null && !tasks.isEmpty()) { Task task = tasks.get(0); - AssessmentEntryStatus status = gtaManager.convertToAssessmentEntrystatus(task, cNode); + AssessmentEntryStatus status = gtaManager.convertToAssessmentEntryStatus(task, cNode); entry.setStatus(status.name()); String details = gtaManager.getDetails(assessedIdentity, courseEntry, cNode); -- GitLab