Builds upon #897 and #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 #3901
Builds upon #897 and #3901
Desired behavior
Proper resolution of this will involve several steps:
answers, andhintsfields into ajsonfieldJSONField(not a proper postgres JSONField to avoid a complex migration for now).jsonfieldJSONFieldthat is done in Kolibri here: https://github.com/learningequality/kolibri/blob/release-v0.14.x/kolibri/core/fields.py#L102By 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.
Current behavior
Data is stored as text but is validated as JSON in #3901