Generalize grade report to allow display of any report
We would like to be able to generate arbitrary reports and expose them to the instructor by simply uploading them to S3. The existing grade download infrastructure pretty much supported that already, however, all of the internal and external structures were referring to the reports as exclusively grading related. Fixes: AN-590
This commit is contained in:
@@ -33,7 +33,7 @@ from student.models import unique_id_for_user
|
||||
import instructor_task.api
|
||||
from instructor_task.api_helper import AlreadyRunningError
|
||||
from instructor_task.views import get_task_completion_info
|
||||
from instructor_task.models import GradesStore
|
||||
from instructor_task.models import ReportStore
|
||||
import instructor.enrollment as enrollment
|
||||
from instructor.enrollment import enroll_email, unenroll_email, get_email_params
|
||||
from instructor.access import list_with_level, allow_access, revoke_access, update_forum_role
|
||||
@@ -770,16 +770,16 @@ def list_instructor_tasks(request, course_id):
|
||||
@ensure_csrf_cookie
|
||||
@cache_control(no_cache=True, no_store=True, must_revalidate=True)
|
||||
@require_level('staff')
|
||||
def list_grade_downloads(_request, course_id):
|
||||
def list_report_downloads(_request, course_id):
|
||||
"""
|
||||
List grade CSV files that are available for download for this course.
|
||||
"""
|
||||
grades_store = GradesStore.from_config()
|
||||
report_store = ReportStore.from_config()
|
||||
|
||||
response_payload = {
|
||||
'downloads': [
|
||||
dict(name=name, url=url, link='<a href="{}">{}</a>'.format(url, name))
|
||||
for name, url in grades_store.links_for(course_id)
|
||||
for name, url in report_store.links_for(course_id)
|
||||
]
|
||||
}
|
||||
return JsonResponse(response_payload)
|
||||
|
||||
Reference in New Issue
Block a user