Millisecond Forums

Crash in web launcher 4.0.2 after /ontrialend

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

By Jorn - 3/7/2013

My script works perfectly offline, but when using the weblauncher it persistently crashes after the second page of my experiment.


I think I have pinned it down to one issue, this /ontrialend:


/ ontrialend = [if(dropdown.geslacht.selectedvalue) picture.aat_avatar.item.1 = getitem(picture.aat_avatar, dropdown.geslacht.selectedvalue+1)]


It is meant to select a picture in a subsequent task of either a male or a female, depending on the choice of gender (a dropdown called 'geslacht'). 


Without this ontrialend, the experiment seems to run fine online too.


Any thoughts on what could fix this issue? Thanks alot!

By Dave - 3/7/2013

Any thoughts on what could fix this issue?


Hard to say without seeing the script, but you should try opting for a different approach to set the desired picture item.


/ ontrialend = [if(dropdown.geslacht.selectedvalue) picture.aat_avatar.item.1 = getitem(picture.aat_avatar, dropdown.geslacht.selectedvalue+1)]


is weird anyway, because it's circular: You set the 1st item in <picture aat_avatar> by pulling an item from that *same* picture element. Question is what was the 1st item before that? Anyway, If I were you I'd just do


<values>
/ selectedgender = 1
[...]
</values>

<picture genderpic>
/ items = ("Female.jpg", "Male.jpg")
/ select = values.selectedgender
[...]
</picture>

<dropdown getgender>
/ options = ("Female", "Male")
/ optionvalues = ("1", "2")
[...]
</dropdown>



and then


/ ontrialend = [values.selectedgender=dropdown.getgender.response]

By Jorn - 3/11/2013

Thanks for your answer Dave!


I did try your proposed solution: getting the right item based on the gendervalue and letting the dropdown define the gendervalue, but everytime I let the /ontrialend in, it kept crashing.


The only way I got it to work was to get the gender outside of inquisit (php) en then using a phpscript to set the gendervalue in inquisit.

By Dave - 3/11/2013

That's really weird. Can you attach the script along with all supporting files (see the 'Options' tab when posting a reply for upload controls)?