jspsych 6.3.1 → 7.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (401) hide show
  1. package/README.md +36 -37
  2. package/css/jspsych.css +39 -39
  3. package/dist/JsPsych.d.ts +112 -0
  4. package/dist/TimelineNode.d.ts +34 -0
  5. package/dist/index.browser.js +3171 -0
  6. package/dist/index.browser.js.map +1 -0
  7. package/dist/index.browser.min.js +2 -0
  8. package/dist/index.browser.min.js.map +1 -0
  9. package/dist/index.cjs +3165 -0
  10. package/dist/index.cjs.map +1 -0
  11. package/dist/index.d.ts +11 -0
  12. package/dist/index.js +3159 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/migration.d.ts +3 -0
  15. package/dist/modules/data/DataCollection.d.ts +45 -0
  16. package/dist/modules/data/DataColumn.d.ts +15 -0
  17. package/dist/modules/data/index.d.ts +25 -0
  18. package/dist/modules/data/utils.d.ts +3 -0
  19. package/dist/modules/extensions.d.ts +22 -0
  20. package/dist/modules/plugin-api/HardwareAPI.d.ts +15 -0
  21. package/dist/modules/plugin-api/KeyboardListenerAPI.d.ts +34 -0
  22. package/dist/modules/plugin-api/MediaAPI.d.ts +27 -0
  23. package/dist/modules/plugin-api/SimulationAPI.d.ts +41 -0
  24. package/dist/modules/plugin-api/TimeoutAPI.d.ts +5 -0
  25. package/dist/modules/plugin-api/index.d.ts +8 -0
  26. package/dist/modules/plugins.d.ts +136 -0
  27. package/dist/modules/randomization.d.ts +35 -0
  28. package/dist/modules/turk.d.ts +40 -0
  29. package/dist/modules/utils.d.ts +7 -0
  30. package/package.json +32 -15
  31. package/src/JsPsych.ts +884 -0
  32. package/src/TimelineNode.ts +536 -0
  33. package/src/index.ts +71 -0
  34. package/src/migration.ts +37 -0
  35. package/src/modules/data/DataCollection.ts +198 -0
  36. package/src/modules/data/DataColumn.ts +86 -0
  37. package/src/modules/data/index.ts +174 -0
  38. package/src/modules/data/utils.ts +75 -0
  39. package/src/modules/extensions.ts +23 -0
  40. package/src/modules/plugin-api/HardwareAPI.ts +32 -0
  41. package/src/modules/plugin-api/KeyboardListenerAPI.ts +165 -0
  42. package/src/modules/plugin-api/MediaAPI.ts +337 -0
  43. package/src/modules/plugin-api/SimulationAPI.ts +181 -0
  44. package/src/modules/plugin-api/TimeoutAPI.ts +16 -0
  45. package/src/modules/plugin-api/index.ts +28 -0
  46. package/src/modules/plugins.ts +165 -0
  47. package/src/modules/randomization.ts +327 -0
  48. package/src/modules/turk.ts +99 -0
  49. package/src/modules/utils.ts +30 -0
  50. package/.github/workflows/jest.yml +0 -20
  51. package/code-of-conduct.md +0 -56
  52. package/contributors.md +0 -61
  53. package/docs/CNAME +0 -1
  54. package/docs/about/about.md +0 -18
  55. package/docs/about/contributing.md +0 -43
  56. package/docs/about/license.md +0 -25
  57. package/docs/about/support.md +0 -7
  58. package/docs/core_library/jspsych-core.md +0 -719
  59. package/docs/core_library/jspsych-data.md +0 -587
  60. package/docs/core_library/jspsych-pluginAPI.md +0 -624
  61. package/docs/core_library/jspsych-randomization.md +0 -389
  62. package/docs/core_library/jspsych-turk.md +0 -98
  63. package/docs/extensions/extensions.md +0 -83
  64. package/docs/extensions/jspsych-ext-webgazer.md +0 -137
  65. package/docs/img/blue.png +0 -0
  66. package/docs/img/devtools-change-css.png +0 -0
  67. package/docs/img/devtools-css-errors.png +0 -0
  68. package/docs/img/devtools-inspect-element.png +0 -0
  69. package/docs/img/folder-setup.png +0 -0
  70. package/docs/img/folder-with-html.png +0 -0
  71. package/docs/img/githubreleases.jpg +0 -0
  72. package/docs/img/jspsych-favicon.png +0 -0
  73. package/docs/img/jspsych-logo-no-text-mono.svg +0 -493
  74. package/docs/img/jspsych-logo.jpg +0 -0
  75. package/docs/img/orange.png +0 -0
  76. package/docs/img/palmer_stim.png +0 -0
  77. package/docs/img/progress_bar.png +0 -0
  78. package/docs/img/prolific-study-completion.png +0 -0
  79. package/docs/img/prolific-study-link.png +0 -0
  80. package/docs/img/visual_search_example.jpg +0 -0
  81. package/docs/index.md +0 -9
  82. package/docs/overview/browser-device-support.md +0 -35
  83. package/docs/overview/callbacks.md +0 -180
  84. package/docs/overview/data.md +0 -281
  85. package/docs/overview/dynamic-parameters.md +0 -147
  86. package/docs/overview/exclude-browser.md +0 -32
  87. package/docs/overview/experiment-options.md +0 -149
  88. package/docs/overview/eye-tracking.md +0 -271
  89. package/docs/overview/fullscreen.md +0 -36
  90. package/docs/overview/media-preloading.md +0 -369
  91. package/docs/overview/mturk.md +0 -77
  92. package/docs/overview/plugins.md +0 -320
  93. package/docs/overview/progress-bar.md +0 -110
  94. package/docs/overview/prolific.md +0 -78
  95. package/docs/overview/record-browser-interactions.md +0 -23
  96. package/docs/overview/running-experiments.md +0 -95
  97. package/docs/overview/style.md +0 -293
  98. package/docs/overview/timeline.md +0 -457
  99. package/docs/plugins/jspsych-animation.md +0 -40
  100. package/docs/plugins/jspsych-audio-button-response.md +0 -60
  101. package/docs/plugins/jspsych-audio-keyboard-response.md +0 -58
  102. package/docs/plugins/jspsych-audio-slider-response.md +0 -53
  103. package/docs/plugins/jspsych-call-function.md +0 -81
  104. package/docs/plugins/jspsych-canvas-button-response.md +0 -66
  105. package/docs/plugins/jspsych-canvas-keyboard-response.md +0 -68
  106. package/docs/plugins/jspsych-canvas-slider-response.md +0 -89
  107. package/docs/plugins/jspsych-categorize-animation.md +0 -60
  108. package/docs/plugins/jspsych-categorize-html.md +0 -53
  109. package/docs/plugins/jspsych-categorize-image.md +0 -53
  110. package/docs/plugins/jspsych-cloze.md +0 -45
  111. package/docs/plugins/jspsych-external-html.md +0 -70
  112. package/docs/plugins/jspsych-free-sort.md +0 -56
  113. package/docs/plugins/jspsych-fullscreen.md +0 -57
  114. package/docs/plugins/jspsych-html-button-response.md +0 -42
  115. package/docs/plugins/jspsych-html-keyboard-response.md +0 -51
  116. package/docs/plugins/jspsych-html-slider-response.md +0 -45
  117. package/docs/plugins/jspsych-iat-html.md +0 -64
  118. package/docs/plugins/jspsych-iat-image.md +0 -64
  119. package/docs/plugins/jspsych-image-button-response.md +0 -48
  120. package/docs/plugins/jspsych-image-keyboard-response.md +0 -58
  121. package/docs/plugins/jspsych-image-slider-response.md +0 -54
  122. package/docs/plugins/jspsych-instructions.md +0 -58
  123. package/docs/plugins/jspsych-maxdiff.md +0 -41
  124. package/docs/plugins/jspsych-preload.md +0 -128
  125. package/docs/plugins/jspsych-rdk.md +0 -119
  126. package/docs/plugins/jspsych-reconstruction.md +0 -48
  127. package/docs/plugins/jspsych-resize.md +0 -39
  128. package/docs/plugins/jspsych-same-different-html.md +0 -53
  129. package/docs/plugins/jspsych-same-different-image.md +0 -66
  130. package/docs/plugins/jspsych-serial-reaction-time-mouse.md +0 -52
  131. package/docs/plugins/jspsych-serial-reaction-time.md +0 -57
  132. package/docs/plugins/jspsych-survey-html-form.md +0 -50
  133. package/docs/plugins/jspsych-survey-likert.md +0 -70
  134. package/docs/plugins/jspsych-survey-multi-choice.md +0 -48
  135. package/docs/plugins/jspsych-survey-multi-select.md +0 -53
  136. package/docs/plugins/jspsych-survey-text.md +0 -63
  137. package/docs/plugins/jspsych-video-button-response.md +0 -54
  138. package/docs/plugins/jspsych-video-keyboard-response.md +0 -50
  139. package/docs/plugins/jspsych-video-slider-response.md +0 -60
  140. package/docs/plugins/jspsych-virtual-chinrest.md +0 -105
  141. package/docs/plugins/jspsych-visual-search-circle.md +0 -52
  142. package/docs/plugins/jspsych-vsl-animate-occlusion.md +0 -55
  143. package/docs/plugins/jspsych-vsl-grid-scene.md +0 -62
  144. package/docs/plugins/jspsych-webgazer-calibrate.md +0 -61
  145. package/docs/plugins/jspsych-webgazer-init-camera.md +0 -30
  146. package/docs/plugins/jspsych-webgazer-validate.md +0 -44
  147. package/docs/plugins/list-of-plugins.md +0 -54
  148. package/docs/tutorials/hello-world.md +0 -162
  149. package/docs/tutorials/rt-task.md +0 -1334
  150. package/docs/tutorials/video-tutorials.md +0 -11
  151. package/examples/add-to-end-of-timeline.html +0 -38
  152. package/examples/case-sensitive-responses.html +0 -45
  153. package/examples/conditional-and-loop-functions.html +0 -64
  154. package/examples/css/jquery-ui.css +0 -1225
  155. package/examples/css-classes-parameter.html +0 -145
  156. package/examples/data-add-properties.html +0 -44
  157. package/examples/data-as-function.html +0 -39
  158. package/examples/data-from-timeline.html +0 -52
  159. package/examples/data-from-url.html +0 -21
  160. package/examples/demo-flanker.html +0 -117
  161. package/examples/demo-simple-rt-task.html +0 -120
  162. package/examples/demos/demo_1.html +0 -35
  163. package/examples/demos/demo_2.html +0 -50
  164. package/examples/demos/demo_3.html +0 -63
  165. package/examples/display-element-to-embed-experiment.html +0 -79
  166. package/examples/end-active-node.html +0 -52
  167. package/examples/end-experiment.html +0 -45
  168. package/examples/exclusions.html +0 -32
  169. package/examples/external_html/simple_consent.html +0 -4
  170. package/examples/img/1.gif +0 -0
  171. package/examples/img/10.gif +0 -0
  172. package/examples/img/11.gif +0 -0
  173. package/examples/img/12.gif +0 -0
  174. package/examples/img/2.gif +0 -0
  175. package/examples/img/3.gif +0 -0
  176. package/examples/img/4.gif +0 -0
  177. package/examples/img/5.gif +0 -0
  178. package/examples/img/6.gif +0 -0
  179. package/examples/img/7.gif +0 -0
  180. package/examples/img/8.gif +0 -0
  181. package/examples/img/9.gif +0 -0
  182. package/examples/img/age/of1.jpg +0 -0
  183. package/examples/img/age/of2.jpg +0 -0
  184. package/examples/img/age/of3.jpg +0 -0
  185. package/examples/img/age/om1.jpg +0 -0
  186. package/examples/img/age/om2.jpg +0 -0
  187. package/examples/img/age/om3.jpg +0 -0
  188. package/examples/img/age/yf1.jpg +0 -0
  189. package/examples/img/age/yf4.jpg +0 -0
  190. package/examples/img/age/yf5.jpg +0 -0
  191. package/examples/img/age/ym2.jpg +0 -0
  192. package/examples/img/age/ym3.jpg +0 -0
  193. package/examples/img/age/ym5.jpg +0 -0
  194. package/examples/img/backwardN.gif +0 -0
  195. package/examples/img/blue.png +0 -0
  196. package/examples/img/card.png +0 -0
  197. package/examples/img/con1.png +0 -0
  198. package/examples/img/con2.png +0 -0
  199. package/examples/img/fixation.gif +0 -0
  200. package/examples/img/happy_face_1.jpg +0 -0
  201. package/examples/img/happy_face_2.jpg +0 -0
  202. package/examples/img/happy_face_3.jpg +0 -0
  203. package/examples/img/happy_face_4.jpg +0 -0
  204. package/examples/img/inc1.png +0 -0
  205. package/examples/img/inc2.png +0 -0
  206. package/examples/img/normalN.gif +0 -0
  207. package/examples/img/orange.png +0 -0
  208. package/examples/img/redX.png +0 -0
  209. package/examples/img/ribbon.jpg +0 -0
  210. package/examples/img/sad_face_1.jpg +0 -0
  211. package/examples/img/sad_face_2.jpg +0 -0
  212. package/examples/img/sad_face_3.jpg +0 -0
  213. package/examples/img/sad_face_4.jpg +0 -0
  214. package/examples/js/snap.svg-min.js +0 -21
  215. package/examples/js/webgazer/ridgeWorker.mjs +0 -135
  216. package/examples/js/webgazer/webgazer.js +0 -88909
  217. package/examples/js/webgazer/worker_scripts/mat.js +0 -306
  218. package/examples/js/webgazer/worker_scripts/util.js +0 -398
  219. package/examples/jspsych-RDK.html +0 -58
  220. package/examples/jspsych-animation.html +0 -39
  221. package/examples/jspsych-audio-button-response.html +0 -58
  222. package/examples/jspsych-audio-keyboard-response.html +0 -68
  223. package/examples/jspsych-audio-slider-response.html +0 -61
  224. package/examples/jspsych-call-function.html +0 -32
  225. package/examples/jspsych-canvas-button-response.html +0 -95
  226. package/examples/jspsych-canvas-keyboard-response.html +0 -78
  227. package/examples/jspsych-canvas-slider-response.html +0 -67
  228. package/examples/jspsych-categorize-animation.html +0 -49
  229. package/examples/jspsych-categorize-html.html +0 -33
  230. package/examples/jspsych-categorize-image.html +0 -44
  231. package/examples/jspsych-cloze.html +0 -37
  232. package/examples/jspsych-free-sort.html +0 -109
  233. package/examples/jspsych-fullscreen.html +0 -45
  234. package/examples/jspsych-html-button-response.html +0 -43
  235. package/examples/jspsych-html-keyboard-response.html +0 -42
  236. package/examples/jspsych-html-slider-response.html +0 -53
  237. package/examples/jspsych-iat.html +0 -520
  238. package/examples/jspsych-image-button-response.html +0 -91
  239. package/examples/jspsych-image-keyboard-response.html +0 -85
  240. package/examples/jspsych-image-slider-response.html +0 -85
  241. package/examples/jspsych-instructions.html +0 -37
  242. package/examples/jspsych-maxdiff.html +0 -33
  243. package/examples/jspsych-preload.html +0 -140
  244. package/examples/jspsych-reconstruction.html +0 -43
  245. package/examples/jspsych-resize.html +0 -34
  246. package/examples/jspsych-same-different-html.html +0 -28
  247. package/examples/jspsych-same-different-image.html +0 -39
  248. package/examples/jspsych-serial-reaction-time-mouse.html +0 -98
  249. package/examples/jspsych-serial-reaction-time.html +0 -54
  250. package/examples/jspsych-survey-html-form.html +0 -33
  251. package/examples/jspsych-survey-likert.html +0 -42
  252. package/examples/jspsych-survey-multi-choice.html +0 -40
  253. package/examples/jspsych-survey-multi-select.html +0 -42
  254. package/examples/jspsych-survey-text.html +0 -34
  255. package/examples/jspsych-video-button-response.html +0 -65
  256. package/examples/jspsych-video-keyboard-response.html +0 -61
  257. package/examples/jspsych-video-slider-response.html +0 -63
  258. package/examples/jspsych-virtual-chinrest.html +0 -69
  259. package/examples/jspsych-visual-search-circle.html +0 -64
  260. package/examples/jspsych-vsl-animate-occlusion.html +0 -35
  261. package/examples/jspsych-vsl-grid-scene.html +0 -47
  262. package/examples/lexical-decision.html +0 -134
  263. package/examples/manual-preloading.html +0 -59
  264. package/examples/pause-unpause.html +0 -33
  265. package/examples/progress-bar.html +0 -68
  266. package/examples/save-trial-parameters.html +0 -98
  267. package/examples/sound/hammer.mp3 +0 -0
  268. package/examples/sound/sound.mp3 +0 -0
  269. package/examples/sound/speech_blue.mp3 +0 -0
  270. package/examples/sound/speech_green.mp3 +0 -0
  271. package/examples/sound/speech_joke.mp3 +0 -0
  272. package/examples/sound/speech_red.mp3 +0 -0
  273. package/examples/sound/tone.mp3 +0 -0
  274. package/examples/timeline-variables-sampling.html +0 -50
  275. package/examples/timeline-variables.html +0 -64
  276. package/examples/video/sample_video.mp4 +0 -0
  277. package/examples/webgazer.html +0 -174
  278. package/examples/webgazer_audio.html +0 -90
  279. package/examples/webgazer_image.html +0 -60
  280. package/extensions/jspsych-ext-webgazer.js +0 -265
  281. package/jspsych.js +0 -3023
  282. package/license.txt +0 -21
  283. package/mkdocs.yml +0 -118
  284. package/plugins/jspsych-animation.js +0 -189
  285. package/plugins/jspsych-audio-button-response.js +0 -269
  286. package/plugins/jspsych-audio-keyboard-response.js +0 -209
  287. package/plugins/jspsych-audio-slider-response.js +0 -278
  288. package/plugins/jspsych-call-function.js +0 -58
  289. package/plugins/jspsych-canvas-button-response.js +0 -199
  290. package/plugins/jspsych-canvas-keyboard-response.js +0 -155
  291. package/plugins/jspsych-canvas-slider-response.js +0 -207
  292. package/plugins/jspsych-categorize-animation.js +0 -266
  293. package/plugins/jspsych-categorize-html.js +0 -220
  294. package/plugins/jspsych-categorize-image.js +0 -222
  295. package/plugins/jspsych-cloze.js +0 -112
  296. package/plugins/jspsych-external-html.js +0 -112
  297. package/plugins/jspsych-free-sort.js +0 -478
  298. package/plugins/jspsych-fullscreen.js +0 -106
  299. package/plugins/jspsych-html-button-response.js +0 -188
  300. package/plugins/jspsych-html-keyboard-response.js +0 -149
  301. package/plugins/jspsych-html-slider-response.js +0 -202
  302. package/plugins/jspsych-iat-html.js +0 -284
  303. package/plugins/jspsych-iat-image.js +0 -286
  304. package/plugins/jspsych-image-button-response.js +0 -327
  305. package/plugins/jspsych-image-keyboard-response.js +0 -263
  306. package/plugins/jspsych-image-slider-response.js +0 -369
  307. package/plugins/jspsych-instructions.js +0 -237
  308. package/plugins/jspsych-maxdiff.js +0 -173
  309. package/plugins/jspsych-preload.js +0 -345
  310. package/plugins/jspsych-rdk.js +0 -1373
  311. package/plugins/jspsych-reconstruction.js +0 -134
  312. package/plugins/jspsych-resize.js +0 -166
  313. package/plugins/jspsych-same-different-html.js +0 -168
  314. package/plugins/jspsych-same-different-image.js +0 -169
  315. package/plugins/jspsych-serial-reaction-time-mouse.js +0 -212
  316. package/plugins/jspsych-serial-reaction-time.js +0 -247
  317. package/plugins/jspsych-survey-html-form.js +0 -171
  318. package/plugins/jspsych-survey-likert.js +0 -195
  319. package/plugins/jspsych-survey-multi-choice.js +0 -208
  320. package/plugins/jspsych-survey-multi-select.js +0 -232
  321. package/plugins/jspsych-survey-text.js +0 -185
  322. package/plugins/jspsych-video-button-response.js +0 -335
  323. package/plugins/jspsych-video-keyboard-response.js +0 -279
  324. package/plugins/jspsych-video-slider-response.js +0 -351
  325. package/plugins/jspsych-virtual-chinrest.js +0 -471
  326. package/plugins/jspsych-visual-search-circle.js +0 -259
  327. package/plugins/jspsych-vsl-animate-occlusion.js +0 -196
  328. package/plugins/jspsych-vsl-grid-scene.js +0 -103
  329. package/plugins/jspsych-webgazer-calibrate.js +0 -161
  330. package/plugins/jspsych-webgazer-init-camera.js +0 -139
  331. package/plugins/jspsych-webgazer-validate.js +0 -314
  332. package/plugins/template/jspsych-plugin-template.js +0 -35
  333. package/tests/README.md +0 -7
  334. package/tests/jsPsych/case-sensitive-responses.test.js +0 -53
  335. package/tests/jsPsych/css-classes-parameter.test.js +0 -107
  336. package/tests/jsPsych/default-iti.test.js +0 -51
  337. package/tests/jsPsych/default-parameters.test.js +0 -58
  338. package/tests/jsPsych/endexperiment.test.js +0 -49
  339. package/tests/jsPsych/events.test.js +0 -606
  340. package/tests/jsPsych/functions-as-parameters.test.js +0 -210
  341. package/tests/jsPsych/init.test.js +0 -48
  342. package/tests/jsPsych/loads.test.js +0 -7
  343. package/tests/jsPsych/min-rt.test.js +0 -58
  344. package/tests/jsPsych/progressbar.test.js +0 -202
  345. package/tests/jsPsych/timeline-variables.test.js +0 -531
  346. package/tests/jsPsych/timelines.test.js +0 -569
  347. package/tests/jsPsych.data/data-csv-conversion.test.js +0 -85
  348. package/tests/jsPsych.data/data-json-conversion.test.js +0 -120
  349. package/tests/jsPsych.data/datacollection.test.js +0 -117
  350. package/tests/jsPsych.data/datacolumn.test.js +0 -50
  351. package/tests/jsPsych.data/datamodule.test.js +0 -152
  352. package/tests/jsPsych.data/dataparameter.test.js +0 -251
  353. package/tests/jsPsych.data/interactions.test.js +0 -109
  354. package/tests/jsPsych.data/trialparameters.test.js +0 -175
  355. package/tests/jsPsych.extensions/extensions.test.js +0 -207
  356. package/tests/jsPsych.extensions/test-extension.js +0 -42
  357. package/tests/jsPsych.pluginAPI/pluginapi.test.js +0 -365
  358. package/tests/jsPsych.pluginAPI/preloads.test.js +0 -43
  359. package/tests/jsPsych.randomization/randomziation.test.js +0 -27
  360. package/tests/jsPsych.utils/utils.test.js +0 -58
  361. package/tests/plugins/plugin-animation.test.js +0 -34
  362. package/tests/plugins/plugin-audio-button-response.test.js +0 -15
  363. package/tests/plugins/plugin-audio-keyboard-response.test.js +0 -15
  364. package/tests/plugins/plugin-audio-slider-response.test.js +0 -15
  365. package/tests/plugins/plugin-call-function.test.js +0 -49
  366. package/tests/plugins/plugin-categorize-animation.test.js +0 -263
  367. package/tests/plugins/plugin-categorize-html.test.js +0 -17
  368. package/tests/plugins/plugin-categorize-image.test.js +0 -17
  369. package/tests/plugins/plugin-cloze.test.js +0 -157
  370. package/tests/plugins/plugin-free-sort.test.js +0 -106
  371. package/tests/plugins/plugin-fullscreen.test.js +0 -41
  372. package/tests/plugins/plugin-html-button-response.test.js +0 -161
  373. package/tests/plugins/plugin-html-keyboard-response.test.js +0 -139
  374. package/tests/plugins/plugin-html-slider-response.test.js +0 -155
  375. package/tests/plugins/plugin-iat-html.test.js +0 -299
  376. package/tests/plugins/plugin-iat-image.test.js +0 -298
  377. package/tests/plugins/plugin-image-button-response.test.js +0 -174
  378. package/tests/plugins/plugin-image-keyboard-response.test.js +0 -147
  379. package/tests/plugins/plugin-image-slider-response.test.js +0 -174
  380. package/tests/plugins/plugin-instructions.test.js +0 -85
  381. package/tests/plugins/plugin-maxdiff.test.js +0 -39
  382. package/tests/plugins/plugin-preload.test.js +0 -916
  383. package/tests/plugins/plugin-rdk.test.js +0 -61
  384. package/tests/plugins/plugin-reconstruction.test.js +0 -16
  385. package/tests/plugins/plugin-resize.test.js +0 -16
  386. package/tests/plugins/plugin-same-different-html.test.js +0 -17
  387. package/tests/plugins/plugin-same-different-image.test.js +0 -17
  388. package/tests/plugins/plugin-serial-reaction-time-mouse.test.js +0 -42
  389. package/tests/plugins/plugin-serial-reaction-time.test.js +0 -109
  390. package/tests/plugins/plugin-survey-html-form.test.js +0 -44
  391. package/tests/plugins/plugin-survey-likert.test.js +0 -48
  392. package/tests/plugins/plugin-survey-multi-choice.test.js +0 -47
  393. package/tests/plugins/plugin-survey-multi-select.test.js +0 -71
  394. package/tests/plugins/plugin-survey-text.test.js +0 -115
  395. package/tests/plugins/plugin-video-button-response.test.js +0 -32
  396. package/tests/plugins/plugin-video-keyboard-response.test.js +0 -32
  397. package/tests/plugins/plugin-video-slider-response.test.js +0 -31
  398. package/tests/plugins/plugin-visual-search-circle.test.js +0 -16
  399. package/tests/plugins/plugin-vsl-animate-occlusion.test.js +0 -16
  400. package/tests/plugins/plugin-vsl-grid-scene.test.js +0 -16
  401. package/tests/testing-utils.js +0 -13
@@ -1,719 +0,0 @@
1
- # The jsPsych core library
2
-
3
- ---
4
- ## jsPsych.addNodeToEndOfTimeline
5
-
6
- ```javascript
7
- jsPsych.addNodeToEndOfTimeline(node_parameters)
8
- ```
9
-
10
- ### Parameters
11
-
12
- | Parameter | Type | Description |
13
- | --------------- | -------- | ---------------------------------------- |
14
- | node_parameters | object | An object defining a timeline. It must have, at a minimum, a `timeline` parameter with a valid timeline array as the value for that parameter. |
15
-
16
- ### Return value
17
-
18
- None.
19
-
20
- ### Description
21
-
22
- Adds the timeline to the end of the experiment.
23
-
24
- ### Example
25
-
26
- ```javascript
27
- var trial = {
28
- type: 'html-keyboard-response',
29
- stimulus: 'This is a new trial.'
30
- }
31
-
32
- var new_timeline = {
33
- timeline: [trial]
34
- }
35
-
36
- jsPsych.addNodeToEndOfTimeline(new_timeline)
37
- ```
38
-
39
- ---
40
- ## jsPsych.allTimelineVariables
41
-
42
- ```javascript
43
- jsPsych.allTimelineVariables()
44
- ```
45
-
46
- ### Parameters
47
-
48
- None.
49
-
50
- ### Return value
51
-
52
- Returns an object with all available timeline variables at this moment in the experiment, represented as `key: value` pairs.
53
-
54
- ### Description
55
-
56
- This function can be used to get all the timeline variables at a particular moment in the experiment. Can be useful for annotating
57
- data, such as in the example below.
58
-
59
- ### Example
60
-
61
- ```javascript
62
- var trial = {
63
- type: 'html-keyboard-response',
64
- stimulus: 'Just a demo',
65
- on_finish: function(data){
66
- // merge all timeline variables available at this trial into the data for this trial
67
- Object.assign(data, jsPsych.allTimelineVariables())
68
- }
69
- }
70
- ```
71
-
72
- ---
73
- ## jsPsych.currentTimelineNodeID
74
-
75
- ```javascript
76
- jsPsych.currentTimelineNodeID()
77
- ```
78
-
79
- ### Parameters
80
-
81
- None.
82
-
83
- ### Return value
84
-
85
- Returns the ID of the TimelineNode that is currently active.
86
-
87
- ### Description
88
-
89
- Gets the ID of the active TimelineNode. The ID is a string that follows a specific format:
90
-
91
- * `"0.0"` is the ID of the first top-level TimelineNode
92
- * `"1.0"` is the ID of the second top-level TimelineNode
93
- * `"2.0"` is the ID of the third top-level TimelineNode, and so on...
94
-
95
- If a TimelineNode iterates multiple times (using the loop function, for example), then the iterations are indicated in the second number:
96
-
97
- * `"0.0"` is the ID of the first top-level TimelineNode during the first iteration
98
- * `"0.1"` is the ID of the first top-level TimelineNode during the second iteration
99
- * `"0.2"` is the ID of the first top-level TimelineNode during the third iteration, and so on...
100
-
101
- If TimelineNodes are nested in other TimelineNodes, then the hierarchical structure is shown with `"."`:
102
-
103
- * `"0.0-1.0"` is the ID of the second TimelineNode on the timeline of the first top-level TimelineNode.
104
- * `"0.0-2.0"` is the ID of the third TimelineNode on the timeline of the first top-level TimelineNode, and so on...
105
-
106
- The rules about iterations apply throughout the hierarchical ID:
107
-
108
- * `"0.2-1.3"` is the ID of the second TimelineNode, executing for the fourth time, on the timeline of the first top-level TimelineNode, executing for the third time.
109
-
110
-
111
- ### Example
112
-
113
- ```javascript
114
- var id = jsPsych.currentTimelineNodeID();
115
- console.log('The current TimelineNode ID is '+id);
116
- ```
117
-
118
- ---
119
- ## jsPsych.currentTrial
120
-
121
- ```javascript
122
- jsPsych.currentTrial()
123
- ```
124
-
125
- ### Parameters
126
-
127
- None.
128
-
129
- ### Return value
130
-
131
- Returns the object describing the current trial. The object will contain all of the parameters associated with the current trial.
132
-
133
- ### Description
134
-
135
- Get a description of the current trial
136
-
137
- ### Example
138
-
139
- ```javascript
140
- var trial = jsPsych.currentTrial();
141
- console.log('The current trial is using the '+trial.type+' plugin');
142
- ```
143
-
144
- ---
145
- ## jsPsych.endCurrentTimeline
146
-
147
- ```javascript
148
- jsPsych.endCurrentTimeline()
149
- ```
150
-
151
- ### Parameters
152
-
153
- None.
154
-
155
- ### Return value
156
-
157
- None.
158
-
159
- ### Description
160
-
161
- Ends the current timeline. If timelines are nested, then only the timeline that contains the current trial is ended.
162
-
163
- ### Example
164
-
165
- #### End timeline if a particular key is pressed
166
-
167
- ```javascript
168
- var images = [
169
- "img/1.gif", "img/2.gif", "img/3.gif", "img/4.gif",
170
- "img/5.gif", "img/6.gif", "img/7.gif", "img/8.gif",
171
- "img/9.gif", "img/10.gif"
172
- ];
173
-
174
- var trials = [];
175
- for (var i = 0; i < images.length; i++) {
176
- trials.push({
177
- stimulus: images[i]
178
- });
179
- }
180
-
181
- var block = {
182
- type: 'image-keyboard-response',
183
- choices: ['y', 'n'],
184
- prompt: '<p>Press "y" to Continue. Press "n" to end this node of the experiment.</p>',
185
- on_finish: function(data) {
186
- if (jsPsych.pluginAPI.compareKeys(data.response, 'n')) {
187
- jsPsych.endCurrentTimeline();
188
- }
189
- },
190
- timeline: trials
191
- }
192
-
193
- var after_block = {
194
- type: 'html-keyboard-response',
195
- stimulus: '<p>The next node</p>'
196
- }
197
-
198
- jsPsych.init({
199
- timeline: [block, after_block],
200
- on_finish: function() {
201
- jsPsych.data.displayData();
202
- }
203
- });
204
- ```
205
-
206
- ---
207
- ## jsPsych.endExperiment
208
-
209
- ```javascript
210
- jsPsych.endExperiment(end_message)
211
- ```
212
-
213
- ### Parameters
214
-
215
- | Parameter | Type | Description |
216
- | ----------- | ------ | ---------------------------------------- |
217
- | end_message | string | A message to display on the screen after the experiment is over. |
218
-
219
- ### Return value
220
-
221
- None.
222
-
223
- ### Description
224
-
225
- Ends the experiment, skipping all remaining trials.
226
-
227
- ### Example
228
-
229
- #### End the experiment if a particular response is given
230
-
231
- ```javascript
232
- var trial = {
233
- type: 'image-keyboard-response',
234
- stimulus: 'image1.jpg',
235
- choices: ['y', 'n']
236
- prompt: '<p>Press "y" to Continue. Press "n" to end the experiment</p>',
237
- on_finish: function(data){
238
- if(jsPsych.pluginAPI.compareKeys(data.response, "n")){
239
- jsPsych.endExperiment('The experiment was ended by pressing "n".');
240
- }
241
- }
242
- }
243
- ```
244
-
245
- ---
246
- ## jsPsych.finishTrial
247
-
248
- ```javascript
249
- jsPsych.finishTrial(data)
250
- ```
251
-
252
- ### Parameters
253
-
254
- | Parameter | Type | Description |
255
- | --------- | ------ | -------------------------------- |
256
- | data | object | The data to store for the trial. |
257
-
258
-
259
- ### Return value
260
-
261
- Returns nothing.
262
-
263
- ### Description
264
-
265
- This method tells jsPsych that the current trial is over. It is used in all of the plugins to end the current trial. When the trial ends a few things happen:
266
-
267
- * The data is stored using `jsPsych.data.write()`
268
- * The on_finish callback function is executed for the trial
269
- * The on_trial_finish callback function is executed
270
- * The progress bar is updated if it is being displayed
271
- * The experiment ends if the trial is the last one (and the on_finish callback function is executed).
272
- * The next trial, if one exists, is started.
273
-
274
- ### Example
275
-
276
- ```javascript
277
- // this code would be in a plugin
278
- jsPsych.finishTrial({correct_response: true});
279
- ```
280
-
281
- ---
282
- ## jsPsych.getDisplayElement
283
-
284
- ```javascript
285
- jsPsych.getDisplayElement()
286
- ```
287
-
288
- ### Parameters
289
-
290
- None.
291
-
292
- ### Return value
293
-
294
- Returns the HTML DOM element used for displaying the experiment.
295
-
296
- ### Description
297
-
298
- Get the DOM element that displays the experiment.
299
-
300
- ### Example
301
-
302
- ```javascript
303
- var el = jsPsych.getDisplayElement();
304
-
305
- // hide the jsPsych display
306
- el.style.visibility = 'hidden';
307
- ```
308
-
309
- ---
310
- ## jsPsych.getProgressBarCompleted
311
-
312
- ```javascript
313
- jsPsych.getProgressBarCompleted()
314
- ```
315
-
316
- ### Parameters
317
-
318
- None.
319
-
320
- ### Return value
321
-
322
- Returns a value between 0 and 1 representing how full the progress bar currently is.
323
-
324
- ### Description
325
-
326
- Used to get the current value of the progress bar. Works for automated and manual control.
327
-
328
- ### Example
329
-
330
- ```javascript
331
- var progress_bar_amount = jsPsych.getProgressBarCompleted();
332
- ```
333
-
334
- ---
335
- ## jsPsych.init
336
-
337
- ```javascript
338
- jsPsych.init(settings)
339
- ```
340
-
341
- ### Parameters
342
-
343
- | Parameter | Type | Description |
344
- | --------- | ------ | ---------------------------------------- |
345
- | settings | object | The settings object for initializing jsPsych. See table below. |
346
-
347
- The settings object can contain several parameters. The only *required* parameter is `timeline`.
348
-
349
- | Parameter | Type | Description |
350
- | -------------------------- | -------- | ---------------------------------------- |
351
- | timeline | array | An array containing the objects that describe the experiment timeline. See [Creating an Experiment: The Timeline](../overview/timeline.md). |
352
- | display_element | string | The ID of an HTML element to display the experiment in. If left blank, jsPsych will use the `<body>` element to display content. All keyboard event listeners are bound to this element. In order for a keyboard event to be detected, this element must have focus (be the last thing that the subject clicked on). |
353
- | on_finish | function | Function to execute when the experiment ends. |
354
- | on_trial_start | function | Function to execute when a new trial begins. |
355
- | on_trial_finish | function | Function to execute when a trial ends. |
356
- | on_data_update | function | Function to execute every time data is stored using the `jsPsych.data.write` method. All plugins use this method to save data (via a call to `jsPsych.finishTrial`, so this function runs every time a plugin stores new data. |
357
- | on_interaction_data_update | function | Function to execute every time a new interaction event occurs. Interaction events include clicking on a different window (blur), returning to the experiment window (focus), entering full screen mode (fullscreenenter), and exiting full screen mode (fullscreenexit). |
358
- | on_close | function | Function to execute when the user leaves the page. Can be used, for example, to save data before the page is closed. |
359
- | exclusions | object | Specifies restrictions on the browser the subject can use to complete the experiment. See list of options below. |
360
- | show_progress_bar | boolean | If true, then [a progress bar](../overview/progress-bar.md) is shown at the top of the page. |
361
- | message_progress_bar | string | Message to display next to the progress bar. The default is 'Completion Progress'. |
362
- | auto_update_progress_bar | boolean | If true, then the progress bar at the top of the page will automatically update as every top-level timeline or trial is completed. |
363
- | use_webaudio | boolean | If false, then jsPsych will not attempt to use the WebAudio API for audio playback. Instead, HTML5 Audio objects will be used. The WebAudio API offers more precise control over the timing of audio events, and should be used when possible. The default value is true. |
364
- | default_iti | numeric | The default inter-trial interval in ms. The default value if none is specified is 0ms. |
365
- | experiment_width | numeric | The desired width of the jsPsych container in pixels. If left undefined, the width will be 100% of the display element. Usually this is the `<body>` element, and the width will be 100% of the screen size. |
366
- | minimum_valid_rt | numeric | The minimum valid response time for key presses during the experiment. Any key press response time that is less than this value will be treated as invalid and ignored. Note that this parameter only applies to _keyboard responses_, and not to other response types such as buttons and sliders. The default value is 0. |
367
- | override_safe_mode | boolean | Running a jsPsych experiment directly in a web browser (e.g., by double clicking on a local HTML file) will load the page using the `file://` protocol. Some features of jsPsych don't work with this protocol. By default, when jsPsych detects that it's running on a page loaded via the `file://` protocol, it runs in _safe mode_, which automatically disables features that don't work in this context. Specifically, the use of Web Audio is disabled (audio will be played using HTML5 audio instead, even if `use_webaudio` is `true`) and video preloading is disabled. The `override_safe_mode` parameter defaults to `false`, but you can set it to `true` to force these features to operate under the `file://` protocol. In order for this to work, you will need to disable web security (CORS) features in your browser - this is safe to do if you know what you are doing. Note that this parameter has no effect when you are running the experiment on a web server, because the page will be loaded via the `http://` or `https://` protocol. |
368
- | case_sensitive_responses | boolean | If true, then jsPsych will make a distinction between uppercase and lowercase keys when evaluating keyboard responses, e.g. "A" (uppercase) will not be recognized as a valid response if the trial only accepts "a" (lowercase). If false, then jsPsych will not make a distinction between uppercase and lowercase keyboard responses, e.g. both "a" and "A" responses will be valid when the trial's key choice parameter is "a". Setting this parameter to false is useful if you want key responses to be treated the same way when CapsLock is turned on or the Shift key is held down. The default value is false. |
369
- extensions | array | Array containing information about one or more jsPsych extensions that are used during the experiment. Each extension should be specified as an object with `type` (required), which is the name of the extension, and `params` (optional), which is an object containing any parameter-value pairs to be passed to the extension's `initialize` function. Default value is an empty array. |
370
-
371
- Possible values for the exclusions parameter above.
372
-
373
- | Parameter | Type | Description |
374
- | ---------- | ------- | ---------------------------------------- |
375
- | min_width | numeric | The minimum width of the browser window. If the width is below this value, a message will be displayed to the subject asking them to maximize their browser window. The experiment will sit on this page until the browser window is large enough. |
376
- | min_height | numeric | Same as above, but with height. |
377
- | audio | boolean | Set to true to require support for the WebAudio API (used by plugins that play audio files). |
378
-
379
- ### Return value
380
-
381
- Returns nothing.
382
-
383
- ### Description
384
-
385
- This method configures and starts the experiment.
386
-
387
- ### Example
388
-
389
- See any of the plugin examples in the [examples folder](https://github.com/jodeleeuw/jsPsych/tree/master/examples) in the GitHub repository.
390
-
391
- ---
392
-
393
- ## jsPsych.initSettings
394
-
395
- ```javascript
396
- jsPsych.initSettings()
397
- ```
398
-
399
- ### Parameters
400
-
401
- None
402
-
403
- ### Return value
404
-
405
- Returns the settings object used to initialize the experiment.
406
-
407
- ### Description
408
-
409
- Gets the object containing the settings for the current experiment.
410
-
411
- ### Example
412
-
413
- ```javascript
414
- var settings = jsPsych.initSettings();
415
-
416
- // check the experiment structure
417
- console.log(JSON.stringify(settings.timeline));
418
- ```
419
-
420
- ---
421
-
422
- ## jsPsych.pauseExperiment
423
-
424
- ```javascript
425
- jsPsych.pauseExperiment()
426
- ```
427
-
428
- ### Parameters
429
-
430
- None.
431
-
432
- ### Return value
433
-
434
- None.
435
-
436
- ### Description
437
-
438
- Pauses the experiment. The experiment will finish the current trial, but will not execute any additional trials until `jsPsych.resumeExperiment()` is called.
439
-
440
- ### Example
441
-
442
- ```javascript
443
- var trial = {
444
- type: 'html-keyboard-response',
445
- stimulus: 'Press p to take a 30 second break. Otherwise, press c to continue immediately.',
446
- choices: ['p','c'],
447
- on_finish: function(data){
448
- if(jsPsych.pluginAPI.compareKeys(data.response, "p")) {
449
- jsPsych.pauseExperiment();
450
- setTimeout(jsPsych.resumeExperiment, 30000);
451
- }
452
- }
453
- }
454
- ```
455
-
456
- ---
457
-
458
- ## jsPsych.progress
459
-
460
- ```javascript
461
- jsPsych.progress()
462
- ```
463
-
464
- ### Parameters
465
-
466
- None.
467
-
468
- ### Return value
469
-
470
- Returns an object with the following properties:
471
-
472
- | Property | Type | Description |
473
- | -------------------- | ------- | ---------------------------------------- |
474
- | total_trials | numeric | Indicates the number of trials in the experiment. Note that this does not count possible loops or skipped trials due to conditional statements. |
475
- | current_trial_global | numeric | Returns the trial index of the current trial in a global scope. Every trial will increase this count by 1. |
476
- | percent_complete | numeric | Estimates the percent of the experiment that is complete. Works as expected for experiments without conditional or looping timelines. For complex timelines, the percent is an approximation. |
477
-
478
-
479
- ### Description
480
-
481
- This method returns information about the length of the experiment and the subject's current location in the experiment timeline.
482
-
483
- ### Example
484
-
485
- ```javascript
486
- var progress = jsPsych.progress();
487
- alert('You have completed approximately '+progress.percent_complete+'% of the experiment');
488
- ```
489
-
490
- ---
491
-
492
- ## jsPsych.resumeExperiment
493
-
494
- ```javascript
495
- jsPsych.resumeExperiment()
496
- ```
497
-
498
- ### Parameters
499
-
500
- None.
501
-
502
- ### Return value
503
-
504
- None.
505
-
506
- ### Description
507
-
508
- Resumes the experiment after a call to `jsPsych.pauseExperiment()`. If the post trial delay (`post_trial_gap`) has not yet been reached, then the experiment will not continue until the delay is finished. For example, if `post_trial_gap` was 10,000ms and `jsPsych.resumeExperiment()` was called 6,000ms after the previous trial finished, then the experiment would not continue for another 4,000ms.
509
-
510
- ### Example
511
-
512
- ```javascript
513
- var trial = {
514
- type: 'html-keyboard-response',
515
- stimulus: 'Press p to take a 30 second break. Otherwise, press c to continue immediately.',
516
- choices: ['p','c'],
517
- on_finish: function(data){
518
- if(jsPsych.pluginAPI.compareKeys(data.response, "p")) {
519
- jsPsych.pauseExperiment();
520
- setTimeout(jsPsych.resumeExperiment, 30000);
521
- }
522
- }
523
- }
524
- ```
525
-
526
- ---
527
-
528
- ## jsPsych.setProgressBar
529
-
530
- ```javascript
531
- jsPsych.setProgressBar(value)
532
- ```
533
-
534
- ### Parameters
535
-
536
- | Parameter | Type | Description |
537
- | --------- | ------- | ---------------------------------------- |
538
- | value | numeric | Proprotion (between 0 and 1) to fill the progress bar. |
539
-
540
-
541
- ### Return value
542
-
543
- None.
544
-
545
- ### Description
546
-
547
- Set the progress bar to a custom amount. Proportion must be between 0 and 1. Values larger than 1 are treated as 1.
548
-
549
- ### Example
550
-
551
- ```javascript
552
- jsPsych.setProgressBar(0.85);
553
- ```
554
-
555
- ---
556
-
557
- ## jsPsych.startTime
558
-
559
- ```javascript
560
- jsPsych.startTime()
561
- ```
562
-
563
- ### Parameters
564
-
565
- None.
566
-
567
- ### Return value
568
-
569
- Returns a `Date` object indicating when the experiment began.
570
-
571
- ### Description
572
-
573
- Get the time that the experiment began.
574
-
575
- ### Example
576
-
577
- ```javascript
578
- var start_time = jsPsych.startTime();
579
- ```
580
-
581
- ---
582
-
583
- ## jsPsych.timelineVariable
584
-
585
- ```javascript
586
- jsPsych.timelineVariable(variable, call_immediate)
587
- ```
588
-
589
- ### Parameters
590
-
591
- Parameter | Type | Description
592
- ----------|------|------------
593
- variable | string | Name of the timeline variable
594
- call_immediate | bool | This parameter is optional and can usually be omitted. It determines the return value of `jsPsych.timelineVariable`. If `true`, the function returns the _value_ of the current timeline variable. If `false`, the function returns _a function that returns the value_ of the current timeline variable. When `call_immediate` is omitted, the appropriate option is determined automatically based on the context in which this function is called. When `jsPsych.timelineVariable` is used as a parameter value, `call_immediate` will be `false`. This allows it to be used as a [dynamic trial parameter](/overview/dynamic-parameters). When `jsPsych.timelineVariable` is used inside of a function, `call_immediate` will be `true`. It is possible to explicitly set this option to `true` to force the function to immediately return the current value of the timeline variable.
595
-
596
- ### Return value
597
-
598
- Either a function that returns the value of the timeline variable, or the value of the timeline variable, depending on the context in which it is used. See `call_immediate` description above.
599
-
600
- ### Description
601
-
602
- [Timeline variables](/overview/timeline/#timeline-variables) are a powerful technique for generating experiments with repetitive procedures but different parameter values. This function fetches the current value of a particular timeline variable. It must be used in conjunction with a timeline that has timeline variables. See the [timeline variable section](/overview/timeline/#timeline-variables) for details.
603
-
604
- ### Examples
605
-
606
- #### Standard use as a parameter for a trial
607
-
608
- ```javascript
609
- var trial = {
610
- type: 'image-keyboard-response',
611
- stimulus: jsPsych.timelineVariable('image')
612
- }
613
-
614
- var procedure = {
615
- timeline: [trial],
616
- timeline_variables: [
617
- {image: 'face1.png'},
618
- {image: 'face2.png'},
619
- {image: 'face3.png'},
620
- {image: 'face4.png'}
621
- ]
622
- }
623
- ```
624
-
625
- #### Invoking immediately in a function
626
-
627
- ```javascript
628
- var trial = {
629
- type: 'html-keyboard-response',
630
- stimulus: function(){
631
- return "<img style='width:100px; height:100px;' src='"+jsPsych.timelineVariable('image')+"'></img>";
632
- }
633
- }
634
-
635
- var procedure = {
636
- timeline: [trial],
637
- timeline_variables: [
638
- {image: 'face1.png'},
639
- {image: 'face2.png'},
640
- {image: 'face3.png'},
641
- {image: 'face4.png'}
642
- ]
643
- }
644
- ```
645
-
646
- Prior to jsPsych v6.3.0, the `call_immediate` parameter must be set to `true` when `jsPsych.timelineVariable` is called from within a function, such as a [dynamic parameter](/overview/dynamic-parameters):
647
-
648
- ```javascript
649
- var trial = {
650
- type: 'html-keyboard-response',
651
- stimulus: function(){
652
- return "<img style='width:100px; height:100px;' src='"+jsPsych.timelineVariable('image', true)+"'></img>";
653
- }
654
- }
655
-
656
- var procedure = {
657
- timeline: [trial],
658
- timeline_variables: [
659
- {image: 'face1.png'},
660
- {image: 'face2.png'},
661
- {image: 'face3.png'},
662
- {image: 'face4.png'}
663
- ]
664
- }
665
- ```
666
-
667
- ---
668
-
669
- ## jsPsych.totalTime
670
-
671
- ```javascript
672
- jsPsych.totalTime()
673
- ```
674
-
675
- ### Parameters
676
-
677
- None.
678
-
679
- ### Return value
680
-
681
- Returns a numeric value indicating the number of milliseconds since `jsPsych.init` was called.
682
-
683
- ### Description
684
-
685
- Gets the total time the subject has been in the experiment.
686
-
687
- ### Example
688
-
689
- ```javascript
690
- var time = jsPsych.totalTime();
691
- console.log(time);
692
- ```
693
-
694
- ---
695
-
696
- ## jsPsych.version
697
-
698
- ```javascript
699
- jsPsych.version()
700
- ```
701
-
702
- ### Parameters
703
-
704
- None.
705
-
706
- ### Return value
707
-
708
- Returns the version number as a string.
709
-
710
- ### Description
711
-
712
- Gets the version of jsPsych.
713
-
714
- ### Example
715
-
716
- ```javascript
717
- var version = jsPsych.version();
718
- console.log(version);
719
- ```