Playground
Use this playground in order to try out simple manager scripts.
Think of the Study Manager as the code that organizes your study, survey, or experiment. Within Study Manager you will:
There are many types of tasks you can add to the Study Manager but the most common are questionnaires and time-sensitive tasks. For the full list, see this page.
Advanced users may also use the Study Manager to define global variables all tasks can access or change the global settings of the study. You can learn more about the global settings here.
The Study Manager exists in a ‘mgr.js’ file. Start this file by defining a manager object:
define(['managerAPI'], function(Manager) {
var API = new Manager();
API.setName('mgr');
});
Now you must tell Study Manger the tasks to include in your study. Learn about the types of tasks here. Let’s imagine your study consists of three tasks:
You add these tasks to the Study Manager with the following code:
API.addTasksSet({
consent: [{
type: 'quest',
name: 'consent',
scriptUrl: 'consent.js'
}],
rosenberg: [{
type: 'quest',
name: 'rosenberg',
scriptUrl: 'rosenberg.js'
}],
debriefing: [{
type:'message',
name:'lastpage’,
scriptUrl: ‘debrief.js’,
last:true
}]
});
Notice that each task is given a ‘name.’ You will use that name to refer to each task in the next section.
The next task is to define the order in which the tasks are presented to participants. This is referred to as the ‘sequence.’ Use the addSequence() function to define the sequence (i.e., order) the tasks are presented to participants. You can learn more about the addSequence() function here.
API.addSequence([
{inherit: 'consent'},
{inherit: 'rosenbergSelfEsteem'},
{inherit: 'lastpage'}
]);
You can learn more about inheritance and the ‘inherit’ command [here] (https://minnojs.github.io/docs/sequencer/inheritance/).
Sequences can be much more complicated using mixers. With mixers you can randomize the order of tasks, add conditional branches, and use random assignment. You can learn more about mixers here
Finally, you must write a line of code that starts the study running!
return API.script;
And that’s it! See the full example below. Also you can run a working example here
define(['managerAPI'], function(Manager) {
var API = new Manager();
API.setName('mgr');
API.addTasksSet({
consent: [{
type: 'quest',
name: 'consent',
scriptUrl: 'consent.js'
}],
rosenberg: [{
type: 'quest',
name: 'rosenberg',
scriptUrl: 'rosenberg.js'
}],
debriefing: [{
type:'message',
name:'lastpage’,
scriptUrl: ‘debrief.js’,
last:true
}]
});
API.addSequence([
{inherit: 'consent'},
{inherit: 'rosenbergSelfEsteem'},
{inherit: 'lastpage'}
]);
return API.script;
});
Use this playground in order to try out simple manager scripts.
The details of the MinnoJS programming interface for minno-manager
Various examples of manager tasks