-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(api) Enrich incoming statements #410
Conversation
b9fb2b1
to
a803fe8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a5293ad
to
03ef116
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e4a7538
to
f1cdd67
Compare
Not sure I understand. Are you suggesting we remove this field if it is stored in a statement ? |
It's related to enriching outcoming statements (get request) with the version number, as in the spec:
I think, we could add the version field prior statement storage, or, we could not enforce the storage of the version number and add it dynamically to the statements returned from a get request. |
Mhmm, I'm not sure how to interpret the spec since the |
It's indeed not recommended for learning record providers to send statements containing the
However, in my understanding, this doesn't contradict the LRS requirement to return statements with a version field. |
I see. Then perhaps we can open a separate issue, as seems to be beyond the scope of the current PR. EDIT: Issue opened here: #424 |
8a659df
to
336b5ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The xAPI specification indicates to infer the fields `authority`, `stored`, `timestamp` and `id` (discouraging use of `version`), when recieving statements. This commit implements this requirement, thus paving the way to proper permissions management (through `authority`).
e59a2ce
to
814c411
Compare
Purpose
The xAPI specification states that statements SHOULD or MUST be enriched with the following fields:
Currently, only the "id" field is being added. This PR aims improve compliance by enriching incoming statments with the fields above. Adding "authority" is also a necessary step to implement permissions.
Proposal
The main change besides enrichment is testing. Currently, tests check that incoming and retrieved statements are equal. The proposal changes this in an equivalency. Proposed equivalency between statements is defined as:
NB: This proposal creates a new
tests/helpers.py
file for utilities common to multiple test files. We may refactor tests to include statement generation in this file (for example).