Commit Graph

2632 Commits

Author SHA1 Message Date
bjoluc
c340c5ea55 Enhance scripts in package.json files 2021-08-17 20:26:38 +02:00
bjoluc
4fcb2f7e56 Refactor KeyboardListenerAPI 2021-08-17 19:13:30 +02:00
bjoluc
b288a8e21f Move root Jest config into package.json 2021-08-17 18:58:59 +02:00
bjoluc
f54d48911f
Merge pull request #2084 from bjoluc/parameter-types
Enhance parameter types
2021-08-17 17:32:35 +02:00
bjoluc
9c519853fe Use enum for parameter types and remove JsPsych.plugins
`const parameterType` is now `enum ParameterType` and can only be
accessed by importing it.
2021-08-17 17:19:25 +02:00
bjoluc
743ad44e84 Replace ALL_KEYS and NO_KEYS with strings
`"ALL_KEYS"` is now used instead of `jsPsych.ALL_KEYS` and `"NO_KEYS"`
instead of `jsPsych.NO_KEYS`
2021-08-17 17:07:23 +02:00
bjoluc
2e17ca6b33 Introduce parameterType.KEYS for multiple keys
It represents an array of keys, or jsPsych.ALL_KEYS and jsPsych.NO_KEYS
2021-08-17 17:07:23 +02:00
bjoluc
5152f52977
Merge pull request #2079 from bjoluc/preload
Implement `preload` flag for plugin parameters
2021-08-17 17:01:18 +02:00
bjoluc
64541a451f Implement preload flag for plugin parameters
It defaults to `true` for parameters of type IMAGE, VIDEO, and AUDIO,
and is ignored for any other parameter type.
Example: Using `parameterType.IMAGE` for a parameter `param` in a
plugin named `my-plugin` is equivalent to calling
`jspsych.pluginAPI.registerPreload("my-plugin", "param", "image")`
before `jsPsych.run()`. Setting `preload: false` for the parameter would
disable this invocation.
2021-08-17 16:47:07 +02:00
bjoluc
105b041255 Configure husky to run prettier via lint-staged 2021-08-13 22:04:28 +02:00
bjoluc
017b45d87e Make trial_type a string in JsPsychData
I forgot to do this when migrating the core to use plugin objects.
@jansim was first with this in #661, so he gets the credits!

Closes #2076
Co-authored-by: Jan Simson <jan.simson@three-2-one.com>
2021-08-12 18:06:22 +02:00
bjoluc
56d6fd9d0b Make plugin info static
so it can be accessed before a plugin is instantiated
2021-08-12 17:25:26 +02:00
bjoluc
559f60c83e Add Gulp script to create a dist archive 2021-08-09 09:35:48 +02:00
Becky Gilbert
75f3164f29
Merge pull request #2042 from kurokida/docs-demos
Create live demos for jspsych-html-* plugins
2021-08-04 13:10:22 -07:00
Daiichiro Kuroki
e8be19ad89 Create live demos for jspsych-html-* plugin 2021-08-04 15:13:44 +09:00
Becky Gilbert
11a5378865
Merge pull request #2018 from kurokida/docs-demos
Create live demos for the external-html and free-sort plugins.
2021-07-29 11:51:57 -07:00
Daiichiro Kuroki
6c9725c5c8 Create live demos for the external-html and free-sort plugins. 2021-07-29 14:10:58 +09:00
Becky Gilbert
6bd552d3cd
Merge pull request #2015 from kurokida/docs-demos
Create live demos for the categorize-html, categorize-image, and cloze plugins.
2021-07-28 12:08:49 -07:00
Daiichiro Kuroki
bedf5becbf Create live demos for the categorize-html, categorize-image, and cloze plugins 2021-07-28 17:26:43 +09:00
bjoluc
c119650471 Move experiment execution into jsPsych.run()
The `run()` method takes a timeline and returns a promise that is
resolved when the experiment finishes.
Hence, jsPsych can now be initialized without starting an experiment.
This re-enables usage of `jsPsych.timelineVariable()` in timeline
definitions and repairs exclusion checks and extension loading.
2021-07-19 17:10:37 +02:00
bjoluc
82fa8e3f29 Add explicit include option to TS configs
So VS Code ignores the `dist` folders
2021-07-13 09:54:29 +02:00
Becky Gilbert
a3628bc5ec fix plugin docs alphabetical ordering 2021-07-12 14:40:40 -07:00
Becky Gilbert
0a0813bb25 remove server async demo and replace with simulated wait example 2021-07-12 14:39:42 -07:00
Becky Gilbert
d5f7039ba7 tweak prompt wording 2021-07-12 13:51:31 -07:00
Becky Gilbert
895974b418 change demo file paths 2021-07-12 13:41:11 -07:00
Becky Gilbert
ad244e5f8c fix syntax error 2021-07-12 13:29:43 -07:00
Becky Gilbert
97fe654e0e
Merge pull request #1983 from kurokida/docs-demos
Add live demos to docs pages for canvas-keyboard-response, canvas-slider-response, call-function, categorize-animation
2021-07-12 13:05:33 -07:00
bjoluc
8cfbba526a Use classes to avoid global state
Instead of a global `jsPsych` object, there is a `JsPsych` class now
which can be instantiated with the parameters that were previously
accepted by `jsPsych.init`. Upon instantiation, the `JsPsych` class also
instantiates classes for stateful modules (`jsPsych.data` and
`jsPsych.pluginAPI`) and passes relevant `JsPsych` instance information
to them. Plugins are expected to be classes now that are instantiated
for each trial and receive the `JsPsych` instance as their only
constructor argument.
2021-07-12 18:15:37 +02:00
kurokida
d62c553edd Modify the indentations and the explanation of the prompt parameter. 2021-07-12 13:46:45 +09:00
Daiichiro Kuroki
51925a5b88 Create live demos for categorize-animation 2021-07-09 15:04:56 +09:00
Daiichiro Kuroki
93d9a9ec71 Craete live demos for call-function 2021-07-09 13:14:25 +09:00
Daiichiro Kuroki
773dc0e9da Merge branch 'docs-demos' of https://github.com/jspsych/jsPsych into docs-demos 2021-07-09 11:52:35 +09:00
Daiichiro Kuroki
df92593ec7 Create live demos for canvas-slider-response 2021-07-09 11:52:28 +09:00
Daiichiro Kuroki
c93e3f01e2 Create live demos for canvas-keyboard-response 2021-07-09 10:37:24 +09:00
Becky Gilbert
bbb60955f2 fix demo file paths, remove compareKeys for button press comparison 2021-07-08 14:54:18 -07:00
Becky Gilbert
2704ee190b fix demo file path 2021-07-08 14:53:07 -07:00
Becky Gilbert
d7c63e7dec fix code/demo indentation and demo links 2021-07-08 14:43:11 -07:00
bjoluc
1ec9d59305 Update GH Actions workflow for monorepo 2021-07-08 23:34:50 +02:00
bjoluc
9afacdfd90 Fix paths in TS configs 2021-07-08 23:32:30 +02:00
Becky Gilbert
2c6307efce tweak example code indentation 2021-07-08 13:37:48 -07:00
Becky Gilbert
14bcb4d621
Merge pull request #1980 from SHogenboom/docs-demos
add live demo for jspsych-instructions plugin docs
2021-07-08 13:25:32 -07:00
Becky Gilbert
db8bab4c36
Merge pull request #1981 from nikbpetrov/patch-1
Fix typo in the image-button-response docs: `maintain_aspect_ratio` parameter.
2021-07-07 15:50:19 -07:00
Nikolay Petrov
43397d230d
Fixing typo in the maintain_aspect_ratio parameter. 2021-07-07 12:56:07 +01:00
Sally
9d5c41b825 Add demo 3 - new example of changes to button text 2021-07-07 10:54:31 +02:00
Sally
5f324172c5 Add demo 2 - text and image. Updated example. 2021-07-07 10:50:14 +02:00
Sally
92de90b810 Add demo 1 - multi page text 2021-07-07 10:49:48 +02:00
Sally
2a3aeeac8b Restructure to include demo iframes 2021-07-07 10:36:11 +02:00
bjoluc
91e7b1e3ff Migrate to TypeScript 2021-07-06 17:55:42 +02:00
Becky Gilbert
bbbcd0ab3a
Merge pull request #1937 from kurokida/docs-demos
Add a live demo for the canvas-button-response plugin docs page
2021-07-02 11:56:34 -07:00
Becky Gilbert
3221cfa832 tweak jsPsych Builder info box text #1912 2021-07-02 11:40:18 -07:00