-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat: 37468/add REST API endpoints for instructor dashboard data downloads #37984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: 37468/add REST API endpoints for instructor dashboard data downloads #37984
Conversation
|
Thanks for the pull request, @wgu-jesse-stewart! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces new Instructor API v2 endpoints to support programmatic access to the Instructor Dashboard “Data Downloads” workflows by (1) listing available report files from ReportStore and (2) triggering generation of specific report types (mostly via existing instructor-task async infrastructure).
Changes:
- Added
ReportTypeenum (and a task-type→report-type mapping) intended to standardize report identifiers. - Added v2 API views to list report downloads and trigger report generation (including a synchronous issued-certificates export stored into
ReportStore). - Wired the new endpoints into the instructor v2 URL configuration.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 10 comments.
| File | Description |
|---|---|
lms/djangoapps/instructor_task/data.py |
Adds ReportType and a mapping from instructor task types to report types. |
lms/djangoapps/instructor/views/api_v2.py |
Implements the new GET /reports and POST /reports/{report_type}/generate endpoints and related helpers. |
lms/djangoapps/instructor/views/api_urls.py |
Registers the new v2 routes for listing/generating report downloads. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Issue #37468
Description
This PR adds REST API endpoints to support programmatic access to the Instructor Dashboard's data download functionality. It introduces two new v2 API endpoints that allow instructors to list available report downloads and trigger report generation for their courses.
Changes:
/api/instructor/v2/courses/{course_id}/reports- Lists all available report downloads for a course with metadata (filename, URL, type, date generated)/api/instructor/v2/courses/{course_id}/reports/{report_type}/generate- Triggers generation of a specific report typeSupported Report Types:
enrolled_students- Student profile and enrollment datapending_enrollments- Users allowed to enroll but haven't yetpending_activations- Inactive users with enrollmentsanonymized_student_ids- Anonymized student ID mappinggrade- Course grade reportproblem_grade- Problem-level grade reportproblem_responses- Student responses to problemsora2_summary- Open Response Assessment summaryora2_data- ORA detailed data exportora2_submission_files- ORA submission file archivesissued_certificates- Certificate issuance dataUser Roles Impacted:
Supporting information
Related to ticket #37468
Testing instructions
Setup: Ensure you have instructor access to a course with existing data
Test GET endpoint:
Expected: Returns JSON array of available downloads with metadata
Test POST endpoint (generate grade report):
Expected: Returns success message indicating report generation started
Test Problem Responses with specific problem:
Verify report detection: Check that existing reports in storage are correctly categorized by type
Test error cases:
Other information
ReportStoreconfigured viaGRADES_DOWNLOADissued_certificatesreport is generated synchronously (small dataset), all others are async tasksGenerateReportViewuses@method_decorator(transaction.non_atomic_requests)to allow async task submissionReportTypeenum added toinstructor_task/data.pyfor consistent report type identifiers