Skip to content

Commit 20d0bc5

Browse files
committed
update doc for dynamic blocks
1 parent 91a1458 commit 20d0bc5

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

docs/designing-studies/dynamic-blocks.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ In this example, the `dynamicBlock` component is a dynamic block that uses the f
3232
The function in `src/public/study-name/dynamic.ts` uses the following types provided by reVISit:
3333

3434
```ts
35-
export default function dynamicFunction({ components, answers, sequenceSoFar, customParameters } : JumpFunctionParameters<T>): JumpFunctionReturnVal
35+
export default function dynamicFunction({ answers, customParameters, currentStep, currentBlock } : JumpFunctionParameters<T>): JumpFunctionReturnVal
3636
```
3737

3838
Where `JumpFunctionParameters` is defined as:
3939

4040
```ts
4141
export interface JumpFunctionParameters<T> {
42-
components: (string | ComponentBlock)[],
4342
answers: ParticipantData['answers'],
44-
sequenceSoFar: string[],
45-
customParameters: T
43+
customParameters: T,
44+
currentStep: number,
45+
currentBlock: string,
4646
}
4747
```
4848

@@ -56,7 +56,7 @@ export interface JumpFunctionReturnVal {
5656
}
5757
```
5858

59-
The `components` field is an array of all the components in the study. The `answers` field is an object that contains the participant's answers to all the questions so far. The `sequenceSoFar` field is an array of the ids of the components that have been shown so far. The `customParameters` field is an object that contains any parameters passed to the function from the study configuration file.
59+
The `answers` field is an object that contains the participant's answers to all the questions so far. The `customParameters` field is an object that contains any parameters passed to the function from the study configuration file. The `currentStep` field is the current step index in the flattened sequence, and `currentBlock` is the id/path prefix for the active dynamic block.
6060

6161
The function should return an object with the following fields:
6262

@@ -99,4 +99,4 @@ import StructuredLinks from '@site/src/components/StructuredLinks/StructuredLink
9999
referenceLinks={[
100100
{name: "Dynamic Block", url:"../../typedoc/interfaces/DynamicBlock"}
101101
]}
102-
/>
102+
/>

0 commit comments

Comments
 (0)