public Map getAvailableItemsForStudent(String gradebookUid, String userId, String studentId, Collection courseSections) throws IllegalArgumentException { if(gradebookUid == null || userId == null || studentId == null) throw new IllegalArgumentException("Null parameter(s) in GradebookPermissionServiceImpl.getAvailableItemsForStudent"); Long gradebookId = getGradebook(gradebookUid).getId(); return getAvailableItemsForStudent(gradebookId, userId, studentId, courseSections); }
public Map getAvailableItemsForStudents(String gradebookUid, String userId, List studentIds, Collection courseSections) throws IllegalArgumentException { if(gradebookUid == null || userId == null) throw new IllegalArgumentException("Null parameter(s) in GradebookPermissionServiceImpl.getAvailableItemsForStudents"); Long gradebookId = getGradebook(gradebookUid).getId(); return getAvailableItemsForStudents(gradebookId, userId, studentIds, courseSections); }
public List getViewableGroupsForUser(String gradebookUid, String userId, List groupIds) { if(gradebookUid == null || userId == null) throw new IllegalArgumentException("Null parameter(s) in GradebookPermissionServiceImpl.getViewableSectionsForUser"); Long gradebookId = getGradebook(gradebookUid).getId(); return getViewableGroupsForUser(gradebookId, userId, groupIds); }
public Map<String, String> getStudentsForItem(String gradebookUid, String userId, List<String> studentIds, int cateType, Long categoryId, List courseSections) throws IllegalArgumentException { if(gradebookUid == null || userId == null) throw new IllegalArgumentException("Null parameter(s) in GradebookPermissionServiceImpl.getStudentsForItem"); Long gradebookId = getGradebook(gradebookUid).getId(); return getStudentsForItem(gradebookId, userId, studentIds, cateType, categoryId, courseSections); }
public List getGraderPermissionsForUser(String gradebookUid, String userId) { if (gradebookUid == null || userId == null) { throw new IllegalArgumentException("Null gradebookUid or userId passed to getGraderPermissionsForUser"); } Long gradebookId = getGradebook(gradebookUid).getId(); return getPermissionsForUser(gradebookId, userId); }
public Map getCourseGradePermission(String gradebookUid, String userId, List studentIds, List courseSections) throws IllegalArgumentException { if(gradebookUid == null || userId == null) throw new IllegalArgumentException("Null parameter(s) in GradebookPermissionServiceImpl.getCourseGradePermission"); Long gradebookId = getGradebook(gradebookUid).getId(); return getCourseGradePermission(gradebookId, userId, studentIds, courseSections); }
public List getViewableStudentsForUser(String gradebookUid, String userId, List studentIds, List sections) { if(gradebookUid == null || userId == null) throw new IllegalArgumentException("Null parameter(s) in GradebookPermissionServiceImpl.getViewableStudentsForUser"); Long gradebookId = getGradebook(gradebookUid).getId(); return getViewableStudentsForUser(gradebookId, userId, studentIds, sections); }
public Map<String, String> getStudentsForItem(String gradebookUid, String userId, List<String> studentIds, int cateType, Long categoryId, List courseSections) throws IllegalArgumentException { if(gradebookUid == null || userId == null) throw new IllegalArgumentException("Null parameter(s) in GradebookPermissionServiceImpl.getStudentsForItem"); Long gradebookId = getGradebook(gradebookUid).getId(); return getStudentsForItem(gradebookId, userId, studentIds, cateType, categoryId, courseSections); }
public List getGraderPermissionsForUser(String gradebookUid, String userId) { if (gradebookUid == null || userId == null) { throw new IllegalArgumentException("Null gradebookUid or userId passed to getGraderPermissionsForUser"); } Long gradebookId = getGradebook(gradebookUid).getId(); return getPermissionsForUser(gradebookId, userId); }
public Map getCourseGradePermission(String gradebookUid, String userId, List studentIds, List courseSections) throws IllegalArgumentException { if(gradebookUid == null || userId == null) throw new IllegalArgumentException("Null parameter(s) in GradebookPermissionServiceImpl.getCourseGradePermission"); Long gradebookId = getGradebook(gradebookUid).getId(); return getCourseGradePermission(gradebookId, userId, studentIds, courseSections); }
public List getViewableStudentsForUser(String gradebookUid, String userId, List studentIds, List sections) { if(gradebookUid == null || userId == null) throw new IllegalArgumentException("Null parameter(s) in GradebookPermissionServiceImpl.getViewableStudentsForUser"); Long gradebookId = getGradebook(gradebookUid).getId(); return getViewableStudentsForUser(gradebookId, userId, studentIds, sections); }
public List getViewableGroupsForUser(String gradebookUid, String userId, List groupIds) { if(gradebookUid == null || userId == null) throw new IllegalArgumentException("Null parameter(s) in GradebookPermissionServiceImpl.getViewableSectionsForUser"); Long gradebookId = getGradebook(gradebookUid).getId(); return getViewableGroupsForUser(gradebookId, userId, groupIds); }
public Map getAvailableItemsForStudent(String gradebookUid, String userId, String studentId, Collection courseSections) throws IllegalArgumentException { if(gradebookUid == null || userId == null || studentId == null) throw new IllegalArgumentException("Null parameter(s) in GradebookPermissionServiceImpl.getAvailableItemsForStudent"); Long gradebookId = getGradebook(gradebookUid).getId(); return getAvailableItemsForStudent(gradebookId, userId, studentId, courseSections); }
public Map getAvailableItemsForStudents(String gradebookUid, String userId, List studentIds, Collection courseSections) throws IllegalArgumentException { if(gradebookUid == null || userId == null) throw new IllegalArgumentException("Null parameter(s) in GradebookPermissionServiceImpl.getAvailableItemsForStudents"); Long gradebookId = getGradebook(gradebookUid).getId(); return getAvailableItemsForStudents(gradebookId, userId, studentIds, courseSections); }
/** * Updates all uncategorised items to exclude them from the course grade calcs * @param gradebook */ private void excludeUncategorisedItemsFromCourseGradeCalculations(final Gradebook gradebook) { final List<GradebookAssignment> allAssignments = getAssignments(gradebook.getId()); final List<GradebookAssignment> assignments = allAssignments.stream().filter(a -> a.getCategory() == null).collect(Collectors.toList()); assignments.forEach(a -> a.setCounted(false)); batchPersistEntities(assignments); } }
@Override public List<PermissionDefinition> getPermissionsForUser(final String gradebookUid, final String userId) { Long gradebookId = getGradebook(gradebookUid).getId(); List<Permission> permissions = getPermissionsForUser(gradebookId, userId); List<PermissionDefinition> rval = new ArrayList<>(); for(Permission permission: permissions) { rval.add(toPermissionDefinition(permission)); } return rval; }
@Override public Set getGradebookGradeMappings(final String gradebookUid) { final Long gradebookId = getGradebook(gradebookUid).getId(); return this.getGradebookGradeMappings(gradebookId); }
@Override public List<PermissionDefinition> getPermissionsForUser(final String gradebookUid, final String userId) { Long gradebookId = getGradebook(gradebookUid).getId(); List<Permission> permissions = getPermissionsForUser(gradebookId, userId); List<PermissionDefinition> rval = new ArrayList<>(); for(Permission permission: permissions) { rval.add(toPermissionDefinition(permission)); } return rval; }
@Override public Set getGradebookGradeMappings(final String gradebookUid) { final Long gradebookId = getGradebook(gradebookUid).getId(); return this.getGradebookGradeMappings(gradebookId); }
public void clearPermissionsForUser(final String gradebookUid, final String userId) { Long gradebookId = getGradebook(gradebookUid).getId(); // remove all current permissions for user final List<Permission> currentPermissions = getPermissionsForUser(gradebookId, userId); for (Permission currentPermission : currentPermissions) { getHibernateTemplate().getSessionFactory().getCurrentSession().delete(currentPermission); } }