Skip to content

A self-paced Alternating Serial Reaction Time Task (ASRT) created with jsPSych.

License

Notifications You must be signed in to change notification settings

vekteo/ASRT_jsPsych

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alternating Serial Reaction Time Task created with jsPsych

Created by the MEMO Team of Lyon Neuroscience Research Center (CRNL) (PI: Dezso Nemeth)

Citation

If you use the script, please include this citation in your manuscript:

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 DOI

About the task

In the task, four circles are presented on the screen horizontally. A target stimulus (a dog's head) appears in one of the four circles. The task of the user is to press the response key corresponding to the position of the target stimulus as fast and as accurately as they can.

By default, the task begins with one block of practice with random trials (80 stimuli in each block). After that, 20 blocks of ASRT follows. Each block contains 10 repetitions of a randomly chosen 8-element sequence.

The trials are images of dogs. The 's', 'f', 'j' and 'l' keys on the keyboard are set as response keys (corresponding to the four positions from left to right).

If correct response is given, the next element is presented after a 120 ms response-to-stimulus interval. If the response is incorrect (but active response key was pressed), the same target stimulus appears on the screen again with an interstimulus interval of 0 ms (i.e., remains on the screen).

Average performance (mean accuracy and mean RT) is presented as a feedback after the end of the block with a personalized instruction:

  • if the mean accuracy of the block is less than 90%, it instructs to be more accurate.
  • if the mean RT of the block is over 350 ms, it instructs to be faster.
  • in other cases, it instructs to continue the task.

The breaks between the blocks are self-paced. The user can continue the task when they press a response key.

After the end of the task, output data will be downloaded to the local machine (CSV format). If the user quits before the end of the task, the data will also be downloaded to the local machine.

Output variables

  • success: whether fullscreen mode was successfully started/ended (true or false)
  • trial_type: jsPsych trialtype of the given trial (fullscreen, instructions, html-keyboard-response or serial-reaction-time)
  • trial_index: the number of the given trials (all events considered, even instructions, feedback!)
  • time_elapsed: the time elapsed from the start of the script in ms
  • internal_code_id: internal node id of the trial
  • subject: a 15-character long random subject ID for the online version, and customized subject number for the offline version
  • session: customized session number (for offline version only)
  • browser_event: browser events at the given trial (fullscreenenter, fullscreenexit, blur or focus)
  • view_history: only relavant at the instructions; the actions and the corresponding RTs during the reading of the instructions
  • rt: reaction time (RT) in ms - in the case of first responses to the trial, it shows the rt calculated from the appearence of the stimulus; in the case of not first responses, it shows the rt calculated from the last button press
  • stimulus: stimulus on the screen; relevant only if instructions/feedback are present
  • key_press: number code of the key pressed
  • correct: whether the response was correct (true or false)
  • grid: layout of the positions (in a grid)
  • target: position of target stimulus (the 4 positions: 1: 0,0; 2: 0,1; 3: 0,2; 4: 0,3)
  • r_or_p: random or pattern stimulus (R or P)
  • block: number of the block (1-20)
  • first_response: if the answer is the first answer to the given trial (yes: 1; no: 0)
  • trial_number: number of the trial within the block (1-85)
  • sequence: the sequence used during the task (assigned randomly at the beginning)
  • is_practice: whether it was a practice trial (yes: 1; 0: no)
  • correct_pos: the position of the target stimulus (1-4)
  • correct_resp_button: the response key that should be pressed to respond correctly ('s', 'f', 'j' or 'l')
  • resp_button: the pressed response key ('s', 'f', 'j' or 'l')
  • cumulative_RT: the RT from the beginning of the first appeareance of the trial in ms
  • actual_triplet: the triplet to what response was given (three digits indicating the positions of the target stimulus in the last three trials)
  • triplet_type: the type of the triplet (high-probability triplet: H; low-probability triplet: L, first trials: X, trill: T, repetition: T)
  • isWarning: the string "warning" appears if a warning was shown due to low (<80%) overall performance.

Settings

In the parameters.js file, several parameters can be modified by the user:
  • language: the language of the task. Available languages: english (en), hungarian (hu), french (fr), portuguese (pt)
  • numberOfPracticeBlocks: the number of practice blocks at the beginning
  • numberOfBlocks: the number of learning blocks (besides the practice blocks)
  • numberOfSequenceRepetitons: the number of repetitons of the four-element sequence
  • patternTrialImage: the image used for the pattern trials
  • randomTrialImage: the image used for the random trials
  • rsi: the response-to-stimulus interval after a button press (in ms)
  • initialDelay: the delay before the first trial of a block
  • overallWarning: a warning can be shown to the participants if their performance drops below 80% throughout the whole task
  • isOffline: if true, a screen will appear before the task where we can indicate the subject and session number. In that case, the sequence selected for the participants will depend on the subject number. Always the same sequence will be selected for a specific subject number (in the different sessions). If false, a randomly generated subject number will be allocated to the participant, and the sequence will be selected randomly. In that case, the session number is always 1.
  • responseKeys: the response keys
  • isFirstFiveRandom: If true, at the beginning of each block, the first five trials will be random (5 random + 80 sequence elements = 85 trials/block). If false, no random trials will be presented at the beginning of the task (80 sequence elements = 80 trials/block)
  • How to start the task

    Open the index.html file in the main folder.

    Browser requirements

    Any browser except Safari and Internet Explorer. Recommended: Chrome.