Skip to content

Setting a minimum time at the trial level #3260

Answered by Shaobin-Jiang
arthurprat asked this question in Q&A
Discussion options

You must be logged in to vote

You can just:

  • set the choices to something probably no one would have on their keyboard
  • set up your own keyboard listener in on_load with a minimum_valid_rt
  • feed the choices key in the callback

Example given below:

let jsPsych = initJsPsych();

let trial = {
    type: jsPsychHtmlKeyboardResponse,
    stimulus: 'Minimum rt: 3000 ms',
    choices: ['Symbol'],
    on_load: function () {
        jsPsych.pluginAPI.getKeyboardResponse({
            callback_function: function () {
                jsPsych.pluginAPI.keyDown('Symbol');
            },
            valid_responses: 'ALL_KEYS',
            minimum_valid_rt: 3000,
        });
    }
};

jsPsych.run([trial]);

You can, of course, use a …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@arthurprat
Comment options

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