+xAnd here's the key itself -- my apologies, should have included it with the original post.
It's not an off-by-one error, the problem is this:
/ validresponse = ("1", "2", "3", "4", "5", "6", "7", "8", "9")
/ correctresponse = (values.current_symbol)
You've defined the digits 1 to 9 as valid responses. A trial's response property, however, never reflects the character imprinted on the key (e.g. the digit "3" or "7" on the number keys at the top of your keyboard, or the letter "E", etc.), but the respective key's numerical keyboard scancode. See
https://www.millisecond.com/support/docs/v5/html/language/scancodes.htm and Tools -> Keyboard Scancodes...
The scan code for the digit "1" key is 2, the scan code for the digit "2" key is 3 and so forth. That's where the mismatch comes from.
If you do
<trial DSST_practice>
/ ontrialbegin = [ values.current_symbol = list.random_pick.nextvalue ]
/ ontrialbegin = [ values.current_scancode = computer.chartoscancode(values.current_symbol)]/ stimulustimes = [ 0 = symbol_display ]
/ validresponse = ("1", "2", "3", "4", "5", "6", "7", "8", "9")
/ correctresponse = (values.current_scancode)/ posttrialpause = parameters.substitution_post_stim_pause
/ errormessage = true(text.DSST_error, parameters.substitution_feedback_duration)
/ correctmessage = true(text.DSST_correct, parameters.substitution_feedback_duration)
</trial>
with
<values>
/ current_symbol = ""
/ current_scancode = ""/ total_digit_sub_trials = 0
</values>
then things should work fine.