Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edinburgh Handedness Inventory #15

Open
wants to merge 6 commits into
base: old_master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions docs/Group_studies/Example-Group-Studies.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@ title: Example Group Studies
slug: /Example-Group-Studies.html
sidebar_position: 1
---
import Hl from '@site/src/components/Highlight';

In group studies, the workers that are part of a group can communicate with each other. JATOS supports different kinds of groups. A group can e.g. have a fixed set of workers like this [Prisoner's Dilemma](/Example-Studies) where exactly two workers play with each other. On the other side of the spectrum is this [Snake game](/Example-Studies) with an on open, multi-worker approach.
In group studies, the workers that are part of a group can communicate with each other. JATOS supports different kinds of groups. A group can e.g. have a fixed set of workers like this [<Hl>Prisoner's Dilemma</Hl>](/Example-Studies) where exactly two workers play with each other. On the other side of the spectrum is this [<Hl>Snake game</Hl>](/Example-Studies) with an on open, multi-worker approach.

**How can you try-out a group-study if you're alone but want to simulate multiple workers?**

JATOS allows [up to 10 study runs](Tips-and-Tricks.html#run-up-to-10-studies-in-the-same-browser-at-the-same-time) at the same time in the same browser (JATOS has no limit for different browsers). So you can just start the same (group) study multiple times in your browser and pretend you're multiple workers.

As an example of this, let's go through the Snake Game group study in detail:
As an example of this, let's go through the <Hl>Snake Game</Hl> group study in detail:

1. Download and import the [Snake game](/Example-Studies)
1. Open the [Study Links](Run-your-Study-with-Study-Links.html) page
1. Now get a study link to start the first Snake game: Click on the Study Links button in line Personal Multiple (other study link types are fine too). In the opened pop-up window click on the top-left button <span class="glyphicon glyphicon-plus"></span><span class="glyphicon glyphicon-link"></span> to get a new link and then on <span class="glyphicon glyphicon-duplicate"></span> in the link's row to copy it to the clipboard.
1. Open a new tab in your browser and paste the study link into the address field. Press 'Enter' and the study should start.
1. Download and import the [<Hl>Snake game</Hl>](/Example-Studies)
1. Open the [<Hl>Study Links</Hl>](Run-your-Study-with-Study-Links.html) page
1. Now get a study link to start the first Snake game: Click on the <Hl>Study Links</Hl> button in line <Hl>Personal Multiple</Hl> (other study link types are fine too). In the opened pop-up window click on the top-left button <Hl><span className="glyphicon glyphicon-plus"></span><span className="glyphicon glyphicon-link"></span></Hl> to get a new link and then on <Hl><span className="glyphicon glyphicon-duplicate"></span></Hl> in the link's row to copy it to the clipboard.
1. Open a new tab in your browser and paste the study link into the address field. Press <Hl>Enter</Hl> and the study should start.
1. Repeat the last step to start a second Snake game.
1. Now, in both tabs: click through the introduction until you arrive in the waiting room. Click **Join** and then **Ready**.
1. Now, in both tabs: click through the introduction until you arrive in the waiting room. Click <Hl>Join</Hl> and then <Hl>Ready</Hl>.
1. Voilà! You'll see two snakes moving around: each tab is running the Snake Game - but they are in the same group.
1. Optional: Have a look at your [Group in the Study Links page](Run-your-Study-with-Study-Links.html#groups) add see who the member workers are.
1. Optional: Have a look at your [<Hl>Group in the Study Links page</Hl>](Run-your-Study-with-Study-Links.html#groups) add see who the member workers are.

![Snake example](/img/example-studies/Screenshot_snakeGame.png)

Expand Down
19 changes: 10 additions & 9 deletions docs/Group_studies/Write-Group-Studies-I-Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ title: Write Group Studies I - Setup
slug: /Write-Group-Studies-I-Setup.html
sidebar_position: 2
---
import Hl from '@site/src/components/Highlight';

## Set up group studies

First and common to all group setups is to check the Group study checkbox in the study properties.
First and common to all group setups is to check the <Hl>Group study</Hl> checkbox in the study properties.

![Group's property](/img/study-properties-group-study.png)

If the Group property is checked, JATOS will assign workers into groups. We'll describe some group properties that you can use to tweak according to whether you want to keep control over worker assignment, or you give JATOS full control.
If the <Hl>Group</Hl> property is checked, JATOS will assign workers into groups. We'll describe some group properties that you can use to tweak according to whether you want to keep control over worker assignment, or you give JATOS full control.


### Group settings in each batch's properties
Expand All @@ -19,9 +20,9 @@ You can have multiple batches in JATOS, each one with different group settings.

![Study Links screenshot](/img/batch_properties_groups.png)

1. **Max total workers**: This isn't just a properties of group studies. It simply limits the total amount of workers who are allowed to run in this batch.
1. **Max total members**: This limits the number of members a single group can have. While there can be multiple groups in a batch, the _Max total members_ field applies to each separate group.
1. **Max active members**: This limits the number of active members a single group can have. An active member is in the group at this time - in opposite to a past member who already left the group. This number applies to each group separately. Example: In the Prisoner's Dilemma study, you would limit the active members to 2.
1. **<Hl>Max total workers</Hl>**: This isn't just a properties of group studies. It simply limits the total amount of workers who are allowed to run in this batch.
1. **<Hl>Max total members</Hl>**: This limits the number of members a single group can have. While there can be multiple groups in a batch, the <Hl>Max total members</Hl> field applies to each separate group.
1. **<Hl>Max active members</Hl>**: This limits the number of active members a single group can have. An active member is in the group at this time - in opposite to a past member who already left the group. This number applies to each group separately. Example: In the <Hl>Prisoner's Dilemma</Hl> study, you would limit the active members to 2.

By default, all properties have no upper limit.

Expand All @@ -32,24 +33,24 @@ You can either tell JATOS to assign workers to different groups, or you can keep

### Scenario 1: One group, assign workers manually

If in a batch you set the _Max total worker_ to 2 and leave the other two Max parameters empty, JATOS has no other choice than to allow only 2 workers and sort them into the same group. If you then [create two Personal Single study links](Run-your-Study-with-Study-Links.html) (but other study link types are fine too) and send the links to your two participants, you can be sure that they will interact with each other. If you need more groups, just create a second batch with two other workers.
If in a batch you set the <Hl>Max total worker</Hl> to 2 and leave the other two Max parameters empty, JATOS has no other choice than to allow only 2 workers and sort them into the same group. If you then [create two Personal Single study links](Run-your-Study-with-Study-Links.html) (but other study link types are fine too) and send the links to your two participants, you can be sure that they will interact with each other. If you need more groups, just create a second batch with two other workers.

![Prisoners example](/img/prisoners_example.png)

The first two scenarios may apply to the [Prisoner's Dilemma Example Study](/Example-Studies).

### Scenario 2: Several groups, let JATOS assign workers

Say you want to have 3 groups with 2 workers each. You want to leave it to JATOS which workers are paired together. Then, set _Max total workers_ to 6 and both _Max active members_ and _Max total members_ to 2 (remember that these numbers apply to each group separately). Then [create 6 Personal Single study links](Run-your-Study-with-Study-Links.html) (but other study link types are fine too) and send them to your 6 participants.
Say you want to have 3 groups with 2 workers each. You want to leave it to JATOS which workers are paired together. Then, set <Hl>Max total workers</Hl> to 6 and both <Hl>Max active members</Hl> and <Hl>Max total members</Hl> to 2 (remember that these numbers apply to each group separately). Then [create 6 Personal Single study links](Run-your-Study-with-Study-Links.html) (but other study link types are fine too) and send them to your 6 participants.

### Scenario 3: One open world

This scenario is basically the opposite of the first one. By limiting neither the _Max total worker_ nor the _Max total members_, nor the _Max active members_ JATOS will sort all workers into one single group that is potentially of unlimited size. Now --to keep it completely open-- just [create one study link type General Single](Run-your-Study-with-Study-Links.html) (but other study link types are fine too) and publish it (e.g. via a mailing list or on a website).
This scenario is basically the opposite of the first one. By limiting neither the <Hl>Max total worker</Hl> nor the <Hl>Max total members</Hl>, nor the <Hl>Max active members</Hl> JATOS will sort all workers into one single group that is potentially of unlimited size. Now --to keep it completely open-- just [create one study link type General Single](Run-your-Study-with-Study-Links.html) (but other study link types are fine too) and publish it (e.g. via a mailing list or on a website).

![Snake example](/img/snake_example.png)

The third and fourth scenario may apply to the [Snake Example Study](/Example-Studies).

### Scenario 4: Multiple open worlds with limited active members

Say you want to have groups with up to 3 members, interacting _at the same time_. But you don't want to actually limit the total number of members per group: you want to allow new workers to join a group if one of its members left. This way each group can have a flow of workers joining and leaving - the only constraint is the maximum members per group at any given time. You also want to let JATOS set the number of groups depending on the available workers. To set up this just use one batch, set the _Max active members_ to 3, and leave _Max total worker_ and _Max total members_ unlimited.
Say you want to have groups with up to 3 members, interacting _at the same time_. But you don't want to actually limit the total number of members per group: you want to allow new workers to join a group if one of its members left. This way each group can have a flow of workers joining and leaving - the only constraint is the maximum members per group at any given time. You also want to let JATOS set the number of groups depending on the available workers. To set up this just use one batch, set the <Hl>Max active members</Hl> to 3, and leave <Hl>Max total worker</Hl> and <Hl>Max total members</Hl> unlimited.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ title: Write Group Studies II - JavaScript and Messaging
slug: /Write-Group-Studies-II-JavaScript-and-Messaging.html
sidebar_position: 3
---
import Hl from '@site/src/components/Highlight';

## Writing JavaScripts for group studies

Group studies differ from single-worker studies simply in that the JavaScript needs to handle groups and communications between members. The _jatos.js_ library provides some useful functions for this.
<Hl>Group studies</Hl> differ from <Hl>single-worker studies</Hl> simply in that the JavaScript needs to handle groups and communications between members. The <Hl>jatos.js</Hl> library provides some useful functions for this.

If you like to dive right into _jatos.js'_ reference:

Expand All @@ -18,7 +19,7 @@ If you like to dive right into _jatos.js'_ reference:
### Joining a group and opening group channels

Workers can only communicate with members of their own group. So, interacting workers must all join the same group.
**A worker will remain in a group until _jatos.js_ is explicitly told to leave the group (or the study run is finished). This means that if a worker moves between components or reloads a page they will still remain in the same group.** This feature makes groups much more robust.
**A worker will remain in a group until <Hl>jatos.js</Hl> is explicitly told to leave the group (or the study run is finished). This means that if a worker moves between components or reloads a page they will still remain in the same group.** This feature makes groups much more robust.

So here's how a typical JATOS group study run would look like. This study has three components.

Expand All @@ -39,7 +40,7 @@ Component 3

Notice that by calling [`jatos.joinGroup`](jatos.js-Reference.html#jatosjoingroup) in the second and third component JATOS does not let workers join a new group but just opens a group channel in the already joined group. To make a worker leave a group, use the function [`jatos.leaveGroup`](jatos.js-Reference.html#jatosleavegroup).

Every know and then you probably would like to know who the members of your groups are. This and other stats you can get by clicking on your batch's [Groups button in the Study Links page](Run-your-Study-with-Study-Links.html#groups).
Every know and then you probably would like to know who the members of your groups are. This and other stats you can get by clicking on your batch's [<Hl>Groups</Hl> button in the <Hl>Study Links</Hl> page](Run-your-Study-with-Study-Links.html#groups).


### Reassigning to a different group
Expand All @@ -48,19 +49,19 @@ To move a worker from one group to a different one, use [`jatos.reassignGroup`](

### Fixing a group

Sometimes you want to stay with the group like it is in this moment and don't let new members join - although it would be allowed according to the group properties. For example in the [Prisoner's Example study](/Example-Studies) after the group is assembled in the waiting room component it is necessary to keep the two members as it is. Even if one of the members leaves in the middle of the game, JATOS shouldn't just assign a new member. To do this you can call _jatos.js_' function [`jatos.setGroupFixed`](jatos.js-Reference.html#jatossetgroupfixed). Alternatively you can fix a group in JATOS' GUI, in the
[Groups table in the Study Links page](Run-your-Study-with-Study-Links.html#groups).
Sometimes you want to stay with the group like it is in this moment and don't let new members join - although it would be allowed according to the group properties. For example in the [<Hl>Prisoner's Example study</Hl>](/Example-Studies) after the group is assembled in the waiting room component it is necessary to keep the two members as it is. Even if one of the members leaves in the middle of the game, JATOS shouldn't just assign a new member. To do this you can call _jatos.js_' function [`jatos.setGroupFixed`](jatos.js-Reference.html#jatossetgroupfixed). Alternatively you can fix a group in JATOS' GUI, in the
[<Hl>Groups</Hl> table in the <Hl>Study Links page</Hl>](Run-your-Study-with-Study-Links.html#groups).


## Communication between group members

JATOS provides three ways for communicating within the group: direct messaging, broadcast messaging and with the Group Session.

### Direct messaging
Members can send direct messages to a single other member of the same group with the [`jatos.sendGroupMsgTo`](jatos.js-Reference.html#jatossendgroupmsgto) function. Like broadcast messaging this way of group communication is fast but can be unreliable in case of an unstable network connection. We use direct messaging in the [Snake example](/Example-Studies) to send the coordinates of the snakes on every step. Here, speed is more critical than reliability in the messages, because a few dropped frames will probably go unnoticed.
Members can send direct messages to a single other member of the same group with the [`jatos.sendGroupMsgTo`](jatos.js-Reference.html#jatossendgroupmsgto) function. Like broadcast messaging this way of group communication is fast but can be unreliable in case of an unstable network connection. We use direct messaging in the [<Hl>Snake example</Hl>](/Example-Studies) to send the coordinates of the snakes on every step. Here, speed is more critical than reliability in the messages, because a few dropped frames will probably go unnoticed.

### Broadcast messaging
Members can send messages to all other members of the same group with the [`jatos.sendGroupMsg`](jatos.js-Reference.html#jatossendgroupmsg) function. Like direct messaging this way of group communication is fast but can be unreliable in case of an unstable network connection.

### Group session
The Group Session is one of the [three types of session that JATOS provides](Session-Data-Three-Types.html). Members can access the Group Session data with the [Group Session functions](jatos.js-Reference.html#functions-to-access-the-group-session). The Group Session data are stored in JATOS' database **only while the group is active. It is deleted when the group is finished.** Communication via Group Session is slower, but more reliable than group messaging. If one member has an unstable internet connection or does a page reload, the Group Session will be automatically restored after the member reopens the group channel. Workers communicate via the Group Session data in the [Prisoner's Example study](/Example-Studies), because here one dropped message would lead to important information loss.
The Group Session is one of the [three types of session that JATOS provides](Session-Data-Three-Types.html). Members can access the Group Session data with the [Group Session functions](jatos.js-Reference.html#functions-to-access-the-group-session). The Group Session data are stored in JATOS' database **only while the group is active. It is deleted when the group is finished.** Communication via Group Session is slower, but more reliable than group messaging. If one member has an unstable internet connection or does a page reload, the Group Session will be automatically restored after the member reopens the group channel. Workers communicate via the Group Session data in the [<Hl>Prisoner's Example study</Hl>](/Example-Studies), because here one dropped message would lead to important information loss.
Loading