Skip to content

Commit

Permalink
Set 3.9.x as default docs in versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
kristian-lange committed Jun 4, 2024
1 parent eb33c4f commit c84ab8d
Show file tree
Hide file tree
Showing 63 changed files with 8,246 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,21 @@ const config = {
routeBasePath: '/',
showLastUpdateAuthor: true,
showLastUpdateTime: true,
lastVersion: '3.8.1',
lastVersion: '3.9.1',
versions: {
current: {
label: 'next',
path: 'next',
banner: 'unreleased',
},
'3.9.1': {
label: '3.9.x',
path: '',
banner: 'none',
},
'3.8.1': {
label: '3.8.x',
path: '',
path: '3.8.x',
banner: 'none',
},
'3.7.1': {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: Example Group Studies
slug: /Example-Group-Studies.html
sidebar_position: 1
---

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.

**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:

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. 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. 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.

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

There's actually a lot going on behind the curtain of a group study. All members of a group are able to communicate in real-time with each other directly or broadcast messages to the whole group.

Next step: [Write Your Own Group Studies](Write-Group-Studies-I-Setup.html).
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: Write Group Studies I - Setup
slug: /Write-Group-Studies-I-Setup.html
sidebar_position: 2
---

## Set up group studies

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

![Group's property](/img/v39x/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.


### Group settings in each batch's properties

You can have multiple batches in JATOS, each one with different group settings. There are three important bits of information for a group study:

![Study Links screenshot](/img/v39x/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.

By default, all properties have no upper limit.


## Group assignment

You can either tell JATOS to assign workers to different groups, or you can keep full control and do it yourself (or something in between). We'll use some example scenarios to explain how this assignment works.

### 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.

![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.

### 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).

![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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: Write Group Studies II - JavaScript and Messaging
slug: /Write-Group-Studies-II-JavaScript-and-Messaging.html
sidebar_position: 3
---

## 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.

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

* [_jatos.js_ functions for group studies](jatos.js-Reference.html#group-functions)
* [_jatos.js_ group variables](jatos.js-Reference.html#group-variables)
* [_jatos.js_ Group Session functions](jatos.js-Reference.html#functions-to-access-the-group-session)


### 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.

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

Component 1

* `jatos.joinGroup` -> joins group and opens group channel
* `jatos.nextComponent` -> closes group channel and jumps to next component

Component 2

* `jatos.joinGroup` -> opens group channel in the **same group**
* `jatos.nextComponent` -> closes group channel and jumps to next component

Component 3

* `jatos.joinGroup` -> opens group channel **same group**
* `jatos.endStudy` -> closes group channel, leaves group, ends component, and ends study

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).


### Reassigning to a different group

To move a worker from one group to a different one, use [`jatos.reassignGroup`](jatos.js-Reference.html#jatosreassigngroup). This function will make a worker leave their group and join a different one. JATOS can only reassign to a different group if there is another group available. If there is no other group JATOS will not start a new one but put the worker into the same old group again.

### 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).


## 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.

### 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.
4 changes: 4 additions & 0 deletions versioned_docs/version-3.9.1/Group_studies/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Group studies",
"position": 5
}
32 changes: 32 additions & 0 deletions versioned_docs/version-3.9.1/Manage_your_JATOS/Administration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: Administration
slug: /Administration.html
sidebar_position: 1
---

On the Administration page [users with admin rights](/User-Manager.html) can get an overview of the studies and users of a JATOS installation. You can see the **logs**, **system info**, or go to the **test page** to check if JATOS runs correctly. It is also the place where **update notifications** appear when a new JATOS version is available and where [admins can trigger an update](/Update-JATOS.html#automatic-updates).

![Administration screenshot](/img/v39x/administration.png)


### User Manager

Manage users, passwords, and rights from here. Find more details on [its documentation page](/User-Manager.html)


### Study Administration

By clicking the _Studies_ button you'll get to an overview about all studies that are on the JATOS instance. You'll also see, for each study: whom it belongs to (the study members), how much disk space it takes, and when it was active last.

**In larger JATOS installations it can take up to a couple minutes to gather all data for this page**

![Studies Administration](/img/v39x/study_manager.png)

The information is displayed in a table with the columns:

* **Active** - In cases where e.g. a study uses to many server resources, an admin can **deactivate** (or activate again) it by clicking the checkbox in the 'Active' column. A deactivated study cannot be started by participants (workers) anymore, but an already started study run can be continued. That means, an admin will not interrupt a participant if they already started doing a study, but no new participants will be able to start it. The study members can still see and edit the study, as well as export its result data.
* **Study Assets Size** - The disk size of all asset files associated to this study (HTML, JS, CSS, images, videos, etc.).
* **Result Count** - The number of study results collected so far on this JATOS instance.
* **Result Data Size** - The size of all result data that are stored in the database. In brackets is the average size per result count.
* **Result File Size** - The size of all result files that are stored in the server's file system. In brackets is the average size per result count.
* **Last Started** - When was this study last started by a participant.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: Customize JATOS' Home Page
slug: /Customize-JATOS-Home-Page.html
sidebar_position: 5
---

## Link to Terms of Use

You can configure JATOS to show a link to your 'Terms of Use' that will be shown in a info box on the home page.

In your JATOS installation folder edit `conf/jatos.conf` (or `conf/production.conf` in version < 3.8.3) and add the URL under `jatos.termsOfUseUrl`. If left empty the info box is not shown.


## Welcome Block

You can customize JATOS' home page to e.g.
* show your university's logo,
* add some introduction text, or
* announce an upcoming event.

This is done by configuring JATOS with an URL that points to some static HTML that describes your individual welcome block. This HTML block will then be loaded and displayed in every home page.

Have a look at this [example welcome block](https://github.com/JATOS/customized-home-page-template/blob/main/foobar-university-welcome.html).


![template customized home page](/img/v39x/screenshot-branding.png)

You can update your welcome block at any time to add new information (e.g. anouncement of JATOS maintance work). But since the HMTL is cached it can take **up to an hour to be visible to your users**. If you want to see it right away for testing you can disable caching in your browser.

This welcome block can be fetched from **any HTTP server** that is able to serve HTML. One way is to do it via GitHub.

### With GitHub

1. Go to [https://github.com/JATOS/customized-home-page-template](https://github.com/JATOS/customized-home-page-template)
1. Click 'Use this template' button to create a copy of this repository
1. Change the content of `foobar-university-welcome.html` to your needs
1. Add necessary files (e.g. logo images) to your repository
1. Configure JATOS: In your JATOS installation folder edit `conf/jatos.conf` (or `conf/production.conf` in version < 3.8.3) - add `jatos.brandingUrl`:

1. Easy but with rate limit (from GitHub)

```
jatos.brandingUrl = "https://raw.githubusercontent.com/my-user/my-repo/main/foobar-university-welcome.html"
```
Remember to change `my-user`, `my-repo`, and `foobar-university-welcome.html`
1. Better use [GitHub pages](https://docs.github.com/en/github/working-with-github-pages/creating-a-github-pages-site)
```
jatos.brandingUrl = "https://my-user.github.io/my-repo/foobar-university-welcome.html"
```
Remember to change `my-user`, `my-repo`, and `foobar-university-welcome.html`
1. Restart JATOS
Loading

0 comments on commit c84ab8d

Please sign in to comment.