Draft
Fix assignment and quiz submissions download with new unified functions#21
Conversation
…handling Co-authored-by: tin900 <113692500+tin900@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improving downlaoding assignment and quiz results
Fix assignment and quiz submissions download with new unified functions
Jul 17, 2025
… results Co-authored-by: tin900 <113692500+tin900@users.noreply.github.com>
Contributor
Author
Updated the get_submissions function to use the paginate helper function like other functions in the codebase. The function now properly handles multiple pages of results instead of only returning the first page. Commit 508ee59 Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the issue with downloading assignment and quiz results by implementing new functions that use the correct Canvas API endpoints.
Problem
The existing
get_assignment_submissions()function was failing because it used the/students/submissions/endpoint which doesn't exist in all Canvas systems. Users were getting authentication errors even with proper credentials.Solution
Added new functions that use the correct Canvas API endpoints:
New Functions
get_submissions(canvas, course_id, type, id, per_page)- Main unified functiontype = "assignments") and quizzes (type = "quizzes")/courses/{id}/assignments/{id}/submissionsand/courses/{id}/quizzes/{id}/submissionsget_quiz_submissions(canvas, course_id, quiz_id, per_page)- Convenience function for quiz submissionsget_assignment_submissions_new(canvas, course_id, assignment_id, per_page)- Convenience function for assignment submissions using reliable endpointget_course_gradebook(canvas, course_id, per_page, include_quizzes, include_assignments)- Comprehensive function inspired by Jon Vik's workUpdated Function
get_assignment_submissions()- Now uses the new endpoint whenassignment_idis provided, with improved error handling and fallbackUsage Examples
Key Improvements
/students/submissions/endpoint issueAll functions include proper error handling, parameter validation, and maintain consistency with the existing codebase patterns.
Fixes #14.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
cloud.r-project.org/usr/lib/R/bin/exec/R -e install.packages(c('httr',~+~'jsonlite',~+~'dplyr',~+~'tidyr',~+~'magrittr'))(dns block)cran.rstudio.com/usr/lib/R/bin/exec/R -e install.packages(c('devtools',~+~'httr',~+~'jsonlite',~+~'dplyr',~+~'tidyr',~+~'magrittr'),~+~repos='REDACTED')(dns block)esm.ubuntu.com/usr/lib/apt/methods/https(dns block)test/usr/lib/R/bin/exec/R --no-echo --no-restore --file=/tmp/comprehensive_test.R(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.