Millisecond Forums

Adding text to a Likert scale and creating an attention check

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

By dinghu - 4/30/2024

Hello,
I am running an experiment in which participants will be making ratings on a 7 point Likert type scale after viewing stimuli. I currently have the Likert scale set up with only the buttons and corresponding ratings, but I wanted to also have the rating prompt presented with the scale each time. How do I add just some text above the Likert scale?

<likert ratingtrial>
/ ontrialbegin = [
    likert.ratingtrial.resetstimulusframes();
    likert.ratingtrial.insertstimulustime(picture.mask, 250 + values.viewtime);
    likert.ratingtrial.insertstimulustime(clearscreen, 250 + values.viewtime + 50);
]
/ pretrialpause = 300
/ stimulustimes = [0=fix; 200=mask; 250=clearscreen; 250=site]
/ anchors=[1="very unaesthetic"; 2="unaesthetic"; 3="somewhat unaesthetic"; 4="neutral"; 5="somewhat aesthetic"; 6="aesthetic"; 7="very aesthetic"]
/ numpoints = 7
/ position=(50, 50)
/ posttrialpause = 100
/ buttonvalues = [1="1",2="2",3="3",4="4",5="5",6="6",7="7"]
/ mouse = true
</likert>

Additionally, I want to include a short attention check towards the end of my experiment. Could I just add another Likert type scale with a question and set one of the answers as the correct one?
By Dave - 4/30/2024

dinghu - 4/30/2024
Hello,
I am running an experiment in which participants will be making ratings on a 7 point Likert type scale after viewing stimuli. I currently have the Likert scale set up with only the buttons and corresponding ratings, but I wanted to also have the rating prompt presented with the scale each time. How do I add just some text above the Likert scale?

<likert ratingtrial>
/ ontrialbegin = [
    likert.ratingtrial.resetstimulusframes();
    likert.ratingtrial.insertstimulustime(picture.mask, 250 + values.viewtime);
    likert.ratingtrial.insertstimulustime(clearscreen, 250 + values.viewtime + 50);
]
/ pretrialpause = 300
/ stimulustimes = [0=fix; 200=mask; 250=clearscreen; 250=site]
/ anchors=[1="very unaesthetic"; 2="unaesthetic"; 3="somewhat unaesthetic"; 4="neutral"; 5="somewhat aesthetic"; 6="aesthetic"; 7="very aesthetic"]
/ numpoints = 7
/ position=(50, 50)
/ posttrialpause = 100
/ buttonvalues = [1="1",2="2",3="3",4="4",5="5",6="6",7="7"]
/ mouse = true
</likert>

Additionally, I want to include a short attention check towards the end of my experiment. Could I just add another Likert type scale with a question and set one of the answers as the correct one?

You need a <text> element for the prompt and display that via /stimulustimes, just like any and all other stimuli.

And yes, you can do whatever you want or need for an attention check
By dinghu - 5/6/2024

Dave - 4/30/2024
dinghu - 4/30/2024
Hello,
I am running an experiment in which participants will be making ratings on a 7 point Likert type scale after viewing stimuli. I currently have the Likert scale set up with only the buttons and corresponding ratings, but I wanted to also have the rating prompt presented with the scale each time. How do I add just some text above the Likert scale?

<likert ratingtrial>
/ ontrialbegin = [
    likert.ratingtrial.resetstimulusframes();
    likert.ratingtrial.insertstimulustime(picture.mask, 250 + values.viewtime);
    likert.ratingtrial.insertstimulustime(clearscreen, 250 + values.viewtime + 50);
]
/ pretrialpause = 300
/ stimulustimes = [0=fix; 200=mask; 250=clearscreen; 250=site]
/ anchors=[1="very unaesthetic"; 2="unaesthetic"; 3="somewhat unaesthetic"; 4="neutral"; 5="somewhat aesthetic"; 6="aesthetic"; 7="very aesthetic"]
/ numpoints = 7
/ position=(50, 50)
/ posttrialpause = 100
/ buttonvalues = [1="1",2="2",3="3",4="4",5="5",6="6",7="7"]
/ mouse = true
</likert>

Additionally, I want to include a short attention check towards the end of my experiment. Could I just add another Likert type scale with a question and set one of the answers as the correct one?

You need a <text> element for the prompt and display that via /stimulustimes, just like any and all other stimuli.

And yes, you can do whatever you want or need for an attention check

Thank you so much! With the attention check, is there a way for me to insert one into part of a block, perhaps about 15 trials into a block? Or will I have to break the block up into two separate blocks, and have an attention check block in between?
By Dave - 5/6/2024

dinghu - 5/6/2024
Dave - 4/30/2024
dinghu - 4/30/2024
Hello,
I am running an experiment in which participants will be making ratings on a 7 point Likert type scale after viewing stimuli. I currently have the Likert scale set up with only the buttons and corresponding ratings, but I wanted to also have the rating prompt presented with the scale each time. How do I add just some text above the Likert scale?

<likert ratingtrial>
/ ontrialbegin = [
    likert.ratingtrial.resetstimulusframes();
    likert.ratingtrial.insertstimulustime(picture.mask, 250 + values.viewtime);
    likert.ratingtrial.insertstimulustime(clearscreen, 250 + values.viewtime + 50);
]
/ pretrialpause = 300
/ stimulustimes = [0=fix; 200=mask; 250=clearscreen; 250=site]
/ anchors=[1="very unaesthetic"; 2="unaesthetic"; 3="somewhat unaesthetic"; 4="neutral"; 5="somewhat aesthetic"; 6="aesthetic"; 7="very aesthetic"]
/ numpoints = 7
/ position=(50, 50)
/ posttrialpause = 100
/ buttonvalues = [1="1",2="2",3="3",4="4",5="5",6="6",7="7"]
/ mouse = true
</likert>

Additionally, I want to include a short attention check towards the end of my experiment. Could I just add another Likert type scale with a question and set one of the answers as the correct one?

You need a <text> element for the prompt and display that via /stimulustimes, just like any and all other stimuli.

And yes, you can do whatever you want or need for an attention check

Thank you so much! With the attention check, is there a way for me to insert one into part of a block, perhaps about 15 trials into a block? Or will I have to break the block up into two separate blocks, and have an attention check block in between?

You can insert it into a block however you deem fit. How to do that depends on how you've set the block up. That information is not available to me, so I can't give you any specific guidance.
By dinghu - 5/6/2024

Dave - 5/6/2024
dinghu - 5/6/2024
Dave - 4/30/2024
dinghu - 4/30/2024
Hello,
I am running an experiment in which participants will be making ratings on a 7 point Likert type scale after viewing stimuli. I currently have the Likert scale set up with only the buttons and corresponding ratings, but I wanted to also have the rating prompt presented with the scale each time. How do I add just some text above the Likert scale?

<likert ratingtrial>
/ ontrialbegin = [
    likert.ratingtrial.resetstimulusframes();
    likert.ratingtrial.insertstimulustime(picture.mask, 250 + values.viewtime);
    likert.ratingtrial.insertstimulustime(clearscreen, 250 + values.viewtime + 50);
]
/ pretrialpause = 300
/ stimulustimes = [0=fix; 200=mask; 250=clearscreen; 250=site]
/ anchors=[1="very unaesthetic"; 2="unaesthetic"; 3="somewhat unaesthetic"; 4="neutral"; 5="somewhat aesthetic"; 6="aesthetic"; 7="very aesthetic"]
/ numpoints = 7
/ position=(50, 50)
/ posttrialpause = 100
/ buttonvalues = [1="1",2="2",3="3",4="4",5="5",6="6",7="7"]
/ mouse = true
</likert>

Additionally, I want to include a short attention check towards the end of my experiment. Could I just add another Likert type scale with a question and set one of the answers as the correct one?

You need a <text> element for the prompt and display that via /stimulustimes, just like any and all other stimuli.

And yes, you can do whatever you want or need for an attention check

Thank you so much! With the attention check, is there a way for me to insert one into part of a block, perhaps about 15 trials into a block? Or will I have to break the block up into two separate blocks, and have an attention check block in between?

You can insert it into a block however you deem fit. How to do that depends on how you've set the block up. That information is not available to me, so I can't give you any specific guidance.
I've pasted part of the code below. Each experiment is set up to run a practice block and then 3 blocks with different amounts of viewing time. I want to insert an attention check about 15 trials into the first of the actual experimental blocks without interfering with anything else. How would I be able to do that?
Thank you for your time!
<expt>
/ onexptbegin = [
    values.filtergroup = 1;
    values.viewtimegroup = 1;
]
/ postinstructions = (end)
/ blocks = [1 = practice; 2 - 4 = test]
/ groups = (1 of 18)
</expt>

<block practice>
/ onblockbegin = [
    values.viewtime = 50; // 50 ms viewtime during practice
]
/ preinstructions = (intro1)
/ trials = [1-3 = ratingtrial]
</block>

<block test>
/ onblockbegin = [
    values.viewtime = list.viewtime.nextvalue;
]
/ trials = [1-50 = ratingtrial]
</block>
By Dave - 5/6/2024

dinghu - 5/6/2024
Dave - 5/6/2024
dinghu - 5/6/2024
Dave - 4/30/2024
dinghu - 4/30/2024
Hello,
I am running an experiment in which participants will be making ratings on a 7 point Likert type scale after viewing stimuli. I currently have the Likert scale set up with only the buttons and corresponding ratings, but I wanted to also have the rating prompt presented with the scale each time. How do I add just some text above the Likert scale?

<likert ratingtrial>
/ ontrialbegin = [
    likert.ratingtrial.resetstimulusframes();
    likert.ratingtrial.insertstimulustime(picture.mask, 250 + values.viewtime);
    likert.ratingtrial.insertstimulustime(clearscreen, 250 + values.viewtime + 50);
]
/ pretrialpause = 300
/ stimulustimes = [0=fix; 200=mask; 250=clearscreen; 250=site]
/ anchors=[1="very unaesthetic"; 2="unaesthetic"; 3="somewhat unaesthetic"; 4="neutral"; 5="somewhat aesthetic"; 6="aesthetic"; 7="very aesthetic"]
/ numpoints = 7
/ position=(50, 50)
/ posttrialpause = 100
/ buttonvalues = [1="1",2="2",3="3",4="4",5="5",6="6",7="7"]
/ mouse = true
</likert>

Additionally, I want to include a short attention check towards the end of my experiment. Could I just add another Likert type scale with a question and set one of the answers as the correct one?

You need a <text> element for the prompt and display that via /stimulustimes, just like any and all other stimuli.

And yes, you can do whatever you want or need for an attention check

Thank you so much! With the attention check, is there a way for me to insert one into part of a block, perhaps about 15 trials into a block? Or will I have to break the block up into two separate blocks, and have an attention check block in between?

You can insert it into a block however you deem fit. How to do that depends on how you've set the block up. That information is not available to me, so I can't give you any specific guidance.
I've pasted part of the code below. Each experiment is set up to run a practice block and then 3 blocks with different amounts of viewing time. I want to insert an attention check about 15 trials into the first of the actual experimental blocks without interfering with anything else. How would I be able to do that?
Thank you for your time!
<expt>
/ onexptbegin = [
    values.filtergroup = 1;
    values.viewtimegroup = 1;
]
/ postinstructions = (end)
/ blocks = [1 = practice; 2 - 4 = test]
/ groups = (1 of 18)
</expt>

<block practice>
/ onblockbegin = [
    values.viewtime = 50; // 50 ms viewtime during practice
]
/ preinstructions = (intro1)
/ trials = [1-3 = ratingtrial]
</block>

<block test>
/ onblockbegin = [
    values.viewtime = list.viewtime.nextvalue;
]
/ trials = [1-50 = ratingtrial]
</block>

Create a variable which you increase by one /ontrialbegin in every ratingtrial. Also create a variable indicating after how many test trials the attention check should occur.

<values>
...
/ ntrials = 0
/ attentioncheck_after = 0
...
</values>


At the start of the <expt>, pick a random number between 15 and, let's say 20, test trials after which the attention check should occur.

<expt>
/ onexptbegin = [
    values.filtergroup = 1;
    values.viewtimegroup = 1;
    values.attentioncheck_after = round(rand(15, 20));
]
/ postinstructions = (end)
/ blocks = [1 = practice; 2 - 4 = test]
/ groups = (1 of 18)
</expt>


At the end of the practice block, set the trial count variable back to 0 (you only care about the number of test trials).

<block practice>
...
/ onblockend = [values.ntrials = 0]
....
</block>


In your ratingtrial likert, increase the trial count variable by one and branch to the attentioncheck after the randomly determiined amount of test trials.

<likert ratingtrial>
/ ontrialbegin = [values.ntrials += 1]
...
/ branch = [
    if (values.ntrials == values.attentioncheck_after) {
        return likert.attentioncheck;
    }
]
</likert>

By dinghu - 5/7/2024

Dave - 5/6/2024
dinghu - 5/6/2024
Dave - 5/6/2024
dinghu - 5/6/2024
Dave - 4/30/2024
dinghu - 4/30/2024
Hello,
I am running an experiment in which participants will be making ratings on a 7 point Likert type scale after viewing stimuli. I currently have the Likert scale set up with only the buttons and corresponding ratings, but I wanted to also have the rating prompt presented with the scale each time. How do I add just some text above the Likert scale?

<likert ratingtrial>
/ ontrialbegin = [
    likert.ratingtrial.resetstimulusframes();
    likert.ratingtrial.insertstimulustime(picture.mask, 250 + values.viewtime);
    likert.ratingtrial.insertstimulustime(clearscreen, 250 + values.viewtime + 50);
]
/ pretrialpause = 300
/ stimulustimes = [0=fix; 200=mask; 250=clearscreen; 250=site]
/ anchors=[1="very unaesthetic"; 2="unaesthetic"; 3="somewhat unaesthetic"; 4="neutral"; 5="somewhat aesthetic"; 6="aesthetic"; 7="very aesthetic"]
/ numpoints = 7
/ position=(50, 50)
/ posttrialpause = 100
/ buttonvalues = [1="1",2="2",3="3",4="4",5="5",6="6",7="7"]
/ mouse = true
</likert>

Additionally, I want to include a short attention check towards the end of my experiment. Could I just add another Likert type scale with a question and set one of the answers as the correct one?

You need a <text> element for the prompt and display that via /stimulustimes, just like any and all other stimuli.

And yes, you can do whatever you want or need for an attention check

Thank you so much! With the attention check, is there a way for me to insert one into part of a block, perhaps about 15 trials into a block? Or will I have to break the block up into two separate blocks, and have an attention check block in between?

You can insert it into a block however you deem fit. How to do that depends on how you've set the block up. That information is not available to me, so I can't give you any specific guidance.
I've pasted part of the code below. Each experiment is set up to run a practice block and then 3 blocks with different amounts of viewing time. I want to insert an attention check about 15 trials into the first of the actual experimental blocks without interfering with anything else. How would I be able to do that?
Thank you for your time!
<expt>
/ onexptbegin = [
    values.filtergroup = 1;
    values.viewtimegroup = 1;
]
/ postinstructions = (end)
/ blocks = [1 = practice; 2 - 4 = test]
/ groups = (1 of 18)
</expt>

<block practice>
/ onblockbegin = [
    values.viewtime = 50; // 50 ms viewtime during practice
]
/ preinstructions = (intro1)
/ trials = [1-3 = ratingtrial]
</block>

<block test>
/ onblockbegin = [
    values.viewtime = list.viewtime.nextvalue;
]
/ trials = [1-50 = ratingtrial]
</block>

Create a variable which you increase by one /ontrialbegin in every ratingtrial. Also create a variable indicating after how many test trials the attention check should occur.

<values>
...
/ ntrials = 0
/ attentioncheck_after = 0
...
</values>


At the start of the <expt>, pick a random number between 15 and, let's say 20, test trials after which the attention check should occur.

<expt>
/ onexptbegin = [
    values.filtergroup = 1;
    values.viewtimegroup = 1;
    values.attentioncheck_after = round(rand(15, 20));
]
/ postinstructions = (end)
/ blocks = [1 = practice; 2 - 4 = test]
/ groups = (1 of 18)
</expt>


At the end of the practice block, set the trial count variable back to 0 (you only care about the number of test trials).

<block practice>
...
/ onblockend = [values.ntrials = 0]
....
</block>


In your ratingtrial likert, increase the trial count variable by one and branch to the attentioncheck after the randomly determiined amount of test trials.

<likert ratingtrial>
/ ontrialbegin = [values.ntrials += 1]
...
/ branch = [
    if (values.ntrials == values.attentioncheck_after) {
        return likert.attentioncheck;
    }
]
</likert>

Thank you so much for breaking it down like this. I just wanted to reply and share for posterity that I modified it to run on trial 15 each time, which made it unnecessary to include the attentioncheck_after value. I instead had it check if values.ntrail = 15, and simply branch from there. Thank you so much once again, you are a life saver!