Comments (2)
I'm in a situation where I need grouped submissions, and I know rewriting the models takes a lot more work to get it into the library properly, but wouldn't it make more sense to allow the user to call grouped data and have the warning prompt them to process the Submissions
themselves?
My solution was to format each submission as JSON using .to_json()
and then manipulate with the standard JSON
library. For instance:
data = []
course = canvas.get_course(123456)
assigns = course.get_multiple_submissions(student_ids='all', assignment_ids=(111111, 111122, ...), grouped=1)
for a in assigns:
data.append(json.loads(a.to_json()))
for item in data:
# do whatever formatting you want with JSON
It's a little brute force, but it works. Reenabling the grouped
flag in the method **kwargs
makes it easier and faster to get multiple, specific assignments. I'd like to be able to deploy the project I'm working on eventually and it'd be a bummer to have to fork and reference a custom build of the library for that one option.
(Love the library, by the way. Thanks for releasing and maintaining such a great tool.)
from canvasapi.
I'm moving some methods over to the Section
module and this limit also exists for section.list_multple_submissions
on line 245.
if 'grouped' in kwargs:
warnings.warn('The `grouped` parameter must be empty. Removing kwarg `grouped`.')
del kwargs['grouped']
from canvasapi.
Related Issues (20)
- "typed" API HOT 1
- Endpoint for Submission Class that returns data from the "submission_comments" field ...? HOT 1
- Deprecation warning when installing canvasapi - Deprecation coming in pip 23.1 HOT 1
- Course.get_enabled_features throws AttributeError: 'str' object has no attribute 'update' HOT 1
- Feature request: Return objects as JSON strings HOT 1
- Terminate user sessions
- Endpoint for accepting and rejecting course invites HOT 1
- Missing pagination for search results HOT 3
- Add missing methods to File HOT 1
- QuizSubmission update_score_and_comments doesn't seem to work HOT 3
- New Quizzes
- New Quiz Items
- Docs: How to download/upload grades/Gradebook? HOT 1
- Error when a course access is restricted HOT 1
- canvas create conversation cannot set subject HOT 3
- Rework url structure to accommodate graphql and new quizzes endpoints
- Attach files when creating a new discussion topic
- Delete Group Pages
- Request timeouts
- Comments to submissions are always added to first attempt HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from canvasapi.