Gorilla LogoHome

[testing] Trial duration enabled in Alternating Serial Reaction Time (ASRT) task

Trial duration enabled in Alternating Serial Reaction Time (ASRT) task.

Testing script from

Vékony, T. (2021). Alternating Serial Reaction Time Task created with jsPsych (Version 1.0.0) [Computer software]. https://doi.org/10.5281/zenodo.7124730

Back to Open Materials


[testing] Trial duration enabled in Alternating Serial Reaction Time (ASRT) task

Built with Code Editor

See https://github.com/jspsych/jsPsych/discussions/3223. Thank you to Shaobin Jiang!


Key change: adding data.key_press !== false && in the following chunk.


/*function for inserting the same random element after incorrect response*/

function randomRepeat(actualRandom) {
    return {
        timeline: [randomIncorrectTrialProperties],
        timeline_variables: actualRandom.timeline_variables,
        conditional_function: function () { //function only happens is response is not correct!
            let data = jsPsych.data.get().last(1).values()[0];
            return data.key_press !== false && data.correct !== true;
        }
    }
}

Creative Commons Attribution (CC BY)

Public

Fully open! Access by URL and searchable from the Open Materials search page

Published on 28 January 2024