minin72704
|
|
Group: Forum Members
Posts: 51,
Visits: 189
|
I set following syntax and attempt to refer "0","1","2","3","4","5","6" respectively to numbers 0~6 (rating design) in CCT_cold. However, when I press 1 on keyboard, it record "2" in data. In addition, no response is recorded when i press 0 on keyboard.
/ validresponse = ("0","1","2","3","4","5","6")
/ correctresponse = ("")
/ inputdevice = keyboard
|
|
|
minin72704
|
|
Group: Forum Members
Posts: 51,
Visits: 189
|
Now, my main concerns are how to convert default setting of mouse in CCT task to correspond to keyboard, and then advanced to set response keys correctly for functioning devices of current design. Actually, I have no idea about these settings, could you give me more examples? Thank you.
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
> "However, when I press 1 on keyboard, it record "2" in data."
This is expected. The keyboard scancode for the key labeled "1" is 2. You can confirm this for yourself via Tools -> Keyboard Scancodes... The scancode is what Inquisit records in the response column in keys of keyboard responses.
Again, use the Keyboard Scancode tool to retrieve the specific scancodes the Lumina box returns for each of its various keys. Then, ideally, specify those scancodes in your /validresponse etc. attributes instead of "literal" key values. For example, the keyboard scancode for the "A" key on your keyboard is 30. So instead of defining
<trial sometrial> / inputdevice = keyboard / validresponse = ("A") ... </trial>
define <trial sometrial> / inputdevice = keyboard / validresponse = (30) ... </trial>
The scancode is also what the response property returns. I.e. any logic in /ontrialbegin, /ontrialend, /branch, /isvalidresponse, etc. that makes use of the response property ought to use the scancode.
<trial sometrial> / inputdevice = keyboard / isvalidresponse = [trial.sometrial.response=="30"] ... </trial>
|
|
|
minin72704
|
|
Group: Forum Members
Posts: 51,
Visits: 189
|
I followed your suggestion and set 0 to scancode 11 (/ validresponse = (11)), and 2 to 6 respectively to 1 to 5 as indicated in tools->keyboard scancodes. However, it doesn't work as well (please see attatchments).
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
<trial pickcard1>
/ stimulusframes = [1=roundinfo1, debuginfo, CR1C1_cold, CR1C2_cold, CR1C3_cold, CR1C4_cold, CR1C5_cold, CR1C6_cold, 00,01,02,03,04,05,06]
/ validresponse = (11,2,3,4,5,6,7)
/ isvalidresponse = [trial.pickcard1.response=="11"]
/ isvalidresponse = [trial.pickcard1.response=="2"]
/ isvalidresponse = [trial.pickcard1.response=="3"]
/ isvalidresponse = [trial.pickcard1.response=="4"]
/ isvalidresponse = [trial.pickcard1.response=="5"]
/ isvalidresponse = [trial.pickcard1.response=="6"]
/ isvalidresponse = [trial.pickcard1.response=="7"]
/ inputdevice = keyboard
/ ontrialend = [if(startswith(trial.pickcard1.response,"0"))values.ncards1=substring(trial.pickcard1.response,1,1) else values.ncards1=trial.pickcard1.response]
/ branch = [if(values.gameround1=="8")trial.mean] / ontrialend = [values.totalscore1+=values.score1]
/ responsemessage = (00, number00, 1) / responsemessage = (01, number01, 1) / responsemessage = (02, number02, 1) / responsemessage = (03, number03, 1) / responsemessage = (04, number04, 1) / responsemessage = (05, number05, 1) / responsemessage = (06, number06, 1) / timeout = 10000 / posttrialpause = trial.pickcard1.timeout-trial.pickcard1.elapsedtime </trial>
All those /isvalidresponse attributes are unnecessary. All the /responsemessage attributes are wrong. It is no longer possible for a response to be 01, 02, etc. You need to adapt those. This is what the trial should look like:
<trial pickcard1>
/ stimulusframes = [1=roundinfo1, debuginfo, CR1C1_cold, CR1C2_cold, CR1C3_cold, CR1C4_cold, CR1C5_cold, CR1C6_cold, 00,01,02,03,04,05,06]
/ validresponse = (11,2,3,4,5,6,7)
/ inputdevice = keyboard
/ ontrialend = [if(startswith(trial.pickcard1.response,"0"))values.ncards1=substring(trial.pickcard1.response,1,1) else values.ncards1=trial.pickcard1.response]
/ branch = [if(values.gameround1=="8")trial.mean] / ontrialend = [values.totalscore1+=values.score1]
/ responsemessage = (11, number00, 1) / responsemessage = (2, number01, 1) / responsemessage = (3, number02, 1) / responsemessage = (4, number03, 1) / responsemessage = (5, number04, 1) / responsemessage = (6, number05, 1) / responsemessage = (7, number06, 1) / timeout = 10000 / posttrialpause = trial.pickcard1.timeout-trial.pickcard1.elapsedtime </trial>
|
|
|
minin72704
|
|
Group: Forum Members
Posts: 51,
Visits: 189
|
After I modified those you mentioned and rerun the script, the problem ramianed existed. Specifically, I expected that red rectangle of 0~6 presented if participants press corresponding keys (e.g. press 0 on my keyboard the red rectangle will present with number 0 at exact position).
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
That is exactly what the code does when you press the keys with the corresponding scancodes. The scancodes are those for the number keys *at the top of your keyboard*, they are *not* the ones for your keyboard's numpad. The numpad keys have different scancodes.
|
|
|
minin72704
|
|
Group: Forum Members
Posts: 51,
Visits: 189
|
Yes, I press the number keys at the top of my keyboard rather than the numpad throughout my every tests. at the top of your keyboard at the top of your keyboard at the top of your keyboard
|
|
|
minin72704
|
|
Group: Forum Members
Posts: 51,
Visits: 189
|
I want participants to confirm their responses. If they press 1 but eventually see 2 on the screen they will feel confused.
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
Double-check you're code. You have an error in there somewhere. Again, the code is:
<trial pickcard1>
/ stimulusframes = [1=roundinfo1, debuginfo, CR1C1_cold, CR1C2_cold, CR1C3_cold, CR1C4_cold, CR1C5_cold, CR1C6_cold, 00,01,02,03,04,05,06]
/ validresponse = (11,2,3,4,5,6,7)
/ inputdevice = keyboard
/ ontrialend = [if(startswith(trial.pickcard1.response,"0"))values.ncards1=substring(trial.pickcard1.response,1,1) else values.ncards1=trial.pickcard1.response]
/ branch = [if(values.gameround1=="8")trial.mean] / ontrialend = [values.totalscore1+=values.score1]
/ responsemessage = (11, number00, 1) / responsemessage = (2, number01, 1) / responsemessage = (3, number02, 1) / responsemessage = (4, number03, 1) / responsemessage = (5, number04, 1) / responsemessage = (6, number05, 1) / responsemessage = (7, number06, 1) / timeout = 10000 / posttrialpause = trial.pickcard1.timeout-trial.pickcard1.elapsedtime </trial>
Pressing the "1" key will highlight "1" on-screen. Pressing "2" will highlight the "2" box on-screen, etc. I have confirmed this multiple times.
|
|
|