Commit Graph

297 Commits

Author SHA1 Message Date
Josh de Leeuw
dba6c4befc fixes double call of function as parameter (#158)
fixed by changing the evaluate parameters function to modify the trial
object directly, so the function is replaced by its value.
2015-12-08 10:35:29 -05:00
Josh de Leeuw
ed4b2ba99c change progress bar behavior (#156) 2015-12-08 09:54:37 -05:00
Josh de Leeuw
94f772e41e allow override of default timing_post_trial (#176) 2015-12-07 16:48:37 -05:00
Josh de Leeuw
2f61a960ab fix clone on shuffle (issue #175) 2015-12-07 15:37:16 -05:00
Josh de Leeuw
1b37453a43 implements #153 2015-06-26 16:55:13 -04:00
Josh de Leeuw
3ef2f16f22 implements #144 2015-06-26 15:30:26 -04:00
Josh de Leeuw
981d15fdc8 implements #98 & #152
adds a routine that detects when keys are being held down. an optional
parameter for getKeyboardResponse allows held keys to be ignored.
2015-06-12 12:58:31 -04:00
Josh de Leeuw
c091cbaa28 fix bug in endExperiment
caused on_finish handler to fire twice
2015-06-08 12:39:33 -04:00
Josh de Leeuw
1974ff4498 fixes #147 2015-06-08 09:03:32 -04:00
Josh de Leeuw
240f409a06 fix bug with data and timing_post_trial function params 2015-06-02 09:27:05 -04:00
Josh de Leeuw
3d597a8f52 implements #107 2015-05-28 13:14:22 -04:00
Josh de Leeuw
eff15d8fa6 fixes #116 2015-05-28 12:45:43 -04:00
Josh de Leeuw
37fa9d9113 implements #142 2015-05-28 09:58:47 -04:00
Josh de Leeuw
23653e7eef implements #143 2015-05-28 09:45:21 -04:00
Josh de Leeuw
9bba6fe2dd finishes #104 2015-05-22 09:52:04 -04:00
Josh de Leeuw
af2543d566 starting to implement #104 2015-05-20 23:09:48 -04:00
Josh de Leeuw
b948e4bc6f fixes #134 2015-05-15 16:39:40 -04:00
Josh de Leeuw
4b4faa6636 fixes #105, #137 2015-05-15 15:31:39 -04:00
Josh de Leeuw
c7e1f40ddc *actually* fixes #128 2015-05-15 15:16:00 -04:00
Josh de Leeuw
b5bb1a552d fixes #128 2015-05-15 15:09:10 -04:00
Josh de Leeuw
d1f9985bf8 implements #136
does the stuff in #136.

- adds the addProperties function
- removes other ways to append data.
2015-05-15 14:46:12 -04:00
Josh de Leeuw
ab44b665a3 add list of variables that are always protected from norming
fixes #133, and provides framework for other related issues.
2015-05-15 14:04:39 -04:00
Josh de Leeuw
0cb807500f avoid loading audio twice
fixes issue #125
2015-03-27 13:43:11 -04:00
Josh de Leeuw
7f9db95c5d update docs loc 2015-02-19 10:24:33 -05:00
Josh de Leeuw
a1900a199b allow skip_load_check
issue #92
2015-02-19 10:15:59 -05:00
Josh de Leeuw
c780dd4557 add sample method
issue #102
2015-02-05 17:19:08 -05:00
Josh de Leeuw
686a6bcdaf fix issues with html content rendering in displayData
issue #99
2015-02-05 17:00:22 -05:00
Josh de Leeuw
0849f8bd9f add randomization.shuffle function
issue #100
2015-02-05 16:52:16 -05:00
Josh de Leeuw
45820a5249 comments removed 2015-02-05 16:49:21 -05:00
Josh de Leeuw
6a634244e3 temp fix to prevent non AudioContext browsers from breaking
issue #95
2014-11-14 15:28:33 -05:00
Josh de Leeuw
55f1d3c5d6 add convertKeyCharacterToKeyCode method 2014-11-14 15:14:48 -05:00
Josh de Leeuw
8ca0e2576c adds a check in init function to see if all audio is loaded 2014-11-11 10:18:12 -05:00
Josh de Leeuw
840cfa908c working audio plugin
- needed to change keyboardResponse method to support measuring RT off
of the audio context
- related to issues #3 and #4
2014-11-11 09:15:26 -05:00
Josh de Leeuw
bb1379b5e4 adding audio support functions to core 2014-11-11 08:37:57 -05:00
Josh de Leeuw
f7d02198d0 fix issue with flatten data
Fixes #85
2014-10-30 16:06:07 -04:00
Josh de Leeuw
b60a331e1f bug fix in displayData 2014-10-28 18:01:47 -04:00
Josh de Leeuw
3c6d7fdd66 removing force_refresh option for turkInfo
just parse the string every time
2014-10-16 11:06:43 -04:00
Josh de Leeuw
9d816dbf2b change blocks to timeline
closes #77
2014-10-15 13:43:28 -04:00
Josh de Leeuw
5546f08094 add getLastChunkData; edge case handling 2014-10-01 08:34:28 -04:00
Josh de Leeuw
f2c0ebf63d add getLastTrialData function 2014-10-01 08:28:50 -04:00
Josh de Leeuw
4171f8d461 adding if chunk 2014-10-01 02:51:47 +00:00
Josh de Leeuw
8cef6f089e semicolon 2014-10-01 02:22:51 +00:00
Josh de Leeuw
6f10c190c5 implement randomize_order and repetitions opts
closes issue #70
2014-09-25 09:13:08 -04:00
Josh de Leeuw
c5c0298c9a remove line 2014-09-24 08:53:49 -04:00
Josh de Leeuw
e07e05ce35 implement ability to get index of trial relative to block 2014-09-24 08:51:44 -04:00
Josh de Leeuw
c1c60c209d update progress bar spec
shows progress based on which chunk the subject is currently doing in
the root_chunk object. this means that progress updates less often, but
the experimenter can always break out blocks into lots of chunks if
they want the progress to update more frequently.
2014-09-24 08:37:28 -04:00
Josh de Leeuw
e4d2766f8b cleaning up stuff that isn't needed. 2014-09-23 16:31:01 -04:00
Josh de Leeuw
044cbc3d6e more fixes for nested chunks
- fixed method to get data associated with chunk ID
- isComplete now works for root type chunk
2014-09-23 16:14:36 -04:00
Josh de Leeuw
619d9ffa05 reconfiguring chunk to be tree-like
now there is a root chunk which contains the entire experiment, with
all other chunks being branches off of the root. lots of tweaking to
chunk ID code to get dynamic IDs depending on how many iterations of a
chunk have happened.
2014-09-23 14:10:51 -04:00
Josh de Leeuw
044cf9c780 trying to implement nested chunks
this is really broken right now.
2014-09-22 09:40:34 -04:00
Josh de Leeuw
d9c356f6d7 replace block.next with jsPsych.finishTrial(); 2014-09-19 15:19:01 -04:00
Josh de Leeuw
e7e3271731 more work to support while chunks
Issue #8
2014-09-19 15:05:11 -04:00
Josh de Leeuw
fcf8239578 implements while chunk
related to Issue #8
2014-09-19 14:43:59 -04:00
Josh de Leeuw
03386a661f various bug fixes to get chunks working 2014-09-19 14:21:49 -04:00
Josh de Leeuw
4128984f36 more work on chunk code 2014-09-19 08:45:59 -04:00
Josh de Leeuw
ab30087973 starting to fill in chunk behavior 2014-09-18 16:55:45 -04:00
Josh de Leeuw
73b6524c0f changing what blocks do
now they are just collections of trials, rather than having significant
functionality for running the experiment. the running code is now part
of the jsPsych object.
2014-09-18 09:58:21 -04:00
Josh de Leeuw
ba0ac9c6bf more changes to support chunks 2014-09-17 17:09:37 -04:00
Josh de Leeuw
4a783ea684 more sketching for chunks 2014-09-17 12:00:36 -04:00
Josh de Leeuw
6fc666ec1e start sketching out chunks 2014-09-17 11:41:54 -04:00
Josh de Leeuw
c19295bd98 add datastore object 2014-09-17 11:34:00 -04:00
Josh de Leeuw
80158e52f2 wake up this branch 2014-09-17 11:24:29 -04:00
Josh de Leeuw
bc00b48ee2 remove genericParameters from plugin specific implementations 2014-09-16 08:54:09 -04:00
Josh de Leeuw
1d5adf787a streamline generic trial options 2014-09-16 08:40:10 -04:00
Josh de Leeuw
2ed85be15b add generic trial options support in core
related to issue #36, #68
2014-09-15 10:53:24 -04:00
Josh de Leeuw
9ab6543cb0 starting to handle trial level callbacks
however, this will probably not be able to happen until the code for
creating trials is refactored somewhat. it’s difficult to specify trial
parameters without editing each plugin manually. when plugins can have
standardized values, then the other half of this can go in.
2014-09-12 16:41:01 -04:00
Josh de Leeuw
89f4f1535c remove part parameter in do trial method
closes #64
2014-09-12 16:25:56 -04:00
Josh de Leeuw
12118247b1 add progress bar option
Can now pass ‘show_progress_bar: true’ to init method to display a
progress bar throughout the experiment.

* default styling has been added to jspsych.css for the progress bar
* bug fixes to jspsych.progress method to support this change (bug was
related to getting progress after experiment had ended)
* improved logic for when on_finish_trial callback function will trigger
2014-09-10 10:15:13 -04:00
Josh de Leeuw
2c33d7603d add block_index to default data
records the index of the current block
2014-09-09 08:32:12 -04:00
Josh de Leeuw
146d1dae20 add time_elapsed to default data
records the number of ms since the start of the experiment when a trial ends.
2014-09-09 08:28:52 -04:00
Josh de Leeuw
8db4ea307e add default data for all trials
records default data for all trials:

- trial type
- trial index within the block
- trial index for entire experiment (global index -- related to issue #63)
2014-09-08 15:22:17 -04:00
Josh de Leeuw
a07f59d323 namespace bug 2014-09-03 14:19:24 -04:00
Josh de Leeuw
26052c22a1 remove append_data 2014-07-10 12:14:05 -04:00
Josh de Leeuw
fdf77c79dd make json pretty 2014-07-10 12:03:51 -04:00
Josh de Leeuw
fc16067939 add getter method for DOM_target, update module methods 2014-07-10 12:00:56 -04:00
Josh de Leeuw
8d3d9af0db bug fix flatten_data -> flattenData 2014-07-10 11:49:40 -04:00
Josh de Leeuw
594be10e52 add dataAPI.displayData 2014-07-10 11:45:01 -04:00
Josh de Leeuw
959447be1e move flatten function 2014-07-04 16:04:36 -04:00
Josh de Leeuw
3e8fb4f780 change header doc 2014-07-01 11:08:48 -04:00
Josh de Leeuw
11f644f6a6 add dataAPI.getTrialsOfType 2014-07-01 11:05:40 -04:00
Josh de Leeuw
107ca90748 a few unrelated bug fixes 2014-06-30 14:19:51 -04:00
Josh de Leeuw
ebd50e7726 replace core with module 2014-06-30 09:47:23 -04:00
Josh de Leeuw
e656894011 move getKeys to the right module 2014-06-30 09:46:32 -04:00
Josh de Leeuw
3b184648fd missing ) 2014-06-30 09:43:47 -04:00
Josh de Leeuw
2befa81411 change $.unbind to $.off 2014-06-30 09:36:33 -04:00
Josh de Leeuw
94446016ae require key to be released before continuing in getKeyboardResponse 2014-06-30 09:33:12 -04:00
Josh de Leeuw
ef64d1389b handle undefined params in enforceArray 2014-06-29 10:48:02 -04:00
Josh de Leeuw
6d08b3ce86 add turk module 2014-06-29 09:26:01 -04:00
Josh de Leeuw
133ce33c3b create dataAPI 2014-06-28 22:10:07 -04:00
Josh de Leeuw
dc4afd50bd add option to persist a keyboard listener 2014-06-28 10:51:54 -04:00
Josh de Leeuw
119c94ca5b move keycode 2014-06-27 23:02:10 -04:00
Josh de Leeuw
2d586bbaa6 move functions into pluginAPI module 2014-06-27 23:00:48 -04:00
Josh de Leeuw
5e85c7025b check to make sure listener exists before removing 2014-06-26 11:48:23 -04:00
Josh de Leeuw
511279df42 add ability to cancel getKeyboardResponse listeners 2014-06-26 11:41:41 -04:00
Josh de Leeuw
0eea72adb1 add factorial method, rename simpleSample to repeat 2014-06-25 13:31:58 -04:00
Josh de Leeuw
f3a514a20b add randomization module
* includes simpleSample method and a few private helper functions
2014-06-25 12:27:03 -04:00
Josh de Leeuw
5880398058 allow key string lookup 2014-06-25 08:58:06 -04:00
Josh de Leeuw
b913c7c9d0 bug fix in getKeyboardResponse 2014-06-24 18:34:44 -04:00
Josh de Leeuw
85ea030ed0 wrong logical operator 2014-06-24 16:59:39 -04:00
Josh de Leeuw
ba64349cb5 Adding getKeyboardResponse method to core 2014-06-24 14:10:16 -04:00
Josh de Leeuw
8d2211b712 Add error message if plugin is not loaded
Closes #51
2014-06-24 12:07:57 -04:00
Josh de Leeuw
12c527e0b4 typo fix in core.submitToTurk 2014-06-16 09:44:51 -04:00
Josh de Leeuw
ebfc6548f6 Add core.submitToTurk
* add function to core
* modify turkInfo to also grab turkSubmitTo location (either sandbox or production)
2014-06-15 12:56:03 -04:00
Josh de Leeuw
decd0cf04b add jsPsych.totalTime method
gets the total time in ms since the experiment started.
2014-06-11 23:15:17 -04:00
Josh de Leeuw
b3b82db7f8 add class information to display element
related to issue #45
2014-06-11 16:10:35 -04:00
Josh de Leeuw
c0beee3221 handle multiple parameters with single call of enforce array 2014-05-19 10:42:14 -04:00
Josh de Leeuw
c5539da1a6 Merge branch 'master' into smart-arrays
Conflicts:
	jspsych.js
2014-05-19 10:05:58 -04:00
Josh de Leeuw
ab6c105dd1 make sure unprocessed functions get preserved in trial obj
related to issue #42
2014-05-15 14:25:33 -04:00
Josh de Leeuw
a8f2a676e6 Allow for protected variables in normalizeTrialVariables
Related to #43
2014-05-14 15:13:04 -04:00
Josh de Leeuw
c88c07887c PreloadImages method will auto-flatten the input array
Closes #42
2014-05-13 13:02:47 -04:00
Josh de Leeuw
75dc0e8b57 Adding enforceArray method 2014-04-28 16:47:15 -04:00
Josh de Leeuw
c8cb4204d1 adding normalizeTrialVariables method
method takes an object (intended to be a trial data structure) and converts any function arguments to their returned value.
2014-03-03 10:41:24 -05:00
Josh de Leeuw
1a3ca8cc69 Add option to return flattened data object
Related to issue #31 because it moves a utility function into the core library.
2014-02-28 17:07:07 -05:00
Josh de Leeuw
99e7cb58ba Adding an extra value for identifying when page is loaded outside of Turk context (relevant to #10) 2013-11-21 15:08:20 -05:00
Josh de Leeuw
b6a89b935c Adding jsPsych.turkInfo() method (addresses issue #10) 2013-11-20 15:07:32 -05:00
Josh de Leeuw
a04f33f30e adding core.preloadImages() 2013-11-11 23:09:21 -05:00
Josh de Leeuw
1f173bcea4 tweaking saveAstext 2013-11-09 19:59:27 -05:00
Josh de Leeuw
d28108d175 tweaking saveAstext 2013-11-09 19:51:45 -05:00
Josh de Leeuw
68a7b64c66 tweaking saveAstext 2013-11-09 19:49:25 -05:00
Josh de Leeuw
61b4a07fa6 bug fix savecsv to file 2013-11-09 17:07:33 -05:00
Josh de Leeuw
fa447f0f52 bug fix savecsv to file 2013-11-09 17:05:29 -05:00
Josh de Leeuw
9bb65c1f1b bug fix savecsv to file 2013-11-09 17:01:03 -05:00
Josh de Leeuw
c820e18f7c adding save CSV to disk option in core library 2013-11-09 16:47:30 -05:00
Josh de Leeuw
260de7bbff fixing a bug in the CSV method 2013-11-07 18:55:49 -05:00
Josh de Leeuw
8da176ec73 adding CSV data option to core library 2013-11-07 18:49:58 -05:00
Josh de Leeuw
9e5c7d73f9 bug fix core - adding root document element addition by default 2013-11-04 10:36:05 -05:00
Josh de Leeuw
f671d6f8da bug fix core 2013-10-26 22:43:46 -04:00
Josh de Leeuw
1facd91a9b changing how display_element is set in the core library 2013-10-24 16:26:26 -04:00
Josh de Leeuw
94af5d0d7b minor typo fix jspsych.js 2013-10-22 12:44:45 -04:00
Josh de Leeuw
f50a579834 add on_data_update callback function to core 2013-10-21 18:00:26 -04:00
Josh de Leeuw
c33eec8724 add on_data_update callback function to core 2013-10-21 18:00:13 -04:00
Josh de Leeuw
d5598e3fff v1.08
- added adaptive category training
- categorize multi and samedifferentloc are incomplete and untested
- fixed issue with core file that caused failure when init method was
called twice.
2013-01-14 11:01:14 -05:00
Josh de Leeuw
fc6321de8a minor commenting 2012-09-06 16:35:05 -04:00
Josh de Leeuw
871ba7a897 added jspsych-free-sort
free sort is a plugin that displays a set of stimuli and records the
movements that participants make as they drag the stimuli to sort them.
sorting is unconstrained (i.e. there are no specific groups that
participants are told to sort into).
2012-07-19 14:18:50 -04:00
Josh de Leeuw
2f0d6c7e1e bug fix - moved where on_trial_finish is called to ensure it is called at the end of every trial 2012-07-17 18:49:46 -04:00
Josh de Leeuw
946f1aeea0 bug fixes for callback methods in previous commit 2012-07-17 18:13:52 -04:00
Josh de Leeuw
19983090a8 Added optional callback methods for tiral start and trial finish events in core library.
Can now pass in functions to the core library on init() so that a
function can be called at the start or end of every trial.
2012-07-17 18:05:09 -04:00
Josh de Leeuw
b33ab88b22 Added core.progress
// core.progress returns an object with the following properties
//   total_blocks: the number of total blocks in the experiment
//  total_trials: the number of total trials in the experiment
//  current_trial_global: the current trial number in global terms
//      i.e. if each block has 20 trials and the experiment is
//     currently in block 2 trial 10, this has a value of 30.
//  current_trial_local: the current trial number within the block.
//  current_block: the current block number.

Useful for showing user progress through the experiment. Planning to add
an option to show a progress bar in the future.
2012-07-17 17:51:17 -04:00
Josh de Leeuw
39846f1754 recommit of previous commit since nothing was changed...
jspsych-similarity.js : fixed data storage so that generic data object
was included in the block's data.

jspsych-storybook.js: included generic data object in data storage,
included path to image in data storage.

jspsych.js: cosmetic adjustment to code in finishExperiment() method.

NEW:

added call-function plugin, which calls a user-specified function.
useful for saving data before completion.

added paint plugin - displays a canvas element superimposed on an image
and allows subjects to draw on the image to indicate areas of interest.
2012-07-12 13:22:06 -04:00
Josh de Leeuw
3c04677878 added core.data()
jsPsych.data() now returns an array that contains all of the data from
the experiment.
2012-07-05 12:30:36 -04:00
Josh de Leeuw
338a21d199 breaking change
changes to the core jspsych.js file will break some backwards
compatibility. script files are no longer loaded dynamically, due to
issues with using $.getScript on local installations. this revision
makes defining a list of plugins unnecessary; they are automatically
recognized based on the experiment structure.

changes to similarity plugin: display is now sequential.

adding storybook plugin: this is an ipad plugin, which displays a single
image and records the location of touch events.
2012-06-29 13:16:24 -04:00
Josh de Leeuw
befdcfc1cd Rescoped everything so that jsPsych is not a jQuery plugin.
The top level object is jsPsych, and plugins are defined as jsPsych.PLUGIN.

The library also loads everything dynamically now, so the user only needs to load the main jsPsych script (and specify the src for any plugins).

This also changes how the library is loaded initially, since it is not based on the jQuery method anymore. See wiki.
2012-05-17 09:19:04 -04:00
Josh de Leeuw
9c94b4d0b6 Reworking the plugin structure to use the Module javascript design pattern.
Plugins now have a consistent internal structure, with better variable scoping.

This version breaks backward compatibility due to a change in the syntax of how experiment objects are declared.
2012-05-15 16:03:26 -04:00
Josh de Leeuw
9c8884f356 removed showImage and showImages from jspsych.js
fixed ie bugs in similarity
2012-05-14 15:41:15 -04:00
Josh de Leeuw
e88a1b052f Suite of bugfixes and changes related to same-different and animation plugin. Animation plugin is a complete redesign that removes dependency on the canimate.js library. 2012-04-05 14:00:20 -04:00
Josh de Leeuw
dfb0642ec2 verifying git setup 2012-03-30 10:15:53 -04:00
Drew Hendrickson
ee8de223d5 code directly from Josh 2012-03-26 23:32:21 -04:00