Giter Site home page Giter Site logo

learnosity-sdk-python's Issues

Incorrect response data handling

Using the data api itembank/questions endpoint and requesting data with request.item_references on all API versions does not actually return any data through the DataAPI.results_iter (works if you pass request.references instead).

I believe the default is to expect a list to be returned in the response['data'] object however a dict is being returned through the itembank/questions api endpoint and will thus only return all of the item keys we requested. Not sure if this is intended but I couldn't find anything pointing that this is.

A simple solution may be to check in the results_iter function if the returned response['data'] is a dict and to just return it as a list of the single object, not efficient but will work with existing api.

if isinstance(response['data'], dict):
    for key, value in response['data'].items():
        yield {key:value}
else:
    for result in response['data']:
        yield result

Type stubs

Hey Learnosity team,

I was wondering if there are any plans to publish type stubs for this repository. I work in a Python environment with strict type-checking using a third party type-checker (pyright). It's a pretty small repository so I'd be happy to PR some type stubs (in the form of .pyi files adjacent to the existing .py files) so that others using type-checkers can access this repository as well.

Best,
Violet

Authoring Examples missing from reference.

It would be really neat if you'd include some examples of authoring questions/activities with this SDK. Especially if you could document all of the possible fields the data_request can have when doing so!

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.