diff --git a/src/main/java/org/olat/course/archiver/ScoreAccountingHelper.java b/src/main/java/org/olat/course/archiver/ScoreAccountingHelper.java index a86897a1cf176d59aa8e90c1d03be64c4abc1c45..a6b7cbe8d94b3e63a1e531587f3e5ff6249108c9 100644 --- a/src/main/java/org/olat/course/archiver/ScoreAccountingHelper.java +++ b/src/main/java/org/olat/course/archiver/ScoreAccountingHelper.java @@ -391,15 +391,15 @@ public class ScoreAccountingHelper { IOUtils.closeQuietly(workbook); } - + /** - * Load all users from all known learning groups into a list + * Load all participant from all known learning groups into a list * * @param courseEnv - * @return The list of identities from this course + * @return The list of participants from this course */ - public static List<Identity> loadUsers(CourseEnvironment courseEnv) { + public static List<Identity> loadParticipants(CourseEnvironment courseEnv) { CourseGroupManager gm = courseEnv.getCourseGroupManager(); List<BusinessGroup> groups = gm.getAllBusinessGroups(); @@ -410,7 +410,19 @@ public class ScoreAccountingHelper { RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class); userSet.addAll(repositoryService.getMembers(re, GroupRoles.participant.name())); } - + return new ArrayList<>(userSet); + } + + + /** + * Load all users from all known learning groups into a list + * + * @param courseEnv + * @return The list of identities from this course + */ + public static List<Identity> loadUsers(CourseEnvironment courseEnv) { + List<Identity> participants = loadParticipants(courseEnv); + Set<Identity> userSet = new HashSet<>(participants); List<Identity> assessedList = courseEnv.getCoursePropertyManager().getAllIdentitiesWithCourseAssessmentData(userSet); if(!assessedList.isEmpty()) { userSet.addAll(assessedList); diff --git a/src/main/java/org/olat/course/nodes/iq/IQIdentityListCourseNodeController.java b/src/main/java/org/olat/course/nodes/iq/IQIdentityListCourseNodeController.java index a4a303c372cd2adfc1e430498c3ea34474c4980b..bdeb6048ee26d69706f4ddc3f433f166a8fb4c9d 100644 --- a/src/main/java/org/olat/course/nodes/iq/IQIdentityListCourseNodeController.java +++ b/src/main/java/org/olat/course/nodes/iq/IQIdentityListCourseNodeController.java @@ -355,7 +355,7 @@ public class IQIdentityListCourseNodeController extends IdentityListCourseNodeCo } else if (identities != null) { identities = asOptions.getIdentities(); } else if (asOptions.isAdmin()){ - identities = ScoreAccountingHelper.loadUsers(getCourseEnvironment()); + identities = ScoreAccountingHelper.loadParticipants(getCourseEnvironment()); } return identities; } diff --git a/src/main/java/org/olat/ims/qti21/resultexport/QTI21ResultsExportMediaResource.java b/src/main/java/org/olat/ims/qti21/resultexport/QTI21ResultsExportMediaResource.java index ade3c919c21988bd17abcb0e56019b7d4c95e18f..5290ee82a3547d8c968f400dbcea77ddeda52bec 100644 --- a/src/main/java/org/olat/ims/qti21/resultexport/QTI21ResultsExportMediaResource.java +++ b/src/main/java/org/olat/ims/qti21/resultexport/QTI21ResultsExportMediaResource.java @@ -28,7 +28,6 @@ import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collections; -import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.HashSet; @@ -346,7 +345,6 @@ public class QTI21ResultsExportMediaResource implements MediaResource { VelocityRenderDecorator vrdec = new VelocityRenderDecorator(renderer, mainVC, sb)) { mainVC.contextPut("r", vrdec); renderer.render(sb, mainVC, null); - vrdec.close(); return sb.toString(); } catch(Exception e) { log.error("", e); @@ -373,12 +371,7 @@ public class QTI21ResultsExportMediaResource implements MediaResource { } private String createMemberListingHTML(List<AssessedMember> assessedMembers) { - Collections.sort(assessedMembers, new Comparator<AssessedMember>() { - @Override - public int compare(AssessedMember o1, AssessedMember o2) { - return o1.getUsername().compareTo(o2.getUsername()); - } - }); + Collections.sort(assessedMembers, (o1, o2) -> o1.getUsername().compareTo(o2.getUsername())); // now put values to velocityContext VelocityContext ctx = new VelocityContext(); ctx.put("t", translator); diff --git a/src/main/java/org/olat/ims/qti21/ui/AssessmentResultController.java b/src/main/java/org/olat/ims/qti21/ui/AssessmentResultController.java index ea653e2e1ff328d842d529fcc0f4ed8e6fec2d86..a3624ed2ce9cd3639acbe3ea8fcacd249d82342c 100644 --- a/src/main/java/org/olat/ims/qti21/ui/AssessmentResultController.java +++ b/src/main/java/org/olat/ims/qti21/ui/AssessmentResultController.java @@ -307,7 +307,7 @@ public class AssessmentResultController extends FormBasicController { if(sessionState != null) { r.setSessionState(sessionState); SessionStatus sessionStatus = sessionState.getSessionStatus(); - if(sessionState != null) { + if(sessionStatus != null) { r.setSessionStatus(sessionStatus); } }