Need help with data record


Author
Message
AmyLiang
AmyLiang
Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)
Group: Forum Members
Posts: 7, Visits: 37
Hi, my script is as below.

<defaults>        
    / screencolor = black
    / txbgcolor = black
    / txcolor = white
    / fontstyle = ("Arial", 5%)
    / canvasaspectratio = (4,3)
</defaults>

<item Instruction_Speed>
    /1 = "会話の録音を聞いて頂きます。"
    /2 = "その録音の発話スピードに関して、
    速く感じますか?
    遅く感じますか?
    
    その程度を評価してください。"
</item>

<text Instruction_Speed>
    /items = Instruction_Speed
    /hjustify = center
    /size = (90%, 60%)
    /position = (50%, 85%)
    /valign = bottom
    /select = sequence
</text>

<text Spacebar>
    / items = ("スペースキーを押して、続けてください。")    
    / position = (50%, 95%)
    / valign = bottom
</text>

<trial Instruction>
    / stimulustimes = [1 = Instruction_Speed, Spacebar]
    / correctresponse = (" ")
    / errormessage = false
    / recorddata = false
</trial>

<text Rest>
    / items = ("しばらく休んでください。")
    /hjustify = center
    /size = (90%, 60%)
    /position = (50%, 85%)
    /valign = bottom
</text>

<trial Rest>
    / stimulustimes = [1= Rest, Spacebar]
    / correctresponse = (" ")
    / errormessage = false
    / recorddata = false
</trial>

<sound Sample>
/ items = ("K010_016_107.wav")
/ items = ("T021_005_108.wav")
/ items = ("T013_006_116.wav")
/ items = ("K003_008_118.wav")
/ items = ("T008_005_129.wav")
/ items = ("T020_007_134.wav")
/ select = noreplacenorepeat
/ playthrough = true
</sound>
<item Number>
/1 = "1番"
/2="2番"
/3="3番"
/4="4番"
/5="5番"
/6="6番"
</item>

<text Number>
    /items = Number
    /position = (50%, 50%)
    /fontstyle = ("Arial", 15%, true)
    /select = sequence
</text>

<text Blank>
    /items = (" ")
    /position = (50%, 50%)
    /fontstyle = ("Arial", 50%, true)
</text>

<picture scale>
    / items = ("A01_scale.jpg")
    / position = (50%, 50%)
    / size = (100%, 100%)
</picture>

<trial speed>
/pretrialpause = 1000
/posttrialpause = 2000
/stimulustimes = [0 = text.Number; 1000 = text.Blank, sound.Sample, picture.scale]
/inputdevice = keyboard
/validresponse = ("1","2","3","4","5","6","7")
/recorddata = true
</trial>


<block Speed1>
/ trials = [1-2=sequence(Instruction); 3-4 = random (trial.speed); 5=Rest]
/ recorddata = true
</block>

<block Speed2>
/ trials = [1-2 = random (trial.speed)]
/ recorddata = true
</block>

<expt Speed>
/ blocks = [1=Speed1;2=Speed2]
/ recorddata = true
</expt>

<data>
/ columns = (date, time, group, subject, stimulusnumber, stimulusitem, stimulusitem, stimulusitem, response, latency)
</data>

The script could be run without error. However, the data recorded  as below.

The recorded reponse is wrong. What I entered is "5, 7, 1, 3", while the recorde reponse is "6, 8, 2, 4".
Could I get some advise to fix this to the right record?


AKrishna
AKrishna
Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)
Group: Forum Members
Posts: 118, Visits: 396
Hi,

I'm sure Dave will give you a more complete answer very soon, but as I'm currently browsing the forum:

The problem is likely here:

<trial speed>
/pretrialpause = 1000
/posttrialpause = 2000
/stimulustimes = [0 = text.Number; 1000 = text.Blank, sound.Sample, picture.scale]
/inputdevice = keyboard
/validresponse = ("1","2","3","4","5","6","7")

/recorddata = true
</trial>

When you use the keyboard to record responses, Inquisit will write the scan code of the key you pressed into the "response" column. However, the scan code is not identical with what's actually on the keyboard. For example, the scan code for "5" on the number keys above the letters on a standard keyboard is actually 6. The scan code for the "5" key on the NumBlock is 76.

Your responses all look correct for what you pressed - as scan codes.

You can fix this by either using a Likert element instead of your keyboard trial (but that may be undesirable because a simple keypress doesn't end the trial) or by recording a custom value or expression that interprets keyboard scan codes as the numbers. For example:

<expressions>
/ interpreted_response = if (script.currenttrial.response == 2 || script.currenttrial.response == 79) 1
else if (script.currenttrial.response == 3 || script.currenttrial.response == 80) 2
else if (script.currenttrial.response == 4 || script.currenttrial.response == 81) 3
else if (script.currenttrial.response == 5 || script.currenttrial.response == 75) 4
else if (script.currenttrial.response == 6 || script.currenttrial.response == 76) 5
else if (script.currenttrial.response == 7 || script.currenttrial.response == 77) 6
else if (script.currenttrial.response == 8 || script.currenttrial.response == 71) 7
</expressions>


You could then record expressions.interpreted_response for a "translation" of the scan codes.

Hope this helps!
AmyLiang
AmyLiang
Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)
Group: Forum Members
Posts: 7, Visits: 37
AKrishna - 7/26/2024
Hi,

I'm sure Dave will give you a more complete answer very soon, but as I'm currently browsing the forum:

The problem is likely here:

<trial speed>
/pretrialpause = 1000
/posttrialpause = 2000
/stimulustimes = [0 = text.Number; 1000 = text.Blank, sound.Sample, picture.scale]
/inputdevice = keyboard
/validresponse = ("1","2","3","4","5","6","7")

/recorddata = true
</trial>

When you use the keyboard to record responses, Inquisit will write the scan code of the key you pressed into the "response" column. However, the scan code is not identical with what's actually on the keyboard. For example, the scan code for "5" on the number keys above the letters on a standard keyboard is actually 6. The scan code for the "5" key on the NumBlock is 76.

Your responses all look correct for what you pressed - as scan codes.

You can fix this by either using a Likert element instead of your keyboard trial (but that may be undesirable because a simple keypress doesn't end the trial) or by recording a custom value or expression that interprets keyboard scan codes as the numbers. For example:

<expressions>
/ interpreted_response = if (script.currenttrial.response == 2 || script.currenttrial.response == 79) 1
else if (script.currenttrial.response == 3 || script.currenttrial.response == 80) 2
else if (script.currenttrial.response == 4 || script.currenttrial.response == 81) 3
else if (script.currenttrial.response == 5 || script.currenttrial.response == 75) 4
else if (script.currenttrial.response == 6 || script.currenttrial.response == 76) 5
else if (script.currenttrial.response == 7 || script.currenttrial.response == 77) 6
else if (script.currenttrial.response == 8 || script.currenttrial.response == 71) 7
</expressions>


You could then record expressions.interpreted_response for a "translation" of the scan codes.

Hope this helps!

I really appreciate it, thank you so much!

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
AmyLiang - 7/26/2024
AKrishna - 7/26/2024
Hi,

I'm sure Dave will give you a more complete answer very soon, but as I'm currently browsing the forum:

The problem is likely here:

<trial speed>
/pretrialpause = 1000
/posttrialpause = 2000
/stimulustimes = [0 = text.Number; 1000 = text.Blank, sound.Sample, picture.scale]
/inputdevice = keyboard
/validresponse = ("1","2","3","4","5","6","7")

/recorddata = true
</trial>

When you use the keyboard to record responses, Inquisit will write the scan code of the key you pressed into the "response" column. However, the scan code is not identical with what's actually on the keyboard. For example, the scan code for "5" on the number keys above the letters on a standard keyboard is actually 6. The scan code for the "5" key on the NumBlock is 76.

Your responses all look correct for what you pressed - as scan codes.

You can fix this by either using a Likert element instead of your keyboard trial (but that may be undesirable because a simple keypress doesn't end the trial) or by recording a custom value or expression that interprets keyboard scan codes as the numbers. For example:

<expressions>
/ interpreted_response = if (script.currenttrial.response == 2 || script.currenttrial.response == 79) 1
else if (script.currenttrial.response == 3 || script.currenttrial.response == 80) 2
else if (script.currenttrial.response == 4 || script.currenttrial.response == 81) 3
else if (script.currenttrial.response == 5 || script.currenttrial.response == 75) 4
else if (script.currenttrial.response == 6 || script.currenttrial.response == 76) 5
else if (script.currenttrial.response == 7 || script.currenttrial.response == 77) 6
else if (script.currenttrial.response == 8 || script.currenttrial.response == 71) 7
</expressions>


You could then record expressions.interpreted_response for a "translation" of the scan codes.

Hope this helps!

I really appreciate it, thank you so much!

You can simply log responsetext to the data file, which will reflect the character. response, as @AKrishna explained, reflects the keyboard scancode.

AmyLiang
AmyLiang
Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)
Group: Forum Members
Posts: 7, Visits: 37
Dave - 7/26/2024
AmyLiang - 7/26/2024
AKrishna - 7/26/2024
Hi,

I'm sure Dave will give you a more complete answer very soon, but as I'm currently browsing the forum:

The problem is likely here:

<trial speed>
/pretrialpause = 1000
/posttrialpause = 2000
/stimulustimes = [0 = text.Number; 1000 = text.Blank, sound.Sample, picture.scale]
/inputdevice = keyboard
/validresponse = ("1","2","3","4","5","6","7")

/recorddata = true
</trial>

When you use the keyboard to record responses, Inquisit will write the scan code of the key you pressed into the "response" column. However, the scan code is not identical with what's actually on the keyboard. For example, the scan code for "5" on the number keys above the letters on a standard keyboard is actually 6. The scan code for the "5" key on the NumBlock is 76.

Your responses all look correct for what you pressed - as scan codes.

You can fix this by either using a Likert element instead of your keyboard trial (but that may be undesirable because a simple keypress doesn't end the trial) or by recording a custom value or expression that interprets keyboard scan codes as the numbers. For example:

<expressions>
/ interpreted_response = if (script.currenttrial.response == 2 || script.currenttrial.response == 79) 1
else if (script.currenttrial.response == 3 || script.currenttrial.response == 80) 2
else if (script.currenttrial.response == 4 || script.currenttrial.response == 81) 3
else if (script.currenttrial.response == 5 || script.currenttrial.response == 75) 4
else if (script.currenttrial.response == 6 || script.currenttrial.response == 76) 5
else if (script.currenttrial.response == 7 || script.currenttrial.response == 77) 6
else if (script.currenttrial.response == 8 || script.currenttrial.response == 71) 7
</expressions>


You could then record expressions.interpreted_response for a "translation" of the scan codes.

Hope this helps!

I really appreciate it, thank you so much!

You can simply log responsetext to the data file, which will reflect the character. response, as @AKrishna explained, reflects the keyboard scancode.

Thank you. I will try this
AmyLiang
AmyLiang
Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)
Group: Forum Members
Posts: 7, Visits: 37
Dave - 7/26/2024
AmyLiang - 7/26/2024
AKrishna - 7/26/2024
Hi,

I'm sure Dave will give you a more complete answer very soon, but as I'm currently browsing the forum:

The problem is likely here:

<trial speed>
/pretrialpause = 1000
/posttrialpause = 2000
/stimulustimes = [0 = text.Number; 1000 = text.Blank, sound.Sample, picture.scale]
/inputdevice = keyboard
/validresponse = ("1","2","3","4","5","6","7")

/recorddata = true
</trial>

When you use the keyboard to record responses, Inquisit will write the scan code of the key you pressed into the "response" column. However, the scan code is not identical with what's actually on the keyboard. For example, the scan code for "5" on the number keys above the letters on a standard keyboard is actually 6. The scan code for the "5" key on the NumBlock is 76.

Your responses all look correct for what you pressed - as scan codes.

You can fix this by either using a Likert element instead of your keyboard trial (but that may be undesirable because a simple keypress doesn't end the trial) or by recording a custom value or expression that interprets keyboard scan codes as the numbers. For example:

<expressions>
/ interpreted_response = if (script.currenttrial.response == 2 || script.currenttrial.response == 79) 1
else if (script.currenttrial.response == 3 || script.currenttrial.response == 80) 2
else if (script.currenttrial.response == 4 || script.currenttrial.response == 81) 3
else if (script.currenttrial.response == 5 || script.currenttrial.response == 75) 4
else if (script.currenttrial.response == 6 || script.currenttrial.response == 76) 5
else if (script.currenttrial.response == 7 || script.currenttrial.response == 77) 6
else if (script.currenttrial.response == 8 || script.currenttrial.response == 71) 7
</expressions>


You could then record expressions.interpreted_response for a "translation" of the scan codes.

Hope this helps!

I really appreciate it, thank you so much!

You can simply log responsetext to the data file, which will reflect the character. response, as @AKrishna explained, reflects the keyboard scancode.

I have understood the difference between scan code and keyboard value.
However, I failed to log responsetext to the data file.
I have read the help as below, but still do not understand where (the trail element? the block element?) and how to log responsetext.

************************************************************
Member of

<block><checkboxes><dropdown><expt><likert><listbox><openended><radiobuttons><slider><slidertrial><textbox><trial>

Remarks

If the element is a block, this returns the responsetext given on the most recent trial that was run within the block. If the element is a trial, this returns the responsetext given the last time the trial was run.

Examples

The following displays the value of responsetext in a text stimulus:
<text sometext>
/ items= ("responsetext = <% trial.sometrial.responsetext %>")
</text>

The following displays the value of responsetext in an instruction page:
<page somepage>
responsetext = <% trial.sometrial.responsetext %>
</page>

AKrishna
AKrishna
Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)
Group: Forum Members
Posts: 118, Visits: 396
You need to create a <data> element in your script. This element has a /columns attribute that allows you to define what you want to record for each trial. Just be aware that this will replace the default data file, so be sure to include all the variables you need.

See the help topic on "Inquisit Data Output" to learn what the default data file writes and see the help on the columns attribute for codes Inquisit understands.

For example, the following code:

<data>
/ columns = (subject, display.refreshinterval, date, time, trialcode, response, responsetext, latency)
</data>


...will log the subject id, display refresh interval, starting date and time, trialcode, response, responsetext, and latency variables for every trial. But it won't log the correct variable that is normally included, because I didn't explicitly specifiy it.

AmyLiang
AmyLiang
Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)
Group: Forum Members
Posts: 7, Visits: 37
AKrishna - 8/7/2024
You need to create a <data> element in your script. This element has a /columns attribute that allows you to define what you want to record for each trial. Just be aware that this will replace the default data file, so be sure to include all the variables you need.

See the help topic on "Inquisit Data Output" to learn what the default data file writes and see the help on the columns attribute for codes Inquisit understands.

For example, the following code:

<data>
/ columns = (subject, display.refreshinterval, date, time, trialcode, response, responsetext, latency)
</data>


...will log the subject id, display refresh interval, starting date and time, trialcode, response, responsetext, and latency variables for every trial. But it won't log the correct variable that is normally included, because I didn't explicitly specifiy it.

Get it Done! OMG, Thank you so much!!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search