Skip to content

Commit 2fc2030

Browse files
Merge pull request #511 from lookit/develop
Move changes to `master`
2 parents 0c726ef + 3ab2e7c commit 2fc2030

6 files changed

Lines changed: 173 additions & 42 deletions

File tree

docs/source/_static/css/lookit.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ ul.tutorial-participants {
9494
column-count: 2;
9595
}
9696

97-
ul.tutorial-participants li {
97+
ul.tutorial-participants li, ul.jspsych-plugins-extensions li {
9898
padding: 0;
9999
}
100100

docs/source/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ Families may take part in studies from multiple labs over time. Having one centr
7070

7171
researchers-jspsych-intro
7272
Limitations <researchers-jspsych-limitations>
73-
Releases <researchers-jspsych-releases>
7473

7574
.. toctree::
7675
:maxdepth: 2

docs/source/researchers-jspsych-intro.rst

Lines changed: 107 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,77 @@ To learn more about jsPsych features, some other great places to start are the j
1616
jsPsych packages
1717
==============================
1818

19-
The CHS jsPsych experiment runner automatically loads a set of packages from the standard jsPsych library for researchers to use. These are:
19+
The CHS jsPsych experiment runner automatically loads a set of packages from the standard jsPsych library for researchers to use. The set of jsPsych packages/versions loaded by CHS is below, along with links to documentation and change logs (version history).
2020

21-
- `Core jsPsych library <https://www.jspsych.org/v8/>`__ v8.0.3
22-
- `HTML keyboard response plugin <https://www.jspsych.org/v8/plugins/html-keyboard-response/>`__ v2.0.0: ``jsPsychHtmlKeyboardResponse``
23-
- `Image keyboard response plugin <https://www.jspsych.org/v8/plugins/image-keyboard-response/>`__ v2.0.0: ``jsPsychImageKeyboardResponse``
24-
- `HTML button response plugin <https://www.jspsych.org/v8/plugins/html-button-response>`__ v2.0.0: ``jsPsychHtmlButtonResponse``
25-
- `Image button response plugin <https://www.jspsych.org/v8/plugins/image-button-response/>`__ v2.0.0: ``jsPsychImageButtonResponse``
26-
- `Video button response plugin <https://www.jspsych.org/v8/plugins/video-button-response/>`__ v2.0.0: ``jsPsychVideoButtonResponse``
27-
- `Preload plugin <https://www.jspsych.org/v8/plugins/preload/>`__ v2.0.0: ``jsPsychPreload``
28-
- `Survey text plugin <https://www.jspsych.org/latest/plugins/survey-text/>`__ v2.1.0: ``jsPsychSurveyText``
29-
- `Survey multi-choice plugin <https://www.jspsych.org/latest/plugins/survey-multi-choice/>`__ v2.1.0: ``jsPsychSurveyMultiChoice``
30-
- `Fullscreen plugin <https://www.jspsych.org/latest/plugins/fullscreen/>`__ v2.1.0: ``jsPsychFullscreen``
21+
.. rst-class:: jspsych-plugins-extensions
3122

32-
We will likely add more options in the future. If there are any specific jsPsych plugins/extensions that your experiment needs, please let us know! The best way to request access to a standard jsPsych package is by creating a ``lookit-api`` `Github issue <https://github.com/lookit/lookit-api/issues>`__, but you can also let us know on Slack.
23+
- `Core jsPsych library <https://www.jspsych.org/v8/>`__
24+
25+
- v8.0.3 (`see changelog <https://github.com/jspsych/jsPsych/blob/main/packages/jspsych/CHANGELOG.md>`__)
26+
27+
- `HTML keyboard response plugin <https://www.jspsych.org/v8/plugins/html-keyboard-response/>`__
28+
29+
- v2.0.0 (`see changelog <https://github.com/jspsych/jsPsych/blob/main/packages/plugin-html-keyboard-response/CHANGELOG.md>`__)
30+
- ``jsPsychHtmlKeyboardResponse``
31+
32+
- `Image keyboard response plugin <https://www.jspsych.org/v8/plugins/image-keyboard-response/>`__
33+
34+
- v2.0.0 (`see changelog <https://github.com/jspsych/jsPsych/blob/main/packages/plugin-image-keyboard-response/CHANGELOG.md>`__)
35+
- ``jsPsychImageKeyboardResponse``
36+
37+
- `Video keyboard response <https://www.jspsych.org/latest/plugins/video-keyboard-response/>`__
38+
39+
- v2.1.0 (`see changelog <https://github.com/jspsych/jsPsych/blob/main/packages/plugin-video-keyboard-response/CHANGELOG.md>`__)
40+
- ``jsPsychVideoKeyboardResponse``
41+
42+
- `HTML button response plugin <https://www.jspsych.org/v8/plugins/html-button-response>`__
43+
44+
- v2.0.0 (`see changelog <https://github.com/jspsych/jsPsych/blob/main/packages/plugin-html-button-response/CHANGELOG.md>`__)
45+
- ``jsPsychHtmlButtonResponse``
46+
47+
- `Image button response plugin <https://www.jspsych.org/v8/plugins/image-button-response/>`__
48+
49+
- v2.0.0 (`see changelog <https://github.com/jspsych/jsPsych/blob/main/packages/plugin-image-button-response/CHANGELOG.md>`__)
50+
- ``jsPsychImageButtonResponse``
51+
52+
- `Video button response plugin <https://www.jspsych.org/v8/plugins/video-button-response/>`__
53+
54+
- v2.0.0 (`see changelog <https://github.com/jspsych/jsPsych/blob/main/packages/plugin-video-button-response/CHANGELOG.md>`__)
55+
- ``jsPsychVideoButtonResponse``
56+
57+
- `Image hotspots <https://github.com/jspsych/jspsych-contrib/blob/main/packages/plugin-image-hotspots/docs/plugin-image-hotspots.md>`__
58+
59+
- v1.0.0 (`see changelog <https://github.com/jspsych/jspsych-contrib/blob/main/packages/plugin-image-hotspots/CHANGELOG.md>`__)
60+
- ``jsPsychImageHotspots``
61+
62+
- `Video hotspots <https://github.com/jspsych/jspsych-contrib/blob/main/packages/plugin-video-hotspots/docs/plugin-video-hotspots.md>`__
63+
64+
- v1.0.0 (`see changelog <https://github.com/jspsych/jspsych-contrib/blob/main/packages/plugin-video-hotspots/CHANGELOG.md>`__)
65+
- ``jsPsychVideoHotspots``
66+
67+
- `Preload plugin <https://www.jspsych.org/v8/plugins/preload/>`__
68+
69+
- v2.0.0 (`see changelog <https://github.com/jspsych/jsPsych/blob/main/packages/plugin-preload/CHANGELOG.md>`__)
70+
- ``jsPsychPreload``
71+
72+
- `Survey text plugin <https://www.jspsych.org/latest/plugins/survey-text/>`__
73+
74+
- v2.1.0 (`see changelog <https://github.com/jspsych/jsPsych/blob/main/packages/plugin-survey-text/CHANGELOG.md>`__)
75+
- ``jsPsychSurveyText``
76+
77+
- `Survey multi-choice plugin <https://www.jspsych.org/latest/plugins/survey-multi-choice/>`__
78+
79+
- v2.1.0 (`see changelog <https://github.com/jspsych/jsPsych/blob/main/packages/plugin-survey-multi-choice/CHANGELOG.md>`__)
80+
- ``jsPsychSurveyMultiChoice``
81+
82+
- `Fullscreen plugin <https://www.jspsych.org/latest/plugins/fullscreen/>`__
83+
84+
- v2.1.0 (`see changelog <https://github.com/jspsych/jsPsych/blob/main/packages/plugin-fullscreen/CHANGELOG.md>`__)
85+
- ``jsPsychFullscreen``
86+
87+
.. admonition:: Need something else?
88+
89+
If there are any specific jsPsych plugins/extensions that your experiment needs, please let us know! The best way to request access to a standard jsPsych package is by creating a ``lookit-api`` `Github issue <https://github.com/lookit/lookit-api/issues>`__, but you can also let us know on Slack.
3390

3491

3592
.. _chs-jspsych-packages:
@@ -39,34 +96,56 @@ Custom CHS jsPsych packages
3996

4097
In addition to the jsPsych packages listed above, the CHS jsPsych experiment runner also automatically loads some custom packages. These custom plugins/extensions were designed to "fill in the gaps" in the sort of functionality that CHS researchers typically need for child development studies. This functionality includes: standardized webcam/mic configuration steps, video-recorded consent, trial/session recording, and standardized exit surveys.
4198

42-
The `CHS jsPsych documentation <https://lookit.readthedocs.io/projects/chs-jspsych/en/latest/>`__ contains more information about all of the parameters available in the CHS jsPsych plugins/extensions listed below.
99+
The custom CHS-jsPsych packages/versions are listed below, along with links to documentation and change logs (version history). The `CHS jsPsych documentation <https://lookit.readthedocs.io/projects/chs-jspsych/en/latest/>`__ contains more information about all of the parameters available in the CHS-jsPsych plugins/extensions.
43100

44-
Do you need any types of trials (Lookit EFP "frames") or features that are not listed here, and are not available through the standard jsPsych library? Let us know! The best way to request a custom (CHS-specific) jsPsych plugin/extension or feature is by creating a ``lookit-jspsych`` `Github issue <https://github.com/lookit/lookit-jspsych/issues>`__, but you can also let us know on Slack.
101+
**CHS Record package**
45102

46-
.. _chs-jspsych-plugins:
103+
Current version: 4.1.0 (`see changelog <https://github.com/lookit/lookit-jspsych/blob/main/packages/record/CHANGELOG.md>`__)
47104

48-
Plugins
49-
---------------------
105+
.. rst-class:: jspsych-plugins-extensions
50106

51-
- `Video config plugin <https://lookit.readthedocs.io/projects/chs-jspsych/en/latest/record/#video-configuration>`__ in the CHS Record package: ``chsRecord.VideoConfigPlugin``
52-
- `Video consent plugin <https://lookit.readthedocs.io/projects/chs-jspsych/en/latest/record/#video-consent>`__ in the CHS Record package: ``chsRecord.VideoConsentPlugin``
53-
- `Start session recording plugin <https://lookit.readthedocs.io/projects/chs-jspsych/en/latest/record/#session-recording>`__ in the CHS Record package: ``chsRecord.StartRecordPlugin``
54-
- `Stop session recording plugin <https://lookit.readthedocs.io/projects/chs-jspsych/en/latest/record/#session-recording>`__ in the CHS Record package: ``chsRecord.StopRecordPlugin``
55-
- `Consent survey plugin <https://lookit.readthedocs.io/projects/chs-jspsych/en/latest/surveys/#consent-survey>`__ in the CHS Surveys package: ``chsSurveys.ConsentSurveyPlugin``
56-
- `Exit survey plugin <https://lookit.readthedocs.io/projects/chs-jspsych/en/latest/surveys/#exit-survey>`__ in the CHS Surveys package: ``chsSurveys.ExitSurveyPlugin``
107+
- `Video config plugin <https://lookit.readthedocs.io/projects/chs-jspsych/en/latest/record/#video-configuration>`__
57108

58-
.. _chs-jspsych-extensions:
109+
- ``chsRecord.VideoConfigPlugin``
59110

60-
Extensions
61-
--------------------------
111+
- `Video consent plugin <https://lookit.readthedocs.io/projects/chs-jspsych/en/latest/record/#video-consent>`__
112+
113+
- ``chsRecord.VideoConsentPlugin``
114+
115+
- `Start session recording plugin <https://lookit.readthedocs.io/projects/chs-jspsych/en/latest/record/#session-recording>`__
116+
117+
- ``chsRecord.StartRecordPlugin``
118+
119+
- `Stop session recording plugin <https://lookit.readthedocs.io/projects/chs-jspsych/en/latest/record/#session-recording>`__
120+
121+
- ``chsRecord.StopRecordPlugin``
62122

63-
jsPsych extensions are packages that extend the functionality of a plugin.
123+
- `Trial recording extension <https://lookit.readthedocs.io/projects/chs-jspsych/en/latest/record/#trial-recording>`__
124+
125+
- ``chsRecord.TrialRecordExtension``
126+
127+
**CHS Surveys package**
128+
129+
Current version: v4.0.1 (`see changelog <https://github.com/lookit/lookit-jspsych/blob/main/packages/surveys/CHANGELOG.md>`__)
130+
131+
.. rst-class:: jspsych-plugins-extensions
132+
133+
- `Consent survey plugin <https://lookit.readthedocs.io/projects/chs-jspsych/en/latest/surveys/#consent-survey>`__
134+
135+
- ``chsSurveys.ConsentSurveyPlugin``
136+
137+
- `Exit survey plugin <https://lookit.readthedocs.io/projects/chs-jspsych/en/latest/surveys/#exit-survey>`__
138+
139+
- ``chsSurveys.ExitSurveyPlugin``
64140

65-
- `Trial recording extension <https://lookit.readthedocs.io/projects/chs-jspsych/en/latest/record/#trial-recording>`__ in the CHS Record package: ``chsRecord.TrialRecordExtension``
66141

67142
.. _chs-jspsych-translations:
68143

69144
Translations
70145
--------------------------
71146

72147
All of these plugins/extensions support the automatic translation of hard-coded text through a ``locale`` parameter.
148+
149+
.. admonition:: Need something else?
150+
151+
Do you need any types of trials (Lookit EFP "frames") or features that are not listed here, and are not available through the standard jsPsych library? Let us know! The best way to request a custom (CHS-specific) jsPsych plugin/extension or feature is by creating a ``lookit-jspsych`` `Github issue <https://github.com/lookit/lookit-jspsych/issues>`__, but you can also let us know on Slack.

docs/source/researchers-jspsych-releases.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/source/tutorial-contributing.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,9 @@ List of tutorial participants
368368
- Sarah Kiefer (Brown University)
369369
- Olivia Maltz (Temple University)
370370
- Madeline Ephraim (University of Rochester)
371+
- Emma Reddy (University of Maryland, College Park)
372+
- Wilder Hartwell (University of California, San Diego)
373+
- Kaitlin Dobkowski (Boston University)
371374

372375
Checking for and creating issues on Github
373376
-------------------------------------------

docs/source/tutorial-jspsych/tutorial-jspsych-first-study.rst

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,12 @@ The full code so far:
199199
Step 6: Add session recording
200200
-------------------------------------------------
201201

202-
We now have a bare-bones CHS experiment structure: webcam/mic configuration, video-recorded consent, our "experiment" (hello world trial), and an exit survey. The only thing we're missing for typical CHS experiments is webcam recordings that are captured during the experiment. We can do that using either: (a) session recording, where a webcam recording starts at a specified point in the experiment's trial sequence and ends at another point, with any number of experimental trials in between, or (b) trial recording, where a webcam recording is created at the start of a particular trial and ends when that trial finishes.
202+
We now have a bare-bones CHS experiment structure: webcam/mic configuration, video-recorded consent, our "experiment" (hello world trial), and an exit survey. The only thing we're missing for typical CHS experiments is webcam recordings that are captured during the experiment. We can do that using either:
203+
204+
.. rst-class:: jspsych-plugins-extensions
205+
206+
- **session recording**, where a webcam recording starts at a specified point in the experiment's trial sequence and ends at another point, with any number of experimental trials in between, or
207+
- **trial recording**, where a webcam recording is created at the start of a particular trial and ends when that trial finishes.
203208

204209
.. admonition:: When should/shouldn't I use trial and session recording?
205210

@@ -258,6 +263,17 @@ Here's the full experiment code now:
258263
259264
jsPsych.run([video_config, video_consent, start_rec, hello_trial, stop_rec, exit_survey]);
260265
266+
Now when you save your code and preview the experiment, your experiment will run as it did before, but you will also get a video recording that captures the duration between your ``start_rec`` and ``stop_rec`` trials. To see your recording, you will need to approve your own consent statement: from the study details page, click "Review Consent", find your most recent session, change it from "pending" to "accept", then click "Submit Rulings & Comments". Then go back to your study details page, click "Study Responses", click "Individual Responses", and find your most recent session in the table. With that response selected, you should see two videos listed in the "Download videos" box - one is your consent video and the other is your session recording.
267+
268+
**Bonus step**: Use the ``wait_for_upload_message`` parameter to override the ``stop_rec`` trial's default message ("uploading video, please wait...") and present some custom HTML content instead. The example below will display some text and play a video.
269+
270+
.. code:: javascript
271+
272+
const stop_rec = {
273+
type: chsRecord.StopRecordPlugin,
274+
wait_for_upload_message: "<p style='font-size: 30px; color: blue;'>Please wait while we upload your video!</p><video src='https://www.mit.edu/~kimscott/placeholderstimuli/webm/attentiongrabber.webm' autoplay />",
275+
};
276+
261277
262278
Step 7: Switch to trial recording
263279
-------------------------------------------------
@@ -271,7 +287,7 @@ We now we'll switch to trial-level recording during our hello world trial. To do
271287
jsPsych.run([video_config, video_consent, hello_trial, exit_survey]);
272288
273289
274-
2. Add the `chsRecord.TrialRecordExtension` to the parameters that are passed into ``initJsPsych``. This is the `jsPsych initialization function <https://www.jspsych.org/latest/reference/jspsych/#initjspsych>`__, which takes an optional settings object and parameters. So far we haven't needed any of these setting parameters, but now we do need to tell jsPsych that we're planning to use the trial recording extension at some point during the experiment.
290+
2. Add the ``chsRecord.TrialRecordExtension`` to the parameters that are passed into ``initJsPsych``. This is the `jsPsych initialization function <https://www.jspsych.org/latest/reference/jspsych/#initjspsych>`__, which takes an optional settings object and parameters. So far we haven't needed any of these setting parameters, but now we do need to tell jsPsych that we're planning to use the trial recording extension at some point during the experiment.
275291

276292
.. code:: javascript
277293
@@ -280,8 +296,7 @@ We now we'll switch to trial-level recording during our hello world trial. To do
280296
});
281297
282298
283-
284-
3. Add the `chsRecord.TrialRecordExtension` to the configuration for the trial that we want to be recorded. This tells jsPsych to run trial recording for that particular trial. Here we are just adding trial recording to the "hello_world" trial.
299+
3. Add the ``chsRecord.TrialRecordExtension`` to the configuration for the trial that we want to be recorded. This tells jsPsych to run trial recording for that particular trial. Here we are just adding trial recording to the "hello_world" trial.
285300

286301
.. code:: javascript
287302
@@ -323,8 +338,50 @@ Here's what the whole experiment looks like now:
323338
324339
jsPsych.run([video_config, video_consent, hello_trial, exit_survey]);
325340
341+
You can follow the instructions at the end of the previous step to see your session recordings. Now for your most recent session, you should still see two videos listed in the "Download videos" box - one is your consent video and the other is your trial recording. If you edit your study code to add another ``hello_trial``, then you will end up with three videos: a consent recording and two trial recordings.
342+
343+
**Bonus step**: Use the ``wait_for_upload_message`` parameter to override the default uploading message ("uploading video, please wait...") that is shown at the end of the ``hello_trial``, and present some custom HTML content instead. To do this, we need to add a new property called "params" alongside the trial recording extension. The value of "params" is an object that contains the parameter names and values that should be passed to the extension.
344+
345+
The example below will display some custom text and a video while the webcam recording is uploading at the end of the ``hello_trial``.
346+
347+
.. code:: javascript
348+
349+
const hello_trial = {
350+
type: jsPsychHtmlButtonResponse,
351+
stimulus: 'Hello world!',
352+
choices: ['Next'],
353+
extensions: [{
354+
type: chsRecord.TrialRecordExtension,
355+
params: { wait_for_upload_message: "<p style='font-size: 30px; color: blue;'>Please wait while we upload your video!</p><video src='https://www.mit.edu/~kimscott/placeholderstimuli/webm/attentiongrabber.webm' autoplay />" }
356+
}],
357+
};
358+
359+
Step 8: Move participants in and out of fullscreen
360+
------------------------------------------------------
361+
362+
Typically you'll want your participant's browser to be in fullscreen mode during your experiment, which you can do using `jsPsych's fullscreen plugin <https://www.jspsych.org/latest/plugins/fullscreen/>`__. You can create a trial that will let participants know that they will enter fullscreen when they click the "Continue" button (with parameters that allow you to change the message and button label). You can also create a trial that will automatically exit fullscreen mode.
363+
364+
.. code:: javascript
365+
366+
const enter_fullscreen = {
367+
type: jsPsychFullscreen,
368+
fullscreen_mode: true
369+
};
370+
371+
const exit_fullscreen = {
372+
type: jsPsychFullscreen,
373+
fullscreen_mode: false,
374+
delay_after: 0
375+
};
376+
377+
Once you've created these trials, you can put them anywhere in your experiment timeline.
378+
379+
.. code:: javascript
380+
381+
jsPsych.run([enter_fullscreen, video_config, video_consent, hello_trial, exit_fullscreen, exit_survey]);
382+
326383
327-
Step 8: Learn more on the jsPsych website
384+
Step 9: Learn more on the jsPsych website
328385
-------------------------------------------------
329386

330387
Well done! You've learned how to create a jsPsych experiment on CHS! You can use this tutorial code as a starting point for your real experiment, and replace the hello world trial with some actual jsPsych experiment code.

0 commit comments

Comments
 (0)