-
Dear community, I am currently trying to create a filter question from a survey with multiple questions. If this particular question is answered "No", I would like to ask another question afterwards. If the question is answered with "Yes", the timeline should simply continue. However, I have the problem that the following error message always appears: Filter question is Question 3 and the conditional timeline should run when the question is answered with "no" (= value 1).
So something seems to be wrong with accessing data, but I do not know how to solve it. I'd be very happy about some help. :) Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @lhunim95, The line where you are filtering the data isn't quite right. Unfortunately you can't filter on the Try this instead: var last_trial_data = jsPsych.data.get().last(1).values()[0].response.question3;
if(last_trial_data == 1) {
... This uses the |
Beta Was this translation helpful? Give feedback.
Hi @lhunim95,
The line where you are filtering the data isn't quite right. Unfortunately you can't filter on the
name
property of the question, because that data is nested inside theresponse
property.filter()
also only works at the whole-trial level, so you can't filter to just one of the questions.Try this instead:
This uses the
last()
function to get only the previous trial, and then accesses thequestion3
answer in theresponse
data. Note that this isresponse
and notresponses
. This was changed in v6.3 for better consistency across plugins.