Skip to main content
Version: v1.0.6

RandomInterruption

The RandomInterruption interface is used to define an interruption that will be shown randomly in the block.

For example, if you want to show a single interruption randomly in the block, you would set "spacing" to "random" and "numInterruptions" to 1. If you want to show 3 interruptions randomly in the block, you would set "spacing" to "random" and "numInterruptions" to 3.

The components property is an array of the components that will be inserted randomly in the block. These components should reference components in the StudyConfig.components section of the config.

Here's an example of how to use the RandomInterruption:

{
"order": "fixed",
"components": [
"component1",
"component2",
"component3",
"component4",
"component5",
"component6"
],
"interruptions": [
{
"spacing": "random",
"numInterruptions": 3,
"components": [
"interruption1",
"interruption2"
]
}
]
}

The resulting sequence array could be:

[
["component1", "interruption1", "interruption2", "component2", "interruption1", "interruption2", "component3", "component4", "component5", "interruption1", "interruption2", "component6],
["component1", "interruption1", "interruption2", "component2", "interruption1", "interruption2", "component3", "component4", "interruption1", "interruption2", "component5", "component6],
["component1", "component2" "interruption1", "interruption2", "component3", "interruption1", "interruption2", "component4", "component5", "interruption1", "interruption2", "component6],
...
]

Properties

PropertyTypeDescription
componentsstring[]The components that are included in the interruption. These reference components in the StudyConfig.components section of the config.
numInterruptionsnumberThe number of times the interruption will be randomly added
spacing"random"If spacing is set to random, reVISit will add interruptions randomly. These interruptions will not ever be displayed as the first component in the block.