def bulk_gradebook_view_context(course_key, users): """ Prefetches all course and subsection grades in the given course for the given list of users, also, fetch all the score relavant data, storing the result in a RequestCache and deleting grades on context exit. """ prefetch_course_and_subsection_grades(course_key, users) CourseEnrollment.bulk_fetch_enrollment_states(users, course_key) cohorts.bulk_cache_cohorts(course_key, users) BulkRoleCache.prefetch(users) try: yield finally: clear_prefetched_course_and_subsection_grades(course_key)
def bulk_gradebook_view_context(course_key, users): """ Prefetches all course and subsection grades in the given course for the given list of users, also, fetch all the score relavant data, storing the result in a RequestCache and deleting grades on context exit. """ prefetch_course_and_subsection_grades(course_key, users) CourseEnrollment.bulk_fetch_enrollment_states(users, course_key) cohorts.bulk_cache_cohorts(course_key, users) BulkRoleCache.prefetch(users) try: yield finally: clear_prefetched_course_and_subsection_grades(course_key)