Millisecond Forums

Visual Analogue Scale issues (screen resolution and mouse cursor)

https://forums.millisecond.com/Topic14769.aspx

By Joel Cavallo - 10/30/2014

Hello,
I am running a program that contains 3 different tasks. One of the tasks is a visual analogue scale (VAS) that was modified from a version found here on the forums. I am having issues with variable screen resolutions. Because we are running the script remotely from participant computers at home, I need the VAS to scale according to different resolutions. I know that traditionally this is done by using percentage values for the line length, such as 94% of the screen, etc. When I do this, there are now problems with the clicking of the mouse on the VAS line, the corresponding "X" that is marked on that line, and the  % value that corresponds to where I just clicked. 

For example, when working on a laptop computer with a screen resolution of 1280 X 800, when the VAS line appears, I click all the way to the right, which should correspond to 100%. Instead the "X" appears about 1 inch to the left of where I clicked and the value says something like 83%. When I click all the way to the left (i.e. 0%), the "X" appears in the correct position and the percent value also indicates 0%. Thus, at the left-hand side of the screen, the mouse cursor, X, and % match, but the further I go to the right, the worse the discrepancy becomes. This leads me to believe that the issue lies with the multiplier that is given for the expression equation in the script:

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

I can adjust this multiplier for my specific resolution, but then when I change the resolution, the issues obviously returns. One additional clue to the problem might be that when I specify that my VAS line should be 100% of the screen, it takes up maybe 80% of the screen. The same is true for my images during this task. When I specify the image should be 100% of the screen, there are two wide vertical borders (~1 inch) that flank the images. Thus, Inquisit might believe that the line is longer than it really is and when the score is calculated using the above equation, it incorrectly gives out a score. Therefore, I currently have the line length as a discrete length (eg. 1280, 6), but I would like to make it a % such as 94% as long as I can get the "X" to appear at the correct spot on the line and give a correct corresponding % (from 0-100). 

The final issue I have no clue as to why it might be occurring. When the first participant ran the task this morning on a mid 2012 13 inch macbook pro, the mouse cursor did not appear during this task, which prevented him from clicking on the VAS line. Any thoughts on this strange issue? I have attached the current script to this post for your reference. Thank you in advance.
By Dave - 10/30/2014

> One additional clue to the problem might be that when I specify that my VAS line should be 100% of the screen, it takes up maybe 80% of the screen.

That's because you specified

<defaults>
...
/canvasaspectratio = (4,3)
</defaults>

The calculations in the <expressions> are based on display width, not canvas size.

No idea about the mouse issue, I'm afraid.
By Joel Cavallo - 10/30/2014

Ok, that is certainly helpful! Knowing that I need to change that setting, how can I ensure that the VAS line and pictures will be displayed similarly on various screen types. Should I specify an aspect ratio at all or just remove that altogether? Thanks.
By Dave - 10/30/2014

Observe the difference between:

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

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

<trial mytrial>
/ stimulusframes = [1=bg, line]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showx]
</trial>

<trial showx>
/ stimulusframes = [1=x, debug]
/ trialduration = 2000
</trial>

<shape line>
/ shape = rectangle
/ size = (0.94px*display.width, 2%)
/ position = (50%, 80%)
/ erase = false
</shape>

<text x>
/ items = ("X")
/ txcolor = (red)
/ txbgcolor = (transparent)
/ fontstyle = ("Arial", 10%, true)
/ hposition = 1px*trial.mytrial.responsex
/ vposition = shape.line.vposition
</text>

<text debug>
/ items = ("<%expressions.roundedvalue%>")
</text>

<shape bg>
/ color = (grey)
/ erase = false
/ size = (100%,100%)
</shape>

and

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

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

<trial mytrial>
/ stimulusframes = [1=bg, line]
/ inputdevice = mouse
/ validresponse = (line)
/ branch = [trial.showx]
</trial>

<trial showx>
/ stimulusframes = [1=x, debug]
/ trialduration = 2000
</trial>

<shape line>
/ shape = rectangle
/ size = (0.94px*display.canvaswidth, 2%)
/ position = (50%, 80%)
/ erase = false
</shape>

<text x>
/ items = ("X")
/ txcolor = (red)
/ txbgcolor = (transparent)
/ fontstyle = ("Arial", 10%, true)
/ hposition = 1px*trial.mytrial.responsex
/ vposition = shape.line.vposition
</text>

<text debug>
/ items = ("<%expressions.roundedvalue%>")
</text>

<shape bg>
/ color = (grey)
/ erase = false
/ size = (100%,100%)
</shape>

<defaults>
/ canvasaspectratio = (4,3)
</defaults>
By Joel Cavallo - 10/30/2014

As usual, your advice worked perfectly! Quick question. In your modification of the <shape line> size attribute, you specify "0.94px*display.width, 2%" What precisely does the 0.94px indicate?

Finally, as far as the mouse cursor not appearing, do you know which internet browsers are preferred for running inquisit? Perhaps the participant was using a less than desirable browser for the tasks. I know that I have had trouble on my mac running the tasks with chrome, but don't have any trouble using firefox. Thanks.
By Dave - 10/30/2014

That's 94% of the display width in a pixels (px).

Inquisit Web should (and according to my experience does) play nice with all major browsers, including Chrome. I would rate the likelihood that the mouse issue was due to the browser used as pretty low, though.
By Joel Cavallo - 10/31/2014

Hello,
I just wanted to provide an update regarding the missing cursor in the VAS task. It turns out the the participant taking the task was indeed using Chrome on a mac. When he used Firefox the cursor reappeared without any issue. Thus, there might be a problem with the VAS code only in mac Chrome. Just fyi. Thanks again for all of your help.
By Dave - 10/31/2014

Thanks for the update. A couple more questions: Which Inquisit Web version are you using? If it's not the latest, please update your launch page to use the latest release (4.0.7.0). Which launch method did the participant in question use? The NPAPI plugin or the Web Player? Perhaps both? Did the issue occur in both or just one? Thanks!
By Joel Cavallo - 11/1/2014

Hello,
Your intuition was right. We are using the older version 4.0.6.0. Quick question though. If I update the version for the web script to the current version 4.0.7.0 will this create issues for my program that was created in version 4.0.6.0? When I open my script on my desktop computer I try to update the software version, but I get the error message: "Update check failed, Unable to retrieve update information." Please let me know what I should do. Thanks.

As far as the plugin vs. web player, the participant used the downloaded plugin, which opened up a separate webpage with the tasks.
By Dave - 11/1/2014

No, using 4.0.7.0 should not create any problems for your script created with 4.0.6.0.

You can always obtain the latest Inquisit Lab version via https://www.millisecond.com/download/ and install it on your system.

> As far as the plugin vs. web player, the participant used the downloaded plugin, which opened up a separate webpage with the
> tasks.

I'm sorry, but I'm not sure what that means. Especially the part about opening "up a separate webpage with the tasks". No launch method will (or at least should) do that (open up a separate webpage). Could you clarify?
By Joel Cavallo - 11/4/2014

Ok, I'll update the version on our desktop computer and then re-post the script on the Inquisit site. Sorry for the confusion regarding the plugin vs. webplayer. The participant downloaded the Inquisit.jnlp, clicked on it and the tasks appeared on the screen. I'm not sure if this constitutes a plugin-induced opening of a web player, but that was the sequence of events. I was incorrect when I stated that it opened a new web browser. After the experiment is completed, then a new tab opens in the web browser, which provides a "thank you" message.