Only incur storage usage for imported exercises that have been edited
Current behavior
During publishing of a channel, a .perseus ZIP file is generated for each exercise it contains. If the exercise was imported, this happens regardless of whether any aspect of the exercise has been altered. These ZIP files are saved to object storage and are counted in a user's storage usage.
Desired behavior
It is our intention to support freely re-mixing publicly available educational resources, including exercises. We should only generate and save exercise .perseus ZIP files if the user has modified the exercise from it's imported version, and therefore user's storage should only reflect files they've uploaded or exercises they've modified.
Value add
- Enables our intention to support freely re-mixing educational resources from publicly available channels
- Avoids confusion regarding storage usage for exercises when a user hasn't created any
Implementation ideas
- Edit perseus files in the frontend, and then zip and checksum them in the browser to determine if there have been changes
- (patch) Exclude Khan Academy exercises that are already uneditable
Possible tradeoffs
- Complexity in generating a predictable ZIP file whose checksum can be used to determine if changes were made
- Current perseus generation adds a comment (
Perseus file generated during export process) to each file, and likely affects the ability to rely on checksums:
Archive: ./2e061e478350406e880bb5efe5483e4c.perseus
Length Date Time Name
--------- ---------- ----- ----
1484 2013-03-14 01:59 exercise.json
Perseus file generated during export process
280 2013-03-14 01:59 images/42714dceed8e10807bab2d9aedf17968.png
Perseus file generated during export process
3098 2013-03-14 01:59 images/488036d2d4498cb8b67ee4af3937fc3f.png
Perseus file generated during export process
229 2013-03-14 01:59 images/25682b13e9606cf068d1a30625a08010.png
Perseus file generated during export process
4376 2013-03-14 01:59 images/2865abdb3111b6350c6c5c2077242079.png
Perseus file generated during export process
Perhaps we could just simply not count storage for perseus files?
Also, when you copy / import an exercise do we copy the associated file objects?
Overall this brings up areas for improvement on handling how and when exercises have changed. Related to: https://github.com/learningequality/studio/issues/5135
Suggesting that we just go with this idea:
Perhaps we could just simply not count storage for perseus files?
Perseus files are just an export format, and not something users directly upload.