Since last week, I got the jsonized survey (with blocking, not with branching) to pass the HTML tests, and the resulting survey HTML appears to be working correctly. I then made an attempt at adding branching, but am still working on getting it to produce the correct JSON for the branchmap. My original thoughts, based on a discussion between Emma and Presley, were to make a Constraint object, which takes a question as a parameter and allows the user to specify branches from the question’s options (based on their id or index). The survey would then contain a list of constraints, along with the top level block list. However, the JSON schema structure suggests that the branch map (Constraint) JSON is meant to be generated within the question, as a question property (rather than a top-level survey property). I am dealing with this by creating a question attribute to reference the constraint when a constraint is constructed for that question; questions with no constraints won’t have this attribute, since it is created and assigned within the constraint constructor. When producing the Question JSON, I check whether it has a constraint attribute, and add the appropriate BranchMap JSON if it does.
The current code on my GitHub repo includes an attempt a branching survey representation, but I’m not sure that the branching JSON is correct. It passes my validators, but it is no longer passing the HTML tests. I will have to try to fix this.
In terms of milestones, I accomplished a portion of what I wanted to get done for the end of this week, but I got less of the testing stuff done that I would have liked; I haven’t really started on any automated tests yet. Until I get more testing material, I figured that it would make more sense to focus on the branching. Unfortunately, I won’t be able to meet with Emma and Presley today because of travel issues for track (which came up unexpectedly), so hopefully I can get back on track when I get home on Sunday and be a bit more productive next week; I’ve been struggling with other classes’ homework.