Millisecond Forums

Tick Mark Trial Counter

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

By AndrewPapale - 5/22/2020

Hello,

I am trying to create tick mark stimuli (e.g. vertical lines) to inform a subject how many times they have selected an option (e.g. one deck out of four decks of cards).  Unfortunately, we do not want to use a numeric counter, which would be easier to implement.  Does anyone have advice on how to do this in Inquisit 6?

Thank you!
Andrew
By Dave - 5/22/2020

AndrewPapale - 5/22/2020
Hello,

I am trying to create tick mark stimuli (e.g. vertical lines) to inform a subject how many times they have selected an option (e.g. one deck out of four decks of cards).  Unfortunately, we do not want to use a numeric counter, which would be easier to implement.  Does anyone have advice on how to do this in Inquisit 6?

Thank you!
Andrew

<values>
/ a_counter = ""
/ b_counter = ""
</values>

<trial a_or_b>
/ ontrialend = [
    if (trial.a_or_b.response == "a") {
        values.a_counter = concat(values.a_counter, "|");
    } else if (trial.a_or_b.response == "b") {
        values.b_counter = concat(values.b_counter, "|");
    };
]
/ stimulusframes = [1=a, b, a_counter, b_counter]
/ inputdevice = mouse
/ validresponse = ("a", "b")
</trial>

<text a>
/ items = ("Deck A")
/ size = (18%, 40%)
/ txbgcolor = cadetblue
/ position = (40%, 50%)
/ erase = false
</text>

<text a_counter>
/ items = ("<%values.a_counter%>")
/ position = (40%, 10%)
/ erase = false
</text>

<text b>
/ items = ("Deck B")
/ size = (18%, 40%)
/ txbgcolor = cadetblue
/ position = (60%, 50%)
/ erase = false
</text>

<text b_counter>
/ items = ("<%values.b_counter%>")
/ position = (60%, 10%)
/ erase = false
</text>

<block example>
/ trials = [1-10 = a_or_b]
</block>
By AndrewPapale - 5/22/2020

Dave - 5/22/2020
AndrewPapale - 5/22/2020
Hello,

I am trying to create tick mark stimuli (e.g. vertical lines) to inform a subject how many times they have selected an option (e.g. one deck out of four decks of cards).  Unfortunately, we do not want to use a numeric counter, which would be easier to implement.  Does anyone have advice on how to do this in Inquisit 6?

Thank you!
Andrew

<values>
/ a_counter = ""
/ b_counter = ""
</values>

<trial a_or_b>
/ ontrialend = [
    if (trial.a_or_b.response == "a") {
        values.a_counter = concat(values.a_counter, "|");
    } else if (trial.a_or_b.response == "b") {
        values.b_counter = concat(values.b_counter, "|");
    };
]
/ stimulusframes = [1=a, b, a_counter, b_counter]
/ inputdevice = mouse
/ validresponse = ("a", "b")
</trial>

<text a>
/ items = ("Deck A")
/ size = (18%, 40%)
/ txbgcolor = cadetblue
/ position = (40%, 50%)
/ erase = false
</text>

<text a_counter>
/ items = ("<%values.a_counter%>")
/ position = (40%, 10%)
/ erase = false
</text>

<text b>
/ items = ("Deck B")
/ size = (18%, 40%)
/ txbgcolor = cadetblue
/ position = (60%, 50%)
/ erase = false
</text>

<text b_counter>
/ items = ("<%values.b_counter%>")
/ position = (60%, 10%)
/ erase = false
</text>

<block example>
/ trials = [1-10 = a_or_b]
</block>
By AndrewPapale - 5/26/2020

Is there a way to change the color of each "|" to indicate rewarded vs. unrewarded trials? e.g. black for each rewarded trial and red for each unrewarded trial?  Or should I do two counters, one for each?  (If the latter, I can do this).
By Dave - 5/26/2020

AndrewPapale - 5/26/2020
Is there a way to change the color of each "|" to indicate rewarded vs. unrewarded trials? e.g. black for each rewarded trial and red for each unrewarded trial?  Or should I do two counters, one for each?  (If the latter, I can do this).

It's theoretically possible, but would be somewhat iffy to implement. If I were you, I'd go for separate rewarded vs unrewarded counters.

<values>
/ a_counter = ""
/ b_counter = ""
/ rewarded = false
</values>

<list rewardlist>
/ items = (true, true, true, true, true, false, false, false, false, false)
</list>

<trial a_or_b>
/ ontrialbegin = [
    values.rewarded = list.rewardlist.nextvalue;
]
/ ontrialend = [
  if (trial.a_or_b.response == "a") {
        if (values.rewarded){
            values.a_counter = concat(values.a_counter, "|");
        } else if (!values.rewarded) {
            values.a_counter = concat(values.a_counter, "<font color=#FF0000>|</font>");
        };
    } else if (trial.a_or_b.response == "b") {
        if (values.rewarded){
            values.b_counter = concat(values.b_counter, "|");
        } else if (!values.rewarded) {
            values.b_counter = concat(values.b_counter, "<font color=#FF0000>|</font>");
        };
    }
]
/ stimulusframes = [1=a, b, a_counter, b_counter]
/ inputdevice = mouse
/ validresponse = ("a", "b")
</trial>

<text a>
/ items = ("Deck A")
/ size = (18%, 40%)
/ txbgcolor = cadetblue
/ position = (40%, 50%)
/ erase = false
</text>

<text a_counter>
/ items = ("<%values.a_counter%>")
/ position = (40%, 10%)
/ erase = false
</text>

<text b>
/ items = ("Deck B")
/ size = (18%, 40%)
/ txbgcolor = cadetblue
/ position = (60%, 50%)
/ erase = false
</text>

<text b_counter>
/ items = ("<%values.b_counter%>")
/ position = (60%, 10%)
/ erase = false
</text>

<block example>
/ trials = [1-10 = a_or_b]
</block>

https://www.millisecond.com/support/docs/v6/html/language/markup.htm