Skip to content

Commit

Permalink
SAK-30102 Grade report for collaborative group submissions doesn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelal committed Jan 19, 2016
1 parent 41469ce commit 65679d8
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4615,29 +4615,39 @@ public Collection<Group> getSubmitterGroupList(String searchFilterOnly, String a
Assignment a = getAssignment(aRef);
if (a != null)
{
Site st = SiteService.getSite(contextString);
if (a.getAccess().equals(Assignment.AssignmentAccess.SITE))
{
Collection<Group> groupRefs = st.getGroups();
for (Iterator gIterator = groupRefs.iterator(); gIterator.hasNext();)
{
Group _gg = (Group)gIterator.next();
//if (_gg.getProperties().get(GROUP_SECTION_PROPERTY) == null) { // NO SECTIONS (this might not be valid test for manually created sections)
rv.add(_gg);
//}
}
}
else
{
Collection<String> groupRefs = a.getGroups();
for (Iterator gIterator = groupRefs.iterator(); gIterator.hasNext();)
{
Group _gg = st.getGroup((String)gIterator.next()); // NO SECTIONS (this might not be valid test for manually created sections)
if (_gg != null) {// && _gg.getProperties().get(GROUP_SECTION_PROPERTY) == null) {
Site st = SiteService.getSite(contextString);
if (allOrOneGroup.equals(AssignmentConstants.ALL))
{
if (a.getAccess().equals(Assignment.AssignmentAccess.SITE))
{
Collection<Group> groupRefs = st.getGroups();
for (Iterator gIterator = groupRefs.iterator(); gIterator.hasNext();)
{
Group _gg = (Group)gIterator.next();
//if (_gg.getProperties().get(GROUP_SECTION_PROPERTY) == null) { // NO SECTIONS (this might not be valid test for manually created sections)
rv.add(_gg);
//}
}
}
else
{
Collection<String> groupRefs = a.getGroups();
for (Iterator gIterator = groupRefs.iterator(); gIterator.hasNext();)
{
Group _gg = st.getGroup((String)gIterator.next()); // NO SECTIONS (this might not be valid test for manually created sections)
if (_gg != null) {
rv.add(_gg);
}
}
}
}
else
{
Group _gg = st.getGroup(allOrOneGroup);
if (_gg != null) {// && _gg.getProperties().get(GROUP_SECTION_PROPERTY) == null) {
rv.add(_gg);
}
}
}
}

for (Iterator uIterator = rv.iterator(); uIterator.hasNext();)
{
Expand All @@ -4660,7 +4670,8 @@ public Collection<Group> getSubmitterGroupList(String searchFilterOnly, String a
M_log.debug(this + " getSubmitterGroupList context " + contextString + " for assignment " + a.getId() + " for group " + g.getId());
AssignmentSubmissionEdit s =
addSubmission(contextString, a.getId(), g.getId());
s.setSubmitted(false);
s.setSubmitted(true);
s.setIsUserSubmission(false);
s.setAssignment(a);

// set the resubmission properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14201,9 +14201,17 @@ else if (MODE_INSTRUCTOR_REPORT_SUBMISSIONS.equals(mode))
List<String> submitterIds = AssignmentService.getSubmitterIdList(searchFilterOnly.toString(), allOrOneGroup, search, a.getReference(), contextString);
Collection<String> _dupUsers = new ArrayList<String>();
if (a.isGroup()) {
Collection<Group> submitterGroups = AssignmentService.getSubmitterGroupList(searchFilterOnly.toString(), allOrOneGroup, "", a.getReference(), contextString);
if (submitterGroups != null && !submitterGroups.isEmpty())
{
for (Iterator<Group> iSubmitterGroupsIterator = submitterGroups.iterator(); iSubmitterGroupsIterator.hasNext();)
{
Group gId = iSubmitterGroupsIterator.next();
submitterIds.add(gId.getId());
}
_dupUsers = usersInMultipleGroups(a, true);
}
}

//get the list of users which are allowed to grade this assignment
List allowGradeAssignmentUsers = AssignmentService.allowGradeAssignmentUsers(a.getReference());
String deleted = a.getProperties().getProperty(ResourceProperties.PROP_ASSIGNMENT_DELETED);
Expand Down

0 comments on commit 65679d8

Please sign in to comment.