learningequality / studio

Content curation tools for Kolibri
https://studio.learningequality.org/
MIT License
113 stars 163 forks source link

Migrate AssessmentItem data to proper JSON fields #3985

Open bjester opened 1 year ago

bjester commented 1 year ago

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.

Current behavior

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

manavagr1108 commented 1 year ago

Hey @bjester, I am willing to work on this issue. Can I take up this issue?

bjester commented 1 year ago

Hi @manavagr1108, thank you for your interest in working on Studio. My apologies for the late response.

This issue isn't the best for an external contributor to address. It is rather convoluted as we can't simply change the field types, since we have millions of existing records in the database. We have a strict time limit on Django migrations, which requires us to handle this situation with care. Not only that, but there could be invalid JSON in the existing fields too.