📝 Added documentation for the cqa-file-format used for quizzes

This commit is contained in:
Mawoka
2022-11-30 21:33:03 +01:00
parent fde5b7178b
commit b3960db2e6
+26
View File
@@ -0,0 +1,26 @@
# .cqa - ClassQuizArchive
A file-format for ClassQuiz-quizzes which stores images and the quiz in one compact file
## How the file format works
```
[QUIZ_DATA] {C7 C7 C7 00}
{C6 C6 C6 00} [UTF-8 encoded image-index] {C5 C5 00} [IMAGE as it is]
{C6 C6 C6 00} [UTF-8 encoded image-index] {C5 C5 00} [IMAGE as it is]
```
## Understanding the schema
### in {}
- `{C7 C7 C7 00}`: separates the quiz-data from the images
- `{C6 C6 C6 00}`: Indicates that a new image-block starts
- `{C5 C5 00}`: separates image-index and image
### in []
- `[QUIZ_DATA]`: The **gzipped JSON** of the quiz with some modifications:
- Removed `id`-field and `user_id`-field
- Dates (`created_at` and `updated_at`) formatted as ISO-Dates
- Images replaced with their question-index
- Cover-image with index `-1`
- `[UTF-8 encoded image-index]`: The index of the question which the image belongs to.
- `[IMAGE as it is]`: The unmodified uploaded image (jpg, png, webp, etc.)