diff --git a/docs/core_library/jspsych-core.md b/docs/core_library/jspsych-core.md index 64a8c01a..72031750 100644 --- a/docs/core_library/jspsych-core.md +++ b/docs/core_library/jspsych-core.md @@ -205,7 +205,7 @@ var block = { choices: ['y', 'n'], prompt: '

Press "y" to Continue. Press "n" to end this node of the experiment.

', on_finish: function(data) { - if (data.key_press == 'n') { + if (data.response == 'n') { jsPsych.endCurrentTimeline(); } }, @@ -258,7 +258,7 @@ var trial = { choices: ['y', 'n'] prompt: '

Press "y" to Continue. Press "n" to end the experiment

', on_finish: function(data){ - if(data.key_press == "n"){ + if(data.response == "n"){ jsPsych.endExperiment('The experiment was ended by pressing "n".'); } } @@ -466,7 +466,7 @@ var trial = { stimulus: 'Press p to take a 30 second break. Otherwise, press c to continue immediately.', choices: ['p','c'], on_finish: function(data){ - if(data.key_press == "p") { + if(data.response == "p") { jsPsych.pauseExperiment(); setTimeout(jsPsych.resumeExperiment, 30000); } @@ -535,7 +535,7 @@ var trial = { stimulus: 'Press p to take a 30 second break. Otherwise, press c to continue immediately.', choices: ['p','c'], on_finish: function(data){ - if(data.key_press == "p") { + if(data.response == "p") { jsPsych.pauseExperiment(); setTimeout(jsPsych.resumeExperiment, 30000); } diff --git a/docs/overview/callbacks.md b/docs/overview/callbacks.md index 63713f9c..21b60761 100644 --- a/docs/overview/callbacks.md +++ b/docs/overview/callbacks.md @@ -46,7 +46,7 @@ var trial = { type: 'image-keyboard-response', stimulus: 'imgA.png', on_finish: function(data) { - if(data.key_press == 'j'){ + if(data.response == 'j'){ data.correct = true; } else { data.correct = false; diff --git a/docs/overview/data.md b/docs/overview/data.md index a2f09d67..59f588c3 100644 --- a/docs/overview/data.md +++ b/docs/overview/data.md @@ -61,7 +61,7 @@ var trial = { type: 'image-keyboard-response', stimulus: 'imgA.jpg', on_finish: function(data){ - if(data.key_press == 'j'){ + if(data.response == 'j'){ data.correct = true; } else { data.correct = false; diff --git a/docs/overview/dynamic-parameters.md b/docs/overview/dynamic-parameters.md index 96c8fade..171050c0 100644 --- a/docs/overview/dynamic-parameters.md +++ b/docs/overview/dynamic-parameters.md @@ -22,7 +22,7 @@ var trial = { }, on_finish: function(data){ // Score the response as correct or incorrect. - if(data.key_press == "f"){ + if(data.response == "f"){ data.correct = true; } else { data.correct = false; diff --git a/docs/overview/eye-tracking.md b/docs/overview/eye-tracking.md index 0646e43e..60679b39 100644 --- a/docs/overview/eye-tracking.md +++ b/docs/overview/eye-tracking.md @@ -196,7 +196,7 @@ Below is example data from the image-keyboard-response trial taken from the expe { "rt": null, "stimulus": "img/blue.png", - "key_press": null, + "response": null, "trial_type": "image-keyboard-response", "trial_index": 4, "time_elapsed": 30701, diff --git a/docs/overview/plugins.md b/docs/overview/plugins.md index a6f9a9bf..537fbcc5 100644 --- a/docs/overview/plugins.md +++ b/docs/overview/plugins.md @@ -132,7 +132,7 @@ var trial = { correct_response: 'f' }, on_finish: function(data){ - if(data.key_press == data.correct_response){ + if(data.response == data.correct_response){ data.correct = true; } else { data.correct = false; diff --git a/docs/overview/timeline.md b/docs/overview/timeline.md index ea67054a..b6011b66 100644 --- a/docs/overview/timeline.md +++ b/docs/overview/timeline.md @@ -352,7 +352,7 @@ var trial = { var loop_node = { timeline: [trial], loop_function: function(data){ - if(data.values()[0].key_press == 'r'){ + if(data.values()[0].response == 'r'){ return true; } else { return false; @@ -382,7 +382,7 @@ var if_node = { // get the data from the previous trial, // and check which key was pressed var data = jsPsych.data.get().last(1).values()[0]; - if(data.key_press == 's'){ + if(data.response == 's'){ return false; } else { return true; diff --git a/examples/conditional-and-loop-functions.html b/examples/conditional-and-loop-functions.html index 8b377235..d8824e1b 100644 --- a/examples/conditional-and-loop-functions.html +++ b/examples/conditional-and-loop-functions.html @@ -17,7 +17,7 @@ var loop_node = { timeline: [trial], loop_function: function(data){ - if(data.values()[0].key_press == 'r'){ + if(data.values()[0].response == 'r'){ return true; } else { return false; @@ -40,7 +40,7 @@ timeline: [if_trial], conditional_function: function(){ var data = jsPsych.data.get().last(1).values()[0]; - if(data.key_press == 's'){ + if(data.response == 's'){ return false; } else { return true; diff --git a/examples/demo-flanker.html b/examples/demo-flanker.html index 65af2704..9b725968 100644 --- a/examples/demo-flanker.html +++ b/examples/demo-flanker.html @@ -61,9 +61,9 @@ data: jsPsych.timelineVariable('data'), on_finish: function(data){ var correct = false; - if(data.direction == 'left' && data.key_press == 'ArrowLeft' && data.rt > -1){ + if(data.direction == 'left' && data.response == 'ArrowLeft' && data.rt > -1){ correct = true; - } else if(data.direction == 'right' && data.key_press == 'ArrowRight' && data.rt > -1){ + } else if(data.direction == 'right' && data.response == 'ArrowRight' && data.rt > -1){ correct = true; } data.correct = correct; diff --git a/examples/end-active-node.html b/examples/end-active-node.html index cc3db69e..7d05bc65 100644 --- a/examples/end-active-node.html +++ b/examples/end-active-node.html @@ -24,7 +24,7 @@ render_on_canvas: false, prompt: '

Press "y" to continue. Press "n" to end this node of the experiment.

', on_finish: function(data) { - if (data.key_press == "n") { + if (data.response == "n") { jsPsych.endCurrentTimeline(); } }, diff --git a/examples/end-experiment.html b/examples/end-experiment.html index 0d1853ed..960500a4 100644 --- a/examples/end-experiment.html +++ b/examples/end-experiment.html @@ -28,7 +28,7 @@ prompt: '

Press "y" to continue. Press "n" to end the experiment.

', render_on_canvas: false, on_finish: function(data) { - if (data.key_press == 'n') { + if (data.response == 'n') { jsPsych.endExperiment('The experiment was ended. This is the end message.'); } }, diff --git a/examples/lexical-decision.html b/examples/lexical-decision.html index 527d1232..c258c600 100644 --- a/examples/lexical-decision.html +++ b/examples/lexical-decision.html @@ -90,9 +90,9 @@ }, on_finish: function(data){ if(data.word_validity == 'valid'){ - var correct = data.key_press == 'y'; + var correct = data.response == 'y'; } else { - var correct = data.key_press == 'n'; + var correct = data.response == 'n'; } data.correct = correct; }