-
Hi all, I want to display an error message to participants if they make a lot of errors in a row. I think the basic layout should be an if statement, which returns true if the count of incorrect responses in the past n trials equals n. For instance, let's say I want to tell participants that they make many errors if they made three errors in a row:
I am not sure what I am missing -- but this apparently never returns true. Is there any other way to achieve this? Or what error am I making? Note that I have different elements such as fixation and stimulus display but adding |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
This looks like the right general approach to me, and I don't immediately see any bugs in the code. If you have multiple trial parts you will need to do some kind of filter statement like the one you describe. You'll need to do that filter before the var count = jsPsych.data.get().filter({test_part: 'response_screen'}).last(3).filter({correct: false}).count(); |
Beta Was this translation helpful? Give feedback.
This looks like the right general approach to me, and I don't immediately see any bugs in the code.
If you have multiple trial parts you will need to do some kind of filter statement like the one you describe. You'll need to do that filter before the
.last(3)
part, or you won't get three trials with acorrect
value. The full command might look like this: