feat: 37468/add REST API endpoints for instructor dashboard data downloads#37984
feat: 37468/add REST API endpoints for instructor dashboard data downloads#37984wgu-jesse-stewart wants to merge 7 commits intoopenedx:masterfrom
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. 🔘 Update the status of your PRYour PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate. Where 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. |
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