Tasks

Introduction to tasks and their common parameters

The basic unit in miManager is the task. There are many types of tasks available, and you can also create custom tasks of your own. Tasks are defined within the sequence just like any other element, and you can use mixers, inheritance, and templates to control their flow.

For example, following is a manager sequence with two subsequent tasks - first a questionnaire, then a time-sensitive tasks.

API.addSequence([
    { type: 'quest', name: 'race-questionnaire', scriptUrl:'race.quest.js'},
    { type: 'time', name: 'race-iat', scriptUrl:'iat.js'}
]);

Task properties

All tasks have some common properties that can be used to customize their behaviour. Following is a list of such properties and a description of their behaviour.

PropertyDescription
nameTask name.
typeType of task (quest,message etc.).
preA function to invoke before the task (may return a promise).
loadA function to invoke as soon as the task is loaded (may return a promise).
postA function to invoke after the task (may return a promise).
canvasA canvas object (as defined under settings) to invoke at the beginning of the task and remove
titleA string to be used as the page title (the name displayed on the tag). It is reset at the end of the task.
preTextA template to be expanded before the task
postTextA template to be expanded after the task
currentAn object that will be merged into the task current object.
Last modified March 11, 2021: setup hugo (11980dc)