Millisecond Forums

How to get input from participants and use it as value.

https://forums.millisecond.com/Topic28570.aspx

By kk1132 - 3/19/2020

Hi all,

I am new to Inquisit programming and I was wondering how to get input from participants and use it as value. 
So, simply saying, at the beginning of the program, participants will be asked to input their name, and then they will see this as stimulus/values as the program goes on.

For example, 
at the beginning there will be text box where participants will be asked to type their name. (I think I can do this by using openended element?,,) Then, there will be page showing "Welcome XXX (whatever they typed in the box)." 
How would you code this?

I know this can be very simple and easy for you all. I am new to this and trying to get a sense of this. I have read the tutorial and tried to search any previous posts but still no good news. Once I know how this can be coded, I think I will be good to go further! I'd really appreciate it if you can help me with this! 


Thanks!
By Dave - 3/20/2020

kk1132 - 3/20/2020
Hi all,

I am new to Inquisit programming and I was wondering how to get input from participants and use it as value. 
So, simply saying, at the beginning of the program, participants will be asked to input their name, and then they will see this as stimulus/values as the program goes on.

For example, 
at the beginning there will be text box where participants will be asked to type their name. (I think I can do this by using openended element?,,) Then, there will be page showing "Welcome XXX (whatever they typed in the box)." 
How would you code this?

I know this can be very simple and easy for you all. I am new to this and trying to get a sense of this. I have read the tutorial and tried to search any previous posts but still no good news. Once I know how this can be coded, I think I will be good to go further! I'd really appreciate it if you can help me with this! 


Thanks!

<block example>
/ trials = [1=enter_name; 2=welcome]
</block>

<values>
/ yourname = ""
</values>


<openended enter_name>
/ ontrialend = [
    values.yourname = openended.enter_name.response;
]
/ stimulusframes = [1=name_prompt]
/ position = (50%, 60%)
</openended>

<text name_prompt>
/ items = ("Please enter your name")
</text>

<trial welcome>
/ stimulusframes = [1=welcome_msg]
/ validresponse = (57)
</trial>

<text welcome_msg>
/ items = ("Welcome, <%values.yourname%>.")
</text>

By kk1132 - 4/2/2020

Dave - 3/20/2020
kk1132 - 3/20/2020
Hi all,

I am new to Inquisit programming and I was wondering how to get input from participants and use it as value. 
So, simply saying, at the beginning of the program, participants will be asked to input their name, and then they will see this as stimulus/values as the program goes on.

For example, 
at the beginning there will be text box where participants will be asked to type their name. (I think I can do this by using openended element?,,) Then, there will be page showing "Welcome XXX (whatever they typed in the box)." 
How would you code this?

I know this can be very simple and easy for you all. I am new to this and trying to get a sense of this. I have read the tutorial and tried to search any previous posts but still no good news. Once I know how this can be coded, I think I will be good to go further! I'd really appreciate it if you can help me with this! 


Thanks!

<block example>
/ trials = [1=enter_name; 2=welcome]
</block>

<values>
/ yourname = ""
</values>


<openended enter_name>
/ ontrialend = [
    values.yourname = openended.enter_name.response;
]
/ stimulusframes = [1=name_prompt]
/ position = (50%, 60%)
</openended>

<text name_prompt>
/ items = ("Please enter your name")
</text>

<trial welcome>
/ stimulusframes = [1=welcome_msg]
/ validresponse = (57)
</trial>

<text welcome_msg>
/ items = ("Welcome, <%values.yourname%>.")
</text>


Thank you Dave! This helped so much!