Video Loop ad infinitum


Author
Message
AnthonyFCollinsSussex
AnthonyFCollinsSussex
Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)
Group: Forum Members
Posts: 52, Visits: 249
Hi there
I hope all is well?

I am struggling with two key issues I need to resolve before making my final experiment live, I was hoping to ask for some support after some marked attempts:

1. Participants are aurally presented with 50 everyday ambiguous scenarios. For a given scenario, once audio is finished, they are prompted with a textual comprehension question (requiring a yes/no response), followed by correct/incorrect feedback (depending upon their response). This all works fine. However, they also need to do a breathing exercise for 2 minutes (in a separate trial depicted by a breathing pacer animation), and this should occur after every 10 scenarios. I have the code in place to branch after the 10th scenario's feedback trial, but I do not know how to adapt it so that this breathing trial is interspersed after every 10 scenarios (e.g., 20th, 30th etc). How to change == 10 to something elegant enough to arrive after every 10 scenarios of the 50:

<trial correctfeed>
/ontrialbegin = [values.numberoftrialsrun= values.numberoftrialsrun+ 1]
/branch = [if (values.numberoftrialsrun == 10) trial.breathcount]
/ stimulusframes = [1=text.correctfeed]
/ trialduration = 950
/ showmousecursor = false
/ recorddata = false
</trial>

<trial incorrectfeed>
/ontrialbegin = [values.numberoftrialsrun= values.numberoftrialsrun+ 1]
/branch = [if (values.numberoftrialsrun == 10) trial.breathcount]
/ stimulusframes = [1=text.incorrectfeed]
/ trialduration = 950
/ showmousecursor = false
/ recorddata = false
</trial>


2. During the 2 minute breathing trial, a giff is presented on loop, the giff is a bar that rises and then falls as the breathing pacer. If I do not loop the giff, it goes up and down only once. So, if I want participants to engage with it for 2 minutes, the giff must be on loop to continue its animation. However, this results in the giff looping forever, even when I set the breathing trial itself to two minutes (via timeout or trial duration) - the loop seems to override the trial's specified duration, and does not terminate. i also tried to amend stimulusframes to stimulustimes, but does not rectify this issue. Participants need not press anything in this two minute period, merely see the pacer on screen. After two minutes, it should resume back to the next ambiguous scenario (according to above) until another 10 scenarios have passed, and so on. The only solution I can think of is pre-recording the giff animation for 2 minutes, and presenting this instead, albeit this is sub-optimal due to refresh-rate precision of the bar's movement. The giff provides a reasonably unlaggy motion, hence my desire to keep it if possible.

<video 6BPM>
/ items = ("6BPMGIF.gif")
/ playthrough = true
/ loop = true
/ position = (49.4, 65)
/ stream = false
/ size = (300, 300)
</video>

<trial breath>
/ stimulusframes= [1=video.6BPM]
/ recorddata = false
/ response = noresponse
/ trialduration = 120000
</trial>

I would truly appreciate your help and guidance on how best to proceed

Many thanks in advance
AC



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: 98K
AnthonyFCollinsSussex - 3/31/2022
Hi there
I hope all is well?

I am struggling with two key issues I need to resolve before making my final experiment live, I was hoping to ask for some support after some marked attempts:

1. Participants are aurally presented with 50 everyday ambiguous scenarios. For a given scenario, once audio is finished, they are prompted with a textual comprehension question (requiring a yes/no response), followed by correct/incorrect feedback (depending upon their response). This all works fine. However, they also need to do a breathing exercise for 2 minutes (in a separate trial depicted by a breathing pacer animation), and this should occur after every 10 scenarios. I have the code in place to branch after the 10th scenario's feedback trial, but I do not know how to adapt it so that this breathing trial is interspersed after every 10 scenarios (e.g., 20th, 30th etc). How to change == 10 to something elegant enough to arrive after every 10 scenarios of the 50:

<trial correctfeed>
/ontrialbegin = [values.numberoftrialsrun= values.numberoftrialsrun+ 1]
/branch = [if (values.numberoftrialsrun == 10) trial.breathcount]
/ stimulusframes = [1=text.correctfeed]
/ trialduration = 950
/ showmousecursor = false
/ recorddata = false
</trial>

<trial incorrectfeed>
/ontrialbegin = [values.numberoftrialsrun= values.numberoftrialsrun+ 1]
/branch = [if (values.numberoftrialsrun == 10) trial.breathcount]
/ stimulusframes = [1=text.incorrectfeed]
/ trialduration = 950
/ showmousecursor = false
/ recorddata = false
</trial>


2. During the 2 minute breathing trial, a giff is presented on loop, the giff is a bar that rises and then falls as the breathing pacer. If I do not loop the giff, it goes up and down only once. So, if I want participants to engage with it for 2 minutes, the giff must be on loop to continue its animation. However, this results in the giff looping forever, even when I set the breathing trial itself to two minutes (via timeout or trial duration) - the loop seems to override the trial's specified duration, and does not terminate. i also tried to amend stimulusframes to stimulustimes, but does not rectify this issue. Participants need not press anything in this two minute period, merely see the pacer on screen. After two minutes, it should resume back to the next ambiguous scenario (according to above) until another 10 scenarios have passed, and so on. The only solution I can think of is pre-recording the giff animation for 2 minutes, and presenting this instead, albeit this is sub-optimal due to refresh-rate precision of the bar's movement. The giff provides a reasonably unlaggy motion, hence my desire to keep it if possible.

<video 6BPM>
/ items = ("6BPMGIF.gif")
/ playthrough = true
/ loop = true
/ position = (49.4, 65)
/ stream = false
/ size = (300, 300)
</video>

<trial breath>
/ stimulusframes= [1=video.6BPM]
/ recorddata = false
/ response = noresponse
/ trialduration = 120000
</trial>

I would truly appreciate your help and guidance on how best to proceed

Many thanks in advance
AC



> How to change == 10 to something elegant enough to arrive after every 10 scenarios of the 50

Modular arithmetic is your friend. Use the mod() function.

Can't say anything about the GIF, since you have not provided it. One guess: The GIF is self-looping. Perhpas try using a different kind of video format.

Edited 2 Years Ago by 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: 12K, Visits: 98K
Dave - 3/31/2022
AnthonyFCollinsSussex - 3/31/2022
Hi there
I hope all is well?

I am struggling with two key issues I need to resolve before making my final experiment live, I was hoping to ask for some support after some marked attempts:

1. Participants are aurally presented with 50 everyday ambiguous scenarios. For a given scenario, once audio is finished, they are prompted with a textual comprehension question (requiring a yes/no response), followed by correct/incorrect feedback (depending upon their response). This all works fine. However, they also need to do a breathing exercise for 2 minutes (in a separate trial depicted by a breathing pacer animation), and this should occur after every 10 scenarios. I have the code in place to branch after the 10th scenario's feedback trial, but I do not know how to adapt it so that this breathing trial is interspersed after every 10 scenarios (e.g., 20th, 30th etc). How to change == 10 to something elegant enough to arrive after every 10 scenarios of the 50:

<trial correctfeed>
/ontrialbegin = [values.numberoftrialsrun= values.numberoftrialsrun+ 1]
/branch = [if (values.numberoftrialsrun == 10) trial.breathcount]
/ stimulusframes = [1=text.correctfeed]
/ trialduration = 950
/ showmousecursor = false
/ recorddata = false
</trial>

<trial incorrectfeed>
/ontrialbegin = [values.numberoftrialsrun= values.numberoftrialsrun+ 1]
/branch = [if (values.numberoftrialsrun == 10) trial.breathcount]
/ stimulusframes = [1=text.incorrectfeed]
/ trialduration = 950
/ showmousecursor = false
/ recorddata = false
</trial>


2. During the 2 minute breathing trial, a giff is presented on loop, the giff is a bar that rises and then falls as the breathing pacer. If I do not loop the giff, it goes up and down only once. So, if I want participants to engage with it for 2 minutes, the giff must be on loop to continue its animation. However, this results in the giff looping forever, even when I set the breathing trial itself to two minutes (via timeout or trial duration) - the loop seems to override the trial's specified duration, and does not terminate. i also tried to amend stimulusframes to stimulustimes, but does not rectify this issue. Participants need not press anything in this two minute period, merely see the pacer on screen. After two minutes, it should resume back to the next ambiguous scenario (according to above) until another 10 scenarios have passed, and so on. The only solution I can think of is pre-recording the giff animation for 2 minutes, and presenting this instead, albeit this is sub-optimal due to refresh-rate precision of the bar's movement. The giff provides a reasonably unlaggy motion, hence my desire to keep it if possible.

<video 6BPM>
/ items = ("6BPMGIF.gif")
/ playthrough = true
/ loop = true
/ position = (49.4, 65)
/ stream = false
/ size = (300, 300)
</video>

<trial breath>
/ stimulusframes= [1=video.6BPM]
/ recorddata = false
/ response = noresponse
/ trialduration = 120000
</trial>

I would truly appreciate your help and guidance on how best to proceed

Many thanks in advance
AC



> How to change == 10 to something elegant enough to arrive after every 10 scenarios of the 50

Modular arithmetic is your friend. Use the mod() function.

Can't say anything about the GIF, since you have not provided it. One guess: The GIF is self-looping. Perhpas try using a different kind of video format.

One more thing:

<video 6BPM>
/ items = ("6BPMGIF.gif")
/ playthrough = true
/ loop = true
/ position = (49.4, 65)
/ stream = false
/ size = (300, 300)
</video>

Why is playthrough set to true? This doesn't seem to make sense if you want the trial to end after 2 minutes.
AnthonyFCollinsSussex
AnthonyFCollinsSussex
Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)
Group: Forum Members
Posts: 52, Visits: 249
Dave - 3/31/2022
Dave - 3/31/2022
AnthonyFCollinsSussex - 3/31/2022
Hi there
I hope all is well?

I am struggling with two key issues I need to resolve before making my final experiment live, I was hoping to ask for some support after some marked attempts:

1. Participants are aurally presented with 50 everyday ambiguous scenarios. For a given scenario, once audio is finished, they are prompted with a textual comprehension question (requiring a yes/no response), followed by correct/incorrect feedback (depending upon their response). This all works fine. However, they also need to do a breathing exercise for 2 minutes (in a separate trial depicted by a breathing pacer animation), and this should occur after every 10 scenarios. I have the code in place to branch after the 10th scenario's feedback trial, but I do not know how to adapt it so that this breathing trial is interspersed after every 10 scenarios (e.g., 20th, 30th etc). How to change == 10 to something elegant enough to arrive after every 10 scenarios of the 50:

<trial correctfeed>
/ontrialbegin = [values.numberoftrialsrun= values.numberoftrialsrun+ 1]
/branch = [if (values.numberoftrialsrun == 10) trial.breathcount]
/ stimulusframes = [1=text.correctfeed]
/ trialduration = 950
/ showmousecursor = false
/ recorddata = false
</trial>

<trial incorrectfeed>
/ontrialbegin = [values.numberoftrialsrun= values.numberoftrialsrun+ 1]
/branch = [if (values.numberoftrialsrun == 10) trial.breathcount]
/ stimulusframes = [1=text.incorrectfeed]
/ trialduration = 950
/ showmousecursor = false
/ recorddata = false
</trial>


2. During the 2 minute breathing trial, a giff is presented on loop, the giff is a bar that rises and then falls as the breathing pacer. If I do not loop the giff, it goes up and down only once. So, if I want participants to engage with it for 2 minutes, the giff must be on loop to continue its animation. However, this results in the giff looping forever, even when I set the breathing trial itself to two minutes (via timeout or trial duration) - the loop seems to override the trial's specified duration, and does not terminate. i also tried to amend stimulusframes to stimulustimes, but does not rectify this issue. Participants need not press anything in this two minute period, merely see the pacer on screen. After two minutes, it should resume back to the next ambiguous scenario (according to above) until another 10 scenarios have passed, and so on. The only solution I can think of is pre-recording the giff animation for 2 minutes, and presenting this instead, albeit this is sub-optimal due to refresh-rate precision of the bar's movement. The giff provides a reasonably unlaggy motion, hence my desire to keep it if possible.

<video 6BPM>
/ items = ("6BPMGIF.gif")
/ playthrough = true
/ loop = true
/ position = (49.4, 65)
/ stream = false
/ size = (300, 300)
</video>

<trial breath>
/ stimulusframes= [1=video.6BPM]
/ recorddata = false
/ response = noresponse
/ trialduration = 120000
</trial>

I would truly appreciate your help and guidance on how best to proceed

Many thanks in advance
AC



> How to change == 10 to something elegant enough to arrive after every 10 scenarios of the 50

Modular arithmetic is your friend. Use the mod() function.

Can't say anything about the GIF, since you have not provided it. One guess: The GIF is self-looping. Perhpas try using a different kind of video format.

One more thing:

<video 6BPM>
/ items = ("6BPMGIF.gif")
/ playthrough = true
/ loop = true
/ position = (49.4, 65)
/ stream = false
/ size = (300, 300)
</video>

Why is playthrough set to true? This doesn't seem to make sense if you want the trial to end after 2 minutes.

Hi Dave
TY for your swift reply, much appreciated.

So when I set playback to false, whilst the trial indeed ends at the specified time, the giff does not display itself now. Also, the giff is self looping (though if setting loop to false in inquisit, the giff does not loop it's animation!) I attach it here
Attachments
6BPMGIF.gif (107 views, 90.00 KB)
AnthonyFCollinsSussex
AnthonyFCollinsSussex
Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)
Group: Forum Members
Posts: 52, Visits: 249
Dave - 3/31/2022
Dave - 3/31/2022
AnthonyFCollinsSussex - 3/31/2022
Hi there
I hope all is well?

I am struggling with two key issues I need to resolve before making my final experiment live, I was hoping to ask for some support after some marked attempts:

1. Participants are aurally presented with 50 everyday ambiguous scenarios. For a given scenario, once audio is finished, they are prompted with a textual comprehension question (requiring a yes/no response), followed by correct/incorrect feedback (depending upon their response). This all works fine. However, they also need to do a breathing exercise for 2 minutes (in a separate trial depicted by a breathing pacer animation), and this should occur after every 10 scenarios. I have the code in place to branch after the 10th scenario's feedback trial, but I do not know how to adapt it so that this breathing trial is interspersed after every 10 scenarios (e.g., 20th, 30th etc). How to change == 10 to something elegant enough to arrive after every 10 scenarios of the 50:

<trial correctfeed>
/ontrialbegin = [values.numberoftrialsrun= values.numberoftrialsrun+ 1]
/branch = [if (values.numberoftrialsrun == 10) trial.breathcount]
/ stimulusframes = [1=text.correctfeed]
/ trialduration = 950
/ showmousecursor = false
/ recorddata = false
</trial>

<trial incorrectfeed>
/ontrialbegin = [values.numberoftrialsrun= values.numberoftrialsrun+ 1]
/branch = [if (values.numberoftrialsrun == 10) trial.breathcount]
/ stimulusframes = [1=text.incorrectfeed]
/ trialduration = 950
/ showmousecursor = false
/ recorddata = false
</trial>


2. During the 2 minute breathing trial, a giff is presented on loop, the giff is a bar that rises and then falls as the breathing pacer. If I do not loop the giff, it goes up and down only once. So, if I want participants to engage with it for 2 minutes, the giff must be on loop to continue its animation. However, this results in the giff looping forever, even when I set the breathing trial itself to two minutes (via timeout or trial duration) - the loop seems to override the trial's specified duration, and does not terminate. i also tried to amend stimulusframes to stimulustimes, but does not rectify this issue. Participants need not press anything in this two minute period, merely see the pacer on screen. After two minutes, it should resume back to the next ambiguous scenario (according to above) until another 10 scenarios have passed, and so on. The only solution I can think of is pre-recording the giff animation for 2 minutes, and presenting this instead, albeit this is sub-optimal due to refresh-rate precision of the bar's movement. The giff provides a reasonably unlaggy motion, hence my desire to keep it if possible.

<video 6BPM>
/ items = ("6BPMGIF.gif")
/ playthrough = true
/ loop = true
/ position = (49.4, 65)
/ stream = false
/ size = (300, 300)
</video>

<trial breath>
/ stimulusframes= [1=video.6BPM]
/ recorddata = false
/ response = noresponse
/ trialduration = 120000
</trial>

I would truly appreciate your help and guidance on how best to proceed

Many thanks in advance
AC



> How to change == 10 to something elegant enough to arrive after every 10 scenarios of the 50

Modular arithmetic is your friend. Use the mod() function.

Can't say anything about the GIF, since you have not provided it. One guess: The GIF is self-looping. Perhpas try using a different kind of video format.

One more thing:

<video 6BPM>
/ items = ("6BPMGIF.gif")
/ playthrough = true
/ loop = true
/ position = (49.4, 65)
/ stream = false
/ size = (300, 300)
</video>

Why is playthrough set to true? This doesn't seem to make sense if you want the trial to end after 2 minutes.

I hate to be a pain, can I clarify (as I cannot find an example on the forums on inquisit page) can i implement the mod() within the branch function : /branch = [if (values.numberoftrialsrun == mod(50, 5) trial.breathcount]

Best
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: 98K
AnthonyFCollinsSussex - 3/31/2022
Dave - 3/31/2022
Dave - 3/31/2022
AnthonyFCollinsSussex - 3/31/2022
Hi there
I hope all is well?

I am struggling with two key issues I need to resolve before making my final experiment live, I was hoping to ask for some support after some marked attempts:

1. Participants are aurally presented with 50 everyday ambiguous scenarios. For a given scenario, once audio is finished, they are prompted with a textual comprehension question (requiring a yes/no response), followed by correct/incorrect feedback (depending upon their response). This all works fine. However, they also need to do a breathing exercise for 2 minutes (in a separate trial depicted by a breathing pacer animation), and this should occur after every 10 scenarios. I have the code in place to branch after the 10th scenario's feedback trial, but I do not know how to adapt it so that this breathing trial is interspersed after every 10 scenarios (e.g., 20th, 30th etc). How to change == 10 to something elegant enough to arrive after every 10 scenarios of the 50:

<trial correctfeed>
/ontrialbegin = [values.numberoftrialsrun= values.numberoftrialsrun+ 1]
/branch = [if (values.numberoftrialsrun == 10) trial.breathcount]
/ stimulusframes = [1=text.correctfeed]
/ trialduration = 950
/ showmousecursor = false
/ recorddata = false
</trial>

<trial incorrectfeed>
/ontrialbegin = [values.numberoftrialsrun= values.numberoftrialsrun+ 1]
/branch = [if (values.numberoftrialsrun == 10) trial.breathcount]
/ stimulusframes = [1=text.incorrectfeed]
/ trialduration = 950
/ showmousecursor = false
/ recorddata = false
</trial>


2. During the 2 minute breathing trial, a giff is presented on loop, the giff is a bar that rises and then falls as the breathing pacer. If I do not loop the giff, it goes up and down only once. So, if I want participants to engage with it for 2 minutes, the giff must be on loop to continue its animation. However, this results in the giff looping forever, even when I set the breathing trial itself to two minutes (via timeout or trial duration) - the loop seems to override the trial's specified duration, and does not terminate. i also tried to amend stimulusframes to stimulustimes, but does not rectify this issue. Participants need not press anything in this two minute period, merely see the pacer on screen. After two minutes, it should resume back to the next ambiguous scenario (according to above) until another 10 scenarios have passed, and so on. The only solution I can think of is pre-recording the giff animation for 2 minutes, and presenting this instead, albeit this is sub-optimal due to refresh-rate precision of the bar's movement. The giff provides a reasonably unlaggy motion, hence my desire to keep it if possible.

<video 6BPM>
/ items = ("6BPMGIF.gif")
/ playthrough = true
/ loop = true
/ position = (49.4, 65)
/ stream = false
/ size = (300, 300)
</video>

<trial breath>
/ stimulusframes= [1=video.6BPM]
/ recorddata = false
/ response = noresponse
/ trialduration = 120000
</trial>

I would truly appreciate your help and guidance on how best to proceed

Many thanks in advance
AC



> How to change == 10 to something elegant enough to arrive after every 10 scenarios of the 50

Modular arithmetic is your friend. Use the mod() function.

Can't say anything about the GIF, since you have not provided it. One guess: The GIF is self-looping. Perhpas try using a different kind of video format.

One more thing:

<video 6BPM>
/ items = ("6BPMGIF.gif")
/ playthrough = true
/ loop = true
/ position = (49.4, 65)
/ stream = false
/ size = (300, 300)
</video>

Why is playthrough set to true? This doesn't seem to make sense if you want the trial to end after 2 minutes.

I hate to be a pain, can I clarify (as I cannot find an example on the forums on inquisit page) can i implement the mod() within the branch function : /branch = [if (values.numberoftrialsrun == mod(50, 5) trial.breathcount]

Best

Eh, the GIF thing has to do with how GIFs, which are expanded into stimulusframes, interact with the /response attribute. Long story short, do

<trial breath>
/ stimulusframes= [1=video.6BPM]
/ recorddata = false
/ validresponse = (0)
/ trialduration = 120000
</trial>

<video 6BPM>
/ items = ("6BPMGIF.gif")
/ playthrough = false
/ loop = true
/ position = (49.4%, 65%)
/ size = (300, 300)
</video>

and things should work.

As for the mod() function, it works like in any other programming language. It's not hard:

<block myblock>
/ trials = [1-50 = mytrial]
</block>

<values>
/ trialcount = 0
</values>

<trial mytrial>
/ ontrialbegin = [
    values.trialcount += 1;
]
/ stimulusframes = [1=mytext]
/ validresponse = (57)
/ branch = [
    if (mod(values.trialcount, 10) == 0) {
        trial.breaktrial;
    };
]
</trial>

<trial breaktrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("<%values.trialcount%> <%script.currenttrial%>")
</text>


AnthonyFCollinsSussex
AnthonyFCollinsSussex
Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)Partner Member (665 reputation)
Group: Forum Members
Posts: 52, Visits: 249
Dave - 3/31/2022
AnthonyFCollinsSussex - 3/31/2022
Dave - 3/31/2022
Dave - 3/31/2022
AnthonyFCollinsSussex - 3/31/2022
Hi there
I hope all is well?

I am struggling with two key issues I need to resolve before making my final experiment live, I was hoping to ask for some support after some marked attempts:

1. Participants are aurally presented with 50 everyday ambiguous scenarios. For a given scenario, once audio is finished, they are prompted with a textual comprehension question (requiring a yes/no response), followed by correct/incorrect feedback (depending upon their response). This all works fine. However, they also need to do a breathing exercise for 2 minutes (in a separate trial depicted by a breathing pacer animation), and this should occur after every 10 scenarios. I have the code in place to branch after the 10th scenario's feedback trial, but I do not know how to adapt it so that this breathing trial is interspersed after every 10 scenarios (e.g., 20th, 30th etc). How to change == 10 to something elegant enough to arrive after every 10 scenarios of the 50:

<trial correctfeed>
/ontrialbegin = [values.numberoftrialsrun= values.numberoftrialsrun+ 1]
/branch = [if (values.numberoftrialsrun == 10) trial.breathcount]
/ stimulusframes = [1=text.correctfeed]
/ trialduration = 950
/ showmousecursor = false
/ recorddata = false
</trial>

<trial incorrectfeed>
/ontrialbegin = [values.numberoftrialsrun= values.numberoftrialsrun+ 1]
/branch = [if (values.numberoftrialsrun == 10) trial.breathcount]
/ stimulusframes = [1=text.incorrectfeed]
/ trialduration = 950
/ showmousecursor = false
/ recorddata = false
</trial>


2. During the 2 minute breathing trial, a giff is presented on loop, the giff is a bar that rises and then falls as the breathing pacer. If I do not loop the giff, it goes up and down only once. So, if I want participants to engage with it for 2 minutes, the giff must be on loop to continue its animation. However, this results in the giff looping forever, even when I set the breathing trial itself to two minutes (via timeout or trial duration) - the loop seems to override the trial's specified duration, and does not terminate. i also tried to amend stimulusframes to stimulustimes, but does not rectify this issue. Participants need not press anything in this two minute period, merely see the pacer on screen. After two minutes, it should resume back to the next ambiguous scenario (according to above) until another 10 scenarios have passed, and so on. The only solution I can think of is pre-recording the giff animation for 2 minutes, and presenting this instead, albeit this is sub-optimal due to refresh-rate precision of the bar's movement. The giff provides a reasonably unlaggy motion, hence my desire to keep it if possible.

<video 6BPM>
/ items = ("6BPMGIF.gif")
/ playthrough = true
/ loop = true
/ position = (49.4, 65)
/ stream = false
/ size = (300, 300)
</video>

<trial breath>
/ stimulusframes= [1=video.6BPM]
/ recorddata = false
/ response = noresponse
/ trialduration = 120000
</trial>

I would truly appreciate your help and guidance on how best to proceed

Many thanks in advance
AC



> How to change == 10 to something elegant enough to arrive after every 10 scenarios of the 50

Modular arithmetic is your friend. Use the mod() function.

Can't say anything about the GIF, since you have not provided it. One guess: The GIF is self-looping. Perhpas try using a different kind of video format.

One more thing:

<video 6BPM>
/ items = ("6BPMGIF.gif")
/ playthrough = true
/ loop = true
/ position = (49.4, 65)
/ stream = false
/ size = (300, 300)
</video>

Why is playthrough set to true? This doesn't seem to make sense if you want the trial to end after 2 minutes.

I hate to be a pain, can I clarify (as I cannot find an example on the forums on inquisit page) can i implement the mod() within the branch function : /branch = [if (values.numberoftrialsrun == mod(50, 5) trial.breathcount]

Best

Eh, the GIF thing has to do with how GIFs, which are expanded into stimulusframes, interact with the /response attribute. Long story short, do

<trial breath>
/ stimulusframes= [1=video.6BPM]
/ recorddata = false
/ validresponse = (0)
/ trialduration = 120000
</trial>

<video 6BPM>
/ items = ("6BPMGIF.gif")
/ playthrough = false
/ loop = true
/ position = (49.4%, 65%)
/ size = (300, 300)
</video>

and things should work.

As for the mod() function, it works like in any other programming language. It's not hard:

<block myblock>
/ trials = [1-50 = mytrial]
</block>

<values>
/ trialcount = 0
</values>

<trial mytrial>
/ ontrialbegin = [
    values.trialcount += 1;
]
/ stimulusframes = [1=mytext]
/ validresponse = (57)
/ branch = [
    if (mod(values.trialcount, 10) == 0) {
        trial.breaktrial;
    };
]
</trial>

<trial breaktrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("<%values.trialcount%> <%script.currenttrial%>")
</text>


I can't begin to tell you how helpful this is, thank you alot. The video/giff works as it should now. I will also implement the mod() code you kindly provide here, Cheers!

Yours Sincerely
AC
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search