Millisecond Forums

Textbox multiple entries

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

By wmfang - 4/22/2024

I want participants to enter words that are associated with their conceptualization of the word "status" as separate entries, one after the other (max 20).  
They type in a word, hit the 'Enter' key, then enter another word, hit the 'Enter' key, so on and so forth...
I currently have a simple textbox asking them to enter one word (see script below). 
How do I create a task that will go an iterative process of (1) store the word entry/response and then (2) clear textbox for new entry/response? 
Thanks in advance!

<surveypage status_words>
/ questions = [1=status_words]
/ finishlabel = "Click here to continue"
/ showpagenumbers = false
/ showquestionnumbers = false
</surveypage>

<textbox status_words>
/ caption = "At the top of society are the people who are the best off and have high status. ~nAt the bottom are the people who are the worst off and have low status. ~nWhat traits or characteristics tell you whether someone has low or high status?"
/ fontstyle = ("Arial", -18, false, false, false, false, 5, 0)
/ textboxsize = (20,20)
/ position = (10%,15%)
/ required = true
</textbox>
By Dave - 4/22/2024

wmfang - 4/22/2024
I want participants to enter words that are associated with their conceptualization of the word "status" as separate entries, one after the other (max 20).  
They type in a word, hit the 'Enter' key, then enter another word, hit the 'Enter' key, so on and so forth...
I currently have a simple textbox asking them to enter one word (see script below). 
How do I create a task that will go an iterative process of (1) store the word entry/response and then (2) clear textbox for new entry/response? 
Thanks in advance!

<surveypage status_words>
/ questions = [1=status_words]
/ finishlabel = "Click here to continue"
/ showpagenumbers = false
/ showquestionnumbers = false
</surveypage>

<textbox status_words>
/ caption = "At the top of society are the people who are the best off and have high status. ~nAt the bottom are the people who are the worst off and have low status. ~nWhat traits or characteristics tell you whether someone has low or high status?"
/ fontstyle = ("Arial", -18, false, false, false, false, 5, 0)
/ textboxsize = (20,20)
/ position = (10%,15%)
/ required = true
</textbox>

<values>
/ wordsentered = 0
</values>

<expt myexpt>
/ blocks = [1=block.enterwords; 2=block.showwords]
</expt>

<block enterwords>
/ trials = [1=surveypage.status_words]
</block>

<block showwords>
/ trials = [1=trial.mytrial]
</block>

<surveypage status_words>
/ ontrialend = [
    if (textbox.status_words.response != "") {
        values.wordsentered += 1;
        item.statusworditems.appenditem(textbox.status_words.response);
    };
]
/ branch = [
    if (values.wordsentered < 20 && textbox.status_words.response != "") {
        surveypage.status_words;
    };
]
/ caption = "Enter a word below. You will be prompted for up to 20 words."
/ subcaption = "When you can't come up with a word anymore, simply leave the box empty and click the continue button."
/ questions = [1=status_words]
/ finishlabel = "Click here to continue"
/ showpagenumbers = false
/ showquestionnumbers = false
</surveypage>

<textbox status_words>
/ caption = "At the top of society are the people who are the best off and have high status. ~nAt the bottom are the people who are the worst off and have low status. ~nWhat traits or characteristics tell you whether someone has low or high status?"
/ fontstyle = ("Arial", -18, false, false, false, false, 5, 0)
/ textboxsize = (20,20)
/ position = (10%,15%)
/ required = false
</textbox>

<item statusworditems>
</item>

<text statusword>
/ items = item.statusworditems
/ select = sequence
</text>

<trial mytrial>
/ stimulusframes = [1=text.statusword]
/ validresponse = (57)
/ branch = [
    if (trial.mytrial.count < values.wordsentered) {
        trial.mytrial;
    };
]
</trial>


Also, there are various examples in the library you can look at, such as the first two scripts at https://www.millisecond.com/download/library/iat/iattemplates
By wmfang - 4/22/2024

Dave - 4/22/2024
wmfang - 4/22/2024
I want participants to enter words that are associated with their conceptualization of the word "status" as separate entries, one after the other (max 20).  
They type in a word, hit the 'Enter' key, then enter another word, hit the 'Enter' key, so on and so forth...
I currently have a simple textbox asking them to enter one word (see script below). 
How do I create a task that will go an iterative process of (1) store the word entry/response and then (2) clear textbox for new entry/response? 
Thanks in advance!

<surveypage status_words>
/ questions = [1=status_words]
/ finishlabel = "Click here to continue"
/ showpagenumbers = false
/ showquestionnumbers = false
</surveypage>

<textbox status_words>
/ caption = "At the top of society are the people who are the best off and have high status. ~nAt the bottom are the people who are the worst off and have low status. ~nWhat traits or characteristics tell you whether someone has low or high status?"
/ fontstyle = ("Arial", -18, false, false, false, false, 5, 0)
/ textboxsize = (20,20)
/ position = (10%,15%)
/ required = true
</textbox>

<values>
/ wordsentered = 0
</values>

<expt myexpt>
/ blocks = [1=block.enterwords; 2=block.showwords]
</expt>

<block enterwords>
/ trials = [1=surveypage.status_words]
</block>

<block showwords>
/ trials = [1=trial.mytrial]
</block>

<surveypage status_words>
/ ontrialend = [
    if (textbox.status_words.response != "") {
        values.wordsentered += 1;
        item.statusworditems.appenditem(textbox.status_words.response);
    };
]
/ branch = [
    if (values.wordsentered < 20 && textbox.status_words.response != "") {
        surveypage.status_words;
    };
]
/ caption = "Enter a word below. You will be prompted for up to 20 words."
/ subcaption = "When you can't come up with a word anymore, simply leave the box empty and click the continue button."
/ questions = [1=status_words]
/ finishlabel = "Click here to continue"
/ showpagenumbers = false
/ showquestionnumbers = false
</surveypage>

<textbox status_words>
/ caption = "At the top of society are the people who are the best off and have high status. ~nAt the bottom are the people who are the worst off and have low status. ~nWhat traits or characteristics tell you whether someone has low or high status?"
/ fontstyle = ("Arial", -18, false, false, false, false, 5, 0)
/ textboxsize = (20,20)
/ position = (10%,15%)
/ required = false
</textbox>

<item statusworditems>
</item>

<text statusword>
/ items = item.statusworditems
/ select = sequence
</text>

<trial mytrial>
/ stimulusframes = [1=text.statusword]
/ validresponse = (57)
/ branch = [
    if (trial.mytrial.count < values.wordsentered) {
        trial.mytrial;
    };
]
</trial>


Also, there are various examples in the library you can look at, such as the first two scripts at https://www.millisecond.com/download/library/iat/iattemplates

Thank you so much! This is extremely helpful.
By wmfang - 4/24/2024

Dave - 4/22/2024
wmfang - 4/22/2024
I want participants to enter words that are associated with their conceptualization of the word "status" as separate entries, one after the other (max 20).  
They type in a word, hit the 'Enter' key, then enter another word, hit the 'Enter' key, so on and so forth...
I currently have a simple textbox asking them to enter one word (see script below). 
How do I create a task that will go an iterative process of (1) store the word entry/response and then (2) clear textbox for new entry/response? 
Thanks in advance!

<surveypage status_words>
/ questions = [1=status_words]
/ finishlabel = "Click here to continue"
/ showpagenumbers = false
/ showquestionnumbers = false
</surveypage>

<textbox status_words>
/ caption = "At the top of society are the people who are the best off and have high status. ~nAt the bottom are the people who are the worst off and have low status. ~nWhat traits or characteristics tell you whether someone has low or high status?"
/ fontstyle = ("Arial", -18, false, false, false, false, 5, 0)
/ textboxsize = (20,20)
/ position = (10%,15%)
/ required = true
</textbox>

<values>
/ wordsentered = 0
</values>

<expt myexpt>
/ blocks = [1=block.enterwords; 2=block.showwords]
</expt>

<block enterwords>
/ trials = [1=surveypage.status_words]
</block>

<block showwords>
/ trials = [1=trial.mytrial]
</block>

<surveypage status_words>
/ ontrialend = [
    if (textbox.status_words.response != "") {
        values.wordsentered += 1;
        item.statusworditems.appenditem(textbox.status_words.response);
    };
]
/ branch = [
    if (values.wordsentered < 20 && textbox.status_words.response != "") {
        surveypage.status_words;
    };
]
/ caption = "Enter a word below. You will be prompted for up to 20 words."
/ subcaption = "When you can't come up with a word anymore, simply leave the box empty and click the continue button."
/ questions = [1=status_words]
/ finishlabel = "Click here to continue"
/ showpagenumbers = false
/ showquestionnumbers = false
</surveypage>

<textbox status_words>
/ caption = "At the top of society are the people who are the best off and have high status. ~nAt the bottom are the people who are the worst off and have low status. ~nWhat traits or characteristics tell you whether someone has low or high status?"
/ fontstyle = ("Arial", -18, false, false, false, false, 5, 0)
/ textboxsize = (20,20)
/ position = (10%,15%)
/ required = false
</textbox>

<item statusworditems>
</item>

<text statusword>
/ items = item.statusworditems
/ select = sequence
</text>

<trial mytrial>
/ stimulusframes = [1=text.statusword]
/ validresponse = (57)
/ branch = [
    if (trial.mytrial.count < values.wordsentered) {
        trial.mytrial;
    };
]
</trial>


Also, there are various examples in the library you can look at, such as the first two scripts at https://www.millisecond.com/download/library/iat/iattemplates

How would I store each word entry (one per row) in a column named "StatusItems" in the data file?
By Dave - 4/24/2024

wmfang - 4/24/2024
Dave - 4/22/2024
wmfang - 4/22/2024
I want participants to enter words that are associated with their conceptualization of the word "status" as separate entries, one after the other (max 20).  
They type in a word, hit the 'Enter' key, then enter another word, hit the 'Enter' key, so on and so forth...
I currently have a simple textbox asking them to enter one word (see script below). 
How do I create a task that will go an iterative process of (1) store the word entry/response and then (2) clear textbox for new entry/response? 
Thanks in advance!

<surveypage status_words>
/ questions = [1=status_words]
/ finishlabel = "Click here to continue"
/ showpagenumbers = false
/ showquestionnumbers = false
</surveypage>

<textbox status_words>
/ caption = "At the top of society are the people who are the best off and have high status. ~nAt the bottom are the people who are the worst off and have low status. ~nWhat traits or characteristics tell you whether someone has low or high status?"
/ fontstyle = ("Arial", -18, false, false, false, false, 5, 0)
/ textboxsize = (20,20)
/ position = (10%,15%)
/ required = true
</textbox>

<values>
/ wordsentered = 0
</values>

<expt myexpt>
/ blocks = [1=block.enterwords; 2=block.showwords]
</expt>

<block enterwords>
/ trials = [1=surveypage.status_words]
</block>

<block showwords>
/ trials = [1=trial.mytrial]
</block>

<surveypage status_words>
/ ontrialend = [
    if (textbox.status_words.response != "") {
        values.wordsentered += 1;
        item.statusworditems.appenditem(textbox.status_words.response);
    };
]
/ branch = [
    if (values.wordsentered < 20 && textbox.status_words.response != "") {
        surveypage.status_words;
    };
]
/ caption = "Enter a word below. You will be prompted for up to 20 words."
/ subcaption = "When you can't come up with a word anymore, simply leave the box empty and click the continue button."
/ questions = [1=status_words]
/ finishlabel = "Click here to continue"
/ showpagenumbers = false
/ showquestionnumbers = false
</surveypage>

<textbox status_words>
/ caption = "At the top of society are the people who are the best off and have high status. ~nAt the bottom are the people who are the worst off and have low status. ~nWhat traits or characteristics tell you whether someone has low or high status?"
/ fontstyle = ("Arial", -18, false, false, false, false, 5, 0)
/ textboxsize = (20,20)
/ position = (10%,15%)
/ required = false
</textbox>

<item statusworditems>
</item>

<text statusword>
/ items = item.statusworditems
/ select = sequence
</text>

<trial mytrial>
/ stimulusframes = [1=text.statusword]
/ validresponse = (57)
/ branch = [
    if (trial.mytrial.count < values.wordsentered) {
        trial.mytrial;
    };
]
</trial>


Also, there are various examples in the library you can look at, such as the first two scripts at https://www.millisecond.com/download/library/iat/iattemplates

How would I store each word entry (one per row) in a column named "StatusItems" in the data file?

Why would you want to do that? Also, you already have the information in the response column for the textbox / surveypage.