def test_groups(self): group = StudentGroup(course_instance=self.current_course_instance) group.save() group.members.add(self.user.userprofile,self.grader.userprofile) self.assertEqual(StudentGroup.get_exact(self.current_course_instance, [self.user.userprofile,self.grader.userprofile]), group) self.assertEqual(StudentGroup.get_exact(self.current_course_instance, [self.user.userprofile,self.superuser.userprofile]), None)
def get_group(self): if self.submission_count > 0: s = self.submissions[0] if s.submitters.count() > 0: return StudentGroup.get_exact(self.exercise.course_instance, s.submitters.all()) return None
def get_group(self): if self.submission_count > 0: s = self.submissions[0] if s.submitters.count() > 0: return StudentGroup.get_exact( self.exercise.course_instance, s.submitters.all() ) return None