'Return all model instances that correspond to problems that have been
submitted for a given course. So module_type=\'problem\' and a non-null
grade. Use a read replica if one exists for this environment.'

@classmethod
def all_submitted_problems_read_only(cls, course_id):

    queryset = cls.objects.filter(course_id=course_id, module_type='problem', grade__isnull=False)
    if ('read_replica' in settings.DATABASES):
        return queryset.using('read_replica')
    else:
        return queryset
