clicks count


Author
Message
Inquisit1234
Inquisit1234
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 13, Visits: 31
Dave - Thursday, May 17, 2018
Inquisit1234 - Thursday, May 17, 2018
Dave - Thursday, May 17, 2018
Inquisit1234 - Thursday, May 17, 2018
Inquisit1234 - Thursday, May 17, 2018
Dave - Wednesday, May 16, 2018
Inquisit1234 - Wednesday, May 16, 2018
Thanks so much for the script, Sean.  Unfortunately, both parts of the equation need to be presented at the same time, and I do not want it to automatically submit after an option is select . Dave's script seems to work great for the design I am attempting to implement. Now, I just have a question about the output. Each of the rows appear to be a change in the digit, and it appears the "response" column corresponds to each selected response (first digit = gt1,eq1,lt1, second digit = gt2,eg2,lt2). Is that correct? What I don't know if I understand is the operator 1 and 2 response. I believe the operators contain the response options (gt,eg,lt), but why are they recorded (and the latency) as well as the response selected? Also, I am not sure I understand column stimulusonset1 onward. Thanks again.

There are three <trial> elements in the script. <trial main> just sits there and waits for your response, i.e. a click on one of the two grey boxes that function as the placeholder for the operators (operator1 and operator2). In the response column for each instance of <trial main> you're going to see which of the two operator box was clicked, and the latency reflects when that occurred relative to when that instance of <trial main> started.

Once that selection is made, either <trial select_operator1> or <trial select_operator2> is run: If you indicated you wanted to set or change operator1 by clicking on the operator1 box in <trial main>, you get <trial select_operator1> which presents the three options gt1, eq1 and lt1. If you selected the operator2 box, you get <trial select_operator2> which offers the options gt2, eq2 and lt2. You will find that logged in the response column in the respective row(s). The latency reflects when an option (greater than, equal, or less than) was chosen relative to when the respective instance of <trial select_operator1> or <trial select_operator2> started.

After that, both <trial select_operator1> and <trial select_operator1> invoke <trial main> again, which sits there until you decide what you want to do next: Set the other operator, change the operator you already set again. This will repeat for as long as you decide to change things around, i.e. the script will bounce back and forth between <trial main> and the two operator selection trials.

Finally, once you've set both and settled on a solution, the whole thing can be ended by submitting your solution (click on the submit box) presented by <trial main>.
Thanks very much, Dave.  This explanation is extremely helpful.


I would like to create additional trials using other digits. So, is it possible to simply add additional digits in the <value>, and add another <trial> (e.g., <trial main 2> ) with the new digits listed in the stimulusframes? I attempted this, but it seems is it unable to locate the new digits, and even if I can get beyond that, I am not sure the operators with reset to blank for trial 2.   

Yes, it's possible. Store your digits in paired <list>s and then sample from those lists at the start of each round and store the digits sampled in the respective values.

Okay, so I have created these lists:

<list firstnumbers>
/ items = (1,2,3,4,5,6)
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = (1,2,3,4,5,6)
/ selectionmode = sequence
</list>

<list thirdnumbers>
/ items = (1,2,3,4,5,6)
/ selectionmode = sequence
</list>
 
And, have edited the <text>:

<text digit1>
/ items = ("<%list.firstnumbers.selectionmode%> is")
/ position = (30%, 50%)
/ erase = false
/ size = (10%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%list.secondnumbers.selectionmode%> is")
/ position = (50%, 50%)
/ size = (10%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%list.thirdnumbers.selectionmode%>")
/ position = (70%, 50%)
/ size = (10%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

But, I am a little confused as to how to make the trials continue until the sequence of numbers have concluded. Any suggestions? Thank you.

You need to do something like this:

<values>
/ digit1 = 0
/ digit2 = 0
/ digit3 = 0
/ op1 = ""
/ op2 = ""
/ roundnumber = 0
</values>

<defaults>
/ fontstyle = ("Verdana", 3%)
</defaults>


<block myblock>
/ trials = [1-6=startround;]
</block>

<trial startround>
/ ontrialbegin = [values.op1 = "";
    values.op2 = "";
    values.digit1 = list.firstnumbers.nextvalue;
    values.digit2 = list.secondnumbers.nextvalue;
    values.digit3 = list.thirdnumbers.nextvalue;
    values.roundnumber += 1;
    ]
/ stimulusframes = [1=clearscreen, roundtext]
/ trialduration = 1000
/ validresponse = (0)
/ branch = [trial.main]
</trial>

<shape clearscreen>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
</shape>

<text roundtext>
/ items = ("This is round #<%values.roundnumber%>.")
</text>

<list firstnumbers>
/ items = (1,2,3,4,5,6)
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = (1,2,3,4,5,6)
/ selectionmode = list.firstnumbers.currentindex
</list>

<list thirdnumbers>
/ items = (1,2,3,4,5,6)
/ selectionmode = list.firstnumbers.currentindex
</list>

<trial main>
/ stimulusframes = [1=question, digit1, operator1, digit2, operator2, digit3, submit]
/ inputdevice = mouse
/ validresponse = (operator1, operator2, submit)
/ isvalidresponse = [(trial.main.response == "submit" && values.op1 !="" && values.op2 !="")
    || trial.main.response == "operator1" || trial.main.response == "operator2"]
/ branch = [if (trial.main.response == "operator1") trial.select_operator1]
/ branch = [if (trial.main.response == "operator2") trial.select_operator2]
</trial>

<trial select_operator1>
/ ontrialend = [if (trial.select_operator1.response == "gt1") values.op1 = ">"]
/ ontrialend = [if (trial.select_operator1.response == "lt1") values.op1 = "<"]
/ ontrialend = [if (trial.select_operator1.response == "eq1") values.op1 = "="]
/ stimulusframes = [1=gt1,lt1,eq1]
/ inputdevice = mouse
/ validresponse = (gt1,lt1,eq1)
/ branch = [trial.main]
</trial>

<trial select_operator2>
/ ontrialend = [if (trial.select_operator2.response == "gt2") values.op2 = ">"]
/ ontrialend = [if (trial.select_operator2.response == "lt2") values.op2 = "<"]
/ ontrialend = [if (trial.select_operator2.response == "eq2") values.op2 = "="]
/ stimulusframes = [1=gt2,lt2,eq2]
/ inputdevice = mouse
/ validresponse = (gt2,lt2,eq2)
/ branch = [trial.main]
</trial>

<text question>
/ items = ("Please answer the question below")
/ erase = false
/ position = (50%, 25%)
</text>

<text digit1>
/ items = ("<%values.digit1%> is")
/ position = (30%, 50%)
/ erase = false
/ size = (10%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%values.digit2%> is")
/ position = (50%, 50%)
/ size = (10%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%values.digit3%>")
/ position = (70%, 50%)
/ size = (10%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator1>
/ items = ("<%values.op1%>")
/ position = (40%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator2>
/ items = ("<%values.op2%>")
/ position = (60%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text submit>
/ items = ("SUBMIT")
/ position = (50%, 92%)
/ size = (20%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text gt1>
/ items = (">")
/ position = (40%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text eq1>
/ items = ("=")
/ position = (40%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt1>
/ items = ("<")
/ position = (40%, 80%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text gt2>
/ items = (">")
/ position = (60%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text eq2>
/ items = ("=")
/ position = (60%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt2>
/ items = ("<")
/ position = (60%, 80%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>


This code appears to work great. Thanks so much, Dave.
Inquisit1234
Inquisit1234
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 13, Visits: 31
Hello again. So, I have a related question.  Any suggestions as to how to collect the same log data from these "drop down" menus, but change both the text and responses in the operators for each item.

For example, lets use the phrase "This is a large item, and this is a small item." The words "large" and "small" would be in the operators, the reset would be text. The next item would be "This is 10 times larger, and this is 3 times smaller." In this item, "10 and "3" would be in the operators, the rest would be text.

Overall, I am trying to figure out what would be the most efficient way to administer several different items (both text and operators), but still collect all of the log data capture by the script previously provided here.

Thank you.

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: 100K
Inquisit1234 - Wednesday, July 11, 2018
Hello again. So, I have a related question.  Any suggestions as to how to collect the same log data from these "drop down" menus, but change both the text and responses in the operators for each item.

For example, lets use the phrase "This is a large item, and this is a small item." The words "large" and "small" would be in the operators, the reset would be text. The next item would be "This is 10 times larger, and this is 3 times smaller." In this item, "10 and "3" would be in the operators, the rest would be text.

Overall, I am trying to figure out what would be the most efficient way to administer several different items (both text and operators), but still collect all of the log data capture by the script previously provided here.

Thank you.

It would work exactly the same way as the existing script. There is nothing that prevents to from storing text strings in <list> elements and using those in the various <values> instead of using digits only. And there is nothing that prevents you from having the operators -- <text lt> etc. in the original script -- be variable as well, in the same way as the digits are variable in the original. E.g.:

<values>
/ digit1 = 0
/ digit2 = 0
/ digit3 = 0
/ opa = ""
/ opb = ""
/ op1 = ""
/ op2 = ""
/ roundnumber = 0
</values>

<defaults>
/ fontstyle = ("Verdana", 3%)
</defaults>


<block myblock>
/ trials = [1-2=startround;]
</block>

<trial startround>
/ ontrialbegin = [values.op1 = "";
    values.op2 = "";
    values.digit1 = list.firstnumbers.nextvalue;
    values.digit2 = list.secondnumbers.nextvalue;
    values.digit3 = list.thirdnumbers.nextvalue;
    values.opa = list.opa.nextvalue;
    values.opb = list.opb.nextvalue;
    values.roundnumber += 1;
    ]
/ stimulusframes = [1=clearscreen, roundtext]
/ trialduration = 1000
/ validresponse = (0)
/ branch = [trial.main]
</trial>

<shape clearscreen>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
</shape>

<text roundtext>
/ items = ("This is round #<%values.roundnumber%>.")
</text>

<list firstnumbers>
/ items = ("This is a", "This is")
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = ("item. This is a","times larger. And this is")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list thirdnumbers>
/ items = ("item.","times smaller")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opa>
/ items = ("large","10")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opb>
/ items = ("small","3")
/ selectionmode = list.firstnumbers.currentindex
</list>

<trial main>
/ stimulusframes = [1=question, digit1, operator1, digit2, operator2, digit3, submit]
/ inputdevice = mouse
/ validresponse = (operator1, operator2, submit)
/ isvalidresponse = [(trial.main.response == "submit" && values.op1 !="" && values.op2 !="")
    || trial.main.response == "operator1" || trial.main.response == "operator2"]
/ branch = [if (trial.main.response == "operator1") trial.select_operator1]
/ branch = [if (trial.main.response == "operator2") trial.select_operator2]
</trial>

<trial select_operator1>
/ ontrialend = [if (trial.select_operator1.response == "gt1") values.op1 = values.opa]
/ ontrialend = [if (trial.select_operator1.response == "lt1") values.op1 = values.opb]
/ stimulusframes = [1=gt1,lt1]
/ inputdevice = mouse
/ validresponse = (gt1,lt1)
/ branch = [trial.main]
</trial>

<trial select_operator2>
/ ontrialend = [if (trial.select_operator2.response == "gt2") values.op2 = values.opa]
/ ontrialend = [if (trial.select_operator2.response == "lt2") values.op2 = values.opb]
/ stimulusframes = [1=gt2,lt2]
/ inputdevice = mouse
/ validresponse = (gt2,lt2)
/ branch = [trial.main]
</trial>

<text question>
/ items = ("Please answer the question below")
/ erase = false
/ position = (50%, 25%)
</text>

<text digit1>
/ items = ("<%values.digit1%>")
/ position = (20%, 50%)
/ erase = false
/ size = (20%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%values.digit2%>")
/ position = (50%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%values.digit3%>")
/ position = (80%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator1>
/ items = ("<%values.op1%>")
/ position = (30%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator2>
/ items = ("<%values.op2%>")
/ position = (60%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text submit>
/ items = ("SUBMIT")
/ position = (50%, 92%)
/ size = (20%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text gt1>
/ items = ("<%values.opa%>")
/ position = (30%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt1>
/ items = ("<%values.opb%>")
/ position = (30%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text gt2>
/ items = ("<%values.opa%>")
/ position = (60%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt2>
/ items = ("<%values.opb%>")
/ position = (60%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

You'll have to fiddle around with the on-screen positions a bit to make things look good because your example items at least vary in length, but the general approach is no different from the digits-only version.

Inquisit1234
Inquisit1234
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 13, Visits: 31
Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Hello again. So, I have a related question.  Any suggestions as to how to collect the same log data from these "drop down" menus, but change both the text and responses in the operators for each item.

For example, lets use the phrase "This is a large item, and this is a small item." The words "large" and "small" would be in the operators, the reset would be text. The next item would be "This is 10 times larger, and this is 3 times smaller." In this item, "10 and "3" would be in the operators, the rest would be text.

Overall, I am trying to figure out what would be the most efficient way to administer several different items (both text and operators), but still collect all of the log data capture by the script previously provided here.

Thank you.

It would work exactly the same way as the existing script. There is nothing that prevents to from storing text strings in <list> elements and using those in the various <values> instead of using digits only. And there is nothing that prevents you from having the operators -- <text lt> etc. in the original script -- be variable as well, in the same way as the digits are variable in the original. E.g.:

<values>
/ digit1 = 0
/ digit2 = 0
/ digit3 = 0
/ opa = ""
/ opb = ""
/ op1 = ""
/ op2 = ""
/ roundnumber = 0
</values>

<defaults>
/ fontstyle = ("Verdana", 3%)
</defaults>


<block myblock>
/ trials = [1-2=startround;]
</block>

<trial startround>
/ ontrialbegin = [values.op1 = "";
    values.op2 = "";
    values.digit1 = list.firstnumbers.nextvalue;
    values.digit2 = list.secondnumbers.nextvalue;
    values.digit3 = list.thirdnumbers.nextvalue;
    values.opa = list.opa.nextvalue;
    values.opb = list.opb.nextvalue;
    values.roundnumber += 1;
    ]
/ stimulusframes = [1=clearscreen, roundtext]
/ trialduration = 1000
/ validresponse = (0)
/ branch = [trial.main]
</trial>

<shape clearscreen>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
</shape>

<text roundtext>
/ items = ("This is round #<%values.roundnumber%>.")
</text>

<list firstnumbers>
/ items = ("This is a", "This is")
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = ("item. This is a","times larger. And this is")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list thirdnumbers>
/ items = ("item.","times smaller")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opa>
/ items = ("large","10")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opb>
/ items = ("small","3")
/ selectionmode = list.firstnumbers.currentindex
</list>

<trial main>
/ stimulusframes = [1=question, digit1, operator1, digit2, operator2, digit3, submit]
/ inputdevice = mouse
/ validresponse = (operator1, operator2, submit)
/ isvalidresponse = [(trial.main.response == "submit" && values.op1 !="" && values.op2 !="")
    || trial.main.response == "operator1" || trial.main.response == "operator2"]
/ branch = [if (trial.main.response == "operator1") trial.select_operator1]
/ branch = [if (trial.main.response == "operator2") trial.select_operator2]
</trial>

<trial select_operator1>
/ ontrialend = [if (trial.select_operator1.response == "gt1") values.op1 = values.opa]
/ ontrialend = [if (trial.select_operator1.response == "lt1") values.op1 = values.opb]
/ stimulusframes = [1=gt1,lt1]
/ inputdevice = mouse
/ validresponse = (gt1,lt1)
/ branch = [trial.main]
</trial>

<trial select_operator2>
/ ontrialend = [if (trial.select_operator2.response == "gt2") values.op2 = values.opa]
/ ontrialend = [if (trial.select_operator2.response == "lt2") values.op2 = values.opb]
/ stimulusframes = [1=gt2,lt2]
/ inputdevice = mouse
/ validresponse = (gt2,lt2)
/ branch = [trial.main]
</trial>

<text question>
/ items = ("Please answer the question below")
/ erase = false
/ position = (50%, 25%)
</text>

<text digit1>
/ items = ("<%values.digit1%>")
/ position = (20%, 50%)
/ erase = false
/ size = (20%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%values.digit2%>")
/ position = (50%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%values.digit3%>")
/ position = (80%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator1>
/ items = ("<%values.op1%>")
/ position = (30%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator2>
/ items = ("<%values.op2%>")
/ position = (60%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text submit>
/ items = ("SUBMIT")
/ position = (50%, 92%)
/ size = (20%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text gt1>
/ items = ("<%values.opa%>")
/ position = (30%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt1>
/ items = ("<%values.opb%>")
/ position = (30%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text gt2>
/ items = ("<%values.opa%>")
/ position = (60%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt2>
/ items = ("<%values.opb%>")
/ position = (60%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

You'll have to fiddle around with the on-screen positions a bit to make things look good because your example items at least vary in length, but the general approach is no different from the digits-only version.
Hello, Dave.  Great. This makes a lot of sense. Thank you.
Now, what if I wanted to include items that use a single selection Likert type scale as the response option (e.g., a text prompt and four radio button response options) instead of the dropdowns, but I want to capture all of the clicking as well. Is that possible?


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: 100K
Inquisit1234 - Wednesday, July 11, 2018
Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Hello again. So, I have a related question.  Any suggestions as to how to collect the same log data from these "drop down" menus, but change both the text and responses in the operators for each item.

For example, lets use the phrase "This is a large item, and this is a small item." The words "large" and "small" would be in the operators, the reset would be text. The next item would be "This is 10 times larger, and this is 3 times smaller." In this item, "10 and "3" would be in the operators, the rest would be text.

Overall, I am trying to figure out what would be the most efficient way to administer several different items (both text and operators), but still collect all of the log data capture by the script previously provided here.

Thank you.

It would work exactly the same way as the existing script. There is nothing that prevents to from storing text strings in <list> elements and using those in the various <values> instead of using digits only. And there is nothing that prevents you from having the operators -- <text lt> etc. in the original script -- be variable as well, in the same way as the digits are variable in the original. E.g.:

<values>
/ digit1 = 0
/ digit2 = 0
/ digit3 = 0
/ opa = ""
/ opb = ""
/ op1 = ""
/ op2 = ""
/ roundnumber = 0
</values>

<defaults>
/ fontstyle = ("Verdana", 3%)
</defaults>


<block myblock>
/ trials = [1-2=startround;]
</block>

<trial startround>
/ ontrialbegin = [values.op1 = "";
    values.op2 = "";
    values.digit1 = list.firstnumbers.nextvalue;
    values.digit2 = list.secondnumbers.nextvalue;
    values.digit3 = list.thirdnumbers.nextvalue;
    values.opa = list.opa.nextvalue;
    values.opb = list.opb.nextvalue;
    values.roundnumber += 1;
    ]
/ stimulusframes = [1=clearscreen, roundtext]
/ trialduration = 1000
/ validresponse = (0)
/ branch = [trial.main]
</trial>

<shape clearscreen>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
</shape>

<text roundtext>
/ items = ("This is round #<%values.roundnumber%>.")
</text>

<list firstnumbers>
/ items = ("This is a", "This is")
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = ("item. This is a","times larger. And this is")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list thirdnumbers>
/ items = ("item.","times smaller")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opa>
/ items = ("large","10")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opb>
/ items = ("small","3")
/ selectionmode = list.firstnumbers.currentindex
</list>

<trial main>
/ stimulusframes = [1=question, digit1, operator1, digit2, operator2, digit3, submit]
/ inputdevice = mouse
/ validresponse = (operator1, operator2, submit)
/ isvalidresponse = [(trial.main.response == "submit" && values.op1 !="" && values.op2 !="")
    || trial.main.response == "operator1" || trial.main.response == "operator2"]
/ branch = [if (trial.main.response == "operator1") trial.select_operator1]
/ branch = [if (trial.main.response == "operator2") trial.select_operator2]
</trial>

<trial select_operator1>
/ ontrialend = [if (trial.select_operator1.response == "gt1") values.op1 = values.opa]
/ ontrialend = [if (trial.select_operator1.response == "lt1") values.op1 = values.opb]
/ stimulusframes = [1=gt1,lt1]
/ inputdevice = mouse
/ validresponse = (gt1,lt1)
/ branch = [trial.main]
</trial>

<trial select_operator2>
/ ontrialend = [if (trial.select_operator2.response == "gt2") values.op2 = values.opa]
/ ontrialend = [if (trial.select_operator2.response == "lt2") values.op2 = values.opb]
/ stimulusframes = [1=gt2,lt2]
/ inputdevice = mouse
/ validresponse = (gt2,lt2)
/ branch = [trial.main]
</trial>

<text question>
/ items = ("Please answer the question below")
/ erase = false
/ position = (50%, 25%)
</text>

<text digit1>
/ items = ("<%values.digit1%>")
/ position = (20%, 50%)
/ erase = false
/ size = (20%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%values.digit2%>")
/ position = (50%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%values.digit3%>")
/ position = (80%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator1>
/ items = ("<%values.op1%>")
/ position = (30%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator2>
/ items = ("<%values.op2%>")
/ position = (60%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text submit>
/ items = ("SUBMIT")
/ position = (50%, 92%)
/ size = (20%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text gt1>
/ items = ("<%values.opa%>")
/ position = (30%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt1>
/ items = ("<%values.opb%>")
/ position = (30%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text gt2>
/ items = ("<%values.opa%>")
/ position = (60%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt2>
/ items = ("<%values.opb%>")
/ position = (60%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

You'll have to fiddle around with the on-screen positions a bit to make things look good because your example items at least vary in length, but the general approach is no different from the digits-only version.
Hello, Dave.  Great. This makes a lot of sense. Thank you.
Now, what if I wanted to include items that use a single selection Likert type scale as the response option (e.g., a text prompt and four radio button response options) instead of the dropdowns, but I want to capture all of the clicking as well. Is that possible?


Yes, you can again do that in the exact same way.

Inquisit1234
Inquisit1234
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 13, Visits: 31
Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Hello again. So, I have a related question.  Any suggestions as to how to collect the same log data from these "drop down" menus, but change both the text and responses in the operators for each item.

For example, lets use the phrase "This is a large item, and this is a small item." The words "large" and "small" would be in the operators, the reset would be text. The next item would be "This is 10 times larger, and this is 3 times smaller." In this item, "10 and "3" would be in the operators, the rest would be text.

Overall, I am trying to figure out what would be the most efficient way to administer several different items (both text and operators), but still collect all of the log data capture by the script previously provided here.

Thank you.

It would work exactly the same way as the existing script. There is nothing that prevents to from storing text strings in <list> elements and using those in the various <values> instead of using digits only. And there is nothing that prevents you from having the operators -- <text lt> etc. in the original script -- be variable as well, in the same way as the digits are variable in the original. E.g.:

<values>
/ digit1 = 0
/ digit2 = 0
/ digit3 = 0
/ opa = ""
/ opb = ""
/ op1 = ""
/ op2 = ""
/ roundnumber = 0
</values>

<defaults>
/ fontstyle = ("Verdana", 3%)
</defaults>


<block myblock>
/ trials = [1-2=startround;]
</block>

<trial startround>
/ ontrialbegin = [values.op1 = "";
    values.op2 = "";
    values.digit1 = list.firstnumbers.nextvalue;
    values.digit2 = list.secondnumbers.nextvalue;
    values.digit3 = list.thirdnumbers.nextvalue;
    values.opa = list.opa.nextvalue;
    values.opb = list.opb.nextvalue;
    values.roundnumber += 1;
    ]
/ stimulusframes = [1=clearscreen, roundtext]
/ trialduration = 1000
/ validresponse = (0)
/ branch = [trial.main]
</trial>

<shape clearscreen>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
</shape>

<text roundtext>
/ items = ("This is round #<%values.roundnumber%>.")
</text>

<list firstnumbers>
/ items = ("This is a", "This is")
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = ("item. This is a","times larger. And this is")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list thirdnumbers>
/ items = ("item.","times smaller")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opa>
/ items = ("large","10")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opb>
/ items = ("small","3")
/ selectionmode = list.firstnumbers.currentindex
</list>

<trial main>
/ stimulusframes = [1=question, digit1, operator1, digit2, operator2, digit3, submit]
/ inputdevice = mouse
/ validresponse = (operator1, operator2, submit)
/ isvalidresponse = [(trial.main.response == "submit" && values.op1 !="" && values.op2 !="")
    || trial.main.response == "operator1" || trial.main.response == "operator2"]
/ branch = [if (trial.main.response == "operator1") trial.select_operator1]
/ branch = [if (trial.main.response == "operator2") trial.select_operator2]
</trial>

<trial select_operator1>
/ ontrialend = [if (trial.select_operator1.response == "gt1") values.op1 = values.opa]
/ ontrialend = [if (trial.select_operator1.response == "lt1") values.op1 = values.opb]
/ stimulusframes = [1=gt1,lt1]
/ inputdevice = mouse
/ validresponse = (gt1,lt1)
/ branch = [trial.main]
</trial>

<trial select_operator2>
/ ontrialend = [if (trial.select_operator2.response == "gt2") values.op2 = values.opa]
/ ontrialend = [if (trial.select_operator2.response == "lt2") values.op2 = values.opb]
/ stimulusframes = [1=gt2,lt2]
/ inputdevice = mouse
/ validresponse = (gt2,lt2)
/ branch = [trial.main]
</trial>

<text question>
/ items = ("Please answer the question below")
/ erase = false
/ position = (50%, 25%)
</text>

<text digit1>
/ items = ("<%values.digit1%>")
/ position = (20%, 50%)
/ erase = false
/ size = (20%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%values.digit2%>")
/ position = (50%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%values.digit3%>")
/ position = (80%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator1>
/ items = ("<%values.op1%>")
/ position = (30%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator2>
/ items = ("<%values.op2%>")
/ position = (60%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text submit>
/ items = ("SUBMIT")
/ position = (50%, 92%)
/ size = (20%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text gt1>
/ items = ("<%values.opa%>")
/ position = (30%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt1>
/ items = ("<%values.opb%>")
/ position = (30%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text gt2>
/ items = ("<%values.opa%>")
/ position = (60%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt2>
/ items = ("<%values.opb%>")
/ position = (60%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

You'll have to fiddle around with the on-screen positions a bit to make things look good because your example items at least vary in length, but the general approach is no different from the digits-only version.
Hello, Dave.  Great. This makes a lot of sense. Thank you.
Now, what if I wanted to include items that use a single selection Likert type scale as the response option (e.g., a text prompt and four radio button response options) instead of the dropdowns, but I want to capture all of the clicking as well. Is that possible?


Yes, you can again do that in the exact same way.

I am still struggling with this. I have items that have prompts (e.g., "Which of these must be true?", "Which of these must be false?") and 6 vertical radio button response options (A-F). I am not certain how to adapt the above script to cycle through the prompts and response options. Would I use the <radiobuttons> element in place of the <text operator1>?As always, thanks for the help.
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: 100K
Inquisit1234 - Wednesday, July 18, 2018
Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Hello again. So, I have a related question.  Any suggestions as to how to collect the same log data from these "drop down" menus, but change both the text and responses in the operators for each item.

For example, lets use the phrase "This is a large item, and this is a small item." The words "large" and "small" would be in the operators, the reset would be text. The next item would be "This is 10 times larger, and this is 3 times smaller." In this item, "10 and "3" would be in the operators, the rest would be text.

Overall, I am trying to figure out what would be the most efficient way to administer several different items (both text and operators), but still collect all of the log data capture by the script previously provided here.

Thank you.

It would work exactly the same way as the existing script. There is nothing that prevents to from storing text strings in <list> elements and using those in the various <values> instead of using digits only. And there is nothing that prevents you from having the operators -- <text lt> etc. in the original script -- be variable as well, in the same way as the digits are variable in the original. E.g.:

<values>
/ digit1 = 0
/ digit2 = 0
/ digit3 = 0
/ opa = ""
/ opb = ""
/ op1 = ""
/ op2 = ""
/ roundnumber = 0
</values>

<defaults>
/ fontstyle = ("Verdana", 3%)
</defaults>


<block myblock>
/ trials = [1-2=startround;]
</block>

<trial startround>
/ ontrialbegin = [values.op1 = "";
    values.op2 = "";
    values.digit1 = list.firstnumbers.nextvalue;
    values.digit2 = list.secondnumbers.nextvalue;
    values.digit3 = list.thirdnumbers.nextvalue;
    values.opa = list.opa.nextvalue;
    values.opb = list.opb.nextvalue;
    values.roundnumber += 1;
    ]
/ stimulusframes = [1=clearscreen, roundtext]
/ trialduration = 1000
/ validresponse = (0)
/ branch = [trial.main]
</trial>

<shape clearscreen>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
</shape>

<text roundtext>
/ items = ("This is round #<%values.roundnumber%>.")
</text>

<list firstnumbers>
/ items = ("This is a", "This is")
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = ("item. This is a","times larger. And this is")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list thirdnumbers>
/ items = ("item.","times smaller")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opa>
/ items = ("large","10")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opb>
/ items = ("small","3")
/ selectionmode = list.firstnumbers.currentindex
</list>

<trial main>
/ stimulusframes = [1=question, digit1, operator1, digit2, operator2, digit3, submit]
/ inputdevice = mouse
/ validresponse = (operator1, operator2, submit)
/ isvalidresponse = [(trial.main.response == "submit" && values.op1 !="" && values.op2 !="")
    || trial.main.response == "operator1" || trial.main.response == "operator2"]
/ branch = [if (trial.main.response == "operator1") trial.select_operator1]
/ branch = [if (trial.main.response == "operator2") trial.select_operator2]
</trial>

<trial select_operator1>
/ ontrialend = [if (trial.select_operator1.response == "gt1") values.op1 = values.opa]
/ ontrialend = [if (trial.select_operator1.response == "lt1") values.op1 = values.opb]
/ stimulusframes = [1=gt1,lt1]
/ inputdevice = mouse
/ validresponse = (gt1,lt1)
/ branch = [trial.main]
</trial>

<trial select_operator2>
/ ontrialend = [if (trial.select_operator2.response == "gt2") values.op2 = values.opa]
/ ontrialend = [if (trial.select_operator2.response == "lt2") values.op2 = values.opb]
/ stimulusframes = [1=gt2,lt2]
/ inputdevice = mouse
/ validresponse = (gt2,lt2)
/ branch = [trial.main]
</trial>

<text question>
/ items = ("Please answer the question below")
/ erase = false
/ position = (50%, 25%)
</text>

<text digit1>
/ items = ("<%values.digit1%>")
/ position = (20%, 50%)
/ erase = false
/ size = (20%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%values.digit2%>")
/ position = (50%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%values.digit3%>")
/ position = (80%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator1>
/ items = ("<%values.op1%>")
/ position = (30%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator2>
/ items = ("<%values.op2%>")
/ position = (60%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text submit>
/ items = ("SUBMIT")
/ position = (50%, 92%)
/ size = (20%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text gt1>
/ items = ("<%values.opa%>")
/ position = (30%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt1>
/ items = ("<%values.opb%>")
/ position = (30%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text gt2>
/ items = ("<%values.opa%>")
/ position = (60%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt2>
/ items = ("<%values.opb%>")
/ position = (60%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

You'll have to fiddle around with the on-screen positions a bit to make things look good because your example items at least vary in length, but the general approach is no different from the digits-only version.
Hello, Dave.  Great. This makes a lot of sense. Thank you.
Now, what if I wanted to include items that use a single selection Likert type scale as the response option (e.g., a text prompt and four radio button response options) instead of the dropdowns, but I want to capture all of the clicking as well. Is that possible?


Yes, you can again do that in the exact same way.

I am still struggling with this. I have items that have prompts (e.g., "Which of these must be true?", "Which of these must be false?") and 6 vertical radio button response options (A-F). I am not certain how to adapt the above script to cycle through the prompts and response options. Would I use the <radiobuttons> element in place of the <text operator1>?As always, thanks for the help.

No, you would not use <radiobuttons>. If you want something that works *exactly* like the previous script you use regular <text> and / or <shape> elements. If you want something like a simple likert-type scale, then simply use the <likert> trial element.

Inquisit1234
Inquisit1234
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 13, Visits: 31
Dave - Wednesday, July 18, 2018
Inquisit1234 - Wednesday, July 18, 2018
Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Hello again. So, I have a related question.  Any suggestions as to how to collect the same log data from these "drop down" menus, but change both the text and responses in the operators for each item.

For example, lets use the phrase "This is a large item, and this is a small item." The words "large" and "small" would be in the operators, the reset would be text. The next item would be "This is 10 times larger, and this is 3 times smaller." In this item, "10 and "3" would be in the operators, the rest would be text.

Overall, I am trying to figure out what would be the most efficient way to administer several different items (both text and operators), but still collect all of the log data capture by the script previously provided here.

Thank you.

It would work exactly the same way as the existing script. There is nothing that prevents to from storing text strings in <list> elements and using those in the various <values> instead of using digits only. And there is nothing that prevents you from having the operators -- <text lt> etc. in the original script -- be variable as well, in the same way as the digits are variable in the original. E.g.:

<values>
/ digit1 = 0
/ digit2 = 0
/ digit3 = 0
/ opa = ""
/ opb = ""
/ op1 = ""
/ op2 = ""
/ roundnumber = 0
</values>

<defaults>
/ fontstyle = ("Verdana", 3%)
</defaults>


<block myblock>
/ trials = [1-2=startround;]
</block>

<trial startround>
/ ontrialbegin = [values.op1 = "";
    values.op2 = "";
    values.digit1 = list.firstnumbers.nextvalue;
    values.digit2 = list.secondnumbers.nextvalue;
    values.digit3 = list.thirdnumbers.nextvalue;
    values.opa = list.opa.nextvalue;
    values.opb = list.opb.nextvalue;
    values.roundnumber += 1;
    ]
/ stimulusframes = [1=clearscreen, roundtext]
/ trialduration = 1000
/ validresponse = (0)
/ branch = [trial.main]
</trial>

<shape clearscreen>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
</shape>

<text roundtext>
/ items = ("This is round #<%values.roundnumber%>.")
</text>

<list firstnumbers>
/ items = ("This is a", "This is")
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = ("item. This is a","times larger. And this is")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list thirdnumbers>
/ items = ("item.","times smaller")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opa>
/ items = ("large","10")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opb>
/ items = ("small","3")
/ selectionmode = list.firstnumbers.currentindex
</list>

<trial main>
/ stimulusframes = [1=question, digit1, operator1, digit2, operator2, digit3, submit]
/ inputdevice = mouse
/ validresponse = (operator1, operator2, submit)
/ isvalidresponse = [(trial.main.response == "submit" && values.op1 !="" && values.op2 !="")
    || trial.main.response == "operator1" || trial.main.response == "operator2"]
/ branch = [if (trial.main.response == "operator1") trial.select_operator1]
/ branch = [if (trial.main.response == "operator2") trial.select_operator2]
</trial>

<trial select_operator1>
/ ontrialend = [if (trial.select_operator1.response == "gt1") values.op1 = values.opa]
/ ontrialend = [if (trial.select_operator1.response == "lt1") values.op1 = values.opb]
/ stimulusframes = [1=gt1,lt1]
/ inputdevice = mouse
/ validresponse = (gt1,lt1)
/ branch = [trial.main]
</trial>

<trial select_operator2>
/ ontrialend = [if (trial.select_operator2.response == "gt2") values.op2 = values.opa]
/ ontrialend = [if (trial.select_operator2.response == "lt2") values.op2 = values.opb]
/ stimulusframes = [1=gt2,lt2]
/ inputdevice = mouse
/ validresponse = (gt2,lt2)
/ branch = [trial.main]
</trial>

<text question>
/ items = ("Please answer the question below")
/ erase = false
/ position = (50%, 25%)
</text>

<text digit1>
/ items = ("<%values.digit1%>")
/ position = (20%, 50%)
/ erase = false
/ size = (20%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%values.digit2%>")
/ position = (50%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%values.digit3%>")
/ position = (80%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator1>
/ items = ("<%values.op1%>")
/ position = (30%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator2>
/ items = ("<%values.op2%>")
/ position = (60%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text submit>
/ items = ("SUBMIT")
/ position = (50%, 92%)
/ size = (20%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text gt1>
/ items = ("<%values.opa%>")
/ position = (30%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt1>
/ items = ("<%values.opb%>")
/ position = (30%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text gt2>
/ items = ("<%values.opa%>")
/ position = (60%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt2>
/ items = ("<%values.opb%>")
/ position = (60%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

You'll have to fiddle around with the on-screen positions a bit to make things look good because your example items at least vary in length, but the general approach is no different from the digits-only version.
Hello, Dave.  Great. This makes a lot of sense. Thank you.
Now, what if I wanted to include items that use a single selection Likert type scale as the response option (e.g., a text prompt and four radio button response options) instead of the dropdowns, but I want to capture all of the clicking as well. Is that possible?


Yes, you can again do that in the exact same way.

I am still struggling with this. I have items that have prompts (e.g., "Which of these must be true?", "Which of these must be false?") and 6 vertical radio button response options (A-F). I am not certain how to adapt the above script to cycle through the prompts and response options. Would I use the <radiobuttons> element in place of the <text operator1>?As always, thanks for the help.

No, you would not use <radiobuttons>. If you want something that works *exactly* like the previous script you use regular <text> and / or <shape> elements. If you want something like a simple likert-type scale, then simply use the <likert> trial element.

Hello Dave.  Will the log data be captured with the <likert> trial element (e.g., which options the participant selected before submitting, timing, etc.)? And, is there a way to make the Likert options be presented vertically instead of horizontally? 
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: 100K
Inquisit1234 - Wednesday, July 18, 2018
Dave - Wednesday, July 18, 2018
Inquisit1234 - Wednesday, July 18, 2018
Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Hello again. So, I have a related question.  Any suggestions as to how to collect the same log data from these "drop down" menus, but change both the text and responses in the operators for each item.

For example, lets use the phrase "This is a large item, and this is a small item." The words "large" and "small" would be in the operators, the reset would be text. The next item would be "This is 10 times larger, and this is 3 times smaller." In this item, "10 and "3" would be in the operators, the rest would be text.

Overall, I am trying to figure out what would be the most efficient way to administer several different items (both text and operators), but still collect all of the log data capture by the script previously provided here.

Thank you.

It would work exactly the same way as the existing script. There is nothing that prevents to from storing text strings in <list> elements and using those in the various <values> instead of using digits only. And there is nothing that prevents you from having the operators -- <text lt> etc. in the original script -- be variable as well, in the same way as the digits are variable in the original. E.g.:

<values>
/ digit1 = 0
/ digit2 = 0
/ digit3 = 0
/ opa = ""
/ opb = ""
/ op1 = ""
/ op2 = ""
/ roundnumber = 0
</values>

<defaults>
/ fontstyle = ("Verdana", 3%)
</defaults>


<block myblock>
/ trials = [1-2=startround;]
</block>

<trial startround>
/ ontrialbegin = [values.op1 = "";
    values.op2 = "";
    values.digit1 = list.firstnumbers.nextvalue;
    values.digit2 = list.secondnumbers.nextvalue;
    values.digit3 = list.thirdnumbers.nextvalue;
    values.opa = list.opa.nextvalue;
    values.opb = list.opb.nextvalue;
    values.roundnumber += 1;
    ]
/ stimulusframes = [1=clearscreen, roundtext]
/ trialduration = 1000
/ validresponse = (0)
/ branch = [trial.main]
</trial>

<shape clearscreen>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
</shape>

<text roundtext>
/ items = ("This is round #<%values.roundnumber%>.")
</text>

<list firstnumbers>
/ items = ("This is a", "This is")
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = ("item. This is a","times larger. And this is")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list thirdnumbers>
/ items = ("item.","times smaller")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opa>
/ items = ("large","10")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opb>
/ items = ("small","3")
/ selectionmode = list.firstnumbers.currentindex
</list>

<trial main>
/ stimulusframes = [1=question, digit1, operator1, digit2, operator2, digit3, submit]
/ inputdevice = mouse
/ validresponse = (operator1, operator2, submit)
/ isvalidresponse = [(trial.main.response == "submit" && values.op1 !="" && values.op2 !="")
    || trial.main.response == "operator1" || trial.main.response == "operator2"]
/ branch = [if (trial.main.response == "operator1") trial.select_operator1]
/ branch = [if (trial.main.response == "operator2") trial.select_operator2]
</trial>

<trial select_operator1>
/ ontrialend = [if (trial.select_operator1.response == "gt1") values.op1 = values.opa]
/ ontrialend = [if (trial.select_operator1.response == "lt1") values.op1 = values.opb]
/ stimulusframes = [1=gt1,lt1]
/ inputdevice = mouse
/ validresponse = (gt1,lt1)
/ branch = [trial.main]
</trial>

<trial select_operator2>
/ ontrialend = [if (trial.select_operator2.response == "gt2") values.op2 = values.opa]
/ ontrialend = [if (trial.select_operator2.response == "lt2") values.op2 = values.opb]
/ stimulusframes = [1=gt2,lt2]
/ inputdevice = mouse
/ validresponse = (gt2,lt2)
/ branch = [trial.main]
</trial>

<text question>
/ items = ("Please answer the question below")
/ erase = false
/ position = (50%, 25%)
</text>

<text digit1>
/ items = ("<%values.digit1%>")
/ position = (20%, 50%)
/ erase = false
/ size = (20%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%values.digit2%>")
/ position = (50%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%values.digit3%>")
/ position = (80%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator1>
/ items = ("<%values.op1%>")
/ position = (30%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator2>
/ items = ("<%values.op2%>")
/ position = (60%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text submit>
/ items = ("SUBMIT")
/ position = (50%, 92%)
/ size = (20%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text gt1>
/ items = ("<%values.opa%>")
/ position = (30%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt1>
/ items = ("<%values.opb%>")
/ position = (30%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text gt2>
/ items = ("<%values.opa%>")
/ position = (60%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt2>
/ items = ("<%values.opb%>")
/ position = (60%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

You'll have to fiddle around with the on-screen positions a bit to make things look good because your example items at least vary in length, but the general approach is no different from the digits-only version.
Hello, Dave.  Great. This makes a lot of sense. Thank you.
Now, what if I wanted to include items that use a single selection Likert type scale as the response option (e.g., a text prompt and four radio button response options) instead of the dropdowns, but I want to capture all of the clicking as well. Is that possible?


Yes, you can again do that in the exact same way.

I am still struggling with this. I have items that have prompts (e.g., "Which of these must be true?", "Which of these must be false?") and 6 vertical radio button response options (A-F). I am not certain how to adapt the above script to cycle through the prompts and response options. Would I use the <radiobuttons> element in place of the <text operator1>?As always, thanks for the help.

No, you would not use <radiobuttons>. If you want something that works *exactly* like the previous script you use regular <text> and / or <shape> elements. If you want something like a simple likert-type scale, then simply use the <likert> trial element.

Hello Dave.  Will the log data be captured with the <likert> trial element (e.g., which options the participant selected before submitting, timing, etc.)? And, is there a way to make the Likert options be presented vertically instead of horizontally? 

> Will the log data be captured with the <likert> trial element (e.g., which options the participant selected before submitting, timing, etc.)?

No. If you want that you need to build something like the script discussed throughout this thread. I.e. use standard <text> and <trial> elements.

>  And, is there a way to make the Likert options be presented vertically instead of horizontally?

No.


Inquisit1234
Inquisit1234
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 13, Visits: 31
Dave - Wednesday, July 18, 2018
Inquisit1234 - Wednesday, July 18, 2018
Dave - Wednesday, July 18, 2018
Inquisit1234 - Wednesday, July 18, 2018
Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Hello again. So, I have a related question.  Any suggestions as to how to collect the same log data from these "drop down" menus, but change both the text and responses in the operators for each item.

For example, lets use the phrase "This is a large item, and this is a small item." The words "large" and "small" would be in the operators, the reset would be text. The next item would be "This is 10 times larger, and this is 3 times smaller." In this item, "10 and "3" would be in the operators, the rest would be text.

Overall, I am trying to figure out what would be the most efficient way to administer several different items (both text and operators), but still collect all of the log data capture by the script previously provided here.

Thank you.

It would work exactly the same way as the existing script. There is nothing that prevents to from storing text strings in <list> elements and using those in the various <values> instead of using digits only. And there is nothing that prevents you from having the operators -- <text lt> etc. in the original script -- be variable as well, in the same way as the digits are variable in the original. E.g.:

<values>
/ digit1 = 0
/ digit2 = 0
/ digit3 = 0
/ opa = ""
/ opb = ""
/ op1 = ""
/ op2 = ""
/ roundnumber = 0
</values>

<defaults>
/ fontstyle = ("Verdana", 3%)
</defaults>


<block myblock>
/ trials = [1-2=startround;]
</block>

<trial startround>
/ ontrialbegin = [values.op1 = "";
    values.op2 = "";
    values.digit1 = list.firstnumbers.nextvalue;
    values.digit2 = list.secondnumbers.nextvalue;
    values.digit3 = list.thirdnumbers.nextvalue;
    values.opa = list.opa.nextvalue;
    values.opb = list.opb.nextvalue;
    values.roundnumber += 1;
    ]
/ stimulusframes = [1=clearscreen, roundtext]
/ trialduration = 1000
/ validresponse = (0)
/ branch = [trial.main]
</trial>

<shape clearscreen>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
</shape>

<text roundtext>
/ items = ("This is round #<%values.roundnumber%>.")
</text>

<list firstnumbers>
/ items = ("This is a", "This is")
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = ("item. This is a","times larger. And this is")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list thirdnumbers>
/ items = ("item.","times smaller")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opa>
/ items = ("large","10")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opb>
/ items = ("small","3")
/ selectionmode = list.firstnumbers.currentindex
</list>

<trial main>
/ stimulusframes = [1=question, digit1, operator1, digit2, operator2, digit3, submit]
/ inputdevice = mouse
/ validresponse = (operator1, operator2, submit)
/ isvalidresponse = [(trial.main.response == "submit" && values.op1 !="" && values.op2 !="")
    || trial.main.response == "operator1" || trial.main.response == "operator2"]
/ branch = [if (trial.main.response == "operator1") trial.select_operator1]
/ branch = [if (trial.main.response == "operator2") trial.select_operator2]
</trial>

<trial select_operator1>
/ ontrialend = [if (trial.select_operator1.response == "gt1") values.op1 = values.opa]
/ ontrialend = [if (trial.select_operator1.response == "lt1") values.op1 = values.opb]
/ stimulusframes = [1=gt1,lt1]
/ inputdevice = mouse
/ validresponse = (gt1,lt1)
/ branch = [trial.main]
</trial>

<trial select_operator2>
/ ontrialend = [if (trial.select_operator2.response == "gt2") values.op2 = values.opa]
/ ontrialend = [if (trial.select_operator2.response == "lt2") values.op2 = values.opb]
/ stimulusframes = [1=gt2,lt2]
/ inputdevice = mouse
/ validresponse = (gt2,lt2)
/ branch = [trial.main]
</trial>

<text question>
/ items = ("Please answer the question below")
/ erase = false
/ position = (50%, 25%)
</text>

<text digit1>
/ items = ("<%values.digit1%>")
/ position = (20%, 50%)
/ erase = false
/ size = (20%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%values.digit2%>")
/ position = (50%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%values.digit3%>")
/ position = (80%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator1>
/ items = ("<%values.op1%>")
/ position = (30%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator2>
/ items = ("<%values.op2%>")
/ position = (60%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text submit>
/ items = ("SUBMIT")
/ position = (50%, 92%)
/ size = (20%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text gt1>
/ items = ("<%values.opa%>")
/ position = (30%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt1>
/ items = ("<%values.opb%>")
/ position = (30%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text gt2>
/ items = ("<%values.opa%>")
/ position = (60%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt2>
/ items = ("<%values.opb%>")
/ position = (60%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

You'll have to fiddle around with the on-screen positions a bit to make things look good because your example items at least vary in length, but the general approach is no different from the digits-only version.
Hello, Dave.  Great. This makes a lot of sense. Thank you.
Now, what if I wanted to include items that use a single selection Likert type scale as the response option (e.g., a text prompt and four radio button response options) instead of the dropdowns, but I want to capture all of the clicking as well. Is that possible?


Yes, you can again do that in the exact same way.

I am still struggling with this. I have items that have prompts (e.g., "Which of these must be true?", "Which of these must be false?") and 6 vertical radio button response options (A-F). I am not certain how to adapt the above script to cycle through the prompts and response options. Would I use the <radiobuttons> element in place of the <text operator1>?As always, thanks for the help.

No, you would not use <radiobuttons>. If you want something that works *exactly* like the previous script you use regular <text> and / or <shape> elements. If you want something like a simple likert-type scale, then simply use the <likert> trial element.

Hello Dave.  Will the log data be captured with the <likert> trial element (e.g., which options the participant selected before submitting, timing, etc.)? And, is there a way to make the Likert options be presented vertically instead of horizontally? 

> Will the log data be captured with the <likert> trial element (e.g., which options the participant selected before submitting, timing, etc.)?

No. If you want that you need to build something like the script discussed throughout this thread. I.e. use standard <text> and <trial> elements.

>  And, is there a way to make the Likert options be presented vertically instead of horizontally?

No.


Thanks for this information. I compiled the script below.  Essentially, it presents a prompt, then the participant can click on the 6 responses and the selections turn green.  However, I would like to make it so only one response can be selected at a time (e.g., when the participant selects "A" and turns it green, it would turn back to black if "C" was selected which would turn green. Any suggestions?

Also, is there a special character to create a numeric exponent and a fraction in the text? 

<block myblock>
/ trials = [1=trial1,trial2]
</block>

<trial trial1>
/ stimulusframes = [1=question,prompt,option01,option02,option03,option04,option05,option06,submit]
/ inputdevice = mouse
/ validresponse = (option01,option02,option03,option04,option05,option06,submit)
/ ontrialend = [if(trial.trial1.response=="option01")
text.option01.textcolor=sequence(green,black)]
/ ontrialend = [if(trial.trial1.response=="option02")
text.option02.textcolor=sequence(green,black)]
/ ontrialend = [if(trial.trial1.response=="option03")
text.option03.textcolor=sequence(green,black)]
/ ontrialend = [if(trial.trial1.response=="option04")
text.option04.textcolor=sequence(green,black)]
/ ontrialend = [if(trial.trial1.response=="option05")
text.option05.textcolor=sequence(green,black)]
/ ontrialend = [if(trial.trial1.response=="option06")
text.option06.textcolor=sequence(green,black)]
/ branch = [if(trial.trial1.response!="submit")trial.trial1]
</trial>

<text question>
/ items = ("Please answer the question below")
/ fontstyle= ("MS Shell Dlg 2", 3.61%, true, false, false, false, 5, 1)
/ erase = false
/ position = (50%, 25%)
</text>

<text prompt>
/ items = ("There are many shapes. One shape is randomly selected from the shapes in the box. ~nWhich of the following statements must be false?")
/ fontstyle= ("MS Shell Dlg 2", 2%, true, false, false, false, 5, 1)
/ position = (30.5%, 35%)
/ erase = false
</text>

<text option01>
/ items = ("A.) 1")
/ txcolor = black
/ erase = false
/ size = (5%,4%)
/ position = (10%,42%)
/ hjustify = left
</text>

<text option02>
/ items = ("B.) 2")
/ txcolor = black
/ erase = false
/ size = (5%,4%)
/ position = (10%,47%)
/ hjustify = left
</text>

<text option03>
/ items = ("C.) 3")
/ txcolor = black
/ erase = false
/ size = (5%,4%)
/ position = (10%,52%)
/ hjustify = left
</text>

<text option04>
/ items = ("D.) 4")
/ txcolor = black
/ erase = false
/ size = (5%,4%)
/ position = (10%,57%)
/ hjustify = left
</text>

<text option05>
/ items = ("E.) 5")
/ width = 100%
/ txcolor = black
/ erase = false
/ size = (5%,4%)
/ position = (10%,62%)
/ hjustify = left
</text>

<text option06>
/ items = ("F.) 6")
/ txcolor = black
/ erase = false
/ size = (5%,4%)
/ position = (10%,67%)
/ hjustify = left
</text>

<trial trial2>
/ stimulusframes = [1=question,prompt2,option01_2,option02_2,option03_2,option04_2,option05_2,option06_2,submit]
/ inputdevice = mouse
/ validresponse = (option01_2,option02_2,option03_2,option04_2,option05_2,option06_2,submit)
/ ontrialend = [if(trial.trial2.response=="option01_2")
text.option01_2.textcolor=sequence(green,black)]
/ ontrialend = [if(trial.trial2.response=="option02_2")
text.option02_2.textcolor=sequence(green,black)]
/ ontrialend = [if(trial.trial2.response=="option03_2")
text.option03_2.textcolor=sequence(green,black)]
/ ontrialend = [if(trial.trial2.response=="option04_2")
text.option04_2.textcolor=sequence(green,black)]
/ ontrialend = [if(trial.trial2.response=="option05_2")
text.option05_2.textcolor=sequence(green,black)]
/ ontrialend = [if(trial.trial2.response=="option06_2")
text.option06_2.textcolor=sequence(green,black)]
/ branch = [if(trial.trial2.response!="submit")trial.trial2]
</trial>


<text prompt2>
/ items = ("There are some shapes. Two shapes are randomly selected from the shapes in the box. ~nWhich of the following statements must be true?")
/ fontstyle= ("MS Shell Dlg 2", 2%, true, false, false, false, 5, 1)
/ position = (30.5%, 35%)
/ erase = false
</text>

<text option01_2>
/ items = ("A.) 7")
/ txcolor = black
/ erase = false
/ size = (5%,4%)
/ position = (10%,42%)
/ hjustify = left
</text>

<text option02_2>
/ items = ("B.) 8")
/ txcolor = black
/ erase = false
/ size = (5%,4%)
/ position = (10%,47%)
/ hjustify = left
</text>

<text option03_2>
/ items = ("C.) 9")
/ txcolor = black
/ erase = false
/ size = (5%,4%)
/ position = (10%,52%)
/ hjustify = left
</text>

<text option04_2>
/ items = ("D.) 10")
/ txcolor = black
/ erase = false
/ size = (5%,4%)
/ position = (10%,57%)
/ hjustify = left
</text>

<text option05_2>
/ items = ("E.) 11")
/ width = 100%
/ txcolor = black
/ erase = false
/ size = (5%,4%)
/ position = (10%,62%)
/ hjustify = left
</text>

<text option06_2>
/ items = ("F.) 12")
/ txcolor = black
/ erase = false
/ size = (5%,4%)
/ position = (10%,67%)
/ hjustify = left
</text>

<text submit>
/ items = ("Submit")
/ txbgcolor = gainsboro
/ width = 10%
/ height = 5%
/ hjustify = center
/ vjustify = center
/ position = (50%, 90%)
/ erase = false
</text>

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search