CentreForDigitalHumanities / CentreForDigitalHumanities/coloringbook
Idea: conditional branching for pages
- Dominant language
- Python
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
A little epiphany from this morning. This is a combination of two or three relatively small changes, which would open many new possibilities, such as:
- games;
- interactive stories;
- automatic bespoke difficulty levels (staircase);
- rehearsal.
For efficiency of implementation, these changes would be best to do after #25 and #34.
**Change 1**: instead of making each page a combination of an optional written sentence, an optional recording and a required drawing, we introduce a polymorphism between two types of pages. One page type consists of a required drawing and an optional recording, the other consists of a required written sentence (though it may be the empty string) and an optional recording as well. This makes it possible to alternate between text and drawings in arbitrary order. Migration of pre-existing pages and surveys is straightforward, where every page with written text is split in two. Placing text above or below a drawing can be achieved by simply including the text in the drawing SVG (or by still supporting optional written text in the drawing page type).
**Change 2**: at the survey level, the editor gains the possibility to define conditional branching rules. Conditions are applied per-page (if present) in a fallthrough manner. I envision five types of rules:
1. If area X on page W is given color Y, continue to page Z.
2. If area X on page W is *not* given color Y, continue to page Z.
3. If color Y is applied on page W to an area *other* than X, continue to page Z.
4. If color Y is *not* applied on page W to an area other than X, continue to page Z.
5. By default (i.e., if all previous conditions fell through), continue to page Z.
Z may be any page in the sequence, including W and all pages before it. This makes both cycles and skips possible. The "default default" is to simply continue to the next page. There should also be a special Z value that stands for the end of the survey, so that the survey can be closed without visiting the last page.
Y may be "white" which means "no color", or "any color" if negated (in rule types 2 and 4).
X may be a nil area. In combination with rule types 3 and 4, this makes it possible to capture "anywhere in the drawing" and "nowhere in the drawing" type of conditions.
**Change 3 (optional):** surveys currently have a global setting for the time delay between the appearance of the sentence and the drawing. After change 1 above, that delay will apply to text pages. An optional refinement is to allow per-page overrides, which might smoothen game-like setups.
Contributor guide
No contributing guide indexed for this repository
Research direction
Read issues #25 and #34 first, then trace the existing page and survey models, editor flow, and navigation behavior. Break the proposal into the page-type migration, conditional branching rules, and optional per-page delay; done means existing pages still work and the new page and survey behaviors support the listed cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- full-stack
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100