Developing a workflow system for Stat-JR

As part of the ESRC grant "The use of interactive electronic-books in the teaching and application of modern quantitative methods in the social sciences" we have developed a workflow system for Stat-JR, first released with Stat-JR v1.0.4 (summer 2016).

The workflow system uses the Blockly visual programming system, extending the selection of blocks available to include blocks that perform common statistical processes. As such, it has a user-friendly front-end which allows users to build up a workflow using different blocks, with each block conceptually representing a particular section of code.

Screenshots of the workflow system

Selecting blocks

The workflow system consists of a range of blocks accessible from the menus on the left-hand side; each block performs a different function:

Workflow screenshot 1

Here we have selected a block which loops through whatever blocks are placed inside it (i.e. to the right of "do") with the number of times it does that defined by whatever we place at the top (i.e. in between "repeat" and "times"):

Workflow screenshot 2

The blocks themselves ensure syntactical rules are respected

As well as the physical shape of blocks determining how users can join them together, you'll find sometimes if you try to fit a block which isn't appropriate - here trying to place a string object (which could consist of inappropriate characters, such as letters) - then it won't allow you to: the block 'pops' out each time you try to fit it in. In this way the blocks themselves guide users to respect correct syntax when fitting them together, helping avoid errors at run-time (note in this picture we've enlarged the size of the blocks):

Workflow screenshot 3

In contrast when we try to use a numeric object block to define the number of iterations the loop will make, the block accepts it:

Workflow screenshot 4

Attaching blocks together to make a workflow

By attaching blocks together, complex workflows can be gradually built up. In this example there are conditional statements, loops, procedure calls, and even questions which prompt the user for input when the workflow runs:

Workflow screenshot 5