zooniverse / front-end-monorepo

A rebuild of the front-end for zooniverse.org
https://www.zooniverse.org
Apache License 2.0
104 stars 29 forks source link

Branching in the single choice task isn't supported #687

Closed rogerhutchings closed 3 years ago

rogerhutchings commented 5 years ago

Package

lib-classifier

rogerhutchings commented 5 years ago

Time estimate: 1 dev, 1 week

srallen commented 4 years ago

Workflow steps ADR has an example of how branching logic will be supported with workflow steps: https://github.com/zooniverse/front-end-monorepo/blob/master/docs/arch/adr-05.md#decision

srallen commented 4 years ago

This also can be developed against the kitteh zoo staging project as the first step/task should be a branching single choice question.

mcbouslog commented 4 years ago

I've created draft PRs for two of likely a few approaches:

1747 - adds next property to Step, similar to what intended for recursive workflows as stated in https://github.com/zooniverse/front-end-monorepo/blob/master/docs/arch/adr-05.md#decision

1748 - adds next to workflowStepStore

Going Back/Previous breaks either at the moment.

In this test workflow - https://master.pfe-preview.zooniverse.org/lab/1693/workflows/3428, it should go: single q (0, 1, 2) 0 - complete 1 - drawing, then complete 2 - text, then complete However, after the drawing task it advances to the text task, because the workflow step store does not currently account for the next task setting (on any task, including the branching of the single question task). Is this what we refer to as a recursive workflows, and is therefor out of scope of this issue? That's fine, I can just focus on advancing from a single choice question, but they're (single choice branching, any task next's setting, going back/previous) so interrelated I'm not sure if should be considered at same time?

srallen commented 4 years ago

After discussing this with @mcbouslog, we've realized that once a branching has occurred, we will always need to explicitly know what step is next and previous. Say a branching workflow looks like this:

|Step A| |.......... | |...........| [B]......[C] |............| [D].......[E]

So A -> B -> D or A -> C -> E

And the step map looks like this: [[A],[B],[C],[D],[E]]

We can't rely on the map order once the branching happens.

So, we need to tweak how this works and define a next and previous for all steps:

How to determine the previous step with branching still needs some thought.

We'll need to write up an updated ADR for these changes.