Austin
|
|
Group: Forum Members
Posts: 3,
Visits: 27
|
Hello,
The following code displays a "smooth" slider on my Macbook Air running El Captain 10.11.1 with an integrated Intel 5000 graphics card. It has inquisit version 4.0.8.0. By smooth, I mean a slider that the user is able to adjust on a continuum. This smooth slider has a circle which the user can drag, and the bar turns blue as they adjust the slider. Also, the slider is vertically oriented and has the bottom position recognized as a value of "0" and the topmost position recognized as a "10".
I have windows computer running Microsoft Windows 7 Enterprise version 6.1.7601 Service Pack 1 Build 7061 (64 Bit) with a NVIDIA NVS 4200M integrated graphics card with the most up to date drivers. It is running inquisit 4.0.7.0. When this code is run on the windows machine, it does not display a smooth slider (one without ticks) even though the showticks = false. Instead, it displays a slider with the triangular pointer device and discrete selection values. In addition, it recognizes the topmost position as "0" and the bottommost position as "10."
I need the slider to display on the windows machine as it would display on the Mac machine, but I am unable to adjust the settings to do so. Please tell me how I can fix this.
Thanks,
<slider userIntensity> / caption = " Blast~nIntensity" /txcolor = black / fontstyle = ("Arial", 3%) / labels = ("10", "9", "8", "7", "6", "5", "4", "3", "2", "1", "0") / range = (0,10) / validresponse = ("0","1", "2", "3", "4", "5", "6", "7", "8", "9", "10") / orientation = vertical / responsefontstyle = ("Arial", 2%) / slidersize = (3.5%,55%) / position = (68.3%, 25%) / defaultresponse = ("0") /showticks = false </slider>
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
The differences in slider behavior are due to some fundamental platform differences. They cannot be made to behave perfectly identically, I'm afraid. If you want a solution that behaves identically across platforms, you'll have to refrain from using the <slider> and instead build something using standard <trial> elements along the following lines:
<values> / indicatorvpos = 75% / intensity = 0 </values>
<expt> / blocks = [1-2=myblock] </expt>
<block myblock> / onblockbegin = [values.indicatorvpos=75%; values.intensity=0] / trials = [1=adjustintensity; 2=summary; ] </block>
<trial adjustintensity> / stimulusframes = [1=blank, line, l10, l05, l00, intensity, indicator, submit] / inputdevice = mouse / validresponse = (indicator, submit) / branch = [if(trial.adjustintensity.response=="indicator") trial.moveindicator] </trial>
<trial moveindicator> / ontrialend = [values.indicatorvpos = 1px*trial.moveindicator.responsey; ] / ontrialend = [if (values.indicatorvpos>0.75*display.height) values.indicatorvpos=0.75px*display.height; ] / ontrialend = [if (values.indicatorvpos<0.25*display.height) values.indicatorvpos=0.25px*display.height; ] / ontrialend = [values.intensity = round(10-(10*(values.indicatorvpos-0.25*display.height)/(0.5*display.height))); ] / stimulusframes = [1=blank, line, l10, l05, l00, intensity, indicator, submit] / inputdevice = mousekey / validresponse = (lbuttonup, lbuttondown, mousemove) / branch = [if (trial.moveindicator.response=="mousemove") trial.moveindicator else trial.adjustintensity] / recorddata = false </trial>
<trial summary> / stimulusframes = [1=blank, summarytext] / validresponse = (57) </trial>
<shape line> / shape = rectangle / size = (0.5%, 50%) / position = (68.5%, 25%) / erase = false / valign = top </shape>
<shape indicator> / shape = circle / color = blue / erase = false / size = (0.02px*display.width, 0.02px*display.width) / hposition = 68.5% / vposition = values.indicatorvpos </shape>
<shape blank> / shape = rectangle / color = white / size = (100%, 100%) / erase = false </shape>
<text L10> / items = ("10") / position = (72%, 25%) / erase = false </text>
<text L05> / items = ("5") / position = (72%, 50%) / erase = false </text>
<text L00> / items = ("0") / position = (72%, 75%) / erase = false </text>
<text intensity> / items = ("Intensity: <%values.intensity%>") / erase = false / position = (85%, 50%) </text>
<text submit> / items = ("OK >>") / erase = false / position = (50%, 90%) </text>
<text summarytext> / items = ("You chose the following intensity: <%values.intensity%>") </text>
|
|
|
wollewalda
|
|
Group: Forum Members
Posts: 1,
Visits: 1
|
The custom-built slider using <trial> elements will not work correctly for Inquisit on the Mac. This is because the mousemove event is not fired when moving the mouse while holding down the mousebutton. The event will only fire once, when the mouse has been moved inbetween and the button is released. This results in the user not being able to adjust the slider very good. The slider behaves very "laggy".
This can be easily reproduced with just the following test trial: <trial move> / inputdevice = mouse / validresponse = (mousemove) / showmousecursor = true </trial>
Run it and try to: a) Move the mouse without pressing a button -> this will exit immediately b) Move the mouse with pressing a button -> this will exit immediately on a PC, but will only exit on a Mac as soon as the button is released.
Tested with both Inquisit 4.0.8.0 and 4.0.9.0.
Is this a bug? Is there a workaround for that?
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
As a possible workaround, does it help to remove the lbuttondown event from <trial moveindicator>?
<trial moveindicator> / ontrialend = [values.indicatorvpos = 1px*trial.moveindicator.responsey; ] / ontrialend = [if (values.indicatorvpos>0.75*display.height) values.indicatorvpos=0.75px*display.height; ] / ontrialend = [if (values.indicatorvpos<0.25*display.height) values.indicatorvpos=0.25px*display.height; ] / ontrialend = [values.intensity = round(10-(10*(values.indicatorvpos-0.25*display.height)/(0.5*display.height))); ] / stimulusframes = [1=blank, line, l10, l05, l00, intensity, indicator, submit] / inputdevice = mouse / validresponse = (lbuttonup, mousemove) / branch = [if (trial.moveindicator.response=="mousemove") trial.moveindicator else trial.adjustintensity] / recorddata = false </trial>
Another thing worth trying is to change the order of events listed in /validresponse. Inquisit checks those in the order given, i.e.,
/ validresponse = (mousemove, lbuttonup, lbuttondown)
should give mousemove precedence over button presses.
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
And, as a final resort, ditching the continuous indicator movement is an option as well. Intensity could instead be selected by clicking on the desired position on the scale directly:
<values> / indicatorvpos = 75% / intensity = 0 </values>
<expt> / blocks = [1-2=myblock] </expt>
<block myblock> / onblockbegin = [values.indicatorvpos=75%; values.intensity=0] / trials = [1=adjustintensity; 2=summary; ] </block>
<trial adjustintensity> / stimulusframes = [1=blank, line, l10, l05, l00, intensity, indicator, submit] / inputdevice = mouse / validresponse = (line, submit) / branch = [if(trial.adjustintensity.response=="line") trial.moveindicator] </trial>
<trial moveindicator> / ontrialend = [values.indicatorvpos = 1px*trial.adjustintensity.responsey; ] / ontrialend = [if (values.indicatorvpos>0.75*display.height) values.indicatorvpos=0.75px*display.height; ] / ontrialend = [if (values.indicatorvpos<0.25*display.height) values.indicatorvpos=0.25px*display.height; ] / ontrialend = [values.intensity = round(10-(10*(values.indicatorvpos-0.25*display.height)/(0.5*display.height))); ] / stimulusframes = [1=blank, line, l10, l05, l00, intensity, indicator, submit] / inputdevice = mouse / validresponse = (0) / branch = [trial.adjustintensity] / recorddata = false / trialduration = 0 </trial>
<trial summary> / stimulusframes = [1=blank, summarytext] / validresponse = (57) </trial>
<shape line> / shape = rectangle / size = (0.75%, 50%) / position = (68.5%, 25%) / erase = false / valign = top </shape>
<shape indicator> / shape = circle / color = blue / erase = false / size = (0.02px*display.width, 0.02px*display.width) / hposition = 68.5% / vposition = values.indicatorvpos </shape>
<shape blank> / shape = rectangle / color = white / size = (100%, 100%) / erase = false </shape>
<text L10> / items = ("10") / position = (72%, 25%) / erase = false </text>
<text L05> / items = ("5") / position = (72%, 50%) / erase = false </text>
<text L00> / items = ("0") / position = (72%, 75%) / erase = false </text>
<text intensity> / items = ("Intensity: <%values.intensity%>") / erase = false / position = (85%, 50%) </text>
<text submit> / items = ("OK >>") / erase = false / position = (50%, 90%) </text>
<text summarytext> / items = ("You chose the following intensity: <%values.intensity%>") </text>
|
|
|