Beispiel #1
0
 def __init__(self, context, users):
     self.certs = _CertificateBulkContext(context, users)
     self.teams = _TeamBulkContext(context, users)
     self.enrollments = _EnrollmentBulkContext(context, users)
     bulk_cache_cohorts(context.course_id, users)
     BulkRoleCache.prefetch(users)
     PersistentCourseGrade.prefetch(context.course_id, users)
     BulkCourseTags.prefetch(context.course_id, users)
Beispiel #2
0
def bulk_course_grade_context(course_key, users):
    """
    Prefetches grades for the given users in the given course
    within a context, storing in a RequestCache and deleting
    on context exit.
    """
    PersistentCourseGrade.prefetch(course_key, users)
    yield
    PersistentCourseGrade.clear_prefetched_data(course_key)
Beispiel #3
0
def bulk_course_grade_context(course_key, users):
    """
    Prefetches grades for the given users in the given course
    within a context, storing in a RequestCache and deleting
    on context exit.
    """
    PersistentCourseGrade.prefetch(course_key, users)
    yield
    PersistentCourseGrade.clear_prefetched_data(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.
    """
    PersistentSubsectionGrade.prefetch(course_key, users)
    PersistentCourseGrade.prefetch(course_key, users)
    CourseEnrollment.bulk_fetch_enrollment_states(users, course_key)
    cohorts.bulk_cache_cohorts(course_key, users)
    BulkRoleCache.prefetch(users)
    yield
    PersistentSubsectionGrade.clear_prefetched_data(course_key)
    PersistentCourseGrade.clear_prefetched_data(course_key)
Beispiel #5
0
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.
    """
    PersistentSubsectionGrade.prefetch(course_key, users)
    PersistentCourseGrade.prefetch(course_key, users)
    CourseEnrollment.bulk_fetch_enrollment_states(users, course_key)
    cohorts.bulk_cache_cohorts(course_key, users)
    BulkRoleCache.prefetch(users)
    yield
    PersistentSubsectionGrade.clear_prefetched_data(course_key)
    PersistentCourseGrade.clear_prefetched_data(course_key)
def prefetch_course_and_subsection_grades(course_key, users):
    _PersistentCourseGrade.prefetch(course_key, users)
    _PersistentSubsectionGrade.prefetch(course_key, users)
def prefetch_course_grades(course_key, users):
    _PersistentCourseGrade.prefetch(course_key, users)