kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Remove use of the assessmentmetadata state mapper

Open rtibbles opened this issue 1 year ago • 6 comments

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)

rtibbles avatar Jan 12 '24 17:01 rtibbles

I would like to work on this

a6ar55 avatar Jan 18 '24 14:01 a6ar55

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

AlexVelezLl avatar Jan 18 '24 16:01 AlexVelezLl

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

nick2432 avatar Feb 03 '24 12:02 nick2432

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.

MisRob avatar Feb 05 '24 09:02 MisRob

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

a6ar55 avatar Feb 06 '24 02:02 a6ar55

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

MisRob avatar Feb 06 '24 05:02 MisRob

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.

AymanHammadi avatar Mar 05 '24 18:03 AymanHammadi

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 avatar Mar 05 '24 18:03 rtibbles

Assigned!

rtibbles avatar Mar 05 '24 18:03 rtibbles

Fixed in #11940

rtibbles avatar Mar 08 '24 16:03 rtibbles