Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: conditional branching for pages #35

Open
jgonggrijp opened this issue Jan 31, 2024 · 0 comments
Open

Idea: conditional branching for pages #35

jgonggrijp opened this issue Jan 31, 2024 · 0 comments

Comments

@jgonggrijp
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant