Key-press task


Key-press task

Author
Message
Jessica_FAU
Jessica_FAU
Associate Member
Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)

Group: Forum Members
Posts: 4, Visits: 20
Dear Inquisit Team,

I am a new Inquisit user and would like to program the so-called key-press task ("wanting" task). I could not readily find answers to my questions in this forum which is why I decided to start a new topic.

First, some general information about the task: Subjects are presented with a stimulus that if not inferred with, changes after 4 seconds. However, if subjects would like to make the stimulus disappear faster (i.e., change to next stimulus), they can press one of the two arrow keys presented on the right side of the stimulus. Similarly, if they would like to make the stimulus stay longer, they can press the other arrow key. The variable of interest is the amount of work in units of key press that subjects exert in response to the stimuli. Importantly, a "slider" (similar to an egg timer) is shown at the left side of the stimuli that shows total viewing time at any moment, and changes with every keypress (e.g., goes up when pressing key to see stimulus longer vs. goes down when pressing key to make stimulus disappear faster). One way to go would be to increase or decrease the viewing time of the stimulus by 1 second as a result of 1 key press. In total, the task lasts for 4 minutes independent of actions taken by the subjects.

From my colleagues I learned that every time a subject presses a key to make the stimulus stay longer, a new trial begins and consequently the screen would flicker. This seems particularly problematic if subjects press the key repeatedly to see the stimulus longer. Therefore my first question: Is there a way to show the stimuli continuously without the flickering when subjects press a response key? Similarly, is there a way to decrease the default viewing time of 4 seconds dependent on the key press of the subject (e.g., 2 key press would decrease viewing time by 2 seconds)? Lastly, I have not seen a "slider" or egg timer that displays viewing time and changes with every key press before in Inquisit. Do you have any ideas about how something like this could be programmed?

I am aware that these are quite some questions but would appreciate any help or hints on how to overcome these difficulties.

Thank you very much in advance,
Jessica
Dave
Dave
Supreme Being
Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)

Group: Administrators
Posts: 9.3K, Visits: 41K
Jessica_FAU - Friday, October 12, 2018
Dear Inquisit Team,

I am a new Inquisit user and would like to program the so-called key-press task ("wanting" task). I could not readily find answers to my questions in this forum which is why I decided to start a new topic.

First, some general information about the task: Subjects are presented with a stimulus that if not inferred with, changes after 4 seconds. However, if subjects would like to make the stimulus disappear faster (i.e., change to next stimulus), they can press one of the two arrow keys presented on the right side of the stimulus. Similarly, if they would like to make the stimulus stay longer, they can press the other arrow key. The variable of interest is the amount of work in units of key press that subjects exert in response to the stimuli. Importantly, a "slider" (similar to an egg timer) is shown at the left side of the stimuli that shows total viewing time at any moment, and changes with every keypress (e.g., goes up when pressing key to see stimulus longer vs. goes down when pressing key to make stimulus disappear faster). One way to go would be to increase or decrease the viewing time of the stimulus by 1 second as a result of 1 key press. In total, the task lasts for 4 minutes independent of actions taken by the subjects.

From my colleagues I learned that every time a subject presses a key to make the stimulus stay longer, a new trial begins and consequently the screen would flicker. This seems particularly problematic if subjects press the key repeatedly to see the stimulus longer. Therefore my first question: Is there a way to show the stimuli continuously without the flickering when subjects press a response key? Similarly, is there a way to decrease the default viewing time of 4 seconds dependent on the key press of the subject (e.g., 2 key press would decrease viewing time by 2 seconds)? Lastly, I have not seen a "slider" or egg timer that displays viewing time and changes with every key press before in Inquisit. Do you have any ideas about how something like this could be programmed?

I am aware that these are quite some questions but would appreciate any help or hints on how to overcome these difficulties.

Thank you very much in advance,
Jessica

> From my colleagues I learned that every time a subject presses a key to make the stimulus stay longer, a new trial begins and consequently the screen would flicker.

This is not correct. To avoid any kind of flicker, all you need to do is set any stimulus elements displayed by the trial to /erase = false.

> Similarly, is there a way to decrease the default viewing time of 4 seconds dependent on the key press of the subject (e.g., 2 key press would decrease viewing time by 2 seconds)?

Possibly. If you give each trial a fixed duration of 1 second, then you can just run fewer 1-second trials in response to a decrease of the viewing time. I.e. if running 4 trials (4 x 1 second) is your default, decrease that number to 3 if the subject indicates a decrease in the 1st trial, and so forth.

> Lastly, I have not seen a "slider" or egg timer that displays viewing time and changes with every key press before in Inquisit. Do you have any ideas about how something like this could be programmed?

You can display a rectangular <shape> or several <shape>s overlayed in your <trial>s and have the shape change its size according to the participant's responses, i.e. make it larger in case of an indicated increase, reduce its size in case of an indicated decrease.


Dave
Dave
Supreme Being
Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)

Group: Administrators
Posts: 9.3K, Visits: 41K
Dave - Friday, October 12, 2018
Jessica_FAU - Friday, October 12, 2018
Dear Inquisit Team,

I am a new Inquisit user and would like to program the so-called key-press task ("wanting" task). I could not readily find answers to my questions in this forum which is why I decided to start a new topic.

First, some general information about the task: Subjects are presented with a stimulus that if not inferred with, changes after 4 seconds. However, if subjects would like to make the stimulus disappear faster (i.e., change to next stimulus), they can press one of the two arrow keys presented on the right side of the stimulus. Similarly, if they would like to make the stimulus stay longer, they can press the other arrow key. The variable of interest is the amount of work in units of key press that subjects exert in response to the stimuli. Importantly, a "slider" (similar to an egg timer) is shown at the left side of the stimuli that shows total viewing time at any moment, and changes with every keypress (e.g., goes up when pressing key to see stimulus longer vs. goes down when pressing key to make stimulus disappear faster). One way to go would be to increase or decrease the viewing time of the stimulus by 1 second as a result of 1 key press. In total, the task lasts for 4 minutes independent of actions taken by the subjects.

From my colleagues I learned that every time a subject presses a key to make the stimulus stay longer, a new trial begins and consequently the screen would flicker. This seems particularly problematic if subjects press the key repeatedly to see the stimulus longer. Therefore my first question: Is there a way to show the stimuli continuously without the flickering when subjects press a response key? Similarly, is there a way to decrease the default viewing time of 4 seconds dependent on the key press of the subject (e.g., 2 key press would decrease viewing time by 2 seconds)? Lastly, I have not seen a "slider" or egg timer that displays viewing time and changes with every key press before in Inquisit. Do you have any ideas about how something like this could be programmed?

I am aware that these are quite some questions but would appreciate any help or hints on how to overcome these difficulties.

Thank you very much in advance,
Jessica

> From my colleagues I learned that every time a subject presses a key to make the stimulus stay longer, a new trial begins and consequently the screen would flicker.

This is not correct. To avoid any kind of flicker, all you need to do is set any stimulus elements displayed by the trial to /erase = false.

> Similarly, is there a way to decrease the default viewing time of 4 seconds dependent on the key press of the subject (e.g., 2 key press would decrease viewing time by 2 seconds)?

Possibly. If you give each trial a fixed duration of 1 second, then you can just run fewer 1-second trials in response to a decrease of the viewing time. I.e. if running 4 trials (4 x 1 second) is your default, decrease that number to 3 if the subject indicates a decrease in the 1st trial, and so forth.

> Lastly, I have not seen a "slider" or egg timer that displays viewing time and changes with every key press before in Inquisit. Do you have any ideas about how something like this could be programmed?

You can display a rectangular <shape> or several <shape>s overlayed in your <trial>s and have the shape change its size according to the participant's responses, i.e. make it larger in case of an indicated increase, reduce its size in case of an indicated decrease.


Come to think of it, I think there is a better way than using fixed durations and running the corresponding amount of trials. Something like this, in essence:

<values>
/ viewtime = 4000
/ adjustmentvalue = 1000
/ stimnumber = 1
</values>

<expressions>
/ viewtime = values.viewtime
</expressions>

<expt>
/ blocks = [1=start; 2-4 = viewingtime;]
</expt>

<block start>
/ preinstructions = (startinstr)
</block>

<page startinstr>
^press the spacebar when you're ready
</page>

<instruct>
/ nextkey = (57)
</instruct>

<block viewingtime>
/ onblockbegin = [
values.viewtime = 4000;
shape.indicator.height = 8%;
values.stimnumber = list.stimnumbers.nextindex;
]
/ stop = [
block.viewingtime.elapsedtime >= expressions.viewtime;
]
/ trials = [1=viewtrial]
/ branch = [
block.start;
]
</block>

//on the keyboard
//press the UP arrow to increase view time
/ press DOWN arrow to decrease view time
<trial viewtrial>
/ ontrialend = [
if (trial.viewtrial.response == 200) {
values.viewtime += values.adjustmentvalue;
shape.indicator.height += 2%;
};
if (trial.viewtrial.response == 208){
values.viewtime -= values.adjustmentvalue;
shape.indicator.height -= 2%;
};
]
/ stimulusframes = [1=clearscreen, stim, up, down, indicator]
/ validresponse = (200, 208)
/ branch = [
trial.viewtrial;
]
/ timeout = 1000
</trial>

//3 items in this example
<list stimnumbers>
/ poolsize = 3
</list>

<text stim>
/ items = ("A", "B", "C")
/ select = values.stimnumber
/ erase = false
</text>

<text up>
/ items = ("↑")
/ erase = false
/ position = (30%, 50%)
</text>

<text down>
/ items = ("↓")
/ erase = false
/ position = (70%, 50%)
</text>

<shape indicator>
/ shape = rectangle
/ color = blue
/ position = (10%, 90%)
/ size = (5%, 8%)
/ erase = false
/ halign = center
/ valign = bottom
</shape>

<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode response latency values.viewtime block.viewingtime.elapsedtime)
/ separatefiles = true
</data>


Jessica_FAU
Jessica_FAU
Associate Member
Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)

Group: Forum Members
Posts: 4, Visits: 20
Dave - Friday, October 12, 2018
Dave - Friday, October 12, 2018
Jessica_FAU - Friday, October 12, 2018
Dear Inquisit Team,

I am a new Inquisit user and would like to program the so-called key-press task ("wanting" task). I could not readily find answers to my questions in this forum which is why I decided to start a new topic.

First, some general information about the task: Subjects are presented with a stimulus that if not inferred with, changes after 4 seconds. However, if subjects would like to make the stimulus disappear faster (i.e., change to next stimulus), they can press one of the two arrow keys presented on the right side of the stimulus. Similarly, if they would like to make the stimulus stay longer, they can press the other arrow key. The variable of interest is the amount of work in units of key press that subjects exert in response to the stimuli. Importantly, a "slider" (similar to an egg timer) is shown at the left side of the stimuli that shows total viewing time at any moment, and changes with every keypress (e.g., goes up when pressing key to see stimulus longer vs. goes down when pressing key to make stimulus disappear faster). One way to go would be to increase or decrease the viewing time of the stimulus by 1 second as a result of 1 key press. In total, the task lasts for 4 minutes independent of actions taken by the subjects.

From my colleagues I learned that every time a subject presses a key to make the stimulus stay longer, a new trial begins and consequently the screen would flicker. This seems particularly problematic if subjects press the key repeatedly to see the stimulus longer. Therefore my first question: Is there a way to show the stimuli continuously without the flickering when subjects press a response key? Similarly, is there a way to decrease the default viewing time of 4 seconds dependent on the key press of the subject (e.g., 2 key press would decrease viewing time by 2 seconds)? Lastly, I have not seen a "slider" or egg timer that displays viewing time and changes with every key press before in Inquisit. Do you have any ideas about how something like this could be programmed?

I am aware that these are quite some questions but would appreciate any help or hints on how to overcome these difficulties.

Thank you very much in advance,
Jessica

> From my colleagues I learned that every time a subject presses a key to make the stimulus stay longer, a new trial begins and consequently the screen would flicker.

This is not correct. To avoid any kind of flicker, all you need to do is set any stimulus elements displayed by the trial to /erase = false.

> Similarly, is there a way to decrease the default viewing time of 4 seconds dependent on the key press of the subject (e.g., 2 key press would decrease viewing time by 2 seconds)?

Possibly. If you give each trial a fixed duration of 1 second, then you can just run fewer 1-second trials in response to a decrease of the viewing time. I.e. if running 4 trials (4 x 1 second) is your default, decrease that number to 3 if the subject indicates a decrease in the 1st trial, and so forth.

> Lastly, I have not seen a "slider" or egg timer that displays viewing time and changes with every key press before in Inquisit. Do you have any ideas about how something like this could be programmed?

You can display a rectangular <shape> or several <shape>s overlayed in your <trial>s and have the shape change its size according to the participant's responses, i.e. make it larger in case of an indicated increase, reduce its size in case of an indicated decrease.


Come to think of it, I think there is a better way than using fixed durations and running the corresponding amount of trials. Something like this, in essence:

<values>
/ viewtime = 4000
/ adjustmentvalue = 1000
/ stimnumber = 1
</values>

<expressions>
/ viewtime = values.viewtime
</expressions>

<expt>
/ blocks = [1=start; 2-4 = viewingtime;]
</expt>

<block start>
/ preinstructions = (startinstr)
</block>

<page startinstr>
^press the spacebar when you're ready
</page>

<instruct>
/ nextkey = (57)
</instruct>

<block viewingtime>
/ onblockbegin = [
values.viewtime = 4000;
shape.indicator.height = 8%;
values.stimnumber = list.stimnumbers.nextindex;
]
/ stop = [
block.viewingtime.elapsedtime >= expressions.viewtime;
]
/ trials = [1=viewtrial]
/ branch = [
block.start;
]
</block>

//on the keyboard
//press the UP arrow to increase view time
/ press DOWN arrow to decrease view time
<trial viewtrial>
/ ontrialend = [
if (trial.viewtrial.response == 200) {
values.viewtime += values.adjustmentvalue;
shape.indicator.height += 2%;
};
if (trial.viewtrial.response == 208){
values.viewtime -= values.adjustmentvalue;
shape.indicator.height -= 2%;
};
]
/ stimulusframes = [1=clearscreen, stim, up, down, indicator]
/ validresponse = (200, 208)
/ branch = [
trial.viewtrial;
]
/ timeout = 1000
</trial>

//3 items in this example
<list stimnumbers>
/ poolsize = 3
</list>

<text stim>
/ items = ("A", "B", "C")
/ select = values.stimnumber
/ erase = false
</text>

<text up>
/ items = ("↑")
/ erase = false
/ position = (30%, 50%)
</text>

<text down>
/ items = ("↓")
/ erase = false
/ position = (70%, 50%)
</text>

<shape indicator>
/ shape = rectangle
/ color = blue
/ position = (10%, 90%)
/ size = (5%, 8%)
/ erase = false
/ halign = center
/ valign = bottom
</shape>

<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode response latency values.viewtime block.viewingtime.elapsedtime)
/ separatefiles = true
</data>


Dear Dave,

Thank you for your helpful answers. Your script gave me a good starting point to continue working on the task. However, now I encountered new difficulties, haha.

Below you can find my current version of the script.

And I have the following questions:

1. Is it possible to program the task in a way that, if subjects have decided on whether to increase or decrease viewing time, this initial decision is the only correct answer (i.e., it is not possible to first increase, then decrease viewing time (or vice versa) for the same stimulus)?

2. Is it possible to program the timeout function in a way that, a) if no response is made, a stimulus will be displayed for only 4 sec? AND b) if a response is made (e.g., increase viewing time) during the default time of 4 sec, the default time will increase dependent on the key presses made by the subject? For example, 3 key presses correspond to an increase of viewing time of 1.5 seconds (=in total, 5.5sec viewing time).

<values>
/ viewtime = 4000
/ maxtime = 8000;
/ adjustmentvalue = 500
/ stimnumber = 1

</values>

<expressions>
/ viewtime = values.viewtime
</expressions>

<expt>
/ blocks = [1=start; 2-4 = viewingtime;]
</expt>

<block start>
/ preinstructions = (startinstr)
</block>

<page startinstr>
^press the spacebar when you're ready
</page>

<instruct>
/ nextkey = (57)
</instruct>
values.viewtime == values.maxtime || values.viewtime == values.mintime;

<block viewingtime>
/ onblockbegin = [

values.viewtime = 4000;
shape.indicator.height = 2%;
shape.indicator_up.height = 1%;
shape.indicator_down.height = 1%;
values.stimnumber = list.stimnumbers.nextindex;
]

/ stop = [ if (trial.viewtrial.response == 208) block.viewingtime.elapsedtime >= values.viewtime; else block.viewingtime.elapsedtime >= values.maxtime]
/ trials = [1=viewtrial]
/ branch = [
block.start;
]
</block>

//on the keyboard
//press the UP arrow to increase view time
/ press DOWN arrow to decrease view time
<trial viewtrial>


/ stimulustimes = [1=clearscreen, stim, up, down, indicator_up,indicator_down, indicator,mitte,up_05,up_1,up_15,up_2,up_25,up_30,up_35,up_40,down_05,down_1,down_15,down_2,down_25,down_30,down_35,down_40]
/ beginresponsetime = 0
/ validresponse = (200, 208)

/ ontrialend = [
if (trial.viewtrial.response == 200 && values.viewtime < 8000) {
values.viewtime += values.adjustmentvalue;
shape.indicator_up.height += 5%;

};
if (trial.viewtrial.response == 208 && values.viewtime > 0){
values.viewtime -= values.adjustmentvalue;
shape.indicator_down.height += 5%;

};

]

/ branch = [if ((trial.viewtrial.response == 208 && values.viewtime >= 0 ) || (trial.viewtrial.response == 200 && values.viewtime <= 8000)) trial.viewtrial
]

/ timeout = 4000
</trial>



//3 items in this example
<list stimnumbers>
/ poolsize = 3
</list>

<text stim>
/ items = ("A", "B", "C")
/ select = values.stimnumber
/ erase = false
</text>

<text up>
/ items = ("↑")
/ erase = false
/ position = (30%, 50%)
</text>

<text down>
/ items = ("↓")
/ erase = false
/ position = (70%, 50%)
</text>

<shape indicator>
/ shape = rectangle
/ color = blue
/ position = (10%, 50%)
/ size = (5%, 1%)
/ erase = false
/ halign = center
/ valign = bottom
</shape>

<shape indicator_up>
/ shape = rectangle
/ color = red
/ position = (10%, 50%)
/ size = (5%, 1%)
/ erase = false
/ halign = center
/ valign = bottom
</shape>

<shape indicator_down>
/ shape = rectangle
/ color = red
/ position = (10%, 48%)
/ size = (5%, 1%)
/ erase = false
/ halign = center
/ valign = top
</shape>

<text mitte>
/ items = ("4s")
/ color = blue
/ position = (15%, 50%)
/ erase = false

</text>

<text up_05>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 45%)
/ erase = false

</text>

<text up_1>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 40%)
/ erase = false

</text>

<text up_15>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 35%)
/ erase = false

</text>

<text up_2>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 30%)
/ erase = false

</text>

<text up_25>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 25%)
/ erase = false

</text>

<text up_30>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 20%)
/ erase = false

</text>

<text up_35>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 15%)
/ erase = false

</text>

<text up_40>
/ items = ("8s")
/ color = blue
/ position = (15%, 10%)
/ erase = false

</text>

<text down_05>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 55%)
/ erase = false

</text>

<text down_1>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 60%)
/ erase = false

</text>

<text down_15>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 65%)
/ erase = false

</text>

<text down_2>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 70%)
/ erase = false

</text>

<text down_25>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 75%)
/ erase = false

</text>

<text down_30>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 80%)
/ erase = false

</text>

<text down_35>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 85%)
/ erase = false

</text>

<text down_40>
/ items = ("0s")
/ color = blue
/ position = (15%, 90%)
/ erase = false

</text>


<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode response latency values.viewtime block.viewingtime.elapsedtime)
/ separatefiles = true
</data>


Thank you and best regards,
Jessica

Dave
Dave
Supreme Being
Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)

Group: Administrators
Posts: 9.3K, Visits: 41K
Jessica_FAU - Monday, October 22, 2018

Dear Dave,

Thank you for your helpful answers. Your script gave me a good starting point to continue working on the task. However, now I encountered new difficulties, haha.

Below you can find my current version of the script.

And I have the following questions:

1. Is it possible to program the task in a way that, if subjects have decided on whether to increase or decrease viewing time, this initial decision is the only correct answer (i.e., it is not possible to first increase, then decrease viewing time (or vice versa) for the same stimulus)?

2. Is it possible to program the timeout function in a way that, a) if no response is made, a stimulus will be displayed for only 4 sec? AND b) if a response is made (e.g., increase viewing time) during the default time of 4 sec, the default time will increase dependent on the key presses made by the subject? For example, 3 key presses correspond to an increase of viewing time of 1.5 seconds (=in total, 5.5sec viewing time).

<values>
/ viewtime = 4000
/ maxtime = 8000;
/ adjustmentvalue = 500
/ stimnumber = 1

</values>

<expressions>
/ viewtime = values.viewtime
</expressions>

<expt>
/ blocks = [1=start; 2-4 = viewingtime;]
</expt>

<block start>
/ preinstructions = (startinstr)
</block>

<page startinstr>
^press the spacebar when you're ready
</page>

<instruct>
/ nextkey = (57)
</instruct>
values.viewtime == values.maxtime || values.viewtime == values.mintime;

<block viewingtime>
/ onblockbegin = [

values.viewtime = 4000;
shape.indicator.height = 2%;
shape.indicator_up.height = 1%;
shape.indicator_down.height = 1%;
values.stimnumber = list.stimnumbers.nextindex;
]

/ stop = [ if (trial.viewtrial.response == 208) block.viewingtime.elapsedtime >= values.viewtime; else block.viewingtime.elapsedtime >= values.maxtime]
/ trials = [1=viewtrial]
/ branch = [
block.start;
]
</block>

//on the keyboard
//press the UP arrow to increase view time
/ press DOWN arrow to decrease view time
<trial viewtrial>


/ stimulustimes = [1=clearscreen, stim, up, down, indicator_up,indicator_down, indicator,mitte,up_05,up_1,up_15,up_2,up_25,up_30,up_35,up_40,down_05,down_1,down_15,down_2,down_25,down_30,down_35,down_40]
/ beginresponsetime = 0
/ validresponse = (200, 208)

/ ontrialend = [
if (trial.viewtrial.response == 200 && values.viewtime < 8000) {
values.viewtime += values.adjustmentvalue;
shape.indicator_up.height += 5%;

};
if (trial.viewtrial.response == 208 && values.viewtime > 0){
values.viewtime -= values.adjustmentvalue;
shape.indicator_down.height += 5%;

};

]

/ branch = [if ((trial.viewtrial.response == 208 && values.viewtime >= 0 ) || (trial.viewtrial.response == 200 && values.viewtime <= 8000)) trial.viewtrial
]

/ timeout = 4000
</trial>



//3 items in this example
<list stimnumbers>
/ poolsize = 3
</list>

<text stim>
/ items = ("A", "B", "C")
/ select = values.stimnumber
/ erase = false
</text>

<text up>
/ items = ("↑")
/ erase = false
/ position = (30%, 50%)
</text>

<text down>
/ items = ("↓")
/ erase = false
/ position = (70%, 50%)
</text>

<shape indicator>
/ shape = rectangle
/ color = blue
/ position = (10%, 50%)
/ size = (5%, 1%)
/ erase = false
/ halign = center
/ valign = bottom
</shape>

<shape indicator_up>
/ shape = rectangle
/ color = red
/ position = (10%, 50%)
/ size = (5%, 1%)
/ erase = false
/ halign = center
/ valign = bottom
</shape>

<shape indicator_down>
/ shape = rectangle
/ color = red
/ position = (10%, 48%)
/ size = (5%, 1%)
/ erase = false
/ halign = center
/ valign = top
</shape>

<text mitte>
/ items = ("4s")
/ color = blue
/ position = (15%, 50%)
/ erase = false

</text>

<text up_05>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 45%)
/ erase = false

</text>

<text up_1>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 40%)
/ erase = false

</text>

<text up_15>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 35%)
/ erase = false

</text>

<text up_2>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 30%)
/ erase = false

</text>

<text up_25>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 25%)
/ erase = false

</text>

<text up_30>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 20%)
/ erase = false

</text>

<text up_35>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 15%)
/ erase = false

</text>

<text up_40>
/ items = ("8s")
/ color = blue
/ position = (15%, 10%)
/ erase = false

</text>

<text down_05>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 55%)
/ erase = false

</text>

<text down_1>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 60%)
/ erase = false

</text>

<text down_15>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 65%)
/ erase = false

</text>

<text down_2>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 70%)
/ erase = false

</text>

<text down_25>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 75%)
/ erase = false

</text>

<text down_30>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 80%)
/ erase = false

</text>

<text down_35>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 85%)
/ erase = false

</text>

<text down_40>
/ items = ("0s")
/ color = blue
/ position = (15%, 90%)
/ erase = false

</text>


<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode response latency values.viewtime block.viewingtime.elapsedtime)
/ separatefiles = true
</data>


Thank you and best regards,
Jessica

> 1. Is it possible to program the task in a way that, if subjects have decided on whether to increase or decrease viewing time, this initial decision is the only correct answer (i.e., it is not possible to first increase, then decrease viewing time (or vice versa) for the same stimulus)?

Yes. Don't loop trial.viewtrial, then, but only run one instance of it and the /branch to separate <trial> elements depending on response in the 1st viewtrial: One trial that only allows for decreasing, another one that only allows for increasing viewing time.

I don't quite understand question #2. Isn't that how the script I posted behaves already?

Dave
Dave
Supreme Being
Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)Supreme Being (567K reputation)

Group: Administrators
Posts: 9.3K, Visits: 41K
Dave - Monday, October 22, 2018
Jessica_FAU - Monday, October 22, 2018

Dear Dave,

Thank you for your helpful answers. Your script gave me a good starting point to continue working on the task. However, now I encountered new difficulties, haha.

Below you can find my current version of the script.

And I have the following questions:

1. Is it possible to program the task in a way that, if subjects have decided on whether to increase or decrease viewing time, this initial decision is the only correct answer (i.e., it is not possible to first increase, then decrease viewing time (or vice versa) for the same stimulus)?

2. Is it possible to program the timeout function in a way that, a) if no response is made, a stimulus will be displayed for only 4 sec? AND b) if a response is made (e.g., increase viewing time) during the default time of 4 sec, the default time will increase dependent on the key presses made by the subject? For example, 3 key presses correspond to an increase of viewing time of 1.5 seconds (=in total, 5.5sec viewing time).

<values>
/ viewtime = 4000
/ maxtime = 8000;
/ adjustmentvalue = 500
/ stimnumber = 1

</values>

<expressions>
/ viewtime = values.viewtime
</expressions>

<expt>
/ blocks = [1=start; 2-4 = viewingtime;]
</expt>

<block start>
/ preinstructions = (startinstr)
</block>

<page startinstr>
^press the spacebar when you're ready
</page>

<instruct>
/ nextkey = (57)
</instruct>
values.viewtime == values.maxtime || values.viewtime == values.mintime;

<block viewingtime>
/ onblockbegin = [

values.viewtime = 4000;
shape.indicator.height = 2%;
shape.indicator_up.height = 1%;
shape.indicator_down.height = 1%;
values.stimnumber = list.stimnumbers.nextindex;
]

/ stop = [ if (trial.viewtrial.response == 208) block.viewingtime.elapsedtime >= values.viewtime; else block.viewingtime.elapsedtime >= values.maxtime]
/ trials = [1=viewtrial]
/ branch = [
block.start;
]
</block>

//on the keyboard
//press the UP arrow to increase view time
/ press DOWN arrow to decrease view time
<trial viewtrial>


/ stimulustimes = [1=clearscreen, stim, up, down, indicator_up,indicator_down, indicator,mitte,up_05,up_1,up_15,up_2,up_25,up_30,up_35,up_40,down_05,down_1,down_15,down_2,down_25,down_30,down_35,down_40]
/ beginresponsetime = 0
/ validresponse = (200, 208)

/ ontrialend = [
if (trial.viewtrial.response == 200 && values.viewtime < 8000) {
values.viewtime += values.adjustmentvalue;
shape.indicator_up.height += 5%;

};
if (trial.viewtrial.response == 208 && values.viewtime > 0){
values.viewtime -= values.adjustmentvalue;
shape.indicator_down.height += 5%;

};

]

/ branch = [if ((trial.viewtrial.response == 208 && values.viewtime >= 0 ) || (trial.viewtrial.response == 200 && values.viewtime <= 8000)) trial.viewtrial
]

/ timeout = 4000
</trial>



//3 items in this example
<list stimnumbers>
/ poolsize = 3
</list>

<text stim>
/ items = ("A", "B", "C")
/ select = values.stimnumber
/ erase = false
</text>

<text up>
/ items = ("↑")
/ erase = false
/ position = (30%, 50%)
</text>

<text down>
/ items = ("↓")
/ erase = false
/ position = (70%, 50%)
</text>

<shape indicator>
/ shape = rectangle
/ color = blue
/ position = (10%, 50%)
/ size = (5%, 1%)
/ erase = false
/ halign = center
/ valign = bottom
</shape>

<shape indicator_up>
/ shape = rectangle
/ color = red
/ position = (10%, 50%)
/ size = (5%, 1%)
/ erase = false
/ halign = center
/ valign = bottom
</shape>

<shape indicator_down>
/ shape = rectangle
/ color = red
/ position = (10%, 48%)
/ size = (5%, 1%)
/ erase = false
/ halign = center
/ valign = top
</shape>

<text mitte>
/ items = ("4s")
/ color = blue
/ position = (15%, 50%)
/ erase = false

</text>

<text up_05>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 45%)
/ erase = false

</text>

<text up_1>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 40%)
/ erase = false

</text>

<text up_15>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 35%)
/ erase = false

</text>

<text up_2>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 30%)
/ erase = false

</text>

<text up_25>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 25%)
/ erase = false

</text>

<text up_30>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 20%)
/ erase = false

</text>

<text up_35>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 15%)
/ erase = false

</text>

<text up_40>
/ items = ("8s")
/ color = blue
/ position = (15%, 10%)
/ erase = false

</text>

<text down_05>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 55%)
/ erase = false

</text>

<text down_1>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 60%)
/ erase = false

</text>

<text down_15>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 65%)
/ erase = false

</text>

<text down_2>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 70%)
/ erase = false

</text>

<text down_25>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 75%)
/ erase = false

</text>

<text down_30>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 80%)
/ erase = false

</text>

<text down_35>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 85%)
/ erase = false

</text>

<text down_40>
/ items = ("0s")
/ color = blue
/ position = (15%, 90%)
/ erase = false

</text>


<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode response latency values.viewtime block.viewingtime.elapsedtime)
/ separatefiles = true
</data>


Thank you and best regards,
Jessica

> 1. Is it possible to program the task in a way that, if subjects have decided on whether to increase or decrease viewing time, this initial decision is the only correct answer (i.e., it is not possible to first increase, then decrease viewing time (or vice versa) for the same stimulus)?

Yes. Don't loop trial.viewtrial, then, but only run one instance of it and the /branch to separate <trial> elements depending on response in the 1st viewtrial: One trial that only allows for decreasing, another one that only allows for increasing viewing time.

I don't quite understand question #2. Isn't that how the script I posted behaves already?

Still not quite sure I correctly understood point #2 (my bad), but I *think* something along the following lines should be on the right track:

<values>
/ viewtime = 4000
/ maxtime = 8000;
/ adjustmentvalue = 500
/ stimnumber = 1
/ trialtimeout = 0
</values>

<expressions>
/ viewtime = values.viewtime
</expressions>

<expt>
/ blocks = [1=start; 2-4 = viewingtime;]
</expt>

<block start>
/ preinstructions = (startinstr)
</block>

<page startinstr>
^press the spacebar when you're ready
</page>

<instruct>
/ nextkey = (57)
</instruct>
values.viewtime == values.maxtime || values.viewtime == values.mintime;

<block viewingtime>
/ onblockbegin = [

values.viewtime = 4000;
shape.indicator.height = 2%;
shape.indicator_up.height = 1%;
shape.indicator_down.height = 1%;
values.stimnumber = list.stimnumbers.nextindex;
]

/ stop = [ ((trial.viewtrial.response == 208 || trial.decrement.response == 208) && block.viewingtime.elapsedtime >= values.viewtime)]
/ stop = [block.viewingtime.elapsedtime >= values.maxtime]
/ trials = [1=viewtrial]
/ branch = [
block.start;
]
</block>

//on the keyboard
//press the UP arrow to increase view time
/ press DOWN arrow to decrease view time
<trial viewtrial>
/ ontrialbegin = [
if (block.viewingtime.elapsedtime < values.viewtime) values.trialtimeout = values.viewtime - block.viewingtime.elapsedtime else values.trialtimeout = 0;
]

/ stimulustimes = [1=clearscreen, stim, up, down, indicator_up,indicator_down, indicator,mitte,up_05,up_1,up_15,up_2,up_25,up_30,up_35,up_40,down_05,down_1,down_15,down_2,down_25,down_30,down_35,down_40]
/ beginresponsetime = 0
/ validresponse = (200, 208)

/ ontrialend = [
if (trial.viewtrial.response == 200 && values.viewtime < 8000) {
values.viewtime += values.adjustmentvalue;
shape.indicator_up.height += 5%;

};
if (trial.viewtrial.response == 208 && values.viewtime > 0){
values.viewtime -= values.adjustmentvalue;
shape.indicator_down.height += 5%;

};

]

/ branch = [if (trial.viewtrial.response == 208 && values.viewtime >= 0 ) trial.decrement]
/ branch = [if (trial.viewtrial.response == 200 && values.viewtime <= 8000) trial.increment]
/ timeout = values.trialtimeout
</trial>



<trial increment>
/ ontrialbegin = [
if (block.viewingtime.elapsedtime < values.viewtime) values.trialtimeout = values.viewtime - block.viewingtime.elapsedtime else values.trialtimeout = 0;
]

/ stimulustimes = [1=clearscreen, stim, up, down, indicator_up,indicator_down, indicator,mitte,up_05,up_1,up_15,up_2,up_25,up_30,up_35,up_40,down_05,down_1,down_15,down_2,down_25,down_30,down_35,down_40]
/ beginresponsetime = 0
/ validresponse = (200)

/ ontrialend = [
if (trial.increment.response == 200 && values.viewtime < 8000) {
values.viewtime += values.adjustmentvalue;
shape.indicator_up.height += 5%;}

]
/ branch = [if (values.trialtimeout > 0) trial.increment]
/ timeout = values.trialtimeout
</trial>

<trial decrement>
/ ontrialbegin = [
if (block.viewingtime.elapsedtime < values.viewtime) values.trialtimeout = values.viewtime - block.viewingtime.elapsedtime else values.trialtimeout = 0;
]

/ stimulustimes = [1=clearscreen, stim, up, down, indicator_up,indicator_down, indicator,mitte,up_05,up_1,up_15,up_2,up_25,up_30,up_35,up_40,down_05,down_1,down_15,down_2,down_25,down_30,down_35,down_40]
/ beginresponsetime = 0
/ validresponse = (208)

/ ontrialend = [
if (trial.decrement.response == 208 && values.viewtime > 0){
values.viewtime -= values.adjustmentvalue;
shape.indicator_down.height += 5%;}
]
/ branch = [if (values.trialtimeout > 0) trial.decrement]
/ timeout = values.trialtimeout
</trial>

//3 items in this example
<list stimnumbers>
/ poolsize = 3
</list>

<text stim>
/ items = ("A", "B", "C")
/ select = values.stimnumber
/ erase = false
</text>

<text up>
/ items = ("↑")
/ erase = false
/ position = (30%, 50%)
</text>

<text down>
/ items = ("↓")
/ erase = false
/ position = (70%, 50%)
</text>

<shape indicator>
/ shape = rectangle
/ color = blue
/ position = (10%, 50%)
/ size = (5%, 1%)
/ erase = false
/ halign = center
/ valign = bottom
</shape>

<shape indicator_up>
/ shape = rectangle
/ color = red
/ position = (10%, 50%)
/ size = (5%, 1%)
/ erase = false
/ halign = center
/ valign = bottom
</shape>

<shape indicator_down>
/ shape = rectangle
/ color = red
/ position = (10%, 48%)
/ size = (5%, 1%)
/ erase = false
/ halign = center
/ valign = top
</shape>

<text mitte>
/ items = ("4s")
/ color = blue
/ position = (15%, 50%)
/ erase = false

</text>

<text up_05>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 45%)
/ erase = false

</text>

<text up_1>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 40%)
/ erase = false

</text>

<text up_15>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 35%)
/ erase = false

</text>

<text up_2>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 30%)
/ erase = false

</text>

<text up_25>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 25%)
/ erase = false

</text>

<text up_30>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 20%)
/ erase = false

</text>

<text up_35>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 15%)
/ erase = false

</text>

<text up_40>
/ items = ("8s")
/ color = blue
/ position = (15%, 10%)
/ erase = false

</text>

<text down_05>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 55%)
/ erase = false

</text>

<text down_1>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 60%)
/ erase = false

</text>

<text down_15>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 65%)
/ erase = false

</text>

<text down_2>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 70%)
/ erase = false

</text>

<text down_25>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 75%)
/ erase = false

</text>

<text down_30>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 80%)
/ erase = false

</text>

<text down_35>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 85%)
/ erase = false

</text>

<text down_40>
/ items = ("0s")
/ color = blue
/ position = (15%, 90%)
/ erase = false

</text>


<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode response latency values.viewtime block.viewingtime.elapsedtime)
/ separatefiles = true
</data>

Jessica_FAU
Jessica_FAU
Associate Member
Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)

Group: Forum Members
Posts: 4, Visits: 20
Dave - Monday, October 22, 2018
Dave - Monday, October 22, 2018
Jessica_FAU - Monday, October 22, 2018

Dear Dave,

Thank you for your helpful answers. Your script gave me a good starting point to continue working on the task. However, now I encountered new difficulties, haha.

Below you can find my current version of the script.

And I have the following questions:

1. Is it possible to program the task in a way that, if subjects have decided on whether to increase or decrease viewing time, this initial decision is the only correct answer (i.e., it is not possible to first increase, then decrease viewing time (or vice versa) for the same stimulus)?

2. Is it possible to program the timeout function in a way that, a) if no response is made, a stimulus will be displayed for only 4 sec? AND b) if a response is made (e.g., increase viewing time) during the default time of 4 sec, the default time will increase dependent on the key presses made by the subject? For example, 3 key presses correspond to an increase of viewing time of 1.5 seconds (=in total, 5.5sec viewing time).

<values>
/ viewtime = 4000
/ maxtime = 8000;
/ adjustmentvalue = 500
/ stimnumber = 1

</values>

<expressions>
/ viewtime = values.viewtime
</expressions>

<expt>
/ blocks = [1=start; 2-4 = viewingtime;]
</expt>

<block start>
/ preinstructions = (startinstr)
</block>

<page startinstr>
^press the spacebar when you're ready
</page>

<instruct>
/ nextkey = (57)
</instruct>
values.viewtime == values.maxtime || values.viewtime == values.mintime;

<block viewingtime>
/ onblockbegin = [

values.viewtime = 4000;
shape.indicator.height = 2%;
shape.indicator_up.height = 1%;
shape.indicator_down.height = 1%;
values.stimnumber = list.stimnumbers.nextindex;
]

/ stop = [ if (trial.viewtrial.response == 208) block.viewingtime.elapsedtime >= values.viewtime; else block.viewingtime.elapsedtime >= values.maxtime]
/ trials = [1=viewtrial]
/ branch = [
block.start;
]
</block>

//on the keyboard
//press the UP arrow to increase view time
/ press DOWN arrow to decrease view time
<trial viewtrial>


/ stimulustimes = [1=clearscreen, stim, up, down, indicator_up,indicator_down, indicator,mitte,up_05,up_1,up_15,up_2,up_25,up_30,up_35,up_40,down_05,down_1,down_15,down_2,down_25,down_30,down_35,down_40]
/ beginresponsetime = 0
/ validresponse = (200, 208)

/ ontrialend = [
if (trial.viewtrial.response == 200 && values.viewtime < 8000) {
values.viewtime += values.adjustmentvalue;
shape.indicator_up.height += 5%;

};
if (trial.viewtrial.response == 208 && values.viewtime > 0){
values.viewtime -= values.adjustmentvalue;
shape.indicator_down.height += 5%;

};

]

/ branch = [if ((trial.viewtrial.response == 208 && values.viewtime >= 0 ) || (trial.viewtrial.response == 200 && values.viewtime <= 8000)) trial.viewtrial
]

/ timeout = 4000
</trial>



//3 items in this example
<list stimnumbers>
/ poolsize = 3
</list>

<text stim>
/ items = ("A", "B", "C")
/ select = values.stimnumber
/ erase = false
</text>

<text up>
/ items = ("↑")
/ erase = false
/ position = (30%, 50%)
</text>

<text down>
/ items = ("↓")
/ erase = false
/ position = (70%, 50%)
</text>

<shape indicator>
/ shape = rectangle
/ color = blue
/ position = (10%, 50%)
/ size = (5%, 1%)
/ erase = false
/ halign = center
/ valign = bottom
</shape>

<shape indicator_up>
/ shape = rectangle
/ color = red
/ position = (10%, 50%)
/ size = (5%, 1%)
/ erase = false
/ halign = center
/ valign = bottom
</shape>

<shape indicator_down>
/ shape = rectangle
/ color = red
/ position = (10%, 48%)
/ size = (5%, 1%)
/ erase = false
/ halign = center
/ valign = top
</shape>

<text mitte>
/ items = ("4s")
/ color = blue
/ position = (15%, 50%)
/ erase = false

</text>

<text up_05>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 45%)
/ erase = false

</text>

<text up_1>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 40%)
/ erase = false

</text>

<text up_15>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 35%)
/ erase = false

</text>

<text up_2>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 30%)
/ erase = false

</text>

<text up_25>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 25%)
/ erase = false

</text>

<text up_30>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 20%)
/ erase = false

</text>

<text up_35>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 15%)
/ erase = false

</text>

<text up_40>
/ items = ("8s")
/ color = blue
/ position = (15%, 10%)
/ erase = false

</text>

<text down_05>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 55%)
/ erase = false

</text>

<text down_1>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 60%)
/ erase = false

</text>

<text down_15>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 65%)
/ erase = false

</text>

<text down_2>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 70%)
/ erase = false

</text>

<text down_25>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 75%)
/ erase = false

</text>

<text down_30>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 80%)
/ erase = false

</text>

<text down_35>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 85%)
/ erase = false

</text>

<text down_40>
/ items = ("0s")
/ color = blue
/ position = (15%, 90%)
/ erase = false

</text>


<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode response latency values.viewtime block.viewingtime.elapsedtime)
/ separatefiles = true
</data>


Thank you and best regards,
Jessica

> 1. Is it possible to program the task in a way that, if subjects have decided on whether to increase or decrease viewing time, this initial decision is the only correct answer (i.e., it is not possible to first increase, then decrease viewing time (or vice versa) for the same stimulus)?

Yes. Don't loop trial.viewtrial, then, but only run one instance of it and the /branch to separate <trial> elements depending on response in the 1st viewtrial: One trial that only allows for decreasing, another one that only allows for increasing viewing time.

I don't quite understand question #2. Isn't that how the script I posted behaves already?

Still not quite sure I correctly understood point #2 (my bad), but I *think* something along the following lines should be on the right track:

<values>
/ viewtime = 4000
/ maxtime = 8000;
/ adjustmentvalue = 500
/ stimnumber = 1
/ trialtimeout = 0
</values>

<expressions>
/ viewtime = values.viewtime
</expressions>

<expt>
/ blocks = [1=start; 2-4 = viewingtime;]
</expt>

<block start>
/ preinstructions = (startinstr)
</block>

<page startinstr>
^press the spacebar when you're ready
</page>

<instruct>
/ nextkey = (57)
</instruct>
values.viewtime == values.maxtime || values.viewtime == values.mintime;

<block viewingtime>
/ onblockbegin = [

values.viewtime = 4000;
shape.indicator.height = 2%;
shape.indicator_up.height = 1%;
shape.indicator_down.height = 1%;
values.stimnumber = list.stimnumbers.nextindex;
]

/ stop = [ ((trial.viewtrial.response == 208 || trial.decrement.response == 208) && block.viewingtime.elapsedtime >= values.viewtime)]
/ stop = [block.viewingtime.elapsedtime >= values.maxtime]
/ trials = [1=viewtrial]
/ branch = [
block.start;
]
</block>

//on the keyboard
//press the UP arrow to increase view time
/ press DOWN arrow to decrease view time
<trial viewtrial>
/ ontrialbegin = [
if (block.viewingtime.elapsedtime < values.viewtime) values.trialtimeout = values.viewtime - block.viewingtime.elapsedtime else values.trialtimeout = 0;
]

/ stimulustimes = [1=clearscreen, stim, up, down, indicator_up,indicator_down, indicator,mitte,up_05,up_1,up_15,up_2,up_25,up_30,up_35,up_40,down_05,down_1,down_15,down_2,down_25,down_30,down_35,down_40]
/ beginresponsetime = 0
/ validresponse = (200, 208)

/ ontrialend = [
if (trial.viewtrial.response == 200 && values.viewtime < 8000) {
values.viewtime += values.adjustmentvalue;
shape.indicator_up.height += 5%;

};
if (trial.viewtrial.response == 208 && values.viewtime > 0){
values.viewtime -= values.adjustmentvalue;
shape.indicator_down.height += 5%;

};

]

/ branch = [if (trial.viewtrial.response == 208 && values.viewtime >= 0 ) trial.decrement]
/ branch = [if (trial.viewtrial.response == 200 && values.viewtime <= 8000) trial.increment]
/ timeout = values.trialtimeout
</trial>



<trial increment>
/ ontrialbegin = [
if (block.viewingtime.elapsedtime < values.viewtime) values.trialtimeout = values.viewtime - block.viewingtime.elapsedtime else values.trialtimeout = 0;
]

/ stimulustimes = [1=clearscreen, stim, up, down, indicator_up,indicator_down, indicator,mitte,up_05,up_1,up_15,up_2,up_25,up_30,up_35,up_40,down_05,down_1,down_15,down_2,down_25,down_30,down_35,down_40]
/ beginresponsetime = 0
/ validresponse = (200)

/ ontrialend = [
if (trial.increment.response == 200 && values.viewtime < 8000) {
values.viewtime += values.adjustmentvalue;
shape.indicator_up.height += 5%;}

]
/ branch = [if (values.trialtimeout > 0) trial.increment]
/ timeout = values.trialtimeout
</trial>

<trial decrement>
/ ontrialbegin = [
if (block.viewingtime.elapsedtime < values.viewtime) values.trialtimeout = values.viewtime - block.viewingtime.elapsedtime else values.trialtimeout = 0;
]

/ stimulustimes = [1=clearscreen, stim, up, down, indicator_up,indicator_down, indicator,mitte,up_05,up_1,up_15,up_2,up_25,up_30,up_35,up_40,down_05,down_1,down_15,down_2,down_25,down_30,down_35,down_40]
/ beginresponsetime = 0
/ validresponse = (208)

/ ontrialend = [
if (trial.decrement.response == 208 && values.viewtime > 0){
values.viewtime -= values.adjustmentvalue;
shape.indicator_down.height += 5%;}
]
/ branch = [if (values.trialtimeout > 0) trial.decrement]
/ timeout = values.trialtimeout
</trial>

//3 items in this example
<list stimnumbers>
/ poolsize = 3
</list>

<text stim>
/ items = ("A", "B", "C")
/ select = values.stimnumber
/ erase = false
</text>

<text up>
/ items = ("↑")
/ erase = false
/ position = (30%, 50%)
</text>

<text down>
/ items = ("↓")
/ erase = false
/ position = (70%, 50%)
</text>

<shape indicator>
/ shape = rectangle
/ color = blue
/ position = (10%, 50%)
/ size = (5%, 1%)
/ erase = false
/ halign = center
/ valign = bottom
</shape>

<shape indicator_up>
/ shape = rectangle
/ color = red
/ position = (10%, 50%)
/ size = (5%, 1%)
/ erase = false
/ halign = center
/ valign = bottom
</shape>

<shape indicator_down>
/ shape = rectangle
/ color = red
/ position = (10%, 48%)
/ size = (5%, 1%)
/ erase = false
/ halign = center
/ valign = top
</shape>

<text mitte>
/ items = ("4s")
/ color = blue
/ position = (15%, 50%)
/ erase = false

</text>

<text up_05>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 45%)
/ erase = false

</text>

<text up_1>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 40%)
/ erase = false

</text>

<text up_15>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 35%)
/ erase = false

</text>

<text up_2>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 30%)
/ erase = false

</text>

<text up_25>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 25%)
/ erase = false

</text>

<text up_30>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 20%)
/ erase = false

</text>

<text up_35>
/ items = ("+0.5")
/ color = blue
/ position = (15%, 15%)
/ erase = false

</text>

<text up_40>
/ items = ("8s")
/ color = blue
/ position = (15%, 10%)
/ erase = false

</text>

<text down_05>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 55%)
/ erase = false

</text>

<text down_1>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 60%)
/ erase = false

</text>

<text down_15>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 65%)
/ erase = false

</text>

<text down_2>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 70%)
/ erase = false

</text>

<text down_25>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 75%)
/ erase = false

</text>

<text down_30>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 80%)
/ erase = false

</text>

<text down_35>
/ items = ("-0.5")
/ color = blue
/ position = (15%, 85%)
/ erase = false

</text>

<text down_40>
/ items = ("0s")
/ color = blue
/ position = (15%, 90%)
/ erase = false

</text>


<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode response latency values.viewtime block.viewingtime.elapsedtime)
/ separatefiles = true
</data>

Thank you so much, you were very helpful!

GO


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....






Millisecond Forums


Search