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

Add jspsych studies section #438

Merged
merged 25 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3c16211
first pass at adding jsPsych experiment runner, clarifying CHS vs Loo…
becky-gilbert Nov 4, 2024
9c3e2c6
move tutorial pages into separate lookit tutorial section
becky-gilbert Nov 5, 2024
4b2f481
add jsPsych tutorial pages nested in tutorial step 3
becky-gilbert Nov 7, 2024
ee7fa3d
add target label and update tutorial step number
becky-gilbert Nov 7, 2024
3326150
add new tutorial step 3 create study section for nesting lookit and j…
becky-gilbert Nov 7, 2024
19fbb88
add target and update tutorial step number
becky-gilbert Nov 7, 2024
c3816b6
update tutorial step number
becky-gilbert Nov 7, 2024
68b9d28
add new edit study design page to correspond with our now-split study…
becky-gilbert Nov 7, 2024
7d38884
update home page and TOC with CHS vs Lookit terms and to add jsPsych …
becky-gilbert Nov 7, 2024
4bc0582
update TOC with new create study step and nested lookit/jspsych tutor…
becky-gilbert Nov 7, 2024
230a9ac
move study fields page from Lookit into Using CHS since these apply t…
becky-gilbert Nov 7, 2024
a59ea8b
remove fields that are specific to study type (now in on the study de…
becky-gilbert Nov 7, 2024
836a420
update lookit-api installation page with jsPsych and EFP RecordRTC info
becky-gilbert Nov 7, 2024
a3ab316
update CHS vs Lookit terms, update URLs, split Study Edit section int…
becky-gilbert Nov 7, 2024
0ac5df0
update CHS vs Lookit terms, CHS URLs, add jsPsych study type and link…
becky-gilbert Nov 7, 2024
2496344
update CHS vs Lookit terms, CHS links, add jsPsych experiment runner,…
becky-gilbert Nov 7, 2024
9a49804
update with CHS vs Lookit terms, and add jsPsych to architecture over…
becky-gilbert Nov 7, 2024
7062e35
fix typo
becky-gilbert Nov 7, 2024
213b004
Update README.md
mekline Nov 8, 2024
add7820
Update community-irb-and-legal-information.rst
mekline Nov 8, 2024
a2e4a8c
Update faq.rst
mekline Nov 8, 2024
416f2de
fix typos and grammar errors
becky-gilbert Nov 8, 2024
0b45686
add jspsych studies section with intro, limitations and releases pages
becky-gilbert Nov 8, 2024
ae80cd8
merge develop and fix conflicts
becky-gilbert Nov 8, 2024
f043b55
add links to new jsPsych studies pages
becky-gilbert Nov 8, 2024
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
10 changes: 10 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ Families may take part in studies from multiple labs over time. Having one centr
researchers-lag-issues
Releases <researchers-runner-releases>

.. toctree::
:maxdepth: 2
:hidden:
:glob:
:caption: jsPsych studies

researchers-jspsych-intro
Limitations <researchers-jspsych-limitations>
Releases <researchers-jspsych-releases>

.. toctree::
:maxdepth: 2
:hidden:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/researchers-edit-design.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jsPsych
jsPsych Experiment Code
=============================

This is where you enter your jsPsych experiment code. This is the JavaScript code used to generate a jsPsych study, not the surrounding HTML. Please see our CHS jsPsych documentation and :ref:`tutorial <jspsych-tutorial-first-study>` for more information about what jsPsych plugins and versions are automatically loaded for you to use, and how to load stimuli files.
This is where you enter your jsPsych experiment code. This is the JavaScript code used to generate a jsPsych study, not the surrounding HTML. Please see our :ref:`CHS jsPsych documentation <jspsych-intro>` and :ref:`tutorial <jspsych-tutorial-first-study>` for more information about what jsPsych plugins and versions are automatically loaded for you to use, and how to load stimuli files.

.. _`Building an Experiment`: researchers-create-experiment.html

Expand Down
68 changes: 68 additions & 0 deletions docs/source/researchers-jspsych-intro.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
.. _jspsych-intro:

====================================
jsPsych studies on CHS
====================================

`jsPsych <https://www.jspsych.org/latest/>`__ is an open source library for creating a wide range of behavioral experiments that run in a web browser. It consists of a core library and "plugins". Plugins are the components that make up the experiment. Each plugin lets you define different kinds of events (e.g. presenting an image or text) and it collects different kinds of data (e.g. responses and response times). The jsPsych library also supports a wide range of features that are commonly used in behavioral experiments, like looping over sets of trials, randomizing, sampling, and conditional behavior.

To get a feel for how to build a jsPsych experiment, you can check out the jsPsych `Hello World tutorial <https://www.jspsych.org/v8/tutorials/hello-world/>`__ and `RT task tutorial <https://www.jspsych.org/v8/tutorials/rt-task/>`__. We also have our own :ref:`CHS jsPsych Hello World tutorial <jspsych-tutorial-first-study>`, which demonstrates the CHS-specific features (:ref:`detailed in this section <chs-jspsych-packages>`) that we've added for jsPsych studies running on the CHS platform.

To learn more about jsPsych features, some other great places to start are the jsPsych documentation about `timelines <https://www.jspsych.org/v8/overview/timeline/>`__ and `dynamic parameters <https://www.jspsych.org/v8/overview/dynamic-parameters/>`__.


.. _jspsych-packages:

jsPsych packages
==============================

The CHS jsPsych experiment runner automatically loads a set of packages from the standard jsPsych library for researchers to use. These are:

- `Core jsPsych library <https://www.jspsych.org/v8/>`__ v8.0.3
- `HTML keyboard response plugin <https://www.jspsych.org/v8/plugins/html-keyboard-response/>`__ v2.0.0: ``jsPsychHtmlKeyboardResponse``
- `Image keyboard response plugin <https://www.jspsych.org/v8/plugins/image-keyboard-response/>`__ v2.0.0: ``jsPsychImageKeyboardResponse``
- `HTML button response plugin <https://www.jspsych.org/v8/plugins/html-button-response>`__ v2.0.0: ``jsPsychHtmlButtonResponse``
- `Image button response plugin <https://www.jspsych.org/v8/plugins/image-button-response/>`__ v2.0.0: ``jsPsychImageButtonResponse``
- `Preload plugin <https://www.jspsych.org/v8/plugins/preload/>`__ v2.0.0: ``jsPsychPreload``

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.


.. _chs-jspsych-packages:

Custom CHS jsPsych packages
==================================================

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.

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.

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.

.. _chs-jspsych-plugins:

Plugins
---------------------

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

.. _chs-jspsych-extensions:

Extensions
--------------------------

jsPsych extensions are packages that extend the functionality of a plugin.

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

.. _chs-jspsych-translations:

Translations
--------------------------

All of these plugins/extensions support the automatic translation of hard-coded text through a ``locale`` parameter.
20 changes: 20 additions & 0 deletions docs/source/researchers-jspsych-limitations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. _jspsych-limitations:

====================================
Limitations to CHS jsPsych studies
====================================

While building your jsPsych study on the CHS platform, you may run into problems because of certain limitations to the CHS jsPsych experiment runner. This is especially likely if you're an experienced jsPsych user with experiments that you want to move onto CHS, or if you're referencing other (non-CHS) jsPsych tutorials/examples to build your study on CHS.

Here are some things you should keep in mind when creating jsPsych studies on CHS.

- **All of the code needed to run your experiment must be provided in the CHS JavaScript editor.**
* Unlike many other jsPsych hosting options, on CHS you do not write an HTML file. CHS provides your study's HTML file and loads the JavaScript and CSS files. You can think of the CHS JavaScript editor as the main ``script`` element that you'll see in most jsPsych tutorials/examples.
* You do not have the option to load additional files, including stimuli files or custom plugins/extensions.
* Your stimuli files must be hosted online and loaded from an external URL, for instance via institutional storage, cloud storage, or Github (see our documentation about :ref:`hosting your stimuli online <putting-stimuli-online>`).

- **The CHS jsPsych experiment runner supports a limited set of jsPsych package/versions.**
* Please refer to our list of available :ref:`jsPsych packages/versions <jspsych-packages>`, and our list of :ref:`custom CHS jsPsych packages <chs-jspsych-packages>`.
* If you're trying to use a jsPsych plugin that is not available on CHS, you will see the following console error when you try to run the study: "Uncaught ReferenceError: <PLUGIN NAME> is not defined".
* If your jsPsych study uses plugins that are not available on CHS, you may be able to replace them with plugins that we do support. For instance, instructions that are presented with the ``instructions`` plugin could be presented via HTML keyboard/button response trials.
* If you have existing study code that uses a different version of the jsPsych core library or plugins, you may be able to update/modify your jsPsych code so that it's compatible with the versions we support. The jsPsych documentation offers version migration guides in their "Support" section, and all jsPsych packages contain release notes with detailed explanations of changes.
7 changes: 7 additions & 0 deletions docs/source/researchers-jspsych-releases.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. _jspsych-releases:

====================================
jsPsych experiment runner updates
====================================

No updates yet. Watch this space!
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ Check out the jsPsych "hello world" tutorial if you want to start from the basic

There are also lots of examples on the jsPsych plugin documentation pages (e.g. `html-button-response plugin <https://www.jspsych.org/latest/plugins/html-button-response/>`__, `survey plugin <https://www.jspsych.org/latest/plugins/survey/>`__), as well as in the `jsPsych repository "examples" folder <https://github.com/jspsych/jsPsych/tree/main/examples>`__.

Keep in mind that our internal CHS jsPsych experiment runner offers a limited set of jsPsych packages (core library and plugins/extensions) and package versions. In the future, we plan to expand this set. Please see our CHS jsPsych limitations page for information on what jsPsych packages are currently available.
Keep in mind that our internal CHS jsPsych experiment runner offers a limited set of jsPsych packages (core library and plugins/extensions) and package versions. In the future, we plan to expand this set. Please see our :ref:`CHS jsPsych limitations page <jspsych-limitations>` for information on what jsPsych packages are currently available.


Bonus: Translate your experiment into another language
Expand Down