0

I am trying to design a game for an experiment. The game involves recognizing emotions and clicking a button to respond. Now I am onto the next stage of the experiment where participants get a response for the button they clicked (ex. Incorrect, Correct etc.)

I have used the same method to recall jsPsychHtmlKeyboardResponse but I am not sure how to do it for buttons.

Here is code so far. I have attempted to save the button response (ex.'High Happy') under the timeline Variable as corrext_response. I don't think that's right but I am not sure how else to do it.

enter image description here enter image description here

starball
  • 20,030
  • 7
  • 43
  • 238
mp90ua
  • 1
  • What problem is it that you are getting? If you access the last trial's data response, you should get an integer that corresponds to the button index in the `choices` that was pressed (see the [doc](https://www.jspsych.org/7.3/plugins/html-button-response/#data-generated)). For instance, if you have `['Very Happy', 'Happy', 'Sad', 'Very Sad']` choices, the `response` data for the trial can be between 0-3, with, say, 2 (acquired from `jsPsych.data.get().last(1).values()[0].response`) corresponding to the 'Sad' button press. Also, never post images of code! – npetrov937 Jan 11 '23 at 09:32

0 Answers0