learningequality / kolibri

Kolibri Learning Platform: the offline app for universal education
https://learningequality.org/kolibri/
MIT License
780 stars 648 forks source link

Remove use of the assessmentmetadata state mapper #11724

Closed rtibbles closed 7 months ago

rtibbles commented 8 months ago

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:
- [x] Enumerate all places where the state mapper is used in this issue
- [x] Find all the places 'downstream' of these places where the content node assessment metadata is referenced
- [x] 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)
a6ar55 commented 8 months ago

I would like to work on this

AlexVelezLl commented 8 months ago

Hi @a6ar55! Sure! I will assign this issue to you :open_hands:.

nick2432 commented 8 months ago

The current assignee is not active; can i work on this task?

MisRob commented 8 months ago

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.

a6ar55 commented 8 months ago

Hi @MisRob , Unfortunately, I am unable to work on this issue at the moment. Therefore, please feel free to reassign the task to @nick2432.

MisRob commented 8 months ago

Thanks for letting us know, @a6ar55. I am re-assigning to @nick2432.

AymanHammadi commented 7 months ago

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.

rtibbles commented 7 months ago

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).

rtibbles commented 7 months ago

Assigned!

rtibbles commented 7 months ago

Fixed in #11940