treatment "beauty-contest.ztt"{ background{ table globals{ } table subjects{ } table summary{ } table contracts{ } table clients{ } table treatments{ } table sessionglobals{ } table participations{ } numsubjects = 3; numgroups = 1; numpracticeperiods = 0; numactualperiods = 3; exchangerate = 1; startendowment = 0; showupfee = 0; noAutoscope = FALSE; firstBoxesOnTop = FALSE; showupfeeawaytext = "You are making losses. Do you want to invest the showupfee in order to continue?"; showupfeeawayyestext = "Yes"; showupfeeawaynotext = "No"; moneyawaytext = "You are making losses. Do you want to continue?"; moneyawayyestext = "Yes"; moneyawaynotext = "No"; bancruptwaittext = "Please wait until the experimenter unlocks your PC."; program{ table = subjects; do{ MaxGuess = 100; Prize = 100; } } screen action{ usesbg = TRUE; withalertscreen = FALSE; noalertscreen = FALSE; headerbox "Header"{ hasframe = TRUE; height = 10%; top = 0p; cuttop = TRUE; showPeriods = TRUE; showNumPeriods = TRUE; periodtext = "Period"; periodoftext = "of"; practiceperiodprefix = "Trial "; showtime = TRUE; timestr = "Remaining time [sec]:"; pleasedecidetext = "Please reach a decision."; } } screen wait{ usesbg = TRUE; withalertscreen = FALSE; noalertscreen = FALSE; standardbox "Text"{ hasframe = TRUE; buttonposition = BOTTOMRIGHT; buttonsequence = HORIZONTAL; item{ label = "Please wait until the experiment continues."; } } } } stage "Guess"{ startwaitforall = TRUE; startConditionStr = ""; singleentry = FALSE; singleentrycontinuation = FALSE; timeouttype = ifnoinput; timeout = 60; screen action{ usesbg = TRUE; withalertscreen = FALSE; noalertscreen = FALSE; standardbox "Guess"{ hasframe = TRUE; buttonposition = BOTTOMRIGHT; buttonsequence = HORIZONTAL; item{ label = "Guess a number from 0 to 100. The guess in your group closest to 2/3 of the average guess"; } item{ label = "wins 100 points (shared if there is a tie)."; } item{ } item{ label = "Your guess"; variable = Guess; format = "1"; input = TRUE; showdefault = FALSE; emptyallowed = FALSE; min = 0; max = MaxGuess; } button "OK"{ clearinputafterok = FALSE; norecordmadeorselected = FALSE; terminatestage = FALSE; donotterminatestage = FALSE; specialbuttoncolor = FALSE; buttoncolor = 0; } } } screen wait{ usesbg = TRUE; withalertscreen = FALSE; noalertscreen = FALSE; } } stage "Results"{ startwaitforall = TRUE; startConditionStr = ""; singleentry = FALSE; singleentrycontinuation = FALSE; timeouttype = ifnoinput; timeout = 30; program{ table = subjects; do{ Target = round(average(same(Group), Guess) * 2 / 3, 0.01); Distance = abs(Guess - Target); } } program{ table = subjects; do{ Won = if(Distance == minimum(same(Group), Distance), 1, 0); } } program{ table = subjects; do{ NumWinners = sum(same(Group), Won); Profit = if(Won == 1, Prize / NumWinners, 0); } } screen action{ usesbg = TRUE; withalertscreen = FALSE; noalertscreen = FALSE; standardbox "Results"{ hasframe = TRUE; buttonposition = BOTTOMRIGHT; buttonsequence = HORIZONTAL; item{ label = "Your guess"; variable = Guess; format = "1"; input = FALSE; } item{ label = "2/3 of the average guess"; variable = Target; format = "0.01"; input = FALSE; } item{ label = "You"; variable = Won; format = "!text: 1=\"won\"; 0=\"did not win\";"; input = FALSE; } item{ label = "Your payoff"; variable = Profit; format = "0.01"; input = FALSE; } button "Continue"{ clearinputafterok = FALSE; norecordmadeorselected = FALSE; terminatestage = FALSE; donotterminatestage = FALSE; specialbuttoncolor = FALSE; buttoncolor = 0; } } } screen wait{ usesbg = TRUE; withalertscreen = FALSE; noalertscreen = FALSE; } } roles{ role "S 1"{ } role "S 2"{ } role "S 3"{ } } period "1"{ prompt = ""; subject 1{ name = ""; group = 1; do{ Player = 1; } } subject 2{ name = ""; group = 1; do{ Player = 2; } } subject 3{ name = ""; group = 1; do{ Player = 3; } } } period "2"{ prompt = ""; subject 1{ name = ""; group = 1; do{ Player = 1; } } subject 2{ name = ""; group = 1; do{ Player = 2; } } subject 3{ name = ""; group = 1; do{ Player = 3; } } } period "3"{ prompt = ""; subject 1{ name = ""; group = 1; do{ Player = 1; } } subject 2{ name = ""; group = 1; do{ Player = 2; } } subject 3{ name = ""; group = 1; do{ Player = 3; } } } }