alopezlago / MODAQ

Web application for assisting moderators with reading and scorekeeping quiz bowl matches.
https://www.quizbowlreader.com/demo.html
MIT License
14 stars 5 forks source link

Output more logical order of keys in serialized JSON objects #283

Closed hftf closed 8 months ago

hftf commented 8 months ago

JSON objects are conventionally orderless or have undefined order, but a natural order benefits any human needing to read, edit, or otherwise work with the files. Yesterday, for example, we needed to edit a QBJ file manually due to #282, and the unexpected ordering of buzzes before question_number (etc.) led to confusion and delays – the moderator wanted to first pretty-print the QBJ to verify what the object structure was (etc.) before editing.

The same issue should be filed for YAPP (put answer key after question, put answers key after parts, etc.).

Equally, it is not intuitive that QBJ output contains derived quantities and multiple sources of truth that must all be synchronized (team’s bonus_points also equals sum of all bonus parts’ controlled_points; but no such tossup_points exists), but maybe this is more of an issue for https://github.com/quizbowl/schema. Seems bonus_points is entirely optional, but I don’t know about how downstream apps expect to ingest QBJ.

alopezlago commented 8 months ago

bonus_points is a schema issue and was more useful when MODAQ also supported the old PACE format that had bouncebacks, requiring the sum of two different fields. I don't remember if Yellowfruit uses that field, or if any of the advanced stats viewers use it.

alopezlago commented 8 months ago

I'll move question_number before buzzes.