Skip to content
Discussion options

You must be logged in to vote

Hi @cainesap! You're very close. This line:

var sid = jsPsych.data.get().filter({question_id: 'subjid'}).values()[0];

Is getting all of the jsPsych data, then filtering the trials based on the value of "question_id", then returning those trials as an array, and finally giving you the data object from the first (probably only?) trial in that array. So in other words it's giving you all of the data from that trial. Now what you need to do is access the "response" property from that trial data, and then access the specific question name ("Q0") within "response". So try this:

var sid = jsPsych.data.get().filter({question_id: 'subjid'}).values()[0].response.Q0;

Does that work for you?

Btw you'…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@cainesap
Comment options

@becky-gilbert
Comment options

Answer selected by cainesap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants