learningequality / learningequality/studio

Migrate AssessmentItem data to proper JSON fields

Open
#3,985 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

DEV: backend DEV: frontend P3 - low TAG: tech update / debt
Dominant language
Python
Stars
191
Forks
307
Avg merge
5d 6h
Merged PRs (30d)
10

Description

Builds upon https://github.com/learningequality/studio/issues/897 and https://github.com/learningequality/studio/pull/3901

Desired behavior

Proper resolution of this will involve several steps:

By itself, these steps would at least be sufficient to ensure that the incoming data is validated as JSON on save.

However, as the data will now be stored in IndexedDB in the frontend as JSON, any edits to them will be recorded by keypath, rather than the entire text field changing. This has the advantage of giving more granular edits, but means we need to update our serializers to properly handle this.

  • Some original work will be required to be done, probably using the DotPathValueMixin, and in a similar way to the TagField used in the ContentNode serializer.
  • The way that the data is serialized to the frontend should also be updated in order to be sent as a map (see e.g. tags for contentnodes), however, as there is additional data rather than just a tag name, a more complex method would be required.

Current behavior

Data is stored as text but is validated as JSON in https://github.com/learningequality/studio/pull/3901

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading issue 897 and pull request 3901, then inspect the AssessmentItem fields and the referenced Kolibri fields.py extension. Review DotPathValueMixin and the TagField and content-node serializer examples in common.py and contentnode.py. Done means answers and hints are stored and validated as JSON, with frontend serialization and keypath edits handled correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, database, frontend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.