Feedback not running properly in Cognition.run #2204
-
Hello, I am Dusan Nikolic, and I am writing a code for an AX task for my experiment. I am seeing some problems with Cognition.run. It won't run my code well, and the code runs fine on a server.
I will tag in this post, the Cognition.run creator, @javidalpe, if he could help. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @dusannikolic92, are you seeing any errors in the JavaScript console when you run your task on cognition.run? Also, what version of jsPsych did you select on cognition.run? I ask because I noticed that this line: if (data.correct_response == jsPsych.pluginAPI.convertKeyCodeToKeyCharacter(data.key_press)) { won't work in v6.3+ because the if (jsPsych.pluginAPI.compareKeys(data.correct_response, data.response)) { If you selected jsPsych v6.3+ on cognition.run but don't want to update your code, you could just try switching to an jsPsych earlier release to see if that fixes that problem. Another thing you can try is adding some I hope this helps. Let us know if you're able to solve the problem or if you need further guidance. |
Beta Was this translation helpful? Give feedback.
-
Hello @becky-gilbert. Thank you so much! This works quite well. Anyway, it works now, thank you very much. |
Beta Was this translation helpful? Give feedback.
Hi @dusannikolic92, are you seeing any errors in the JavaScript console when you run your task on cognition.run? Also, what version of jsPsych did you select on cognition.run? I ask because I noticed that this line:
won't work in v6.3+ because the
key_press
property in the trial data was changed toresponse
. In v6.3 we also switched to using key characters (e.g. 'f', 'j') in the data, rather than numeric key codes. So instead of using thejsPsych.pluginAPI.convertKeyCodeToKeyCharacter
function, you would usejsPsych.pluginAPI.compareKeys
to check the response accuracy. So altogether, the line ab…