I am having a strange phenomenon occur with a slider during a psychology experiment I am conducting. (I am a masters student)
I use a slider to change an image field, and most of the time it works properly all the way through (there are 144 trials).
Today, however, I had the slider go buggy on me and it appears to be an interface problem - possibly with windows XP. (Using Run Rev 2.9).
What happens is that the slider no longer responds properly - you can click on it but it only moves incredibly slow to the left. It is no longer draggable, you can only click it and hold down the mouse as it barely moves to the left. This behaviour continues until the rest of the trials are over. Strangely it happened at trial 93 the one time and 133 the other time.
I am a newb when it comes to programming... if it was a problem with my code shouldn't it always occur? Or is it a problem with the interface of XP and run rev? I should note that this did happen on my XP lap top once and I tried to correct for it by disabling the bar and re-enabling it when it is the participant's time to change the picture.
The code on the bar itself is:
Code: Select all
on scrollbardrag
put the thumbpos of scrollbar "Slider2" into x
set the itemdelimiter to tab
set the fielname of image "photo" to photopath&item 6 of line trialnum of stimlist&"-"&x&".bmp"
end scrollbardrag
Code: Select all
global thepath, photopath, datapath, imagelist, Data, voicelist, response, soundpath, listened, responseTime, fName, stimlist, trialnum, responseVal
local maxTrial, maxTrial2
on preopenCard
hide image "Photo"
hide player "Voices"
hide scrollbar "Slider"
hide scrollbar "Slider2"
hide button "Next"
hide button "Replay"
hide image "fixation"
hide fld "EndofTime"
hide fld "EndofExperiment"
hide fld "Break"
hide fld "Break2"
hide button "Resume"
end preopencard
on opencard
put 72 into maxTrial
put 144 into maxTrial2
put 1 into trialnum
beginExperiment
end openCard
on beginExperiment
get flushevents("all")
put 0 into response
put 0 into listened
if trialnum <= maxTrial then
show image "fixation"
wait 1 second
hide image "fixation"
set the itemdelimiter to tab
set the filename of player "Voices" to soundpath&item 7 of line trialnum of stimlist&".wav"
set the filename of player "Voices2" to soundpath&item 7 of line trialnum of stimlist&".wav"
set the filename of player "Voices3" to soundpath&item 7 of line trialnum of stimlist&".wav"
set the filename of player "Voices4" to soundpath&item 7 of line trialnum of stimlist&".wav"
set the filename of player "Voices5" to soundpath&item 7 of line trialnum of stimlist&".wav"
set the filename of image "Photo" to empty
show image "photo"
show scrollbar "Slider"
put random (2) into donkey
if donkey = 1 then
start player "Voices2"
disable scrollbar "Slider2"
disable scrollbar "Slider"
disable button "Next"
disable button "Replay"
put 0 into x
repeat until x>25
set the filename of image "photo" to photopath&item 6 of line trialnum of stimlist&"-"&25+x&".bmp"
set the thumbposition of scrollbar "slider" to 25+x
wait 8 milliseconds
add 1 to x
end repeat
put 1 into x
repeat until x>25
set the filename of image "photo" to photopath&item 6 of line trialnum of stimlist&"-"&50-x&".bmp"
set the thumbposition of scrollbar "slider" to 50-x
wait 8 milliseconds
add 1 to x
end repeat
start player "Voices3"
put 1 into x
repeat until x>25
set the filename of image "photo" to photopath&item 6 of line trialnum of stimlist&"-"&25-x&".bmp"
set the thumbposition of scrollbar "slider" to 25-x
wait 8 milliseconds
add 1 to x
end repeat
put 1 into x
repeat until x>25
set the filename of image "photo" to photopath&item 6 of line trialnum of stimlist&"-"&x&".bmp"
set the thumbposition of scrollbar "slider" to x
wait 8 milliseconds
add 1 to x
end repeat
start player "Voices4"
end if
if donkey = 2 then
start player "Voices2"
disable scrollbar "Slider2"
disable button "Next"
disable button "Replay"
put 0 into x
repeat until x>25
set the filename of image "photo" to photopath&item 6 of line trialnum of stimlist&"-"&25-x&".bmp"
set the thumbposition of scrollbar "slider" to 25-x
wait 8 milliseconds
add 1 to x
end repeat
put 1 into x
repeat until x>25
set the filename of image "photo" to photopath&item 6 of line trialnum of stimlist&"-"&x&".bmp"
set the thumbposition of scrollbar "slider" to x
wait 8 milliseconds
add 1 to x
end repeat
start player "Voices3"
put 1 into x
repeat until x>25
set the filename of image "photo" to photopath&item 6 of line trialnum of stimlist&"-"&25+x&".bmp"
set the thumbposition of scrollbar "slider" to 25+x
wait 8 milliseconds
add 1 to x
end repeat
put 1 into x
repeat until x>25
set the filename of image "photo" to photopath&item 6 of line trialnum of stimlist&"-"&50-x&".bmp"
set the thumbposition of scrollbar "slider" to 50-x
wait 8 milliseconds
add 1 to x
end repeat
start player "Voices4"
end if
set the itemdelimiter to tab
put donkey into item 20 of line trialnum of stimlist
show button "Next"
show button "Replay"
hide scrollbar "slider"
set the thumbpos of scrollbar "slider2" to 25
enable scrollbar "slider2"
show scrollbar "slider2"
enable button "Next"
enable button "Replay"
put the milliseconds into t1
send "timeout" to me in 15 seconds
wait until response = 1 with messages
if response = 1 then
put the milliseconds into t2
put t2 - t1 into responseTime
end if
set itemdelimiter to ","
put item 1 of the pendingMessages into iD
cancel iD
set the itemdelimiter to tab
saveData responseTime
saveChoice
hide image "Photo"
hide player "voices"
hide scrollbar "Slider"
hide scrollbar "slider2"
hide button "Next"
hide button "Replay"
hide image "fixation"
hide fld "EndofTime"
hide fld "EndofExperiment"
set the itemdelimiter to tab
put trialnum into item 1 of line trialnum of stimlist
add 1 to trialnum
beginExperiment
else
hide scrollbar "Slider"
hide scrollbar "Slider2"
hide button "Next"
hide button "Replay"
show field "Break"
wait 60 seconds
hide field "Break"
show field "Break2"
show button "Resume"
end if
end beginExperiment
on timeout
hide image "Photo"
hide player "voices"
hide scrollbar "Slider"
hide scrollbar "Slider2"
hide button "Next"
hide button "Replay"
show field "EndofTime"
wait 3 seconds
hide field "EndofTime"
set the itemdelimiter to tab
put trialnum into item 1 of line trialnum of stimlist
put listened into item 15 of line trialnum of stimlist
put "T-O" into item 16 of line trialnum of stimlist
put "T-O" into item 17 of line trialnum of stimlist
put "T-O" into item 18 of line trialnum of stimlist
put "T-O" into item 19 of line trialnum of stimlist
add 1 to trialnum
beginExperiment
end timeout
on timeout2
hide image "Photo"
hide player "voices"
hide scrollbar "Slider"
hide scrollbar "Slider2"
hide button "Next"
hide button "Replay"
show field "EndofTime"
wait 3 seconds
hide field "EndofTime"
set the itemdelimiter to tab
put trialnum into item 1 of line trialnum of stimlist
put listened into item 15 of line trialnum of stimlist
put "T-O" into item 16 of line trialnum of stimlist
put "T-O" into item 17 of line trialnum of stimlist
put "T-O" into item 18 of line trialnum of stimlist
put "T-O" into item 19 of line trialnum of stimlist
add 1 to trialnum
beginExperiment2
end timeout2
on saveChoice
set the itemdelimiter to tab
if response = 1 then
put the thumbpos of scrollbar "slider2" into item 17 of line trialnum of stimlist
put the thumbpos of scrollbar "slider2" into ResponseVal
put listened into item 15 of line trialnum of stimlist
put ResponseVal-25 into item 19 of line trialnum of stimlist
if ResponseVal=25 then
put "M" into item 18 of line trialnum of stimlist
end if
if ResponseVal>25 then
put "R" into item 18 of line trialnum of stimlist
end if
if ResponseVal<25 then
put "J" into item 18 of line trialnum of stimlist
end if
end if
end saveChoice
on saveData x
set the itemdelimiter to tab
put x into item 16 of line trialnum of stimlist
end saveData x
On beginExperiment2
get flushevents("all")
put 0 into response
put 0 into listened
hide fld "Break"
hide fld "Break2"
hide button "Resume"
hide image "Photo"
hide player "Voices"
hide scrollbar "Slider"
hide scrollbar "Slider2"
hide button "Next"
hide button "Replay"
hide image "fixation"
hide fld "EndofTime"
hide fld "EndofExperiment"
if trialnum <= maxTrial2 then
show image "fixation"
wait 1 second
hide image "fixation"
set the itemdelimiter to tab
set the filename of player "Voices" to soundpath&item 7 of line trialnum of stimlist&".wav"
set the filename of player "Voices2" to soundpath&item 7 of line trialnum of stimlist&".wav"
set the filename of player "Voices3" to soundpath&item 7 of line trialnum of stimlist&".wav"
set the filename of player "Voices4" to soundpath&item 7 of line trialnum of stimlist&".wav"
set the filename of player "Voices5" to soundpath&item 7 of line trialnum of stimlist&".wav"
set the filename of image "Photo" to empty
show image "photo"
show scrollbar "Slider"
put random (2) into donkey
if donkey = 1 then
start player "Voices2"
disable scrollbar "Slider"
disable scrollbar "Slider2"
disable button "Next"
disable button "Replay"
put 0 into x
repeat until x>25
set the filename of image "photo" to photopath&item 6 of line trialnum of stimlist&"-"&25+x&".bmp"
set the thumbposition of scrollbar "slider" to 25+x
wait 8 milliseconds
add 1 to x
end repeat
put 1 into x
repeat until x>25
set the filename of image "photo" to photopath&item 6 of line trialnum of stimlist&"-"&50-x&".bmp"
set the thumbposition of scrollbar "slider" to 50-x
wait 8 milliseconds
add 1 to x
end repeat
start player "Voices3"
put 1 into x
repeat until x>25
set the filename of image "photo" to photopath&item 6 of line trialnum of stimlist&"-"&25-x&".bmp"
set the thumbposition of scrollbar "slider" to 25-x
wait 8 milliseconds
add 1 to x
end repeat
put 1 into x
repeat until x>25
set the filename of image "photo" to photopath&item 6 of line trialnum of stimlist&"-"&x&".bmp"
set the thumbposition of scrollbar "slider" to x
wait 8 milliseconds
add 1 to x
end repeat
start player "Voices4"
end if
if donkey = 2 then
start player "Voices2"
disable scrollbar "Slider2"
disable button "Next"
disable button "Replay"
put 0 into x
repeat until x>25
set the filename of image "photo" to photopath&item 6 of line trialnum of stimlist&"-"&25-x&".bmp"
set the thumbposition of scrollbar "slider" to 25-x
wait 8 milliseconds
add 1 to x
end repeat
put 1 into x
repeat until x>25
set the filename of image "photo" to photopath&item 6 of line trialnum of stimlist&"-"&x&".bmp"
set the thumbposition of scrollbar "slider" to x
wait 8 milliseconds
add 1 to x
end repeat
start player "Voices3"
put 1 into x
repeat until x>25
set the filename of image "photo" to photopath&item 6 of line trialnum of stimlist&"-"&25+x&".bmp"
set the thumbposition of scrollbar "slider" to 25+x
wait 8 milliseconds
add 1 to x
end repeat
put 1 into x
repeat until x>25
set the filename of image "photo" to photopath&item 6 of line trialnum of stimlist&"-"&50-x&".bmp"
set the thumbposition of scrollbar "slider" to 50-x
wait 8 milliseconds
add 1 to x
end repeat
start player "Voices4"
end if
set the itemdelimiter to tab
put donkey into item 20 of line trialnum of stimlist
show button "Next"
show button "Replay"
hide scrollbar "slider"
set the thumbpos of scrollbar "slider2" to 25
enable scrollbar "slider2"
show scrollbar "slider2"
enable button "Next"
enable button "Replay"
put the milliseconds into t1
send "timeout2" to me in 15 seconds
wait until response = 1 with messages
if response = 1 then
put the milliseconds into t2
put t2 - t1 into responseTime
end if
set itemdelimiter to ","
put item 1 of the pendingMessages into iD
cancel iD
set the itemdelimiter to tab
saveData responseTime
saveChoice
hide image"Photo"
hide scrollbar "Slider"
hide scrollbar "Slider2"
hide button "Next"
hide button "Replay"
hide image "fixation"
put trialnum into item 1 of line trialnum of stimlist
add 1 to trialnum
beginExperiment2
else
show field "EndofExperiment"
wait 5 seconds
put stimlist into field "Data" of cd "data"
put stimlist into data
go to card "data"
put the internet date into y
put return&"Trialnum"&tab&"Condition"&tab&"Age"&tab&"Language"&tab&"Sex"&tab&"ImageName"&tab&"WordName"&tab&"Con1"&tab&"Vow1"&tab&"Con2"&tab&"Vow2"&tab&"Wordtype"&tab&"1stcontype"&tab&"RealWord?"&tab&"#Replays"&tab&"RT"&tab&"ResponseValue"&tab&"ResponseType"&tab&"Magnitude"&tab&"MvDirection" after y
put "file:"&DataPath&"D"&the ticks into fName
put y&return&Data into URL fName
end if
end beginExperiment2
Thanks in advance
-Brandon