I tried to first and foremost separate schemas from processing and lean on the type-checker where possible. The main structure is of three classes:
1) Submission -- the JSON data coming from
2) Mustache -- what we send into chevron for rendering
3) FadedParsonsProblem -- the main logic for the problem itself, converting between (1), (2), markup, and the xml
I might have left some reusable bits in the "Helper functions" section, but I wanted to open this to allow us to talk about it.
This is my quick stab at this.
I tried to first and foremost separate schemas from processing and lean on the type-checker where possible. The main structure is of three classes: 1)
Submission
-- the JSON data coming from 2)Mustache
-- what we send intochevron
for rendering 3)FadedParsonsProblem
-- the main logic for the problem itself, converting between (1), (2), markup, and the xmlI might have left some reusable bits in the "Helper functions" section, but I wanted to open this to allow us to talk about it.