Millisecond Forums

background image jolts between trial and surveypage element

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

By nrouhani - 9/12/2018

hello! 

in my task, within every trial i have to shift between a trial and a surveypage element (only because i want to use a slider as a response). i have a background image that i have set "erase=false", and it sits still when i'm going through trial elements, but now that i have a surveypage element it jolts every time - is there a way to eliminate this? or set the background image as a default so it doesn't change? 

thank you! 

<trial cue>
/ stimulustimes = [0=background; 0=learnStim]
/ beginresponseframe = 0
/ timeout = 4000
/ validresponse = (noresponse)
/ branch = [
surveypage.slider
]
</trial>

<surveypage slider>
/ stimulustimes = [0=background]
/ questions=[1=estimate]
/ showbackbutton=false
/ finishlabel="Next"
/ showpagenumbers=false
/ showquestionnumbers=false
/ timeout = 5000
/ branch = [
  trial.outcome
]
</surveypage>

<picture background>
/ items = ("background.jpg")
/ size = (100%, 100%)
/ erase = false
</picture>


By Dave - 9/12/2018

nrouhani - Wednesday, September 12, 2018
hello! 

in my task, within every trial i have to shift between a trial and a surveypage element (only because i want to use a slider as a response). i have a background image that i have set "erase=false", and it sits still when i'm going through trial elements, but now that i have a surveypage element it jolts every time - is there a way to eliminate this? or set the background image as a default so it doesn't change? 

thank you! 

<trial cue>
/ stimulustimes = [0=background; 0=learnStim]
/ beginresponseframe = 0
/ timeout = 4000
/ validresponse = (noresponse)
/ branch = [
surveypage.slider
]
</trial>

<surveypage slider>
/ stimulustimes = [0=background]
/ questions=[1=estimate]
/ showbackbutton=false
/ finishlabel="Next"
/ showpagenumbers=false
/ showquestionnumbers=false
/ timeout = 5000
/ branch = [
  trial.outcome
]
</surveypage>

<picture background>
/ items = ("background.jpg")
/ size = (100%, 100%)
/ erase = false
</picture>



You can try setting the screencolor to transparent, as in

<block myblock>
/ screencolor = transparent
/ trials = [1-4 = cue]
</block>

<trial cue>
/ stimulustimes = [0=background; 0=learnStim]
/ beginresponseframe = 0
/ timeout = 4000
/ validresponse = (noresponse)
/ branch = [
surveypage.slider
]
</trial>

<surveypage slider>
/ stimulustimes = [0=background]
/ questions=[1=estimate]
/ showbackbutton=false
/ finishlabel="Next"
/ showpagenumbers=false
/ showquestionnumbers=false
/ timeout = 5000
</surveypage>

<picture background>
/ items = ("background.jpg")
/ size = (100%, 100%)
/ erase = false
</picture>

<textbox estimate>
/ position = (40%, 45%)
</textbox>

<text learnstim>
/ items = ("A", "B", "C", "D")
</text>
By nrouhani - 9/12/2018

Dave - Wednesday, September 12, 2018
nrouhani - Wednesday, September 12, 2018
hello! 

in my task, within every trial i have to shift between a trial and a surveypage element (only because i want to use a slider as a response). i have a background image that i have set "erase=false", and it sits still when i'm going through trial elements, but now that i have a surveypage element it jolts every time - is there a way to eliminate this? or set the background image as a default so it doesn't change? 

thank you! 

<trial cue>
/ stimulustimes = [0=background; 0=learnStim]
/ beginresponseframe = 0
/ timeout = 4000
/ validresponse = (noresponse)
/ branch = [
surveypage.slider
]
</trial>

<surveypage slider>
/ stimulustimes = [0=background]
/ questions=[1=estimate]
/ showbackbutton=false
/ finishlabel="Next"
/ showpagenumbers=false
/ showquestionnumbers=false
/ timeout = 5000
/ branch = [
  trial.outcome
]
</surveypage>

<picture background>
/ items = ("background.jpg")
/ size = (100%, 100%)
/ erase = false
</picture>



You can try setting the screencolor to transparent, as in

<block myblock>
/ screencolor = transparent
/ trials = [1-4 = cue]
</block>

<trial cue>
/ stimulustimes = [0=background; 0=learnStim]
/ beginresponseframe = 0
/ timeout = 4000
/ validresponse = (noresponse)
/ branch = [
surveypage.slider
]
</trial>

<surveypage slider>
/ stimulustimes = [0=background]
/ questions=[1=estimate]
/ showbackbutton=false
/ finishlabel="Next"
/ showpagenumbers=false
/ showquestionnumbers=false
/ timeout = 5000
</surveypage>

<picture background>
/ items = ("background.jpg")
/ size = (100%, 100%)
/ erase = false
</picture>

<textbox estimate>
/ position = (40%, 45%)
</textbox>

<text learnstim>
/ items = ("A", "B", "C", "D")
</text>

yes that worked thank you so much! 

one problem that i'm having now is that the text from the slider element (i.e. the range of the slider) and the caption won't overlap with the background image - i.e. either they sit on top of the image or they are hidden behind it. is there a way around this or do i have to create text elements as stimuli instead of using the slider's properties?

By Dave - 9/12/2018

nrouhani - Wednesday, September 12, 2018
Dave - Wednesday, September 12, 2018
nrouhani - Wednesday, September 12, 2018
hello! 

in my task, within every trial i have to shift between a trial and a surveypage element (only because i want to use a slider as a response). i have a background image that i have set "erase=false", and it sits still when i'm going through trial elements, but now that i have a surveypage element it jolts every time - is there a way to eliminate this? or set the background image as a default so it doesn't change? 

thank you! 

<trial cue>
/ stimulustimes = [0=background; 0=learnStim]
/ beginresponseframe = 0
/ timeout = 4000
/ validresponse = (noresponse)
/ branch = [
surveypage.slider
]
</trial>

<surveypage slider>
/ stimulustimes = [0=background]
/ questions=[1=estimate]
/ showbackbutton=false
/ finishlabel="Next"
/ showpagenumbers=false
/ showquestionnumbers=false
/ timeout = 5000
/ branch = [
  trial.outcome
]
</surveypage>

<picture background>
/ items = ("background.jpg")
/ size = (100%, 100%)
/ erase = false
</picture>



You can try setting the screencolor to transparent, as in

<block myblock>
/ screencolor = transparent
/ trials = [1-4 = cue]
</block>

<trial cue>
/ stimulustimes = [0=background; 0=learnStim]
/ beginresponseframe = 0
/ timeout = 4000
/ validresponse = (noresponse)
/ branch = [
surveypage.slider
]
</trial>

<surveypage slider>
/ stimulustimes = [0=background]
/ questions=[1=estimate]
/ showbackbutton=false
/ finishlabel="Next"
/ showpagenumbers=false
/ showquestionnumbers=false
/ timeout = 5000
</surveypage>

<picture background>
/ items = ("background.jpg")
/ size = (100%, 100%)
/ erase = false
</picture>

<textbox estimate>
/ position = (40%, 45%)
</textbox>

<text learnstim>
/ items = ("A", "B", "C", "D")
</text>

yes that worked thank you so much! 

one problem that i'm having now is that the text from the slider element (i.e. the range of the slider) and the caption won't overlap with the background image - i.e. either they sit on top of the image or they are hidden behind it. is there a way around this or do i have to create text elements as stimuli instead of using the slider's properties?


I think using <text> elements would be the best option, but I'd have to see a more complete version of the code to be sure. If you'd like, you can put the script and any files it needs (e.g. the background picture file) in a ZIP archive and then attach it here via +Insert -> Add File.
By nrouhani - 9/13/2018

Dave - Wednesday, September 12, 2018
nrouhani - Wednesday, September 12, 2018
Dave - Wednesday, September 12, 2018
nrouhani - Wednesday, September 12, 2018
hello! 

in my task, within every trial i have to shift between a trial and a surveypage element (only because i want to use a slider as a response). i have a background image that i have set "erase=false", and it sits still when i'm going through trial elements, but now that i have a surveypage element it jolts every time - is there a way to eliminate this? or set the background image as a default so it doesn't change? 

thank you! 

<trial cue>
/ stimulustimes = [0=background; 0=learnStim]
/ beginresponseframe = 0
/ timeout = 4000
/ validresponse = (noresponse)
/ branch = [
surveypage.slider
]
</trial>

<surveypage slider>
/ stimulustimes = [0=background]
/ questions=[1=estimate]
/ showbackbutton=false
/ finishlabel="Next"
/ showpagenumbers=false
/ showquestionnumbers=false
/ timeout = 5000
/ branch = [
  trial.outcome
]
</surveypage>

<picture background>
/ items = ("background.jpg")
/ size = (100%, 100%)
/ erase = false
</picture>



You can try setting the screencolor to transparent, as in

<block myblock>
/ screencolor = transparent
/ trials = [1-4 = cue]
</block>

<trial cue>
/ stimulustimes = [0=background; 0=learnStim]
/ beginresponseframe = 0
/ timeout = 4000
/ validresponse = (noresponse)
/ branch = [
surveypage.slider
]
</trial>

<surveypage slider>
/ stimulustimes = [0=background]
/ questions=[1=estimate]
/ showbackbutton=false
/ finishlabel="Next"
/ showpagenumbers=false
/ showquestionnumbers=false
/ timeout = 5000
</surveypage>

<picture background>
/ items = ("background.jpg")
/ size = (100%, 100%)
/ erase = false
</picture>

<textbox estimate>
/ position = (40%, 45%)
</textbox>

<text learnstim>
/ items = ("A", "B", "C", "D")
</text>

yes that worked thank you so much! 

one problem that i'm having now is that the text from the slider element (i.e. the range of the slider) and the caption won't overlap with the background image - i.e. either they sit on top of the image or they are hidden behind it. is there a way around this or do i have to create text elements as stimuli instead of using the slider's properties?


I think using <text> elements would be the best option, but I'd have to see a more complete version of the code to be sure. If you'd like, you can put the script and any files it needs (e.g. the background picture file) in a ZIP archive and then attach it here via +Insert -> Add File.

thank you! i'm attaching a very shortened version of this but you should see the problem! 
By Dave - 9/13/2018

nrouhani - Thursday, September 13, 2018
Dave - Wednesday, September 12, 2018
nrouhani - Wednesday, September 12, 2018
Dave - Wednesday, September 12, 2018
nrouhani - Wednesday, September 12, 2018
hello! 

in my task, within every trial i have to shift between a trial and a surveypage element (only because i want to use a slider as a response). i have a background image that i have set "erase=false", and it sits still when i'm going through trial elements, but now that i have a surveypage element it jolts every time - is there a way to eliminate this? or set the background image as a default so it doesn't change? 

thank you! 

<trial cue>
/ stimulustimes = [0=background; 0=learnStim]
/ beginresponseframe = 0
/ timeout = 4000
/ validresponse = (noresponse)
/ branch = [
surveypage.slider
]
</trial>

<surveypage slider>
/ stimulustimes = [0=background]
/ questions=[1=estimate]
/ showbackbutton=false
/ finishlabel="Next"
/ showpagenumbers=false
/ showquestionnumbers=false
/ timeout = 5000
/ branch = [
  trial.outcome
]
</surveypage>

<picture background>
/ items = ("background.jpg")
/ size = (100%, 100%)
/ erase = false
</picture>



You can try setting the screencolor to transparent, as in

<block myblock>
/ screencolor = transparent
/ trials = [1-4 = cue]
</block>

<trial cue>
/ stimulustimes = [0=background; 0=learnStim]
/ beginresponseframe = 0
/ timeout = 4000
/ validresponse = (noresponse)
/ branch = [
surveypage.slider
]
</trial>

<surveypage slider>
/ stimulustimes = [0=background]
/ questions=[1=estimate]
/ showbackbutton=false
/ finishlabel="Next"
/ showpagenumbers=false
/ showquestionnumbers=false
/ timeout = 5000
</surveypage>

<picture background>
/ items = ("background.jpg")
/ size = (100%, 100%)
/ erase = false
</picture>

<textbox estimate>
/ position = (40%, 45%)
</textbox>

<text learnstim>
/ items = ("A", "B", "C", "D")
</text>

yes that worked thank you so much! 

one problem that i'm having now is that the text from the slider element (i.e. the range of the slider) and the caption won't overlap with the background image - i.e. either they sit on top of the image or they are hidden behind it. is there a way around this or do i have to create text elements as stimuli instead of using the slider's properties?


I think using <text> elements would be the best option, but I'd have to see a more complete version of the code to be sure. If you'd like, you can put the script and any files it needs (e.g. the background picture file) in a ZIP archive and then attach it here via +Insert -> Add File.

thank you! i'm attaching a very shortened version of this but you should see the problem! 

Thank you for the script -- that's very helpful. I think re-arranging things like this should do the trick:

*************************************************
Creating an Experiment
*************************************************

<expt>
/ blocks = [1=learning]
</expt>

*************************************************
LEARNING
*************************************************

<block learning>
/ onblockbegin = [
    list.memStims.appenditem(list.learnStims.nextvalue);
    list.memStims.appenditem(list.learnStims.nextvalue);   
    list.memStims.appenditem(list.learnStims.nextvalue);
    list.memStims.appenditem(list.learnStims.nextvalue);   
    list.memStims.appenditem(list.learnStims.nextvalue);
    list.memStims.appenditem(list.learnStims.nextvalue);
    list.memStims.appenditem(list.learnStims.nextvalue);   
    list.memStims.appenditem(list.learnStims.nextvalue);
    list.memStims.appenditem(list.learnStims.nextvalue);   
    list.memStims.appenditem(list.learnStims.nextvalue);
]
/ screencolor = transparent
/ trials = [1-5 = cue]
/ errormessage = false
</block>

// indoor trials
// redraw the background image per responsemessage at the end of the trial
<trial cue>
/ stimulustimes = [0=paris; 0=learnStim]
/ beginresponseframe = 0
/ timeout = 4000
/ validresponse = (noresponse)
/ responsemessage = (0, paris, 0)
/ branch = [
surveypage.slider
]
</trial>

// removed the stimulustimes in the surveypage, it should not be needed:

<surveypage slider>
/ subcaption = "please estimate the value of your findings from 0 to 100 cents"
/ questions=[1=estimate]
/ txcolor = black
/ showbackbutton=false
/ finishlabel="Next"
/ showpagenumbers=false
/ showquestionnumbers=false
/ timeout = 5000
/ branch = [
    trial.outcome
]
</surveypage>


// clear screen and redraw background per stimulustimes

<trial outcome>
/ stimulustimes = [0=clearscreen, paris, learnStim, val]
/ beginresponsetime = 0
/ trialduration = 3000
/ validresponse = (noresponse)
/ branch = [
    trial.pause
]
</trial>

<trial pause>
/ stimulustimes = [0=paris]
/ beginresponsetime = 0
/ trialduration = 1000
/ validresponse = (noresponse)
</trial>

<list learnStims>
/ items = (1,2,3,4,5,6,7,8,9,10)
/ poolsize = 10
/ selectionrate = always
</list>

<list memStims>
/ selectionmode = sequence
</list>

*************************************************
Background
*************************************************

// screen
<defaults>
/ screencolor = (175, 175, 175)
/ txcolor = darkgrey
</defaults>

<shape blank>
/ color = (175, 175, 175)
/ shape = rectangle
/ size = (100%, 100%)
</shape>

<picture paris>
/ items = ("paris.jpg")
/ size = (100%, 100%)
/ erase = false
</picture>

<picture london>
/ items = ("london.jpg")
/ size = (100%, 100%)
</picture>

*************************************************
Stimuli Presentation
*************************************************

// LEARNING
<picture learnStim>
/ items = allStims
/ size = (30%, 30%)
/ select = list.memStims.nextvalue
</picture>

// rewards
<picture val>
/ items = valueStims
/ size = (13%, 13%)
/ resetinterval = 0
/ vposition = 30
/ hposition = 50
/ select = sequence
</picture>

// QUESTIONS
<slider estimate>
/ labels=("0¢", "100¢")
/ range = (0, 100)
/ increment = 1
/ slidersize= (60%, 10%)
/ position = (20%,50%)
/ txcolor = black
</slider>

*************************************************
Item Lists
*************************************************
// image item lists
<item allStims>
/1 = "objects_1.png"
/2 = "objects_2.png"
/3 = "objects_3.png"
/4 = "objects_4.png"
/5 = "objects_5.png"
/6 = "objects_6.png"
/7 = "objects_7.png"
/8 = "objects_8.png"
/9 = "objects_9.png"
/10 = "objects_10.png"
</item>

<item valueStims>
/1 = "0.png"
/2 = "5.png"
/3 = "8.png"
/4 = "10.png"
/5 = "12.png"
</item>