Two responses in one trial


Author
Message
Heidi Umbach Hansen
Heidi Umbach Hansen
Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)
Group: Forum Members
Posts: 19, Visits: 90
Hi,

I would like to have one trial where audio files are played, participants first have to judge whether the beat was on or off, and then give their subjective rating of their confidence of their answer - almost exactly the same as in the attached image.

I can of course program this as two successive trials, but I would like to stay as true to the original as possible. 

Cheers, 

Heidi

I've written the following trial, where sub_rating denotes the confidence question itself, and sr1-sr3 denotes the three "subjective" responses - i.e. I have everything I need, I just have to figure out how to collect responses from two different questions.

<trial off_beat>
/ stimulustimes = [0=clearscreen, remainingtrials, trialquestion, bgstim_audiosymbol, offbeat, response_offbeat, response_onbeat, sub_rating_txt, sr1, sr2, sr3]
/ validresponse = (response_offbeat, response_onbeat)
/ correctresponse = (response_offbeat)
/ inputdevice = mouse
/ posttrialpause = 1000
</trial>
Dave
Dave
Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)
Group: Administrators
Posts: 11K, Visits: 73K
Heidi Umbach Hansen - 8/19/2021
Hi,

I would like to have one trial where audio files are played, participants first have to judge whether the beat was on or off, and then give their subjective rating of their confidence of their answer - almost exactly the same as in the attached image.

I can of course program this as two successive trials, but I would like to stay as true to the original as possible. 

Cheers, 

Heidi

I've written the following trial, where sub_rating denotes the confidence question itself, and sr1-sr3 denotes the three "subjective" responses - i.e. I have everything I need, I just have to figure out how to collect responses from two different questions.

<trial off_beat>
/ stimulustimes = [0=clearscreen, remainingtrials, trialquestion, bgstim_audiosymbol, offbeat, response_offbeat, response_onbeat, sub_rating_txt, sr1, sr2, sr3]
/ validresponse = (response_offbeat, response_onbeat)
/ correctresponse = (response_offbeat)
/ inputdevice = mouse
/ posttrialpause = 1000
</trial>

No image is visible in your post. Please attach it properly.
Heidi Umbach Hansen
Heidi Umbach Hansen
Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)
Group: Forum Members
Posts: 19, Visits: 90
Dave - 8/19/2021
Heidi Umbach Hansen - 8/19/2021
Hi,

I would like to have one trial where audio files are played, participants first have to judge whether the beat was on or off, and then give their subjective rating of their confidence of their answer - almost exactly the same as in the attached image.

I can of course program this as two successive trials, but I would like to stay as true to the original as possible. 

Cheers, 

Heidi

I've written the following trial, where sub_rating denotes the confidence question itself, and sr1-sr3 denotes the three "subjective" responses - i.e. I have everything I need, I just have to figure out how to collect responses from two different questions.

<trial off_beat>
/ stimulustimes = [0=clearscreen, remainingtrials, trialquestion, bgstim_audiosymbol, offbeat, response_offbeat, response_onbeat, sub_rating_txt, sr1, sr2, sr3]
/ validresponse = (response_offbeat, response_onbeat)
/ correctresponse = (response_offbeat)
/ inputdevice = mouse
/ posttrialpause = 1000
</trial>

No image is visible in your post. Please attach it properly.
What about now?

Heidi Umbach Hansen
Heidi Umbach Hansen
Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)
Group: Forum Members
Posts: 19, Visits: 90
Heidi Umbach Hansen - 8/19/2021
Dave - 8/19/2021
Heidi Umbach Hansen - 8/19/2021
Hi,

I would like to have one trial where audio files are played, participants first have to judge whether the beat was on or off, and then give their subjective rating of their confidence of their answer - almost exactly the same as in the attached image.

I can of course program this as two successive trials, but I would like to stay as true to the original as possible. 

Cheers, 

Heidi

I've written the following trial, where sub_rating denotes the confidence question itself, and sr1-sr3 denotes the three "subjective" responses - i.e. I have everything I need, I just have to figure out how to collect responses from two different questions.

<trial off_beat>
/ stimulustimes = [0=clearscreen, remainingtrials, trialquestion, bgstim_audiosymbol, offbeat, response_offbeat, response_onbeat, sub_rating_txt, sr1, sr2, sr3]
/ validresponse = (response_offbeat, response_onbeat)
/ correctresponse = (response_offbeat)
/ inputdevice = mouse
/ posttrialpause = 1000
</trial>

No image is visible in your post. Please attach it properly.
What about now?


Attachments
example_1.jpg (14 views, 90.00 KB)
Dave
Dave
Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)
Group: Administrators
Posts: 11K, Visits: 73K
Heidi Umbach Hansen - 8/19/2021
Dave - 8/19/2021
Heidi Umbach Hansen - 8/19/2021
Hi,

I would like to have one trial where audio files are played, participants first have to judge whether the beat was on or off, and then give their subjective rating of their confidence of their answer - almost exactly the same as in the attached image.

I can of course program this as two successive trials, but I would like to stay as true to the original as possible. 

Cheers, 

Heidi

I've written the following trial, where sub_rating denotes the confidence question itself, and sr1-sr3 denotes the three "subjective" responses - i.e. I have everything I need, I just have to figure out how to collect responses from two different questions.

<trial off_beat>
/ stimulustimes = [0=clearscreen, remainingtrials, trialquestion, bgstim_audiosymbol, offbeat, response_offbeat, response_onbeat, sub_rating_txt, sr1, sr2, sr3]
/ validresponse = (response_offbeat, response_onbeat)
/ correctresponse = (response_offbeat)
/ inputdevice = mouse
/ posttrialpause = 1000
</trial>

No image is visible in your post. Please attach it properly.
What about now?

Still nothing. Please use +Insert -> Add File...
Dave
Dave
Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)
Group: Administrators
Posts: 11K, Visits: 73K
Dave - 8/19/2021
Heidi Umbach Hansen - 8/19/2021
Dave - 8/19/2021
Heidi Umbach Hansen - 8/19/2021
Hi,

I would like to have one trial where audio files are played, participants first have to judge whether the beat was on or off, and then give their subjective rating of their confidence of their answer - almost exactly the same as in the attached image.

I can of course program this as two successive trials, but I would like to stay as true to the original as possible. 

Cheers, 

Heidi

I've written the following trial, where sub_rating denotes the confidence question itself, and sr1-sr3 denotes the three "subjective" responses - i.e. I have everything I need, I just have to figure out how to collect responses from two different questions.

<trial off_beat>
/ stimulustimes = [0=clearscreen, remainingtrials, trialquestion, bgstim_audiosymbol, offbeat, response_offbeat, response_onbeat, sub_rating_txt, sr1, sr2, sr3]
/ validresponse = (response_offbeat, response_onbeat)
/ correctresponse = (response_offbeat)
/ inputdevice = mouse
/ posttrialpause = 1000
</trial>

No image is visible in your post. Please attach it properly.
What about now?

Still nothing. Please use +Insert -> Add File...

I've looked at the attachment. You can build an interface like this that from the participant's perspective appears as a single trial -- code-wise, however, it will involve multiple trials and some fairly complex logic.
Dave
Dave
Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)Supreme Being (957K reputation)
Group: Administrators
Posts: 11K, Visits: 73K
Dave - 8/19/2021
Dave - 8/19/2021
Heidi Umbach Hansen - 8/19/2021
Dave - 8/19/2021
Heidi Umbach Hansen - 8/19/2021
Hi,

I would like to have one trial where audio files are played, participants first have to judge whether the beat was on or off, and then give their subjective rating of their confidence of their answer - almost exactly the same as in the attached image.

I can of course program this as two successive trials, but I would like to stay as true to the original as possible. 

Cheers, 

Heidi

I've written the following trial, where sub_rating denotes the confidence question itself, and sr1-sr3 denotes the three "subjective" responses - i.e. I have everything I need, I just have to figure out how to collect responses from two different questions.

<trial off_beat>
/ stimulustimes = [0=clearscreen, remainingtrials, trialquestion, bgstim_audiosymbol, offbeat, response_offbeat, response_onbeat, sub_rating_txt, sr1, sr2, sr3]
/ validresponse = (response_offbeat, response_onbeat)
/ correctresponse = (response_offbeat)
/ inputdevice = mouse
/ posttrialpause = 1000
</trial>

No image is visible in your post. Please attach it properly.
What about now?

Still nothing. Please use +Insert -> Add File...

I've looked at the attachment. You can build an interface like this that from the participant's perspective appears as a single trial -- code-wise, however, it will involve multiple trials and some fairly complex logic.

Here's a quick draft of how code along those lines would have to be set up:

<defaults>
/ screencolor = lightgray
/ txbgcolor = transparent
/ canvasaspectratio = (4,3)
</defaults>

<values>
/ trialcount = 0
/ trialtype = ""
/ same_diff_response = ""
/ confidence = ""
</values>

<block example>
/ trials = [1-10 = noreplace(same, different)]
</block>

<trial same>
/ ontrialbegin = [
    values.trialcount += 1;
    values.trialtype = "same";
    values.confidence = "";
    values.same_diff_response = "";
    text.same.textcolor = white;
    text.different.textcolor = white;
    text.guess.textcolor = white;
    text.think_so.textcolor = white;
    text.sure.textcolor = white;
]
/ stimulusframes = [1=clearscreen, same_placeholder]
/ trialduration = 2000
/ recorddata = false
/ branch = [
    return trial.getresponses
]
</trial>

<trial different>
/ ontrialbegin = [
    values.trialcount += 1;
    values.trialtype = "different";
    values.confidence = "";
    values.same_diff_response = "";
    text.same.textcolor = white;
    text.different.textcolor = white;
    text.guess.textcolor = white;
    text.think_so.textcolor = white;
    text.sure.textcolor = white;
]
/ stimulusframes = [1=clearscreen, different_placeholder]
/ trialduration = 2000
/ recorddata = false
/ branch = [
    return trial.getresponses
]
</trial>

<text same_placeholder>
/ items = ("Imagine SAME melodies playing here...")
</text>

<text different_placeholder>
/ items = ("Imagine DIFFERENT melodies playing here...")
</text>

<trial getresponses>
/ stimulusframes = [1=clearscreen, q_same_diff, same, different, q_confidence, guess, think_so, sure]
/ validresponse = (same, different, guess, think_so, sure)
/ inputdevice = mouse
/ ontrialend = [
    if (trial.getresponses.response == "same"){
        values.same_diff_response = "same";
        text.same.textcolor = black;
        text.different.textcolor = white;
    };
    if (trial.getresponses.response == "different"){
        values.same_diff_response = "different";
        text.same.textcolor = white;
        text.different.textcolor = black;
    };
    if (trial.getresponses.response == "guess"){
        values.confidence = 1;
        text.guess.textcolor = black;
        text.think_so.textcolor = white;
        text.sure.textcolor = white;
    };
    if (trial.getresponses.response == "think_so"){
        values.confidence = 2;
        text.guess.textcolor = white;
        text.think_so.textcolor = black;
        text.sure.textcolor = white;
    };
    if (trial.getresponses.response == "sure"){
        values.confidence = 3;
        text.guess.textcolor = white;
        text.think_so.textcolor = white;
        text.sure.textcolor = black;
    };
]
/ recorddata = false
/ branch = [
    if (values.same_diff_response == "" || values.confidence == "") {
        return trial.getresponses;
    } else {
        return trial.logresponses;
    }
]
</trial>

<text q_same_diff>
/ items = ("Was the second tune the same melody as the first, despite being played at a different pitch?")
/ position = (50%, 20%)
/ erase = false
</text>

<text q_confidence>
/ items = ("How sure are you about this answer?")
/ position = (50%, 60%)
/ erase = false
</text>

<text different>
/ items = ("DIFFERENT")
/ txbgcolor = green
/ txcolor = white
/ erase = false
/ size = (25%, 12%)
/ position = (30%, 40%)
/ vjustify = center
</text>

<text same>
/ items = ("SAME")
/ txbgcolor = red
/ txcolor = white
/ erase = false
/ size = (25%, 12%)
/ position = (70%, 40%)
/ vjustify = center
</text>

<text guess>
/ items = ("I'm guessing")
/ txbgcolor = cornflowerblue
/ txcolor = white
/ erase = false
/ size = (25%, 12%)
/ position = (20%, 80%)
/ vjustify = center
</text>

<text think_so>
/ items = ("I think so")
/ txbgcolor = cornflowerblue
/ txcolor = white
/ erase = false
/ size = (25%, 12%)
/ position = (50%, 80%)
/ vjustify = center
</text>

<text sure>
/ items = ("I'm totally sure")
/ txbgcolor = cornflowerblue
/ txcolor = white
/ erase = false
/ size = (25%, 12%)
/ position = (80%, 80%)
/ vjustify = center
</text>

<trial logresponses>
/ stimulusframes = [1=q_same_diff, same, different, q_confidence, guess, think_so, sure]
/ validresponse = (0)
/ iscorrectresponse = [
    values.same_diff_response == values.trialtype;
]
/ trialduration = 500
</trial>

<data>
/ columns = (date time subject group session values.trialcount values.trialtype values.same_diff_response correct values.confidence)
</data>


Heidi Umbach Hansen
Heidi Umbach Hansen
Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)
Group: Forum Members
Posts: 19, Visits: 90
Dave - 8/19/2021
Dave - 8/19/2021
Dave - 8/19/2021
Heidi Umbach Hansen - 8/19/2021
Dave - 8/19/2021
Heidi Umbach Hansen - 8/19/2021
Hi,

I would like to have one trial where audio files are played, participants first have to judge whether the beat was on or off, and then give their subjective rating of their confidence of their answer - almost exactly the same as in the attached image.

I can of course program this as two successive trials, but I would like to stay as true to the original as possible. 

Cheers, 

Heidi

I've written the following trial, where sub_rating denotes the confidence question itself, and sr1-sr3 denotes the three "subjective" responses - i.e. I have everything I need, I just have to figure out how to collect responses from two different questions.

<trial off_beat>
/ stimulustimes = [0=clearscreen, remainingtrials, trialquestion, bgstim_audiosymbol, offbeat, response_offbeat, response_onbeat, sub_rating_txt, sr1, sr2, sr3]
/ validresponse = (response_offbeat, response_onbeat)
/ correctresponse = (response_offbeat)
/ inputdevice = mouse
/ posttrialpause = 1000
</trial>

No image is visible in your post. Please attach it properly.
What about now?

Still nothing. Please use +Insert -> Add File...

I've looked at the attachment. You can build an interface like this that from the participant's perspective appears as a single trial -- code-wise, however, it will involve multiple trials and some fairly complex logic.

Here's a quick draft of how code along those lines would have to be set up:

<defaults>
/ screencolor = lightgray
/ txbgcolor = transparent
/ canvasaspectratio = (4,3)
</defaults>

<values>
/ trialcount = 0
/ trialtype = ""
/ same_diff_response = ""
/ confidence = ""
</values>

<block example>
/ trials = [1-10 = noreplace(same, different)]
</block>

<trial same>
/ ontrialbegin = [
    values.trialcount += 1;
    values.trialtype = "same";
    values.confidence = "";
    values.same_diff_response = "";
    text.same.textcolor = white;
    text.different.textcolor = white;
    text.guess.textcolor = white;
    text.think_so.textcolor = white;
    text.sure.textcolor = white;
]
/ stimulusframes = [1=clearscreen, same_placeholder]
/ trialduration = 2000
/ recorddata = false
/ branch = [
    return trial.getresponses
]
</trial>

<trial different>
/ ontrialbegin = [
    values.trialcount += 1;
    values.trialtype = "different";
    values.confidence = "";
    values.same_diff_response = "";
    text.same.textcolor = white;
    text.different.textcolor = white;
    text.guess.textcolor = white;
    text.think_so.textcolor = white;
    text.sure.textcolor = white;
]
/ stimulusframes = [1=clearscreen, different_placeholder]
/ trialduration = 2000
/ recorddata = false
/ branch = [
    return trial.getresponses
]
</trial>

<text same_placeholder>
/ items = ("Imagine SAME melodies playing here...")
</text>

<text different_placeholder>
/ items = ("Imagine DIFFERENT melodies playing here...")
</text>

<trial getresponses>
/ stimulusframes = [1=clearscreen, q_same_diff, same, different, q_confidence, guess, think_so, sure]
/ validresponse = (same, different, guess, think_so, sure)
/ inputdevice = mouse
/ ontrialend = [
    if (trial.getresponses.response == "same"){
        values.same_diff_response = "same";
        text.same.textcolor = black;
        text.different.textcolor = white;
    };
    if (trial.getresponses.response == "different"){
        values.same_diff_response = "different";
        text.same.textcolor = white;
        text.different.textcolor = black;
    };
    if (trial.getresponses.response == "guess"){
        values.confidence = 1;
        text.guess.textcolor = black;
        text.think_so.textcolor = white;
        text.sure.textcolor = white;
    };
    if (trial.getresponses.response == "think_so"){
        values.confidence = 2;
        text.guess.textcolor = white;
        text.think_so.textcolor = black;
        text.sure.textcolor = white;
    };
    if (trial.getresponses.response == "sure"){
        values.confidence = 3;
        text.guess.textcolor = white;
        text.think_so.textcolor = white;
        text.sure.textcolor = black;
    };
]
/ recorddata = false
/ branch = [
    if (values.same_diff_response == "" || values.confidence == "") {
        return trial.getresponses;
    } else {
        return trial.logresponses;
    }
]
</trial>

<text q_same_diff>
/ items = ("Was the second tune the same melody as the first, despite being played at a different pitch?")
/ position = (50%, 20%)
/ erase = false
</text>

<text q_confidence>
/ items = ("How sure are you about this answer?")
/ position = (50%, 60%)
/ erase = false
</text>

<text different>
/ items = ("DIFFERENT")
/ txbgcolor = green
/ txcolor = white
/ erase = false
/ size = (25%, 12%)
/ position = (30%, 40%)
/ vjustify = center
</text>

<text same>
/ items = ("SAME")
/ txbgcolor = red
/ txcolor = white
/ erase = false
/ size = (25%, 12%)
/ position = (70%, 40%)
/ vjustify = center
</text>

<text guess>
/ items = ("I'm guessing")
/ txbgcolor = cornflowerblue
/ txcolor = white
/ erase = false
/ size = (25%, 12%)
/ position = (20%, 80%)
/ vjustify = center
</text>

<text think_so>
/ items = ("I think so")
/ txbgcolor = cornflowerblue
/ txcolor = white
/ erase = false
/ size = (25%, 12%)
/ position = (50%, 80%)
/ vjustify = center
</text>

<text sure>
/ items = ("I'm totally sure")
/ txbgcolor = cornflowerblue
/ txcolor = white
/ erase = false
/ size = (25%, 12%)
/ position = (80%, 80%)
/ vjustify = center
</text>

<trial logresponses>
/ stimulusframes = [1=q_same_diff, same, different, q_confidence, guess, think_so, sure]
/ validresponse = (0)
/ iscorrectresponse = [
    values.same_diff_response == values.trialtype;
]
/ trialduration = 500
</trial>

<data>
/ columns = (date time subject group session values.trialcount values.trialtype values.same_diff_response correct values.confidence)
</data>


Immensely grateful - thank you! 
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search