learnosity / learnosity-sdk-python Goto Github PK
View Code? Open in Web Editor NEWLearnosity SDK for Python
License: Apache License 2.0
Learnosity SDK for Python
License: Apache License 2.0
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
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
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!
Hello getting an error
from learnosity_sdk.uuid import Uuid
ModuleNotFoundError: No module named 'learnosity_sdk.uuid'
From sample in https://github.com/Learnosity/learnosity-sdk-python#usage
I am not sure if this is an old option that has been deprecated, or an error in the sample code
Please look into it as soon as you can
Cheer
I haven't tested this, but I am looking over the code, and can't imagine why this line would work:
https://github.com/Learnosity/learnosity-sdk-python/blob/master/learnosity_sdk/request.py#L73
I'm pretty sure it should be:
output.update(json.loads(self.request_string))
as it has on line 66.
I'm converting this over into a rails sdk and just spotted this issue. Tried in python console and the following causes an error:
{}.update('string')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.