Millisecond Forums

Decimal problem

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

By jolimie - 5/25/2012

Hi, 



I have made my inquisit script on a macbook with inquisit 4. The decimals appear when I tested the script on my computer but the decimals do not appear when I tested it on the web. I can't see where is the problem. I tried this : 



First:


<trial general1choice1>


/ stimulusframes = [1=general1ecranP, general1ecranS, general1,or]


/ validresponse = (general1ecranP, general1ecranS)


/ ontrialend = [if(trial.general1choice1.response=="general1ecranP")  expressions.total.general1choice1==79,90 else expressions.total.general1choice1==0]


/ ontrialend = [if(trial.general1choice1.response=="general1ecranS") expressions.total.general1choice1==0 else expressions.total.general1choice1==79,90]


/ responsemessage = (general1ecranP, noir1ecranP,300)


/ responsemessage = (general1ecranS, noir1ecranS,300) 


/ responsemessage = (general1ecranP, Phrasespositif1,300)


/ responsemessage = (general1ecranS, PhrasesSelectionnertext1,300) 


/ posttrialpause = 750


/ pretrialpause = 500


</trial>





Second:




<trial general1choice1>


/ stimulusframes = [1=general1ecranP, general1ecranS, general1,or]


/ validresponse = (general1ecranP, general1ecranS)


/ ontrialend = [if(trial.general1choice1.response=="general1ecranP")  expressions.total.general1choice1==79.90 else expressions.total.general1choice1==0]


/ ontrialend = [if(trial.general1choice1.response=="general1ecranS") expressions.total.general1choice1==0 else expressions.total.general1choice1==79.90]


/ responsemessage = (general1ecranP, noir1ecranP,300)


/ responsemessage = (general1ecranS, noir1ecranS,300) 


/ responsemessage = (general1ecranP, Phrasespositif1,300)


/ responsemessage = (general1ecranS, PhrasesSelectionnertext1,300) 


/ posttrialpause = 750


/ pretrialpause = 500


</trial>



Third:



<trial general1choice1>


/ stimulusframes = [1=general1ecranP, general1ecranS, general1,or]


/ validresponse = (general1ecranP, general1ecranS)


/ ontrialend = [if(trial.general1choice1.response=="general1ecranP")  expressions.total.general1choice1=79.90 else expressions.total.general1choice1=0]


/ ontrialend = [if(trial.general1choice1.response=="general1ecranS") expressions.total.general1choice1=0 else expressions.total.general1choice1=79.90]


/ responsemessage = (general1ecranP, noir1ecranP,300)


/ responsemessage = (general1ecranS, noir1ecranS,300) 


/ responsemessage = (general1ecranP, Phrasespositif1,300)


/ responsemessage = (general1ecranS, PhrasesSelectionnertext1,300) 


/ posttrialpause = 750


/ pretrialpause = 500


</trial>





Mandy,


By Dave - 5/25/2012

#1 and #2 are wrong and cannot work because '==' is a comparison operator, not an assignment operator (that would be '='). See the operators reference in the Inquisit documentation. Also, you should not try to overwrite expressions via /ontrialend etc. For storing and updating static values, use <values>. Apart from that, it's impossible to tell what the issue may be. You'd have to provide more information, i.e., a shortened, but *runnable* version of your script that illustrates the issue as well as a link to its web launch page. Also note that scripts written w/ Inquisit 4 may not work in Inquisit 3 Web without some additional conversion / intermediary steps.


Regards,


~Dave

By jolimie - 5/25/2012

There is an example ( the goal is to choose between product and then appear the bill):




**************************************************************************************************************


GENERAL 1 MAC POSITIF


**************************************************************************************************************


<survey scoresgeneral1page>


/ pages = [1=scoresgeneral1]


/ screencolor = (black)


</survey>



<surveypage scoresgeneral1>


/ stimulusframes = [1=scorestextgeneral1]


/ finishlabel = "Confirmez votre panier !"


/ nextbuttonposition = (75,83)


/ fontstyle = ("Academy Engraved LET",  2.50%, false, false, false, false, 5, 0)


/ navigationbuttonsize = (250px,40px)


</surveypage>



<text scorestextgeneral1>


/ items = scorereportgeneral1


/ select = sequence


/ size = (60%, 85%)


/ fontstyle = ("Academy Engraved LET", 2.80%, false, false, false, false, 5, 0)


/ txcolor = (white)


/ txbgcolor = (black)


</text>



<item scorereportgeneral1>


/ 1 = 


"      Voici le panier de vos achats additionnels !! : 




   *Configuration externe*


  '' Ecran LED 17 pouces ''  60% de remise : <%expressions.total.general1choice1%>~t€



    *Produits additionnels*


'' Souris Apple Magic ''  30% de remise : <%expressions.total.general1choice2%>~t€


                                 


Total avant remise :~t~t~t<%expressions.total.avantremisegeneral1%>~t€


Total apres remise :~t~t~t<%expressions.total.apresremisegeneral1%>~t€"


</item>






**************************************************************************************************************


ITEM GENERAL 1/2


**************************************************************************************************************



<item General1>


/1 = "general1-ecran-P"


/2 = "general1-ecran-S"


/3 = "general1-souris-P"


/4 = "general1-souris-P"


/5 = "general"


</item>



**************************************************************************************************************


PICTURE GENERAL 1


**************************************************************************************************************



<text general1>


/ items = ("general1-")


/ size = (49.75%, 28%)


/ position = (49.5,35)


/ erase = false


/ color = (white)


</text>



********


<text general1ecranP>


/ items = ("general1-ecran-P")


/ size = (25.75%, 25.75%)


/ position =(38.15,62.25)


/ erase = false


/ color = (white)


</text>



<text general1ecranS>


/ items = ("general1-ecran-S")


/ size = (25.75%, 25.75%)


/ position = (61.00,62.25)


/ erase = false


/ color = (white)


</text>



********


<text general1sourisP>


/ items = ("general1-souris-P")


/ size = (25.75%, 25.75%)


/ position =(38.15,62.25)


/ erase = false


/ color = (white)


</text>


<text general1sourisS>


/ items = ("general1-souris-S")


/ size = (25.75%, 25.75%)


/ position = (61.00,62.25)


/ erase = false


/ color = (white)


</text>



<text or>


/ items = (" OU ")


/ position = (49.43,50)


/ fontstyle = ("Didot", 1.65%, false, false, false, false, 5, 0)


/ txcolor = (white)


/ txbgcolor = (black)


</text>


**************************************************************************************************************


TRIAL GENERAL CHOICE 1


**************************************************************************************************************


<trial general1choice1>


/ stimulusframes = [1=general1ecranP, general1ecranS, general1,or]


/ validresponse = (general1ecranP, general1ecranS)


/ ontrialend = [if(trial.general1choice1.response=="general1ecranP")  expressions.total.general1choice1=79,90 else expressions.total.general1choice1=0]


/ ontrialend = [if(trial.general1choice1.response=="general1ecranS") expressions.total.general1choice1=0 else expressions.total.general1choice1=79,90]


/ posttrialpause = 100


/ pretrialpause = 500


</trial>



<trial general1choice2>


/ stimulusframes = [1=general1sourisP, general1sourisS, general1,or]


/ validresponse = (general1sourisP, general1sourisS)


/ ontrialend = [if(trial.general1choice2.response=="general1sourisP")  expressions.total.general1choice2=62.90 else expressions.total.general1choice2=0]


/ ontrialend = [if(trial.general1choice2.response=="general1sourisS") expressions.total.general1choice2=0 else expressions.total.general1choice2=62.90]


/ posttrialpause = 100


/ pretrialpause = 500


</trial>



**************************************************************************************************************


BLOCK GENERAL 1


**************************************************************************************************************



<block General1choice1>


/ trials = [1=General1choice1]


</block>



<block General1choice2>


/ trials = [1=General1choice2]


</block>



**************************************************************************************************************


**************************************************************************************************************


   Default Settings


**************************************************************************************************************


**************************************************************************************************************


<defaults>


/ screencolor = (black)


/ inputdevice = mouse


/ txbgcolor = (black)


/ windowsize = (1280px, 750px)


</defaults>



**************************************************************************************************************


**************************************************************************************************************


   EXPERIMENT MACPRO POSITIF IMAC NEGATIF


**************************************************************************************************************


**************************************************************************************************************



<expt >


/ blocks = [1=pages3,General1choice1,General1choice2,scoresgeneral1page]


</expt>




****************************************************************


   DATA


****************************************************************



<data>


/ columns = [date,time,subject,trial.General1choice1.response,trial.General1choice2.response, 


expressions.total.avantremisegeneral1,expressions.total.apresremisegeneral1, expressions.total.General1choice1,


expressions.total.General1choice2]



</data>




<expressions >


/ total.avantremisegeneral1 = (expressions.total.General1choice1 + expressions.total.General1choice2 + values.PrixMac)


/ total.apresremisegeneral1 = ((0,4 *(expressions.total.General1choice1)) + (0,7 *(expressions.total.General1choice2)) + values.PrixMac)


/ total.General1choice1 = values.General1choice1


/ total.General1choice2 = values.General1choice2


</expressions>



<values>


/ PrixMac = 685.90


/ Mac = 979.95


/ General1choice1 = 0


/ General1choice2 = 0 


</values>




****************************************************************


   SURVEY


****************************************************************



<surveypage surveypages3>


/ stimulusframes = [1=pages3text]


/ finishlabel= "Choisissez les configurations de votre premier achat!"


/ nextbuttonposition = (30,50)


/ fontstyle = ("Academy Engraved LET",  2.50%, false, false, false, false, 5, 0)


/ txcolor = (black)  


</surveypage>



<survey Pages3>


/ pages = [1=surveypages3]


</survey>



<item pages3Item>


/1=""


</item>



<text pages3text>


/ items = pages3Item


/ fontstyle = ("Academy Engraved LET",  2.50%, false, false, false, false, 5, 0)


/ txcolor = (black) 


</text> 





There is my launch page: http://research.millisecond.com/jolimie_971/FINALMAC.web



















By Dave - 5/25/2012

Apart from the possibility that there may very well be mistakes in your calculations, the code works both in the Desktop version as well as on the web. If that's not what you are seeing, you need to provide a much more specific description. I.e., what do you *think* the code should produce vs. what you actually *observe* it produce (screenshots would be helpful). Also, check your data files for any mistakes in your calculations.

By jolimie - 5/26/2012

Hi Dave,



 Thanks for your reponses always so quick. I  can't try it on web with my mac, but you are right, my friend tell me that it works now.



Besides I have another problem but with the batch element, it works before and then don't want to  :


Problem = 



<batch 1>

/subjects= (1 of 2)

/ file = "Question1.exp"

/ file = "Macmaxiexperiment.exp" 

/ file = "Goodexperiment.exp" 

/ file = "SNARC.exp"

</batch>



<batch 2>

/subjects= (2 of 2)

/ file = "Question1.exp"

/ file = "Macmaxiexperiment.exp" 

/ file = "SNARC.exp"

/ file = "Goodexperiment.exp" 

</batch>



All the files are in the same file even the batch one, but it still don't work.


By Dave - 5/26/2012

All the files are in the same file even the batch one, but it still don't work.


The <batch> elements need to be in a *separate* file. All other files need to be stored in the same location as the file containing the <batch> elements.