Skip to content
Discussion options

You must be logged in to vote

Hi @Altr37, I'm not sure if this is the only issue, but one problem with this is that you can't use the OR (||) operator inside of jsPsych's filter function. If you want to filter on one of two possible values, then you can use the filterCustom function, which allows you to add in logical operators, like this:

var data = jsPsych.data.get().filterCustom(function(trial){
    return (trial.trial_type == "html-keyboard-response" && (trial.trial_part = "probe" || trial.trial_part = "question"));
});

Then you can try printing the result to the console, to make sure that it's working:

var data = jsPsych.data.get().filterCustom(function(trial){
    return (trial.trial_type == "html-keyboard-respo…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@Altr37
Comment options

@becky-gilbert
Comment options

@Altr37
Comment options

@becky-gilbert
Comment options

@Altr37
Comment options

Answer selected by Altr37
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