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

Merge remote-tracking branch 'origin/OpenOLAT_14.1'

parents fa7cb5ae 379ca22c
No related branches found
Tags OpenOLAT_11.5.0
No related merge requests found
...@@ -32,6 +32,7 @@ import java.util.HashSet; ...@@ -32,6 +32,7 @@ import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.olat.basesecurity.GroupRoles; import org.olat.basesecurity.GroupRoles;
...@@ -72,8 +73,11 @@ import org.olat.group.BusinessGroup; ...@@ -72,8 +73,11 @@ import org.olat.group.BusinessGroup;
import org.olat.group.BusinessGroupService; import org.olat.group.BusinessGroupService;
import org.olat.modules.assessment.AssessmentEntry; import org.olat.modules.assessment.AssessmentEntry;
import org.olat.modules.assessment.manager.AssessmentEntryDAO; import org.olat.modules.assessment.manager.AssessmentEntryDAO;
import org.olat.modules.curriculum.CurriculumElement;
import org.olat.modules.scorm.assessment.ScormAssessmentManager; import org.olat.modules.scorm.assessment.ScormAssessmentManager;
import org.olat.repository.RepositoryEntryRelationType;
import org.olat.repository.RepositoryManager; import org.olat.repository.RepositoryManager;
import org.olat.repository.RepositoryService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -92,6 +96,8 @@ public class AssessmentNotificationsHandler implements NotificationsHandler { ...@@ -92,6 +96,8 @@ public class AssessmentNotificationsHandler implements NotificationsHandler {
private static final String CSS_CLASS_USER_ICON = "o_icon_user"; private static final String CSS_CLASS_USER_ICON = "o_icon_user";
@Autowired
private RepositoryService repositoryService;
@Autowired @Autowired
private OrganisationService organisationService; private OrganisationService organisationService;
@Autowired @Autowired
...@@ -318,8 +324,21 @@ public class AssessmentNotificationsHandler implements NotificationsHandler { ...@@ -318,8 +324,21 @@ public class AssessmentNotificationsHandler implements NotificationsHandler {
if (!hasFullAccess) { if (!hasFullAccess) {
// initialize list of users, only when user has not full access // initialize list of users, only when user has not full access
List<BusinessGroup> coachedGroups = cgm.getOwnedBusinessGroups(identity); List<BusinessGroup> coachedGroups = cgm.getOwnedBusinessGroups(identity);
List<Identity> coachedIdentites = businessGroupService.getMembers(coachedGroups, GroupRoles.participant.name()); List<Identity> coachedIdentities = businessGroupService.getMembers(coachedGroups, GroupRoles.participant.name());
coachedUsers.addAll(coachedIdentites); coachedUsers.addAll(coachedIdentities);
List<CurriculumElement> coachedCurriculumElements = cgm.getCoachedCurriculumElements(identity);
List<Long> coachedCurriculumElementKeys = coachedCurriculumElements.stream()
.map(CurriculumElement::getKey).collect(Collectors.toList());
List<Identity> coachedCurriculumElementIdentities = cgm.getCoachesFromCurriculumElements(coachedCurriculumElementKeys);
coachedUsers.addAll(coachedCurriculumElementIdentities);
// course coaches
boolean repoTutor = repositoryService.hasRole(identity, cgm.getCourseEntry(), GroupRoles.coach.name());
if(repoTutor) {
List<Identity> courseParticipants = repositoryService.getMembers(cgm.getCourseEntry(), RepositoryEntryRelationType.entryAndCurriculums, GroupRoles.participant.name());
coachedUsers.addAll(courseParticipants);
}
} }
List<AssessableCourseNode> testNodes = getCourseTestNodes(course); List<AssessableCourseNode> testNodes = getCourseTestNodes(course);
......
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