Radiobuttons --> Just using keys on the keyboard as answers


Author
Message
Anemoniah
Anemoniah
Respected Member (483 reputation)Respected Member (483 reputation)Respected Member (483 reputation)Respected Member (483 reputation)Respected Member (483 reputation)Respected Member (483 reputation)Respected Member (483 reputation)Respected Member (483 reputation)Respected Member (483 reputation)
Group: Forum Members
Posts: 5, Visits: 14
Hey everyone,

so as I am still new in Inquisit I have another "problem" that I can not solve.

To put it in a nutshell: I have two blocks. Within a block there is at trial being repeated until the participant answers in a specific way. To be more precise: The possibilities for answering are "yes" and "no". If the participant answers with "yes", the block will be ended. But if his answer is "no", then the trial will keep being repated until he says for the first time "yes".

To achieve that I have chosen to use radiobuttons as you see ahead:

<radiobuttons q1>
/caption = "..."
/fontstyle = ("Times New Roman", 3.00%, false, false, false, false, 5, 1)
/options=("yes", "no")
/optionvalues = ("1", "0")
/orientation = vertical
/position = (10,20)
/required=true
</radiobuttons>

<surveypage q1_page>
/caption ="..."
/ fontstyle = ("Times New Roman", 4.00%, false, false, false, false, 5, 1)
/itemfontstyle = ("Times New Roman", 2%, false, false, false, false, 5, 1)
/responsefontstyle = ("Times New Roman", 1.5%, false, false, false, false, 5, 1)
/ txcolor = (0, 0, 0)
/questions =[1=q1]

/nextlabel = "Weiter"

/nextbuttonposition = (70%, 60%)
/ finishlabel = "Weiter"

/showpagenumbers = false
/showquestionnumbers = false
</surveypage>
...
<block b1>
/ trials = [1= t1; 2-200= t2]
/ stop = [radiobuttons.q1.response == 1]
</block>

But now I want to change that to save time. So I don't want the participants to see a radiobutton question and answering with yes or no. Instead I want them to press two keys on the keyboard, for example "<" for "no" or "-" for yes". So he just needs to press one keys to end the block (with "-" for "yes"). If he choses "<" the trial will be repeated ( / trials = [1= t1; 2-200= t2]) etc. 
  To achieve that I tried to use the following (with 1 representing yes and 2 being äquivalent with 0) hoping that 1 would end the trial (and block)

<trial q1>
/ stimulusframes = [1=white; 2=text, p]
/correctresponse = ("1")
/ validresponse = ("1", "2")
/ posttrialpause = 500
/branch = [if(trial.q1.response == 1) trial.painadjust_t_th1]
</trial>
...
<block b_1>
/ trials = [1= t1; 2-200= t2]
/ stop = [trial.q1.response == 1]
</block>

But it just does not seem to work.. First problem is that I just am able to use the digits on the keyboard. Then the trial won't end - independently of using 1 or 2.....

Do you guys have any ideas how to manage the problem? Or have an inquisit script example? Thank you so much in advance!


Regard and thank you,
Anemoniah!


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: 12K, Visits: 98K
Anemoniah - Monday, September 10, 2018
Hey everyone,

so as I am still new in Inquisit I have another "problem" that I can not solve.

To put it in a nutshell: I have two blocks. Within a block there is at trial being repeated until the participant answers in a specific way. To be more precise: The possibilities for answering are "yes" and "no". If the participant answers with "yes", the block will be ended. But if his answer is "no", then the trial will keep being repated until he says for the first time "yes".

To achieve that I have chosen to use radiobuttons as you see ahead:

<radiobuttons q1>
/caption = "..."
/fontstyle = ("Times New Roman", 3.00%, false, false, false, false, 5, 1)
/options=("yes", "no")
/optionvalues = ("1", "0")
/orientation = vertical
/position = (10,20)
/required=true
</radiobuttons>

<surveypage q1_page>
/caption ="..."
/ fontstyle = ("Times New Roman", 4.00%, false, false, false, false, 5, 1)
/itemfontstyle = ("Times New Roman", 2%, false, false, false, false, 5, 1)
/responsefontstyle = ("Times New Roman", 1.5%, false, false, false, false, 5, 1)
/ txcolor = (0, 0, 0)
/questions =[1=q1]

/nextlabel = "Weiter"

/nextbuttonposition = (70%, 60%)
/ finishlabel = "Weiter"

/showpagenumbers = false
/showquestionnumbers = false
</surveypage>
...
<block b1>
/ trials = [1= t1; 2-200= t2]
/ stop = [radiobuttons.q1.response == 1]
</block>

But now I want to change that to save time. So I don't want the participants to see a radiobutton question and answering with yes or no. Instead I want them to press two keys on the keyboard, for example "<" for "no" or "-" for yes". So he just needs to press one keys to end the block (with "-" for "yes"). If he choses "<" the trial will be repeated ( / trials = [1= t1; 2-200= t2]) etc. 
  To achieve that I tried to use the following (with 1 representing yes and 2 being äquivalent with 0) hoping that 1 would end the trial (and block)

<trial q1>
/ stimulusframes = [1=white; 2=text, p]
/correctresponse = ("1")
/ validresponse = ("1", "2")
/ posttrialpause = 500
/branch = [if(trial.q1.response == 1) trial.painadjust_t_th1]
</trial>
...
<block b_1>
/ trials = [1= t1; 2-200= t2]
/ stop = [trial.q1.response == 1]
</block>

But it just does not seem to work.. First problem is that I just am able to use the digits on the keyboard. Then the trial won't end - independently of using 1 or 2.....

Do you guys have any ideas how to manage the problem? Or have an inquisit script example? Thank you so much in advance!


Regard and thank you,
Anemoniah!


What a <trial> "sees" as its response, is a numerical keyboard scan code, see Tools -> Keyboard Scancodes..., not the character that is printed on the respective key on your keyboard, (e.g. the symbol "<"). The keyboard scan code is what you need to use when you query the <trial>'s response property and /branch or perform any /stop or /ontrialend logic based on the response.

Here's an example using the LEFT and RIGHT arrow keys:


<block myblock>
/ trials = [1=t1; 2-11=t2;]
/ stop = [trial.t1.response == 203]
</block>

<trial t1>
/ stimulusframes = [1=t1text]
/ validresponse = (203, 205)
</trial>

<trial t2>
/ stimulusframes = [1=t2text]
/ validresponse = (57)
/ posttrialpause = 500
</trial>

<text t1text>
/ items = ("Press the LEFT arrow key to end the block, press the RIGHT arrow key to move on with the block.")
</text>

<text t2text>
/ items = ("Press the SPACEBAR.")
</text>


Anemoniah
Anemoniah
Respected Member (483 reputation)Respected Member (483 reputation)Respected Member (483 reputation)Respected Member (483 reputation)Respected Member (483 reputation)Respected Member (483 reputation)Respected Member (483 reputation)Respected Member (483 reputation)Respected Member (483 reputation)
Group: Forum Members
Posts: 5, Visits: 14
Dave - Monday, September 10, 2018
Anemoniah - Monday, September 10, 2018
Hey everyone,

so as I am still new in Inquisit I have another "problem" that I can not solve.

To put it in a nutshell: I have two blocks. Within a block there is at trial being repeated until the participant answers in a specific way. To be more precise: The possibilities for answering are "yes" and "no". If the participant answers with "yes", the block will be ended. But if his answer is "no", then the trial will keep being repated until he says for the first time "yes".

To achieve that I have chosen to use radiobuttons as you see ahead:

<radiobuttons q1>
/caption = "..."
/fontstyle = ("Times New Roman", 3.00%, false, false, false, false, 5, 1)
/options=("yes", "no")
/optionvalues = ("1", "0")
/orientation = vertical
/position = (10,20)
/required=true
</radiobuttons>

<surveypage q1_page>
/caption ="..."
/ fontstyle = ("Times New Roman", 4.00%, false, false, false, false, 5, 1)
/itemfontstyle = ("Times New Roman", 2%, false, false, false, false, 5, 1)
/responsefontstyle = ("Times New Roman", 1.5%, false, false, false, false, 5, 1)
/ txcolor = (0, 0, 0)
/questions =[1=q1]

/nextlabel = "Weiter"

/nextbuttonposition = (70%, 60%)
/ finishlabel = "Weiter"

/showpagenumbers = false
/showquestionnumbers = false
</surveypage>
...
<block b1>
/ trials = [1= t1; 2-200= t2]
/ stop = [radiobuttons.q1.response == 1]
</block>

But now I want to change that to save time. So I don't want the participants to see a radiobutton question and answering with yes or no. Instead I want them to press two keys on the keyboard, for example "<" for "no" or "-" for yes". So he just needs to press one keys to end the block (with "-" for "yes"). If he choses "<" the trial will be repeated ( / trials = [1= t1; 2-200= t2]) etc. 
  To achieve that I tried to use the following (with 1 representing yes and 2 being äquivalent with 0) hoping that 1 would end the trial (and block)

<trial q1>
/ stimulusframes = [1=white; 2=text, p]
/correctresponse = ("1")
/ validresponse = ("1", "2")
/ posttrialpause = 500
/branch = [if(trial.q1.response == 1) trial.painadjust_t_th1]
</trial>
...
<block b_1>
/ trials = [1= t1; 2-200= t2]
/ stop = [trial.q1.response == 1]
</block>

But it just does not seem to work.. First problem is that I just am able to use the digits on the keyboard. Then the trial won't end - independently of using 1 or 2.....

Do you guys have any ideas how to manage the problem? Or have an inquisit script example? Thank you so much in advance!


Regard and thank you,
Anemoniah!


What a <trial> "sees" as its response, is a numerical keyboard scan code, see Tools -> Keyboard Scancodes..., not the character that is printed on the respective key on your keyboard, (e.g. the symbol "<"). The keyboard scan code is what you need to use when you query the <trial>'s response property and /branch or perform any /stop or /ontrialend logic based on the response.

Here's an example using the LEFT and RIGHT arrow keys:


<block myblock>
/ trials = [1=t1; 2-11=t2;]
/ stop = [trial.t1.response == 203]
</block>

<trial t1>
/ stimulusframes = [1=t1text]
/ validresponse = (203, 205)
</trial>

<trial t2>
/ stimulusframes = [1=t2text]
/ validresponse = (57)
/ posttrialpause = 500
</trial>

<text t1text>
/ items = ("Press the LEFT arrow key to end the block, press the RIGHT arrow key to move on with the block.")
</text>

<text t2text>
/ items = ("Press the SPACEBAR.")
</text>


Sorry, I should have been more precise. I'm aware of the scan codes for the keyboard. And I did it as you described in your response, but Inquisit just gives me the error report "203 ist not a valid setting" etc. As for the /stop I also did that, but then it  appears: "'no response' can not be specified unless the trial has a timeout".... Do you have any ideas why I get these messages?

Anemoniah
Anemoniah
Respected Member (483 reputation)Respected Member (483 reputation)Respected Member (483 reputation)Respected Member (483 reputation)Respected Member (483 reputation)Respected Member (483 reputation)Respected Member (483 reputation)Respected Member (483 reputation)Respected Member (483 reputation)
Group: Forum Members
Posts: 5, Visits: 14
Anemoniah - Tuesday, September 11, 2018
Dave - Monday, September 10, 2018
Anemoniah - Monday, September 10, 2018
Hey everyone,

so as I am still new in Inquisit I have another "problem" that I can not solve.

To put it in a nutshell: I have two blocks. Within a block there is at trial being repeated until the participant answers in a specific way. To be more precise: The possibilities for answering are "yes" and "no". If the participant answers with "yes", the block will be ended. But if his answer is "no", then the trial will keep being repated until he says for the first time "yes".

To achieve that I have chosen to use radiobuttons as you see ahead:

<radiobuttons q1>
/caption = "..."
/fontstyle = ("Times New Roman", 3.00%, false, false, false, false, 5, 1)
/options=("yes", "no")
/optionvalues = ("1", "0")
/orientation = vertical
/position = (10,20)
/required=true
</radiobuttons>

<surveypage q1_page>
/caption ="..."
/ fontstyle = ("Times New Roman", 4.00%, false, false, false, false, 5, 1)
/itemfontstyle = ("Times New Roman", 2%, false, false, false, false, 5, 1)
/responsefontstyle = ("Times New Roman", 1.5%, false, false, false, false, 5, 1)
/ txcolor = (0, 0, 0)
/questions =[1=q1]

/nextlabel = "Weiter"

/nextbuttonposition = (70%, 60%)
/ finishlabel = "Weiter"

/showpagenumbers = false
/showquestionnumbers = false
</surveypage>
...
<block b1>
/ trials = [1= t1; 2-200= t2]
/ stop = [radiobuttons.q1.response == 1]
</block>

But now I want to change that to save time. So I don't want the participants to see a radiobutton question and answering with yes or no. Instead I want them to press two keys on the keyboard, for example "<" for "no" or "-" for yes". So he just needs to press one keys to end the block (with "-" for "yes"). If he choses "<" the trial will be repeated ( / trials = [1= t1; 2-200= t2]) etc. 
  To achieve that I tried to use the following (with 1 representing yes and 2 being äquivalent with 0) hoping that 1 would end the trial (and block)

<trial q1>
/ stimulusframes = [1=white; 2=text, p]
/correctresponse = ("1")
/ validresponse = ("1", "2")
/ posttrialpause = 500
/branch = [if(trial.q1.response == 1) trial.painadjust_t_th1]
</trial>
...
<block b_1>
/ trials = [1= t1; 2-200= t2]
/ stop = [trial.q1.response == 1]
</block>

But it just does not seem to work.. First problem is that I just am able to use the digits on the keyboard. Then the trial won't end - independently of using 1 or 2.....

Do you guys have any ideas how to manage the problem? Or have an inquisit script example? Thank you so much in advance!


Regard and thank you,
Anemoniah!


What a <trial> "sees" as its response, is a numerical keyboard scan code, see Tools -> Keyboard Scancodes..., not the character that is printed on the respective key on your keyboard, (e.g. the symbol "<"). The keyboard scan code is what you need to use when you query the <trial>'s response property and /branch or perform any /stop or /ontrialend logic based on the response.

Here's an example using the LEFT and RIGHT arrow keys:


<block myblock>
/ trials = [1=t1; 2-11=t2;]
/ stop = [trial.t1.response == 203]
</block>

<trial t1>
/ stimulusframes = [1=t1text]
/ validresponse = (203, 205)
</trial>

<trial t2>
/ stimulusframes = [1=t2text]
/ validresponse = (57)
/ posttrialpause = 500
</trial>

<text t1text>
/ items = ("Press the LEFT arrow key to end the block, press the RIGHT arrow key to move on with the block.")
</text>

<text t2text>
/ items = ("Press the SPACEBAR.")
</text>


Sorry, I should have been more precise. I'm aware of the scan codes for the keyboard. And I did it as you described in your response, but Inquisit just gives me the error report "203 ist not a valid setting" etc. As for the /stop I also did that, but then it  appears: "'no response' can not be specified unless the trial has a timeout".... Do you have any ideas why I get these messages?

Ah, now it works! thank you. :) (just had to delete the " ")

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search