Skip to content

Commit

Permalink
Align usage of "input data" and "JSON input data"
Browse files Browse the repository at this point in the history
  • Loading branch information
kristian-lange committed Jun 6, 2024
1 parent c84ab8d commit 72ec2ae
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ see [Group Variables](#group-variables)

### `jatos.studyProperties`

All the properties (except the JSON input data) you entered for this study
All the properties (except the study input data) you entered for this study

* `jatos.studyProperties.title` - Study's title
* `jatos.studyProperties.uuid` - Study's UUID
Expand All @@ -80,7 +80,7 @@ All the properties (except the JSON input data) you entered for this study

### `jatos.studyJsonInput`

The JSON input you entered in the study's properties. This is `{}` if the field was left empty.
The study input data you entered in the study properties. This is `{}` if the field was left empty.

### `jatos.studyLength`

Expand All @@ -91,7 +91,7 @@ Number of component this study has

### `jatos.componentProperties`

All the properties (except the JSON input data) you entered for this component
All the properties (except the component input data) you entered for this component

* `jatos.componentProperties.title` - Component's title
* `jatos.componentProperties.uuid` - Component's UUID
Expand All @@ -100,7 +100,7 @@ All the properties (except the JSON input data) you entered for this component

### `jatos.componentJsonInput`

The JSON input you entered in the component's properties. This is `{}` if the field was left empty.
The component input data you entered in the component properties. This is `{}` if the field was left empty.

### `jatos.componentList`

Expand All @@ -119,7 +119,7 @@ Current version of the _jatos.js_ library

### `jatos.urlQueryParameters`

Original query string parameters of the URL that starts the study. It is provided as a JavaScript object; the value is `{}` if no query string parameters are present. This might be useful to pass on information from outside of JATOS into a study run, e.g. if you want to pass on information like gender and age. However if you know the information beforehand it's easier to put them in the Study's or Component's JSON input. Another example is MTurk which passes on it's worker's ID via a URL query parameter.
Original query string parameters of the URL that starts the study. It is provided as a JavaScript object; the value is `{}` if no query string parameters are present. This might be useful to pass on information from outside of JATOS into a study run, e.g. if you want to pass on information like gender and age. However if you know the information beforehand it's easier to put them in the study/component input (in the study/component properties). Another example is MTurk which passes on it's worker's ID via a URL query parameter.

**Examples**

Expand Down Expand Up @@ -1097,7 +1097,7 @@ All the properties you entered for this batch.

### `jatos.batchJsonInput`

The JSON input you entered in the batch's properties. This is `{}` if the field was left empty.
The batch input data you entered in the batch properties. This is `{}` if the field was left empty.



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,5 @@ That's about it. Infos about other _jatos.js_ functions and variables you can fi
### Beyond the basics

* Think about dividing your study into **several components**. You could have separate components e.g. for introduction, training, experiment and feedback. You could even consider splitting the experiment into several parts. One advantage is that if your participant stops in the middle of your study you still have the result data of the first components. Also, you can re-use components in different studies.
* Use the **study input** or **component input**, defined in the study or component properties. With them you can change variables of your code directly through JATOS' GUI, which might come handy if someone isn't good in JavaScript.
* Use the **study input**, **component input**, or **batch input**, defined in the study/component/batch properties. With them you can change variables of your code directly through JATOS' GUI, which might come handy if someone isn't good in JavaScript.
* You can add a **quit button** to your study to allow the participant to [abort at any time](Data-Privacy-and-Ethics.html#things-you-should-consider-in-your-studies).
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Imagine you have _half-study-1.jzip_ (a survey) and _half-study-2.jzip_ (a perce
4. Look into the folder you found in Step 2. Navigate to the subfolder that corresponds to _half-study-2_. You should find a single _.html_ file (this is what actually displays your study) and probably a lot of other assets, including libraries and CSS stylesheets.
5. In your local JATOS: Go to the component properties of each of your study halves. Find the field with the path to the HTML file that runs your study. If the name of the HTML files is the same for both halves (it often is _index.html_), change the names. Now they are called _index-half-1.html_ and _index-half-2.html_. You can change the names in the component properties. JATOS will change the actual file name on your filesystem for you. (Confirm that you want this when prompted).
6. In your local filesystem: Copy all of the contents of this subfolder for _half-study-2_ into the subfolder for _half-study-1_. You now combined the information from both studies into a single folder and made sure that the HTML files are uniquely named.
7. In your local JATOS: Go to the your _half-study-1_. Click on "New component". In the properties of this new component, indicate the path to the HTML file from _half-study-2_. Copy any other properties that might exist (e.g. JSON input) from the single component in _half-study-2_ to this new component in _half-study-1_.
7. In your local JATOS: Go to the your _half-study-1_. Click on "New component". In the properties of this new component, indicate the path to the HTML file from _half-study-2_. Copy any other properties that might exist (e.g. _study input_ or _component input_) from the single component in _half-study-2_ to this new component in _half-study-1_.
8. Now you have a complete, combined study.
9. Export this study from your local instance.
10. Import the _.jzip_ you created in step 9 into your online JATOS server.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ You probably want to save the data that is collected during your experiments. Th
In your JavaScript you will use _jatos.js_ to handle everything JATOS related and in its [reference](jatos.js-Reference.html) every function and field is described in detail.


## Study input and component input
## Study/component/batch input

Your experiment is defined by its source code, its HTML, JavaScript and CSS. There you specify all text or parameters. But sometimes you want to be able to quickly change your experiment without touching the source code.

Expand All @@ -79,17 +79,23 @@ E.g. you want to be able to quickly change
* the number of trials
* some parameter needed in the experiment

This you can achieve with the "Study input" or "Component input" (in older JATOS versions they are called "Study JSON Input" and "Component JSON Input") because both can be easily edited in the study properties or component properties.
This you can achieve with the "study input", "component input", or "batch input" (in older JATOS versions they are called "Study JSON Input", "Component JSON Input", or "Batch JSON Input") because both can be easily edited in the study/component/batch properties.

![Study properties / study input](/img/v39x/study-input.png)

Both input fields take [JSON](https://www.w3schools.com/whatis/whatis_json.asp) and the data you put in there is then available in your study's JavaScript via `jatos.studyJsonInput` and `jatos.componentJsonInput`.
The input fields take [JSON](https://www.w3schools.com/whatis/whatis_json.asp) and the data you put in there is then available in your study's JavaScript via `jatos.studyJsonInput`, `jatos.componentJsonInput`, and `jatos.batchJsonInput`.

The difference between study input, component input and batch input is where they are available in the code of your study. The study input data are available everywhere in your study code, the component input only in the code of this component, and the batch input in all study runs that belong to this batch. There is also a difference in what gets exported with the study: only the study and component input data get exported - not the batch input data.

| | Study input | Component input | Batch input |
| ------------ | ----------- | --------------- | ----------- |
| Availability | in the whole study (all components, all batches) | only in the component where it was defined (but in all batches) | only in the batch that belongs to the study run (but there in all components) |
| Exported with the study | yes | yes | no |

The difference between the study input and component input is that the first one is available during the whole study run, in all components, and the latter one only in the component for which it is specified.

**Example:**

If you put the following in the study input
If you put the following in the study input of your study properties

```json
{
Expand Down

0 comments on commit 72ec2ae

Please sign in to comment.