Giter Club home page Giter Club logo

Comments (2)

bennettscience avatar bennettscience commented on July 29, 2024

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.

bennettscience avatar bennettscience commented on July 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.