Click on image to play sound


Author
Message
abhi
abhi
Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)
Group: Forum Members
Posts: 114, Visits: 558
Dave - 4/22/2022
abhi - 4/22/2022
Dave - 4/17/2022
abhi - 4/17/2022
Hi, 

I need to show three images on the screen. Respondent has to click on all the images to listen to audio stimuli. And once he/she has listened to all, they can move on to the next block.

Can you please guide me to any script or post that will help in designing this?

Thanks

<block example>
/ onblockbegin = [
    list.responses.reset();
]
/ trials = [1=clicktrial]
</block>

<list responses>
</list>

<trial clicktrial>
/ ontrialend = [
    list.responses.appenditem(trial.clicktrial.response)
]
/ stimulusframes = [1=a, b, c]
/ inputdevice = mouse
/ validresponse = (a, b, c)
/ isvalidresponse = [
    list.responses.indexof(trial.clicktrial.response) == -1;
]
/ branch = [
    return trial.soundtrial;
]
</trial>

<trial soundtrial>
/ ontrialbegin = [
    trial.soundtrial.resetstimulusframes();
    if (trial.clicktrial.response == "a") {
        trial.soundtrial.insertstimulusframe(text.asound, 1);
    } else if (trial.clicktrial.response == "b") {
        trial.soundtrial.insertstimulusframe(text.bsound, 1);
    } else if (trial.clicktrial.response == "c") {
        trial.soundtrial.insertstimulusframe(text.csound, 1);
    };
]
/ trialduration = 2000
/ branch = [
    if (list.responses.itemcount < 3) {
        return trial.clicktrial;
    };
]
</trial>

<text a>
/ items = ("A")
/ position = (25%, 50%)
</text>

<text b>
/ items = ("B")
/ position = (50%, 50%)
</text>

<text c>
/ items = ("C")
/ position = (75%, 50%)
</text>

<text asound>
/ items = ("Imagine sound A playing...")
</text>

<text bsound>
/ items = ("Imagine sound B playing...")
</text>

<text csound>
/ items = ("Imagine sound C playing...")
</text>

Hi Dave,

In this is it possible that respondents can listen to a sound twice/thrice if they want.

How to use 'Clik here to go to the next block' but only after they finish listening to all the sounds.

Thanks.

<block example>
/ onblockbegin = [
    values.asound_listened_to = false;
    values.bsound_listened_to = false;
    values.csound_listened_to = false;
]
/ trials = [1=clicktrial]
</block>

<values>
/ asound_listened_to = false
/ bsound_listened_to = false
/ csound_listened_to = false
</values>

<trial clicktrial>
/ ontrialbegin = [
    trial.clicktrial.resetstimulusframes();
    if (values.asound_listened_to && values.bsound_listened_to && values.csound_listened_to) {
        trial.clicktrial.insertstimulusframe(button.done, 1);
    };
]
/ stimulusframes = [1=a, b, c]
/ inputdevice = mouse
/ validresponse = (a, b, c, done)
/ isvalidresponse = [
    if (trial.clicktrial.response == "done" && (!values.asound_listened_to || !values.bsound_listened_to || !values.csound_listened_to)) {
         return false;
    } else {
        return true;
    }
]
/ branch = [
    if (trial.clicktrial.response != "done") {
        return trial.soundtrial;
    };
]
</trial>

<trial soundtrial>
/ ontrialbegin = [
trial.soundtrial.resetstimulusframes();
if (trial.clicktrial.response == "a") {
trial.soundtrial.insertstimulusframe(text.asound, 1);
        values.asound_listened_to = true;
} else if (trial.clicktrial.response == "b") {
trial.soundtrial.insertstimulusframe(text.bsound, 1);
        values.bsound_listened_to = true;
} else if (trial.clicktrial.response == "c") {
trial.soundtrial.insertstimulusframe(text.csound, 1);
        values.csound_listened_to = true;
};
]
/ trialduration = 2000
/ branch = [
    return trial.clicktrial;
]
</trial>

<text a>
/ items = ("A")
/ position = (25%, 50%)
</text>

<text b>
/ items = ("B")
/ position = (50%, 50%)
</text>

<text c>
/ items = ("C")
/ position = (75%, 50%)
</text>

<button done>
/ caption = "Go to next block"
/ fontstyle = ("Arial", 3%)
/ size = (20%, 10%)
/ position = (50%, 90%)
</button>

<text asound>
/ items = ("Imagine sound A playing...")
</text>

<text bsound>
/ items = ("Imagine sound B playing...")
</text>

<text csound>
/ items = ("Imagine sound C playing...")
</text>

Thanks, Dave.

Working perfectly.
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: 13K, Visits: 104K
abhi - 4/22/2022
Dave - 4/17/2022
abhi - 4/17/2022
Hi, 

I need to show three images on the screen. Respondent has to click on all the images to listen to audio stimuli. And once he/she has listened to all, they can move on to the next block.

Can you please guide me to any script or post that will help in designing this?

Thanks

<block example>
/ onblockbegin = [
    list.responses.reset();
]
/ trials = [1=clicktrial]
</block>

<list responses>
</list>

<trial clicktrial>
/ ontrialend = [
    list.responses.appenditem(trial.clicktrial.response)
]
/ stimulusframes = [1=a, b, c]
/ inputdevice = mouse
/ validresponse = (a, b, c)
/ isvalidresponse = [
    list.responses.indexof(trial.clicktrial.response) == -1;
]
/ branch = [
    return trial.soundtrial;
]
</trial>

<trial soundtrial>
/ ontrialbegin = [
    trial.soundtrial.resetstimulusframes();
    if (trial.clicktrial.response == "a") {
        trial.soundtrial.insertstimulusframe(text.asound, 1);
    } else if (trial.clicktrial.response == "b") {
        trial.soundtrial.insertstimulusframe(text.bsound, 1);
    } else if (trial.clicktrial.response == "c") {
        trial.soundtrial.insertstimulusframe(text.csound, 1);
    };
]
/ trialduration = 2000
/ branch = [
    if (list.responses.itemcount < 3) {
        return trial.clicktrial;
    };
]
</trial>

<text a>
/ items = ("A")
/ position = (25%, 50%)
</text>

<text b>
/ items = ("B")
/ position = (50%, 50%)
</text>

<text c>
/ items = ("C")
/ position = (75%, 50%)
</text>

<text asound>
/ items = ("Imagine sound A playing...")
</text>

<text bsound>
/ items = ("Imagine sound B playing...")
</text>

<text csound>
/ items = ("Imagine sound C playing...")
</text>

Hi Dave,

In this is it possible that respondents can listen to a sound twice/thrice if they want.

How to use 'Clik here to go to the next block' but only after they finish listening to all the sounds.

Thanks.

<block example>
/ onblockbegin = [
    values.asound_listened_to = false;
    values.bsound_listened_to = false;
    values.csound_listened_to = false;
]
/ trials = [1=clicktrial]
</block>

<values>
/ asound_listened_to = false
/ bsound_listened_to = false
/ csound_listened_to = false
</values>

<trial clicktrial>
/ ontrialbegin = [
    trial.clicktrial.resetstimulusframes();
    if (values.asound_listened_to && values.bsound_listened_to && values.csound_listened_to) {
        trial.clicktrial.insertstimulusframe(button.done, 1);
    };
]
/ stimulusframes = [1=a, b, c]
/ inputdevice = mouse
/ validresponse = (a, b, c, done)
/ isvalidresponse = [
    if (trial.clicktrial.response == "done" && (!values.asound_listened_to || !values.bsound_listened_to || !values.csound_listened_to)) {
         return false;
    } else {
        return true;
    }
]
/ branch = [
    if (trial.clicktrial.response != "done") {
        return trial.soundtrial;
    };
]
</trial>

<trial soundtrial>
/ ontrialbegin = [
trial.soundtrial.resetstimulusframes();
if (trial.clicktrial.response == "a") {
trial.soundtrial.insertstimulusframe(text.asound, 1);
        values.asound_listened_to = true;
} else if (trial.clicktrial.response == "b") {
trial.soundtrial.insertstimulusframe(text.bsound, 1);
        values.bsound_listened_to = true;
} else if (trial.clicktrial.response == "c") {
trial.soundtrial.insertstimulusframe(text.csound, 1);
        values.csound_listened_to = true;
};
]
/ trialduration = 2000
/ branch = [
    return trial.clicktrial;
]
</trial>

<text a>
/ items = ("A")
/ position = (25%, 50%)
</text>

<text b>
/ items = ("B")
/ position = (50%, 50%)
</text>

<text c>
/ items = ("C")
/ position = (75%, 50%)
</text>

<button done>
/ caption = "Go to next block"
/ fontstyle = ("Arial", 3%)
/ size = (20%, 10%)
/ position = (50%, 90%)
</button>

<text asound>
/ items = ("Imagine sound A playing...")
</text>

<text bsound>
/ items = ("Imagine sound B playing...")
</text>

<text csound>
/ items = ("Imagine sound C playing...")
</text>

abhi
abhi
Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)
Group: Forum Members
Posts: 114, Visits: 558
Dave - 4/17/2022
abhi - 4/17/2022
Hi, 

I need to show three images on the screen. Respondent has to click on all the images to listen to audio stimuli. And once he/she has listened to all, they can move on to the next block.

Can you please guide me to any script or post that will help in designing this?

Thanks

<block example>
/ onblockbegin = [
    list.responses.reset();
]
/ trials = [1=clicktrial]
</block>

<list responses>
</list>

<trial clicktrial>
/ ontrialend = [
    list.responses.appenditem(trial.clicktrial.response)
]
/ stimulusframes = [1=a, b, c]
/ inputdevice = mouse
/ validresponse = (a, b, c)
/ isvalidresponse = [
    list.responses.indexof(trial.clicktrial.response) == -1;
]
/ branch = [
    return trial.soundtrial;
]
</trial>

<trial soundtrial>
/ ontrialbegin = [
    trial.soundtrial.resetstimulusframes();
    if (trial.clicktrial.response == "a") {
        trial.soundtrial.insertstimulusframe(text.asound, 1);
    } else if (trial.clicktrial.response == "b") {
        trial.soundtrial.insertstimulusframe(text.bsound, 1);
    } else if (trial.clicktrial.response == "c") {
        trial.soundtrial.insertstimulusframe(text.csound, 1);
    };
]
/ trialduration = 2000
/ branch = [
    if (list.responses.itemcount < 3) {
        return trial.clicktrial;
    };
]
</trial>

<text a>
/ items = ("A")
/ position = (25%, 50%)
</text>

<text b>
/ items = ("B")
/ position = (50%, 50%)
</text>

<text c>
/ items = ("C")
/ position = (75%, 50%)
</text>

<text asound>
/ items = ("Imagine sound A playing...")
</text>

<text bsound>
/ items = ("Imagine sound B playing...")
</text>

<text csound>
/ items = ("Imagine sound C playing...")
</text>

Hi Dave,

In this is it possible that respondents can listen to a sound twice/thrice if they want.

How to use 'Clik here to go to the next block' but only after they finish listening to all the sounds.

Thanks.

abhi
abhi
Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)
Group: Forum Members
Posts: 114, Visits: 558
Thanks Dave.


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: 13K, Visits: 104K
abhi - 4/17/2022
Hi, 

I need to show three images on the screen. Respondent has to click on all the images to listen to audio stimuli. And once he/she has listened to all, they can move on to the next block.

Can you please guide me to any script or post that will help in designing this?

Thanks

<block example>
/ onblockbegin = [
    list.responses.reset();
]
/ trials = [1=clicktrial]
</block>

<list responses>
</list>

<trial clicktrial>
/ ontrialend = [
    list.responses.appenditem(trial.clicktrial.response)
]
/ stimulusframes = [1=a, b, c]
/ inputdevice = mouse
/ validresponse = (a, b, c)
/ isvalidresponse = [
    list.responses.indexof(trial.clicktrial.response) == -1;
]
/ branch = [
    return trial.soundtrial;
]
</trial>

<trial soundtrial>
/ ontrialbegin = [
    trial.soundtrial.resetstimulusframes();
    if (trial.clicktrial.response == "a") {
        trial.soundtrial.insertstimulusframe(text.asound, 1);
    } else if (trial.clicktrial.response == "b") {
        trial.soundtrial.insertstimulusframe(text.bsound, 1);
    } else if (trial.clicktrial.response == "c") {
        trial.soundtrial.insertstimulusframe(text.csound, 1);
    };
]
/ trialduration = 2000
/ branch = [
    if (list.responses.itemcount < 3) {
        return trial.clicktrial;
    };
]
</trial>

<text a>
/ items = ("A")
/ position = (25%, 50%)
</text>

<text b>
/ items = ("B")
/ position = (50%, 50%)
</text>

<text c>
/ items = ("C")
/ position = (75%, 50%)
</text>

<text asound>
/ items = ("Imagine sound A playing...")
</text>

<text bsound>
/ items = ("Imagine sound B playing...")
</text>

<text csound>
/ items = ("Imagine sound C playing...")
</text>

abhi
abhi
Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)Guru (7.5K reputation)
Group: Forum Members
Posts: 114, Visits: 558
Hi, 

I need to show three images on the screen. Respondent has to click on all the images to listen to audio stimuli. And once he/she has listened to all, they can move on to the next block.

Can you please guide me to any script or post that will help in designing this?

Thanks
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search