Fixed tests for fast grading.

This commit is contained in:
Bridger Maxwell
2012-09-18 13:18:19 -04:00
parent 1e0932b734
commit b65577f2b7
2 changed files with 11 additions and 0 deletions

View File

@@ -237,6 +237,10 @@ def progress_summary(student, request, course, grader, student_module_cache):
course: An XModule containing the course to grade
student_module_cache: A StudentModuleCache initialized with all
instance_modules for the student
If the student does not have access to load the course module, this function
will return None.
"""
@@ -245,6 +249,9 @@ def progress_summary(student, request, course, grader, student_module_cache):
course_module = get_module(student, request,
course.location, student_module_cache,
course.id)
if not course_module:
# This student must not have access to the course.
return None
chapters = []
# Don't include chapters that aren't displayable (e.g. due to error)

View File

@@ -459,6 +459,10 @@ def progress(request, course_id, student_id=None):
courseware_summary = grades.progress_summary(student, request, course,
course.grader, student_module_cache)
grade_summary = grades.grade(student, request, course, student_module_cache)
if courseware_summary is None:
#This means the student didn't have access to the course (which the instructor requested)
raise Http404
context = {'course': course,
'courseware_summary': courseware_summary,