Replies: 1 comment
-
Yes, you can do this using jsPsych's dynamic parameters for the later sentence stimulus. Dynamic parameters allow you to use a function to define/return the parameter value during the experiment, right before the trial begins. In your case, you'll need a way of finding the response from the earlier question in the jsPsych data. To do this, I suggest looking at the documentation for data manipulation (specifically the data filtering reference and examples). When you put these things together, your later trial that includes their response will look something like this (note that I haven't tested this - it may not work!): var later_trial = {
type: 'html-keyboard-response',
stimulus: function() {
// get data from the earlier trial
var previous_trial = jsPsych.data.get().filter({})[0]; // <-- add criteria to the filter function to find the earlier trial data
// extract the response from the data
var previous_response = JSON.parse(previous_trial.responses[0]);
// construct the stimulus string
var stim = 'Earlier you mentioned you had a ';
stim += previous_response;
stim += "disability...";
return stim;
}
}; Feel free to follow up here and post your code if you need further guidance. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am trying to see if there is a way to include a participants open ended response to a question (completed during the middle of the study) and place it into a sentence later (end of the study).
What I am trying to do here is to draw upon participants response about their identity and include their response to that question in the middle of later sentence (i.e. Earlier you mentioned you had a ________ disability...). Is this feasible with jsPsych?
I am fairly new to jsPsych and coding, so pardon me if this question is unclear.
Beta Was this translation helpful? Give feedback.
All reactions