Adding a Time Counter


Author
Message
Brainsrule
Brainsrule
Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)
Group: Forum Members
Posts: 9, Visits: 45
Hello Everyone, 

I've downloaded Inquisit lab 5 , the BART, and the BART-Y scripts. Everything runs well, but I would like to add a small counter to the upper right hand corner of the BART task screen . 
What I would like is a basic counter that starts as soon as the subject starts the task, and counts down from 10:00 minutes (or 15:00) to 00:00. Once it hits 00:00, I would like the numbers to turn red. 

Does anyone have any pointers they could give me on how to do this?
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
Brainsrule - Thursday, December 01, 2016
Hello Everyone, 

I've downloaded Inquisit lab 5 , the BART, and the BART-Y scripts. Everything runs well, but I would like to add a small counter to the upper right hand corner of the BART task screen . 
What I would like is a basic counter that starts as soon as the subject starts the task, and counts down from 10:00 minutes (or 15:00) to 00:00. Once it hits 00:00, I would like the numbers to turn red. 

Does anyone have any pointers they could give me on how to do this?

You'll want to add a <clock> element to the script and display it (probably via the <block>'s /bgstim). Configure it to count down from the desired amount of time.

https://www.millisecond.com/support/docs/v5/html/language/elements/clock.htm

Brainsrule
Brainsrule
Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)
Group: Forum Members
Posts: 9, Visits: 45
Dave - Thursday, December 01, 2016
Brainsrule - Thursday, December 01, 2016
Hello Everyone, 

I've downloaded Inquisit lab 5 , the BART, and the BART-Y scripts. Everything runs well, but I would like to add a small counter to the upper right hand corner of the BART task screen . 
What I would like is a basic counter that starts as soon as the subject starts the task, and counts down from 10:00 minutes (or 15:00) to 00:00. Once it hits 00:00, I would like the numbers to turn red. 

Does anyone have any pointers they could give me on how to do this?

You'll want to add a <clock> element to the script and display it (probably via the <block>'s /bgstim). Configure it to count down from the desired amount of time.

https://www.millisecond.com/support/docs/v5/html/language/elements/clock.htm

So I wrote this :
<clock timer>
/ format = "mm :ss"
/ mode = timer
/ erase = false
/ monitor = 1
/ position = (50%, 10%)
/ resetrate = block
/ timeout = 600000
/ txbgcolor = black
/ txcolor = red
/ vposition = 5
/ hposition = 95
</clock>

and when i run element I can see the output exactly as I want it, but when I try run it in the test monkey, I see nothing. What may be the problem, is it not displaying properly with the BART images ? 

Also, how do I exit out early from the test monkey and an experiment- I tried the Esc key and it did not work

Thank you very much for your help
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
Brainsrule - Thursday, December 01, 2016
Dave - Thursday, December 01, 2016
Brainsrule - Thursday, December 01, 2016
Hello Everyone, 

I've downloaded Inquisit lab 5 , the BART, and the BART-Y scripts. Everything runs well, but I would like to add a small counter to the upper right hand corner of the BART task screen . 
What I would like is a basic counter that starts as soon as the subject starts the task, and counts down from 10:00 minutes (or 15:00) to 00:00. Once it hits 00:00, I would like the numbers to turn red. 

Does anyone have any pointers they could give me on how to do this?

You'll want to add a <clock> element to the script and display it (probably via the <block>'s /bgstim). Configure it to count down from the desired amount of time.

https://www.millisecond.com/support/docs/v5/html/language/elements/clock.htm

So I wrote this :
<clock timer>
/ format = "mm :ss"
/ mode = timer
/ erase = false
/ monitor = 1
/ position = (50%, 10%)
/ resetrate = block
/ timeout = 600000
/ txbgcolor = black
/ txcolor = red
/ vposition = 5
/ hposition = 95
</clock>

and when i run element I can see the output exactly as I want it, but when I try run it in the test monkey, I see nothing. What may be the problem, is it not displaying properly with the BART images ? 

Also, how do I exit out early from the test monkey and an experiment- I tried the Esc key and it did not work

Thank you very much for your help

A <clock> element is a stimulus element just like <text>, <picture>, etc.

Merely adding a stimulus element to a script is not enough. You also need to instruct the script (when / how) to display it by adding it to the <trial>s' /stimulustimes or -frames, or -- in your case -- a <block>'s /bgstim attribute.

<block BART>
/ bgstim = (timer)
...
</block>

The key combination to terminate an experiment is CTRL+Q. Pressing ESC is not supposed to end a script.

Edited 8 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 - Thursday, December 01, 2016
Brainsrule - Thursday, December 01, 2016
Dave - Thursday, December 01, 2016
Brainsrule - Thursday, December 01, 2016
Hello Everyone, 

I've downloaded Inquisit lab 5 , the BART, and the BART-Y scripts. Everything runs well, but I would like to add a small counter to the upper right hand corner of the BART task screen . 
What I would like is a basic counter that starts as soon as the subject starts the task, and counts down from 10:00 minutes (or 15:00) to 00:00. Once it hits 00:00, I would like the numbers to turn red. 

Does anyone have any pointers they could give me on how to do this?

You'll want to add a <clock> element to the script and display it (probably via the <block>'s /bgstim). Configure it to count down from the desired amount of time.

https://www.millisecond.com/support/docs/v5/html/language/elements/clock.htm

So I wrote this :
<clock timer>
/ format = "mm :ss"
/ mode = timer
/ erase = false
/ monitor = 1
/ position = (50%, 10%)
/ resetrate = block
/ timeout = 600000
/ txbgcolor = black
/ txcolor = red
/ vposition = 5
/ hposition = 95
</clock>

and when i run element I can see the output exactly as I want it, but when I try run it in the test monkey, I see nothing. What may be the problem, is it not displaying properly with the BART images ? 

Also, how do I exit out early from the test monkey and an experiment- I tried the Esc key and it did not work

Thank you very much for your help

A <clock> element is a stimulus element just like <text>, <picture>, etc.

Merely adding a stimulus element to a script is not enough. You also need to instruct the script (when / how) to display it by adding it to the <trial>s' /stimulustimes or -frames, or -- in your case -- a <block>'s /bgstim attribute.

<block BART>
/ bgstim = (timer)
...
</block>

The key combination to terminate an experiment is CTRL+Q. Pressing ESC is not supposed to end a script.

P.S.: If you do not wish the timer to start with the instructions, but only with the 1st balloon:

#1: Remove the two instructions trials at the start of <block BART>, i.e. change

<block BART>
/ bgstim = (timer)
...
/ trials = [1-2=instructions; 3=init; 4=instructions]
...
</block>

to

<block BART>
/ bgstim = (timer)
...
/ trials = [1=init; 2=instructions]
...
</block>

and 

#2: Put the instructions trials in a separate <block> instead.

<block instructions>
/ trials = [1-2=instructions]
</block>

Finally,

#3: Add the new instructions block to the <expt>:

<expt BART>
...
/ blocks = [1=instructions; 2=BART; 2=summary]
...
</expt>

Brainsrule
Brainsrule
Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)
Group: Forum Members
Posts: 9, Visits: 45
Dave - Thursday, December 01, 2016
Dave - Thursday, December 01, 2016
Brainsrule - Thursday, December 01, 2016
Dave - Thursday, December 01, 2016
Brainsrule - Thursday, December 01, 2016
Hello Everyone, 

I've downloaded Inquisit lab 5 , the BART, and the BART-Y scripts. Everything runs well, but I would like to add a small counter to the upper right hand corner of the BART task screen . 
What I would like is a basic counter that starts as soon as the subject starts the task, and counts down from 10:00 minutes (or 15:00) to 00:00. Once it hits 00:00, I would like the numbers to turn red. 

Does anyone have any pointers they could give me on how to do this?

You'll want to add a <clock> element to the script and display it (probably via the <block>'s /bgstim). Configure it to count down from the desired amount of time.

https://www.millisecond.com/support/docs/v5/html/language/elements/clock.htm

So I wrote this :
<clock timer>
/ format = "mm :ss"
/ mode = timer
/ erase = false
/ monitor = 1
/ position = (50%, 10%)
/ resetrate = block
/ timeout = 600000
/ txbgcolor = black
/ txcolor = red
/ vposition = 5
/ hposition = 95
</clock>

and when i run element I can see the output exactly as I want it, but when I try run it in the test monkey, I see nothing. What may be the problem, is it not displaying properly with the BART images ? 

Also, how do I exit out early from the test monkey and an experiment- I tried the Esc key and it did not work

Thank you very much for your help

A <clock> element is a stimulus element just like <text>, <picture>, etc.

Merely adding a stimulus element to a script is not enough. You also need to instruct the script (when / how) to display it by adding it to the <trial>s' /stimulustimes or -frames, or -- in your case -- a <block>'s /bgstim attribute.

<block BART>
/ bgstim = (timer)
...
</block>

The key combination to terminate an experiment is CTRL+Q. Pressing ESC is not supposed to end a script.

P.S.: If you do not wish the timer to start with the instructions, but only with the 1st balloon:

#1: Remove the two instructions trials at the start of <block BART>, i.e. change

<block BART>
/ bgstim = (timer)
...
/ trials = [1-2=instructions; 3=init; 4=instructions]
...
</block>

to

<block BART>
/ bgstim = (timer)
...
/ trials = [1=init; 2=instructions]
...
</block>

and 

#2: Put the instructions trials in a separate <block> instead.

<block instructions>
/ trials = [1-2=instructions]
</block>

Finally,

#3: Add the new instructions block to the <expt>:

<expt BART>
...
/ blocks = [1=instructions; 2=BART; 2=summary]
...
</expt>

Perfect, it works! I did not realize it was a stimulus element as well. 

Thank you for your help
Brainsrule
Brainsrule
Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)
Group: Forum Members
Posts: 9, Visits: 45
Dave - Thursday, December 01, 2016
Dave - Thursday, December 01, 2016
Brainsrule - Thursday, December 01, 2016
Dave - Thursday, December 01, 2016
Brainsrule - Thursday, December 01, 2016
Hello Everyone, 

I've downloaded Inquisit lab 5 , the BART, and the BART-Y scripts. Everything runs well, but I would like to add a small counter to the upper right hand corner of the BART task screen . 
What I would like is a basic counter that starts as soon as the subject starts the task, and counts down from 10:00 minutes (or 15:00) to 00:00. Once it hits 00:00, I would like the numbers to turn red. 

Does anyone have any pointers they could give me on how to do this?

You'll want to add a <clock> element to the script and display it (probably via the <block>'s /bgstim). Configure it to count down from the desired amount of time.

https://www.millisecond.com/support/docs/v5/html/language/elements/clock.htm

So I wrote this :
<clock timer>
/ format = "mm :ss"
/ mode = timer
/ erase = false
/ monitor = 1
/ position = (50%, 10%)
/ resetrate = block
/ timeout = 600000
/ txbgcolor = black
/ txcolor = red
/ vposition = 5
/ hposition = 95
</clock>

and when i run element I can see the output exactly as I want it, but when I try run it in the test monkey, I see nothing. What may be the problem, is it not displaying properly with the BART images ? 

Also, how do I exit out early from the test monkey and an experiment- I tried the Esc key and it did not work

Thank you very much for your help

A <clock> element is a stimulus element just like <text>, <picture>, etc.

Merely adding a stimulus element to a script is not enough. You also need to instruct the script (when / how) to display it by adding it to the <trial>s' /stimulustimes or -frames, or -- in your case -- a <block>'s /bgstim attribute.

<block BART>
/ bgstim = (timer)
...
</block>

The key combination to terminate an experiment is CTRL+Q. Pressing ESC is not supposed to end a script.

P.S.: If you do not wish the timer to start with the instructions, but only with the 1st balloon:

#1: Remove the two instructions trials at the start of <block BART>, i.e. change

<block BART>
/ bgstim = (timer)
...
/ trials = [1-2=instructions; 3=init; 4=instructions]
...
</block>

to

<block BART>
/ bgstim = (timer)
...
/ trials = [1=init; 2=instructions]
...
</block>

and 

#2: Put the instructions trials in a separate <block> instead.

<block instructions>
/ trials = [1-2=instructions]
</block>

Finally,

#3: Add the new instructions block to the <expt>:

<expt BART>
...
/ blocks = [1=instructions; 2=BART; 2=summary]
...
</expt>

Hello, 

I just have one more question: How do I put edit this for the BART-Y ? Right now I have the timer code added, and what happens is when I hit 'run', it skips the instructions and goes straight to the task with the timer.


Brainsrule
Brainsrule
Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)Expert (1.5K reputation)
Group: Forum Members
Posts: 9, Visits: 45
Brainsrule - Monday, December 05, 2016
Dave - Thursday, December 01, 2016
Dave - Thursday, December 01, 2016
Brainsrule - Thursday, December 01, 2016
Dave - Thursday, December 01, 2016
Brainsrule - Thursday, December 01, 2016
Hello Everyone, 

I've downloaded Inquisit lab 5 , the BART, and the BART-Y scripts. Everything runs well, but I would like to add a small counter to the upper right hand corner of the BART task screen . 
What I would like is a basic counter that starts as soon as the subject starts the task, and counts down from 10:00 minutes (or 15:00) to 00:00. Once it hits 00:00, I would like the numbers to turn red. 

Does anyone have any pointers they could give me on how to do this?

You'll want to add a <clock> element to the script and display it (probably via the <block>'s /bgstim). Configure it to count down from the desired amount of time.

https://www.millisecond.com/support/docs/v5/html/language/elements/clock.htm

So I wrote this :
<clock timer>
/ format = "mm :ss"
/ mode = timer
/ erase = false
/ monitor = 1
/ position = (50%, 10%)
/ resetrate = block
/ timeout = 600000
/ txbgcolor = black
/ txcolor = red
/ vposition = 5
/ hposition = 95
</clock>

and when i run element I can see the output exactly as I want it, but when I try run it in the test monkey, I see nothing. What may be the problem, is it not displaying properly with the BART images ? 

Also, how do I exit out early from the test monkey and an experiment- I tried the Esc key and it did not work

Thank you very much for your help

A <clock> element is a stimulus element just like <text>, <picture>, etc.

Merely adding a stimulus element to a script is not enough. You also need to instruct the script (when / how) to display it by adding it to the <trial>s' /stimulustimes or -frames, or -- in your case -- a <block>'s /bgstim attribute.

<block BART>
/ bgstim = (timer)
...
</block>

The key combination to terminate an experiment is CTRL+Q. Pressing ESC is not supposed to end a script.

P.S.: If you do not wish the timer to start with the instructions, but only with the 1st balloon:

#1: Remove the two instructions trials at the start of <block BART>, i.e. change

<block BART>
/ bgstim = (timer)
...
/ trials = [1-2=instructions; 3=init; 4=instructions]
...
</block>

to

<block BART>
/ bgstim = (timer)
...
/ trials = [1=init; 2=instructions]
...
</block>

and 

#2: Put the instructions trials in a separate <block> instead.

<block instructions>
/ trials = [1-2=instructions]
</block>

Finally,

#3: Add the new instructions block to the <expt>:

<expt BART>
...
/ blocks = [1=instructions; 2=BART; 2=summary]
...
</expt>

Hello, 

I just have one more question: How do I put edit this for the BART-Y ? Right now I have the timer code added, and what happens is when I hit 'run', it skips the instructions and goes straight to the task with the timer.


So I have this: 
<expt BARTY>

/ blocks = [2=BARTY; 2=summary]
/ onexptbegin = [
if ( !parameters.showpumpcount )
text.pumpcount.textcolor= white;
if ( !parameters.showballooncount )
text.countballoon.textcolor = white;
]
/ blocks = [
1=BARTY;
2 = summary;
]
/ onexptend = [values.completed = 1]
</expt>

and this : 


<block BARTY>
/ onblockbegin = [
values.balloonwidth = 0.3 * display.width;
values.balloonheight = 0.3 * display.height;
]
/ bgstim = (timer)
/ trials = [1=init; 2=instructions_text]
/ stop = [trial.init.trialcount > parameters.totalballoons]
</block>

<block summary>
/ trials = [1=instructions_text; 2 = showmeter]
</block>




*************
Timer
*************
<clock timer>
/ format = "mm :ss"
/ mode = timer
/ erase = false
/ monitor = 1
/ position = (50%, 10%)
/ resetrate = block
/ timeout = 600000
/ txbgcolor = black
/ txcolor = red
/ vposition = 5
/ hposition = 95
</clock>

*************


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
Brainsrule - Monday, December 05, 2016
Brainsrule - Monday, December 05, 2016
Dave - Thursday, December 01, 2016
Dave - Thursday, December 01, 2016
Brainsrule - Thursday, December 01, 2016
Dave - Thursday, December 01, 2016
Brainsrule - Thursday, December 01, 2016
Hello Everyone, 

I've downloaded Inquisit lab 5 , the BART, and the BART-Y scripts. Everything runs well, but I would like to add a small counter to the upper right hand corner of the BART task screen . 
What I would like is a basic counter that starts as soon as the subject starts the task, and counts down from 10:00 minutes (or 15:00) to 00:00. Once it hits 00:00, I would like the numbers to turn red. 

Does anyone have any pointers they could give me on how to do this?

You'll want to add a <clock> element to the script and display it (probably via the <block>'s /bgstim). Configure it to count down from the desired amount of time.

https://www.millisecond.com/support/docs/v5/html/language/elements/clock.htm

So I wrote this :
<clock timer>
/ format = "mm :ss"
/ mode = timer
/ erase = false
/ monitor = 1
/ position = (50%, 10%)
/ resetrate = block
/ timeout = 600000
/ txbgcolor = black
/ txcolor = red
/ vposition = 5
/ hposition = 95
</clock>

and when i run element I can see the output exactly as I want it, but when I try run it in the test monkey, I see nothing. What may be the problem, is it not displaying properly with the BART images ? 

Also, how do I exit out early from the test monkey and an experiment- I tried the Esc key and it did not work

Thank you very much for your help

A <clock> element is a stimulus element just like <text>, <picture>, etc.

Merely adding a stimulus element to a script is not enough. You also need to instruct the script (when / how) to display it by adding it to the <trial>s' /stimulustimes or -frames, or -- in your case -- a <block>'s /bgstim attribute.

<block BART>
/ bgstim = (timer)
...
</block>

The key combination to terminate an experiment is CTRL+Q. Pressing ESC is not supposed to end a script.

P.S.: If you do not wish the timer to start with the instructions, but only with the 1st balloon:

#1: Remove the two instructions trials at the start of <block BART>, i.e. change

<block BART>
/ bgstim = (timer)
...
/ trials = [1-2=instructions; 3=init; 4=instructions]
...
</block>

to

<block BART>
/ bgstim = (timer)
...
/ trials = [1=init; 2=instructions]
...
</block>

and 

#2: Put the instructions trials in a separate <block> instead.

<block instructions>
/ trials = [1-2=instructions]
</block>

Finally,

#3: Add the new instructions block to the <expt>:

<expt BART>
...
/ blocks = [1=instructions; 2=BART; 2=summary]
...
</expt>

Hello, 

I just have one more question: How do I put edit this for the BART-Y ? Right now I have the timer code added, and what happens is when I hit 'run', it skips the instructions and goes straight to the task with the timer.


So I have this: 
<expt BARTY>

/ blocks = [2=BARTY; 2=summary]
/ onexptbegin = [
if ( !parameters.showpumpcount )
text.pumpcount.textcolor= white;
if ( !parameters.showballooncount )
text.countballoon.textcolor = white;
]
/ blocks = [
1=BARTY;
2 = summary;
]
/ onexptend = [values.completed = 1]
</expt>

and this : 


<block BARTY>
/ onblockbegin = [
values.balloonwidth = 0.3 * display.width;
values.balloonheight = 0.3 * display.height;
]
/ bgstim = (timer)
/ trials = [1=init; 2=instructions_text]
/ stop = [trial.init.trialcount > parameters.totalballoons]
</block>

<block summary>
/ trials = [1=instructions_text; 2 = showmeter]
</block>




*************
Timer
*************
<clock timer>
/ format = "mm :ss"
/ mode = timer
/ erase = false
/ monitor = 1
/ position = (50%, 10%)
/ resetrate = block
/ timeout = 600000
/ txbgcolor = black
/ txcolor = red
/ vposition = 5
/ hposition = 95
</clock>

*************


As with the regular BART, you need to add an additional <block> that displays the instructions trials and then include that new <block> in the <expt>'s /blocks attribute.

chenxyu
chenxyu
Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)
Group: Forum Members
Posts: 18, Visits: 252
Hello,
I'm also using Inquisit 5. My problem related to the timer is that it will not run until after all the stimuli are presented. Specifically, I would like participants to work on a word puzzle for 3 minutes while they can see a timer counting down from 3-min. However, if some finish early, they can move on to the next phase by clicking on Continue after 30s. It all works fine in Inquisit 6, but when I set it up in Inquisit 5, the timer will not change after until 30s has passed. Basically, from 3:00 - 2:30, the clock will not change. Any suggestions?


<html wordsearch>
/ items = ("word search.html")
/ position = (35, 50)
/ size = (80%, 80%)
</html>

<clock timer>
/ mode = timer
/ resetrate = block
/ txcolor = black
/ txbgcolor = cadetblue
/ timeout = 180000
/ position = (90%, 90%)
/ format = "mm:ss"
/ size = (5%, 5%)
</clock>

<text Continue>
/ items = ("Continue")
/ size = (10%, 5%)
/ position = (50%, 95%)
/ txbgcolor = grey
/ vjustify = center
</text>

<trial wordsearch>
/ stimulustimes = [1=wordsearch,timer;30000=Continue]
/ timeout = 180000
/ inputdevice = mouse
/ validresponse = (Continue)
</trial>

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search