Millisecond Forums

visual analogue scale?

https://www.millisecond.com/forums/Topic2345.aspx

By Annemarie - 12/9/2008

Hey there!

Could someone tell me if it is possible (and easy) to create a visual analogue scale in Inquisit version 3? In an older post (from 2007) someone asked the same question, and there the answer was that such a tool would be soon included in a newer version of Inquisit. So I was wondering if this is included in Inquisit 3, and if so, how...

Thanks!

Annemarie
By Dave - 12/9/2008

Hi Annemarie,

I think the closest thing to a visual analogue scale Inquisit 3 has to offer is the 'slider' question format. You could check out the following sample scripts with the downloadable version of Inquisit 3:

(1) Demographics Survey (http://www.millisecond.com/download/library/v3/demographics/demographics.exp)

(2) NASA Tlx (http://www.millisecond.com/download/library/v3/NASATLX/NASATLX.exp)

Both scripts make use of the slider question format. Try it and see if it fits your particular needs. If it doesn't, there might also be some more inconvenient ways to get Inquisit to present a VAS. So, report back and we'll take it from there.

Best,
~Dave


By Dave - 1/29/2009

For anyone who's interested, here's a small sample script that shows how to implement a 'real' VAS with Inquisit 3 (see attached file). Hopefully this will be useful for some.

Regards,
~Dave
By rainbow - 3/9/2011

Hi Dave,


This is really cool, thank you [:D]!


I just ran it and found out that I need a different one though... I would like to have one that has anchors ranging from e.g., -10 to +10.


I already tried this with making use of the buttonvalue option (short version!):


<likert stimuli>
/ stimulusframes=[1=stimuli]
/ anchors=[1="very negative"; 2="negative"; 3="neutral"; 4="good"; 5="very good"]
/ buttonvalues=[1="a"; 2="b"; 3="c"; 4="d"; 5="e"]
/ position= (50, 80)
</likert>


However, in case I would make use of the buttonvalue option I need a button for each point, in this case 21(=including zero for rating a picture as being neutral) and this will get a little bit weird... Hence, I think a VAS would be better but I have no idea how to adapt your script so I hope you can help me.


Thanks a lot!


Marcella


By Dave - 3/9/2011

What you want isn't really a VAS, so you might be better off with a slider. E.g.:


<slider myslider>
/ labels = ("very negative", "negative", "neutral", "good", "very good")
/ range = (-10,10)
/ defaultresponse = 0
/ position = (20%,50%)
/ slidersize = (50%,5%)
</slider>

<surveypage mypage>
/ stimulusframes = [1=mypic]
/ questions = [1=myslider]
</surveypage>

<text mypic>
/ items = ("A","B","C")
/ position = (50%, 30%)
</text>

<block myblock>
/ trials = [1-3=mypage]
</block>


Otherwise you need to either keep fiddling around with the <likert> element or take the VAS sample code as an inspiration to roll your own. You might also want to take a look at the 'Custom Likert Scale' sample script available from the Inquisit 2 (!) sample scripts page for further inspiration.


Regards,


~Dave

By rainbow - 3/10/2011

Hi Dave,


Thanks for your quick reply! I will try it right now!


Best,


Marcella

By rainbow - 3/10/2011

Hmm, I changed it slightly since I want to use pictures.. it keeps telling me that the element 'pic' cannot be located.... do you know why?! Thank you!


<slider myslider>
/ labels = ("very negative", "negative", "neutral", "good", "very good")
/ range = (-10,10)
/ defaultresponse = 0
/ position = (20%,50%)
/ slidersize = (50%,5%)
</slider>

<surveypage mypage>
/ stimulusframes = [1=pic]
/ questions = [1=myslider]
</surveypage>

<image pic>
/ items = ("w1.bmp","w3.bmp")
/ position = (50%, 30%)
</image>

<block myblock>
/ trials = [1-2=mypage]
</block>

<expt>
/ preinstructions = (intro)
/ blocks = [1=myblock]
/ postinstructions = (end)
</expt>

By Dave - 3/10/2011

/ stimulusframes requires you to use a <picture> element (not <image>).

By rainbow - 3/10/2011

thanx ( greenhorn question [*-)] )

By Nina - 4/16/2017

Dave - Friday, January 30, 2009
For anyone who's interested, here's a small sample script that shows how to implement a 'real' VAS with Inquisit 3 (see attached file). Hopefully this will be useful for some.

Regards,
~Dave

Hi Dave, I tried your script and found it to be quite what I was looking for. 
There´s just one problem i have. In my experiment participants are asked to rate quite a number of questions and I tried to fill in the questions in the <text question> .

<text question>
/ items = ("I am confident I get the sucess I deserve in life", "Sometimes I feel depressed.", "When I try I generally suceed")
/ position = (50, 25)
/ select = sequence
/ erase = false
</text>

The problem now is that since the questions aren´t of the same length there is always a part of the old question text displayed when the next question is presented. Is there a way to solve this problem or am I supposed to built a new item for each question? And if I have to do so, how do I implement that into the script (blocks, trials, etc.)?

I hope it get´s clear what I mean. 

Best regards, 
Nina
By Nina - 4/16/2017

Nina - Monday, April 17, 2017
Dave - Friday, January 30, 2009
For anyone who's interested, here's a small sample script that shows how to implement a 'real' VAS with Inquisit 3 (see attached file). Hopefully this will be useful for some.

Regards,
~Dave

Hi Dave, I tried your script and found it to be quite what I was looking for. 
There´s just one problem i have. In my experiment participants are asked to rate quite a number of questions and I tried to fill in the questions in the <text question> .

<text question>
/ items = ("I am confident I get the sucess I deserve in life", "Sometimes I feel depressed.", "When I try I generally suceed")
/ position = (50, 25)
/ select = sequence
/ erase = false
</text>

The problem now is that since the questions aren´t of the same length there is always a part of the old question text displayed when the next question is presented. Is there a way to solve this problem or am I supposed to built a new item for each question? And if I have to do so, how do I implement that into the script (blocks, trials, etc.)?

I hope it get´s clear what I mean. 

Best regards, 
Nina

Oh and by the way, is there a way to use screencaptures with VASs? My paradigm requires participants to answer these questions twice and use their first rating as an orientation. It would be best if they could use the very same VAS to do so but if that is not possible it would also be fine if they just see their past response. 
Can someone help me with that? 
By Dave - 4/17/2017

Nina - Monday, April 17, 2017
Nina - Monday, April 17, 2017
Dave - Friday, January 30, 2009
For anyone who's interested, here's a small sample script that shows how to implement a 'real' VAS with Inquisit 3 (see attached file). Hopefully this will be useful for some.

Regards,
~Dave

Hi Dave, I tried your script and found it to be quite what I was looking for. 
There´s just one problem i have. In my experiment participants are asked to rate quite a number of questions and I tried to fill in the questions in the <text question> .

<text question>
/ items = ("I am confident I get the sucess I deserve in life", "Sometimes I feel depressed.", "When I try I generally suceed")
/ position = (50, 25)
/ select = sequence
/ erase = false
</text>

The problem now is that since the questions aren´t of the same length there is always a part of the old question text displayed when the next question is presented. Is there a way to solve this problem or am I supposed to built a new item for each question? And if I have to do so, how do I implement that into the script (blocks, trials, etc.)?

I hope it get´s clear what I mean. 

Best regards, 
Nina

Oh and by the way, is there a way to use screencaptures with VASs? My paradigm requires participants to answer these questions twice and use their first rating as an orientation. It would be best if they could use the very same VAS to do so but if that is not possible it would also be fine if they just see their past response. 
Can someone help me with that? 

Add a <shape> to the script that covers the entire screen and thus "erases" / overwrites any previous questions fully. Display it as the 1st stimulus in <trial VisualAnalogueScale>

<shape eraser>
/ shape = rectangle
/ size = (100%,100%)
/ color = white
/ erase = false
</shape>

<trial VisualAnalogueScale>
/ stimulusframes = [1=eraser, question, leftborder, rightborder, line, leftanchor, rightanchor]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showresponse]
</trial>

To get screencaptures, set the /screencapture attribute to true in <trial showresponse>:

<trial showresponse>
/ stimulusframes = [1=X, responsevalue]
/ inputdevice = mouse
/ validresponse = (noresponse)
/ timeout = 1500
/ recorddata = false
/ screencapture = true
</trial>



By Nina - 4/17/2017

Dave - Monday, April 17, 2017
Nina - Monday, April 17, 2017
Nina - Monday, April 17, 2017
Dave - Friday, January 30, 2009
For anyone who's interested, here's a small sample script that shows how to implement a 'real' VAS with Inquisit 3 (see attached file). Hopefully this will be useful for some.

Regards,
~Dave

Hi Dave, I tried your script and found it to be quite what I was looking for. 
There´s just one problem i have. In my experiment participants are asked to rate quite a number of questions and I tried to fill in the questions in the <text question> .

<text question>
/ items = ("I am confident I get the sucess I deserve in life", "Sometimes I feel depressed.", "When I try I generally suceed")
/ position = (50, 25)
/ select = sequence
/ erase = false
</text>

The problem now is that since the questions aren´t of the same length there is always a part of the old question text displayed when the next question is presented. Is there a way to solve this problem or am I supposed to built a new item for each question? And if I have to do so, how do I implement that into the script (blocks, trials, etc.)?

I hope it get´s clear what I mean. 

Best regards, 
Nina

Oh and by the way, is there a way to use screencaptures with VASs? My paradigm requires participants to answer these questions twice and use their first rating as an orientation. It would be best if they could use the very same VAS to do so but if that is not possible it would also be fine if they just see their past response. 
Can someone help me with that? 

Add a <shape> to the script that covers the entire screen and thus "erases" / overwrites any previous questions fully. Display it as the 1st stimulus in <trial VisualAnalogueScale>

<shape eraser>
/ shape = rectangle
/ size = (100%,100%)
/ color = white
/ erase = false
</shape>

<trial VisualAnalogueScale>
/ stimulusframes = [1=eraser, question, leftborder, rightborder, line, leftanchor, rightanchor]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showresponse]
</trial>

To get screencaptures, set the /screencapture attribute to true in <trial showresponse>:

<trial showresponse>
/ stimulusframes = [1=X, responsevalue]
/ inputdevice = mouse
/ validresponse = (noresponse)
/ timeout = 1500
/ recorddata = false
/ screencapture = true
</trial>




Thank you, that helps a lot :) 
By Nina - 4/17/2017

Nina - Monday, April 17, 2017
Dave - Monday, April 17, 2017
Nina - Monday, April 17, 2017
Nina - Monday, April 17, 2017
Dave - Friday, January 30, 2009
For anyone who's interested, here's a small sample script that shows how to implement a 'real' VAS with Inquisit 3 (see attached file). Hopefully this will be useful for some.

Regards,
~Dave

Hi Dave, I tried your script and found it to be quite what I was looking for. 
There´s just one problem i have. In my experiment participants are asked to rate quite a number of questions and I tried to fill in the questions in the <text question> .

<text question>
/ items = ("I am confident I get the sucess I deserve in life", "Sometimes I feel depressed.", "When I try I generally suceed")
/ position = (50, 25)
/ select = sequence
/ erase = false
</text>

The problem now is that since the questions aren´t of the same length there is always a part of the old question text displayed when the next question is presented. Is there a way to solve this problem or am I supposed to built a new item for each question? And if I have to do so, how do I implement that into the script (blocks, trials, etc.)?

I hope it get´s clear what I mean. 

Best regards, 
Nina

Oh and by the way, is there a way to use screencaptures with VASs? My paradigm requires participants to answer these questions twice and use their first rating as an orientation. It would be best if they could use the very same VAS to do so but if that is not possible it would also be fine if they just see their past response. 
Can someone help me with that? 

Add a <shape> to the script that covers the entire screen and thus "erases" / overwrites any previous questions fully. Display it as the 1st stimulus in <trial VisualAnalogueScale>

<shape eraser>
/ shape = rectangle
/ size = (100%,100%)
/ color = white
/ erase = false
</shape>

<trial VisualAnalogueScale>
/ stimulusframes = [1=eraser, question, leftborder, rightborder, line, leftanchor, rightanchor]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showresponse]
</trial>

To get screencaptures, set the /screencapture attribute to true in <trial showresponse>:

<trial showresponse>
/ stimulusframes = [1=X, responsevalue]
/ inputdevice = mouse
/ validresponse = (noresponse)
/ timeout = 1500
/ recorddata = false
/ screencapture = true
</trial>




Thank you, that helps a lot :) 

And how can I use the screencaptures later on in the experiment? 
By Dave - 4/17/2017

Nina - Monday, April 17, 2017
Nina - Monday, April 17, 2017
Dave - Monday, April 17, 2017
Nina - Monday, April 17, 2017
Nina - Monday, April 17, 2017
Dave - Friday, January 30, 2009
For anyone who's interested, here's a small sample script that shows how to implement a 'real' VAS with Inquisit 3 (see attached file). Hopefully this will be useful for some.

Regards,
~Dave

Hi Dave, I tried your script and found it to be quite what I was looking for. 
There´s just one problem i have. In my experiment participants are asked to rate quite a number of questions and I tried to fill in the questions in the <text question> .

<text question>
/ items = ("I am confident I get the sucess I deserve in life", "Sometimes I feel depressed.", "When I try I generally suceed")
/ position = (50, 25)
/ select = sequence
/ erase = false
</text>

The problem now is that since the questions aren´t of the same length there is always a part of the old question text displayed when the next question is presented. Is there a way to solve this problem or am I supposed to built a new item for each question? And if I have to do so, how do I implement that into the script (blocks, trials, etc.)?

I hope it get´s clear what I mean. 

Best regards, 
Nina

Oh and by the way, is there a way to use screencaptures with VASs? My paradigm requires participants to answer these questions twice and use their first rating as an orientation. It would be best if they could use the very same VAS to do so but if that is not possible it would also be fine if they just see their past response. 
Can someone help me with that? 

Add a <shape> to the script that covers the entire screen and thus "erases" / overwrites any previous questions fully. Display it as the 1st stimulus in <trial VisualAnalogueScale>

<shape eraser>
/ shape = rectangle
/ size = (100%,100%)
/ color = white
/ erase = false
</shape>

<trial VisualAnalogueScale>
/ stimulusframes = [1=eraser, question, leftborder, rightborder, line, leftanchor, rightanchor]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showresponse]
</trial>

To get screencaptures, set the /screencapture attribute to true in <trial showresponse>:

<trial showresponse>
/ stimulusframes = [1=X, responsevalue]
/ inputdevice = mouse
/ validresponse = (noresponse)
/ timeout = 1500
/ recorddata = false
/ screencapture = true
</trial>




Thank you, that helps a lot :) 

And how can I use the screencaptures later on in the experiment? 

That is not possible.
By Dave - 4/17/2017

Dave - Monday, April 17, 2017
Nina - Monday, April 17, 2017
Nina - Monday, April 17, 2017
Dave - Monday, April 17, 2017
Nina - Monday, April 17, 2017
Nina - Monday, April 17, 2017
Dave - Friday, January 30, 2009
For anyone who's interested, here's a small sample script that shows how to implement a 'real' VAS with Inquisit 3 (see attached file). Hopefully this will be useful for some.

Regards,
~Dave

Hi Dave, I tried your script and found it to be quite what I was looking for. 
There´s just one problem i have. In my experiment participants are asked to rate quite a number of questions and I tried to fill in the questions in the <text question> .

<text question>
/ items = ("I am confident I get the sucess I deserve in life", "Sometimes I feel depressed.", "When I try I generally suceed")
/ position = (50, 25)
/ select = sequence
/ erase = false
</text>

The problem now is that since the questions aren´t of the same length there is always a part of the old question text displayed when the next question is presented. Is there a way to solve this problem or am I supposed to built a new item for each question? And if I have to do so, how do I implement that into the script (blocks, trials, etc.)?

I hope it get´s clear what I mean. 

Best regards, 
Nina

Oh and by the way, is there a way to use screencaptures with VASs? My paradigm requires participants to answer these questions twice and use their first rating as an orientation. It would be best if they could use the very same VAS to do so but if that is not possible it would also be fine if they just see their past response. 
Can someone help me with that? 

Add a <shape> to the script that covers the entire screen and thus "erases" / overwrites any previous questions fully. Display it as the 1st stimulus in <trial VisualAnalogueScale>

<shape eraser>
/ shape = rectangle
/ size = (100%,100%)
/ color = white
/ erase = false
</shape>

<trial VisualAnalogueScale>
/ stimulusframes = [1=eraser, question, leftborder, rightborder, line, leftanchor, rightanchor]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showresponse]
</trial>

To get screencaptures, set the /screencapture attribute to true in <trial showresponse>:

<trial showresponse>
/ stimulusframes = [1=X, responsevalue]
/ inputdevice = mouse
/ validresponse = (noresponse)
/ timeout = 1500
/ recorddata = false
/ screencapture = true
</trial>




Thank you, that helps a lot :) 

And how can I use the screencaptures later on in the experiment? 

That is not possible.

You'll have to do something like this instead:

*** Default Settings & Data Specifications ***

<defaults>
/ fontstyle = ("Arial", -19, true, false, false, false, 5, 0)
</defaults>

<data>
/ columns = [subject, date, time, blockcode, trialcode, trialnum, latency, text.question.currentitem, expressions.correctedscore]
</data>

*** Response Scoring Routines ***

<expressions>
/ correctionvalue = (display.width - shape.line.width) / 2
/ correctedscore = (values.responsex - expressions.correctionvalue) / shape.line.width * 100
/ roundedvalue = format("%.2f", expressions.correctedscore)
</expressions>

*** Block Definition ***

<block VAS>
/ trials = [1-3=VisualAnalogueScale; 4-6=VisualAnalogueScaleRepeat]
</block>

*** Trial Definitions ***

<trial VisualAnalogueScale>
/ ontrialend = [
    counter.Xstore.item = trial.VisualAnalogueScale.responsex;
    values.responseX = trial.VisualAnalogueScale.responsex;
]
/ stimulusframes = [1=eraser, question, leftborder, rightborder, line, leftanchor, rightanchor]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showresponse]
</trial>


<trial showresponse>
/ stimulusframes = [1=X, responsevalue]
/ inputdevice = mouse
/ validresponse = (noresponse)
/ timeout = 1500
/ recorddata = false
</trial>

<trial VisualAnalogueScaleRepeat>
/ ontrialbegin = [
    values.prevX = counter.Xstore.selectedvalue;
]
/ ontrialend = [
    values.responseX = trial.VisualAnalogueScaleRepeat.responsex;
]
/ stimulusframes = [1=eraser, question, leftborder, rightborder, line, leftanchor, rightanchor, prevX]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showresponse]
</trial>


*** Scale Items ***

<shape line>
/ shape = rectangle
/ color = (0, 0, 0)
/ size = (700, 6)
/ position = (50, 75)
/ erase = false
</shape>

<shape leftborder>
/ shape = rectangle
/ color = (0, 0, 0)
/ size = (6, 30)
/ position = (16, 75)
/ erase = false
</shape>

<shape rightborder>
/ shape = rectangle
/ color = (0, 0, 0)
/ size = (6, 30)
/ position = (84, 75)
/ erase = false
</shape>

<shape eraser>
/ shape = rectangle
/ size = (100%,100%)
/ color = white
/ erase = false
</shape>

<text question>
/ items = ("I am confident I get the sucess I deserve in life", "Sometimes I feel depressed.", "When I try I generally suceed")
/ position = (50, 25)
/ select = sequence
/ erase = false
</text>

<text leftanchor>
/ items = ("Left Anchor")
/ position = (10, 75)
/ size = (50, 50)
/ erase = false
</text>

<text rightanchor>
/ items = ("Right Anchor")
/ position = (90, 75)
/ size = (50, 50)
/ erase = false
</text>

*** Response Indicator ***

<text X>
/ fontstyle = ("Arial", -35, true, false, false, false, 5, 0)
/ items = ("X")
/ txcolor = (255, 0, 0)
/ txbgcolor = (transparent)
/ hposition = (values.responsex / display.width) * 100
/ vposition = shape.line.vposition
</text>

<text prevX>
/ fontstyle = ("Arial", -35, true, false, false, false, 5, 0)
/ items = ("X")
/ txcolor = (0, 0, 255)
/ txbgcolor = (transparent)
/ erase = false
/ hposition = (values.prevX / display.width) * 100
/ vposition = shape.line.vposition
</text>

<text responsevalue>
/ items = ("<% expressions.roundedvalue %> %")
/ position = (50, 85)
</text>

<counter Xstore>
/ select = sequence
</counter>

<values>
/ responseX = 0
/ prevX = 0
</values>

*** End Of File ***

I.e.: Store the responses of the 1st run-through somewhere (e.g. a <counter> or <list>) and then retrieve them for the 2nd run-through. During the 2nd run-through, the previous response to the question will be indicated by a blue X.
By Nina - 4/17/2017

Dave - Monday, April 17, 2017
Dave - Monday, April 17, 2017
Nina - Monday, April 17, 2017
Nina - Monday, April 17, 2017
Dave - Monday, April 17, 2017
Nina - Monday, April 17, 2017
Nina - Monday, April 17, 2017
Dave - Friday, January 30, 2009
For anyone who's interested, here's a small sample script that shows how to implement a 'real' VAS with Inquisit 3 (see attached file). Hopefully this will be useful for some.

Regards,
~Dave

Hi Dave, I tried your script and found it to be quite what I was looking for. 
There´s just one problem i have. In my experiment participants are asked to rate quite a number of questions and I tried to fill in the questions in the <text question> .

<text question>
/ items = ("I am confident I get the sucess I deserve in life", "Sometimes I feel depressed.", "When I try I generally suceed")
/ position = (50, 25)
/ select = sequence
/ erase = false
</text>

The problem now is that since the questions aren´t of the same length there is always a part of the old question text displayed when the next question is presented. Is there a way to solve this problem or am I supposed to built a new item for each question? And if I have to do so, how do I implement that into the script (blocks, trials, etc.)?

I hope it get´s clear what I mean. 

Best regards, 
Nina

Oh and by the way, is there a way to use screencaptures with VASs? My paradigm requires participants to answer these questions twice and use their first rating as an orientation. It would be best if they could use the very same VAS to do so but if that is not possible it would also be fine if they just see their past response. 
Can someone help me with that? 

Add a <shape> to the script that covers the entire screen and thus "erases" / overwrites any previous questions fully. Display it as the 1st stimulus in <trial VisualAnalogueScale>

<shape eraser>
/ shape = rectangle
/ size = (100%,100%)
/ color = white
/ erase = false
</shape>

<trial VisualAnalogueScale>
/ stimulusframes = [1=eraser, question, leftborder, rightborder, line, leftanchor, rightanchor]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showresponse]
</trial>

To get screencaptures, set the /screencapture attribute to true in <trial showresponse>:

<trial showresponse>
/ stimulusframes = [1=X, responsevalue]
/ inputdevice = mouse
/ validresponse = (noresponse)
/ timeout = 1500
/ recorddata = false
/ screencapture = true
</trial>




Thank you, that helps a lot :) 

And how can I use the screencaptures later on in the experiment? 

That is not possible.

You'll have to do something like this instead:

*** Default Settings & Data Specifications ***

<defaults>
/ fontstyle = ("Arial", -19, true, false, false, false, 5, 0)
</defaults>

<data>
/ columns = [subject, date, time, blockcode, trialcode, trialnum, latency, text.question.currentitem, expressions.correctedscore]
</data>

*** Response Scoring Routines ***

<expressions>
/ correctionvalue = (display.width - shape.line.width) / 2
/ correctedscore = (values.responsex - expressions.correctionvalue) / shape.line.width * 100
/ roundedvalue = format("%.2f", expressions.correctedscore)
</expressions>

*** Block Definition ***

<block VAS>
/ trials = [1-3=VisualAnalogueScale; 4-6=VisualAnalogueScaleRepeat]
</block>

*** Trial Definitions ***

<trial VisualAnalogueScale>
/ ontrialend = [
    counter.Xstore.item = trial.VisualAnalogueScale.responsex;
    values.responseX = trial.VisualAnalogueScale.responsex;
]
/ stimulusframes = [1=eraser, question, leftborder, rightborder, line, leftanchor, rightanchor]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showresponse]
</trial>


<trial showresponse>
/ stimulusframes = [1=X, responsevalue]
/ inputdevice = mouse
/ validresponse = (noresponse)
/ timeout = 1500
/ recorddata = false
</trial>

<trial VisualAnalogueScaleRepeat>
/ ontrialbegin = [
    values.prevX = counter.Xstore.selectedvalue;
]
/ ontrialend = [
    values.responseX = trial.VisualAnalogueScaleRepeat.responsex;
]
/ stimulusframes = [1=eraser, question, leftborder, rightborder, line, leftanchor, rightanchor, prevX]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showresponse]
</trial>


*** Scale Items ***

<shape line>
/ shape = rectangle
/ color = (0, 0, 0)
/ size = (700, 6)
/ position = (50, 75)
/ erase = false
</shape>

<shape leftborder>
/ shape = rectangle
/ color = (0, 0, 0)
/ size = (6, 30)
/ position = (16, 75)
/ erase = false
</shape>

<shape rightborder>
/ shape = rectangle
/ color = (0, 0, 0)
/ size = (6, 30)
/ position = (84, 75)
/ erase = false
</shape>

<shape eraser>
/ shape = rectangle
/ size = (100%,100%)
/ color = white
/ erase = false
</shape>

<text question>
/ items = ("I am confident I get the sucess I deserve in life", "Sometimes I feel depressed.", "When I try I generally suceed")
/ position = (50, 25)
/ select = sequence
/ erase = false
</text>

<text leftanchor>
/ items = ("Left Anchor")
/ position = (10, 75)
/ size = (50, 50)
/ erase = false
</text>

<text rightanchor>
/ items = ("Right Anchor")
/ position = (90, 75)
/ size = (50, 50)
/ erase = false
</text>

*** Response Indicator ***

<text X>
/ fontstyle = ("Arial", -35, true, false, false, false, 5, 0)
/ items = ("X")
/ txcolor = (255, 0, 0)
/ txbgcolor = (transparent)
/ hposition = (values.responsex / display.width) * 100
/ vposition = shape.line.vposition
</text>

<text prevX>
/ fontstyle = ("Arial", -35, true, false, false, false, 5, 0)
/ items = ("X")
/ txcolor = (0, 0, 255)
/ txbgcolor = (transparent)
/ erase = false
/ hposition = (values.prevX / display.width) * 100
/ vposition = shape.line.vposition
</text>

<text responsevalue>
/ items = ("<% expressions.roundedvalue %> %")
/ position = (50, 85)
</text>

<counter Xstore>
/ select = sequence
</counter>

<values>
/ responseX = 0
/ prevX = 0
</values>

*** End Of File ***

I.e.: Store the responses of the 1st run-through somewhere (e.g. a <counter> or <list>) and then retrieve them for the 2nd run-through. During the 2nd run-through, the previous response to the question will be indicated by a blue X.

Wow, thank you so much!! :) :) :) 
That's really great! 

Best regards, 
Nina
By Nina - 4/20/2017

Hey Dave, 

I am so sorry, but I´ve got another question. 
I´ve been working with your script (which works really great, so thank you very much again!!) and tried to include another VAS. 
To specify where the problem is I´ll have to give a short overview over the entire experiment. 
So after a few demographic questions participants are asked to rate how much they agree to certain statements (and they do so on the VAS). They are supposed to to so for three scales (Satisfaction with Life Scale (SWLS), Core Self Evaluation Scale (CSES) and PANAS). Afterwards they do a different task, where they interact with someone directly (so no Inquisit here) and then I want to reassess the three scales again but in a different order (PANAS, Satisfaction with Life Scale, Core Self Evaluation Scale)
I tried to just copy the <trial VisualAnalogeScale> and the <trial VisualAnalogeScaleRepeat> and rename them for the Scales but now I face the problem that when repeating the scales Inquisit does show an old response but not the one the participant gave on the very current item. 
I know that I somehow have to tell Inquisit where to get the old response from but I have absolutly now idea how to do so. 

I include my script here and hope it isn´t a problem that the items and instructions are in German. 

Would be great if you could give me a hint on how to solve the problem :) Thank you! 
By Dave - 4/21/2017

Nina - Friday, April 21, 2017
Hey Dave, 

I am so sorry, but I´ve got another question. 
I´ve been working with your script (which works really great, so thank you very much again!!) and tried to include another VAS. 
To specify where the problem is I´ll have to give a short overview over the entire experiment. 
So after a few demographic questions participants are asked to rate how much they agree to certain statements (and they do so on the VAS). They are supposed to to so for three scales (Satisfaction with Life Scale (SWLS), Core Self Evaluation Scale (CSES) and PANAS). Afterwards they do a different task, where they interact with someone directly (so no Inquisit here) and then I want to reassess the three scales again but in a different order (PANAS, Satisfaction with Life Scale, Core Self Evaluation Scale)
I tried to just copy the <trial VisualAnalogeScale> and the <trial VisualAnalogeScaleRepeat> and rename them for the Scales but now I face the problem that when repeating the scales Inquisit does show an old response but not the one the participant gave on the very current item. 
I know that I somehow have to tell Inquisit where to get the old response from but I have absolutly now idea how to do so. 

I include my script here and hope it isn´t a problem that the items and instructions are in German. 

Would be great if you could give me a hint on how to solve the problem :) Thank you! 

You need separate <counter>s to store the responses -- one per scale. See attached.
By Nina - 4/21/2017

Dave - Friday, April 21, 2017
Nina - Friday, April 21, 2017
Hey Dave, 

I am so sorry, but I´ve got another question. 
I´ve been working with your script (which works really great, so thank you very much again!!) and tried to include another VAS. 
To specify where the problem is I´ll have to give a short overview over the entire experiment. 
So after a few demographic questions participants are asked to rate how much they agree to certain statements (and they do so on the VAS). They are supposed to to so for three scales (Satisfaction with Life Scale (SWLS), Core Self Evaluation Scale (CSES) and PANAS). Afterwards they do a different task, where they interact with someone directly (so no Inquisit here) and then I want to reassess the three scales again but in a different order (PANAS, Satisfaction with Life Scale, Core Self Evaluation Scale)
I tried to just copy the <trial VisualAnalogeScale> and the <trial VisualAnalogeScaleRepeat> and rename them for the Scales but now I face the problem that when repeating the scales Inquisit does show an old response but not the one the participant gave on the very current item. 
I know that I somehow have to tell Inquisit where to get the old response from but I have absolutly now idea how to do so. 

I include my script here and hope it isn´t a problem that the items and instructions are in German. 

Would be great if you could give me a hint on how to solve the problem :) Thank you! 

You need separate <counter>s to store the responses -- one per scale. See attached.

Ah, I see.
Thank you so much!! :) 
By Nina - 4/25/2017

Hi Dave, 

Thank you for your help so far! :)
I still got some issues with my script. So I used your Visual Analogue Scale as a basis but created multiple different Scales within the script. There are three different experimental groups and two Scales for each group. The first group has to answer the same questions again while seeing their old answer, so I used your VisualAnalogueScale_Repeat trial. For the other two groups i used independent VASs, because they are not supposed to see their old answer.  

Now I have some trouble with the dataframe. I suppose they yield from the fact that I haven´t definded <expressions> more than once and consequently there is no link to the trials and Inquisit has problems saving the results.  
I tried to fix that myself using your examples but was confused, because in your sample script for the Visual Analogue Scale you used  trial.VisualAnalogueScale.responsex

<expressions>
/ correctionvalue = (display.width - shape.line.width) / 2
/ correctedscore = (trial.VisualAnalogueScale.responsex - expressions.correctionvalue) / shape.line.width * 100
/ roundedvalue = format("%.2f", expressions.correctedscore)
</expressions>

and then there was no further definition in the Visual Analogue Trial.  

<trial VisualAnalogueScale>
/ stimulusframes = [1=eraser,question, leftborder, rightborder, line, leftanchor, rightanchor]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showresponse]
</trial>

When I asked you about the Repetition Scale you used values.responsex and that was defined again within the trial. 

<expressions>
/ correctionvalue = (display.width - shape.line.width) / 2
/ correctedscore = (values.responsex - expressions.correctionvalue) / shape.line.width * 100
/ roundedvalue = format("%.2f", expressions.correctedscore)
</expressions>

<trial VisualAnalogueScale>

/ ontrialend = [
    counter.Xstore.item = trial.VisualAnalogueScale.responsex;
    values.responseX = trial.VisualAnalogueScale.responsex;
]
/ stimulusframes = [1=eraser, question, leftborder, rightborder, line, leftanchor, rightanchor]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showresponse]
</trial>

Obviously both ways worked out fine in your scripts, I was just wondering about which to use for my script. I could also imagine that it´s different whether I use a simple VAS or the VAS_Repeat Trial? And do I guess right, that I would also have to include the newly defined expressions in the <data> colums? 

I hope I could make my point. Would be great if you could give me a hint. Thank you in advance! :) 

For further clarification I´ll include my script. 
By Dave - 4/25/2017

Nina - Tuesday, April 25, 2017
Hi Dave, 

Thank you for your help so far! :)
I still got some issues with my script. So I used your Visual Analogue Scale as a basis but created multiple different Scales within the script. There are three different experimental groups and two Scales for each group. The first group has to answer the same questions again while seeing their old answer, so I used your VisualAnalogueScale_Repeat trial. For the other two groups i used independent VASs, because they are not supposed to see their old answer.  

Now I have some trouble with the dataframe. I suppose they yield from the fact that I haven´t definded <expressions> more than once and consequently there is no link to the trials and Inquisit has problems saving the results.  
I tried to fix that myself using your examples but was confused, because in your sample script for the Visual Analogue Scale you used  trial.VisualAnalogueScale.responsex

<expressions>
/ correctionvalue = (display.width - shape.line.width) / 2
/ correctedscore = (trial.VisualAnalogueScale.responsex - expressions.correctionvalue) / shape.line.width * 100
/ roundedvalue = format("%.2f", expressions.correctedscore)
</expressions>

and then there was no further definition in the Visual Analogue Trial.  

<trial VisualAnalogueScale>
/ stimulusframes = [1=eraser,question, leftborder, rightborder, line, leftanchor, rightanchor]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showresponse]
</trial>

When I asked you about the Repetition Scale you used values.responsex and that was defined again within the trial. 

<expressions>
/ correctionvalue = (display.width - shape.line.width) / 2
/ correctedscore = (values.responsex - expressions.correctionvalue) / shape.line.width * 100
/ roundedvalue = format("%.2f", expressions.correctedscore)
</expressions>

<trial VisualAnalogueScale>

/ ontrialend = [
    counter.Xstore.item = trial.VisualAnalogueScale.responsex;
    values.responseX = trial.VisualAnalogueScale.responsex;
]
/ stimulusframes = [1=eraser, question, leftborder, rightborder, line, leftanchor, rightanchor]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showresponse]
</trial>

Obviously both ways worked out fine in your scripts, I was just wondering about which to use for my script. I could also imagine that it´s different whether I use a simple VAS or the VAS_Repeat Trial? And do I guess right, that I would also have to include the newly defined expressions in the <data> colums? 

I hope I could make my point. Would be great if you could give me a hint. Thank you in advance! :) 

For further clarification I´ll include my script. 

values.responsex is a global variable. It isn't necessary to calculate the corrected score in the original script because there is only one <trial> element whose response that calculation is based on -- <trial visualanaloguescale>.

In your script, however, you want to make use of the x coordinate stemming from multiple, *different* trial elements. Hence you store the appropriate x coordinate in the global variable as in

<trial VisualAnalogueScale>
/ ontrialend = [
    counter.Xstore.item = trial.VisualAnalogueScale.responsex;
    values.responseX = trial.VisualAnalogueScale.responsex;
]
/ stimulusframes = [1=eraser, question, leftborder, rightborder, line, leftanchor, rightanchor]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showresponse]
</trial>

and use the variable -- values.responsex -- in the expression. You can see this script attached to my previous response:

https://www.millisecond.com/forums/FindPost21395.aspx

<trial CSESScale>
/ ontrialend = [
    counter.CSESXstore.item = trial.CSESScale.responsex;
    values.responseX = trial.CSESScale.responsex;
]
...
</trial>

<trial PANASScale>
/ ontrialend = [
    counter.PANASXstore.item = trial.PANASScale.responsex;
    values.responseX = trial.PANASScale.responsex;
]
...
</trial>

and so forth.

And yes, if you define additional expressions and want them logged, you need to add them to the <data> element's /columns attribute.
By Nina - 4/26/2017

Dave - Tuesday, April 25, 2017
Nina - Tuesday, April 25, 2017
Hi Dave, 

Thank you for your help so far! :)
I still got some issues with my script. So I used your Visual Analogue Scale as a basis but created multiple different Scales within the script. There are three different experimental groups and two Scales for each group. The first group has to answer the same questions again while seeing their old answer, so I used your VisualAnalogueScale_Repeat trial. For the other two groups i used independent VASs, because they are not supposed to see their old answer.  

Now I have some trouble with the dataframe. I suppose they yield from the fact that I haven´t definded <expressions> more than once and consequently there is no link to the trials and Inquisit has problems saving the results.  
I tried to fix that myself using your examples but was confused, because in your sample script for the Visual Analogue Scale you used  trial.VisualAnalogueScale.responsex

<expressions>
/ correctionvalue = (display.width - shape.line.width) / 2
/ correctedscore = (trial.VisualAnalogueScale.responsex - expressions.correctionvalue) / shape.line.width * 100
/ roundedvalue = format("%.2f", expressions.correctedscore)
</expressions>

and then there was no further definition in the Visual Analogue Trial.  

<trial VisualAnalogueScale>
/ stimulusframes = [1=eraser,question, leftborder, rightborder, line, leftanchor, rightanchor]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showresponse]
</trial>

When I asked you about the Repetition Scale you used values.responsex and that was defined again within the trial. 

<expressions>
/ correctionvalue = (display.width - shape.line.width) / 2
/ correctedscore = (values.responsex - expressions.correctionvalue) / shape.line.width * 100
/ roundedvalue = format("%.2f", expressions.correctedscore)
</expressions>

<trial VisualAnalogueScale>

/ ontrialend = [
    counter.Xstore.item = trial.VisualAnalogueScale.responsex;
    values.responseX = trial.VisualAnalogueScale.responsex;
]
/ stimulusframes = [1=eraser, question, leftborder, rightborder, line, leftanchor, rightanchor]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showresponse]
</trial>

Obviously both ways worked out fine in your scripts, I was just wondering about which to use for my script. I could also imagine that it´s different whether I use a simple VAS or the VAS_Repeat Trial? And do I guess right, that I would also have to include the newly defined expressions in the <data> colums? 

I hope I could make my point. Would be great if you could give me a hint. Thank you in advance! :) 

For further clarification I´ll include my script. 

values.responsex is a global variable. It isn't necessary to calculate the corrected score in the original script because there is only one <trial> element whose response that calculation is based on -- <trial visualanaloguescale>.

In your script, however, you want to make use of the x coordinate stemming from multiple, *different* trial elements. Hence you store the appropriate x coordinate in the global variable as in

<trial VisualAnalogueScale>
/ ontrialend = [
    counter.Xstore.item = trial.VisualAnalogueScale.responsex;
    values.responseX = trial.VisualAnalogueScale.responsex;
]
/ stimulusframes = [1=eraser, question, leftborder, rightborder, line, leftanchor, rightanchor]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showresponse]
</trial>

and use the variable -- values.responsex -- in the expression. You can see this script attached to my previous response:

https://www.millisecond.com/forums/FindPost21395.aspx

<trial CSESScale>
/ ontrialend = [
    counter.CSESXstore.item = trial.CSESScale.responsex;
    values.responseX = trial.CSESScale.responsex;
]
...
</trial>

<trial PANASScale>
/ ontrialend = [
    counter.PANASXstore.item = trial.PANASScale.responsex;
    values.responseX = trial.PANASScale.responsex;
]
...
</trial>

and so forth.

And yes, if you define additional expressions and want them logged, you need to add them to the <data> element's /columns attribute.

Ah, I see. Thank you! But if I get you right and only change the definition of values.responseX for each trial but don´t change anything in the <expressions>, how can I logg the different scales in the data element? 
By Dave - 4/26/2017

Nina - Wednesday, April 26, 2017
Dave - Tuesday, April 25, 2017
Nina - Tuesday, April 25, 2017
Hi Dave, 

Thank you for your help so far! :)
I still got some issues with my script. So I used your Visual Analogue Scale as a basis but created multiple different Scales within the script. There are three different experimental groups and two Scales for each group. The first group has to answer the same questions again while seeing their old answer, so I used your VisualAnalogueScale_Repeat trial. For the other two groups i used independent VASs, because they are not supposed to see their old answer.  

Now I have some trouble with the dataframe. I suppose they yield from the fact that I haven´t definded <expressions> more than once and consequently there is no link to the trials and Inquisit has problems saving the results.  
I tried to fix that myself using your examples but was confused, because in your sample script for the Visual Analogue Scale you used  trial.VisualAnalogueScale.responsex

<expressions>
/ correctionvalue = (display.width - shape.line.width) / 2
/ correctedscore = (trial.VisualAnalogueScale.responsex - expressions.correctionvalue) / shape.line.width * 100
/ roundedvalue = format("%.2f", expressions.correctedscore)
</expressions>

and then there was no further definition in the Visual Analogue Trial.  

<trial VisualAnalogueScale>
/ stimulusframes = [1=eraser,question, leftborder, rightborder, line, leftanchor, rightanchor]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showresponse]
</trial>

When I asked you about the Repetition Scale you used values.responsex and that was defined again within the trial. 

<expressions>
/ correctionvalue = (display.width - shape.line.width) / 2
/ correctedscore = (values.responsex - expressions.correctionvalue) / shape.line.width * 100
/ roundedvalue = format("%.2f", expressions.correctedscore)
</expressions>

<trial VisualAnalogueScale>

/ ontrialend = [
    counter.Xstore.item = trial.VisualAnalogueScale.responsex;
    values.responseX = trial.VisualAnalogueScale.responsex;
]
/ stimulusframes = [1=eraser, question, leftborder, rightborder, line, leftanchor, rightanchor]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showresponse]
</trial>

Obviously both ways worked out fine in your scripts, I was just wondering about which to use for my script. I could also imagine that it´s different whether I use a simple VAS or the VAS_Repeat Trial? And do I guess right, that I would also have to include the newly defined expressions in the <data> colums? 

I hope I could make my point. Would be great if you could give me a hint. Thank you in advance! :) 

For further clarification I´ll include my script. 

values.responsex is a global variable. It isn't necessary to calculate the corrected score in the original script because there is only one <trial> element whose response that calculation is based on -- <trial visualanaloguescale>.

In your script, however, you want to make use of the x coordinate stemming from multiple, *different* trial elements. Hence you store the appropriate x coordinate in the global variable as in

<trial VisualAnalogueScale>
/ ontrialend = [
    counter.Xstore.item = trial.VisualAnalogueScale.responsex;
    values.responseX = trial.VisualAnalogueScale.responsex;
]
/ stimulusframes = [1=eraser, question, leftborder, rightborder, line, leftanchor, rightanchor]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showresponse]
</trial>

and use the variable -- values.responsex -- in the expression. You can see this script attached to my previous response:

https://www.millisecond.com/forums/FindPost21395.aspx

<trial CSESScale>
/ ontrialend = [
    counter.CSESXstore.item = trial.CSESScale.responsex;
    values.responseX = trial.CSESScale.responsex;
]
...
</trial>

<trial PANASScale>
/ ontrialend = [
    counter.PANASXstore.item = trial.PANASScale.responsex;
    values.responseX = trial.PANASScale.responsex;
]
...
</trial>

and so forth.

And yes, if you define additional expressions and want them logged, you need to add them to the <data> element's /columns attribute.

Ah, I see. Thank you! But if I get you right and only change the definition of values.responseX for each trial but don´t change anything in the <expressions>, how can I logg the different scales in the data element? 

You should have all the information you need in the data file if you log the expression. The blockcode and trialcode columns tell you the scale, the logged item numbers and items tell you the scale item, etc. You can aggregate that data as needed. If you want anything beyond that (e.g. variables that sum up the responses by scale), you need to build it into the script and log it.