kolibri
kolibri copied to clipboard
Remove use of the assessmentmetadata state mapper
The AssessmentMetadataState mapper was introduced when the ContentNode API returned a singleton array of assessmentmetadata. It now returns a null value or a single object.
Unfortunately, there are several places where this is still used, rather than directly reading from the expected return shape of the API endpoint.
### Acceptance criteria:
- [ ] Enumerate all places where the state mapper is used in this issue
- [ ] Find all the places 'downstream' of these places where the content node assessment metadata is referenced
- [ ] Update these to read directly from the shape of assessmentmetadata as returned by the API (see the JSDoc for this here: https://github.com/learningequality/kolibri/blob/release-v0.16.x/kolibri/core/assets/src/api-resources/contentNode.js#L64)
I would like to work on this
Hi @a6ar55! Sure! I will assign this issue to you :open_hands:.
The current assignee is not active; can i work on this task?
Hi @nick2432, thanks for volunteering. Let's wait a day or two for @a6ar55 to confirm whether they're working on it or no. Then we can possibly re-assign.
Hi @MisRob , Unfortunately, I am unable to work on this issue at the moment. Therefore, please feel free to reassign the task to @nick2432.
Thanks for letting us know, @a6ar55. I am re-assigning to @nick2432.
I'd like to work on this issue. Could you please assign it to me?
Also I have a question about mastery_model values: After the removal of the assessmentMetaDataState mapper, should we assume these values will always be in snake_case format? Currently, this mapper ensures snake_case. I just want to make sure I understand it correctly.
Yes, the assessment metadata will now be accessed in the same way as it is returned from the API for resource metadata. The JSDoc types for this can be found here: https://github.com/learningequality/kolibri/blob/develop/kolibri/core/assets/src/api-resources/contentNode.js#L18 (see below in the same file for how to access this from the ContentNode metadata).
Assigned!
Fixed in #11940