Skip to content

Commit

Permalink
change key_press to response in rdk plugin jspsych#638
Browse files Browse the repository at this point in the history
  • Loading branch information
becky-gilbert committed Feb 17, 2021
1 parent fe34048 commit a8a1ffa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/plugins/jspsych-rdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ In addition to the [default data collected by all plugins](/overview/plugins#dat
| Name | Type | Value |
| ---------------- | ----------- | ---------------------------------------- |
| rt | numeric | The response time in ms for the subject to make a response. |
| key_press | string | The key that the subject pressed. |
| response | string | The key that the subject pressed. |
| correct | boolean | Whether or not the subject's key press corresponded to those provided in correct_choice. |
| frame_rate | numeric | The average frame rate for the trial. 0 denotes that the subject responded before the appearance of the second frame. |
| number_of_frames | numeric | The number of frames that was shown in this trial. |
Expand Down
5 changes: 2 additions & 3 deletions plugins/jspsych-rdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ jsPsych.plugins["rdk"] = (function() {
//Place all the data to be saved from this trial in one data object
var trial_data = {
rt: response.rt, //The response time
key_press: response.key, //The key that the subject pressed
response: response.key, //The key that the subject pressed
correct: correctOrNot(), //If the subject response was correct
choices: trial.choices, //The set of valid keys
correct_choice: trial.correct_choice, //The correct choice
Expand Down Expand Up @@ -559,8 +559,7 @@ jsPsych.plugins["rdk"] = (function() {
border_thickness: trial.border_thickness,
border_color: trial.border_color,
canvas_width: canvasWidth,
canvas_height: canvasHeight

canvas_height: canvasHeight
}

//Remove the canvas as the child of the display_element element
Expand Down
4 changes: 2 additions & 2 deletions tests/plugins/plugin-rdk.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ describe('rdk plugin', function(){
utils.pressKey('a');

var data = jsPsych.data.get().values();
expect(data[0].key_press).toBe('l');
expect(data[0].response).toBe('l');
expect(data[0].correct).toBe(true);
expect(data[1].key_press).toBe('a');
expect(data[1].response).toBe('a');
expect(data[1].correct).toBe(false);
});

Expand Down

0 comments on commit a8a1ffa

Please sign in to comment.