CONSTANT SUM DEMO Script Info Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC Date: 06-18-2014 last updated: 11-01-2018 by K.Borchert for Millisecond Software LLC Copyright © 11-01-2018 Millisecond Software BACKGROUND INFO *SCRIPT PURPOSE* This script runs code to run a simple Constant Sum Demo *TASK* Participants are asked to allocate 100 points to 3 attributes of product X. If the numbers don't add up to 100 after 'submitting' a warning is flashed onto the screen that alerts participant to the fact that numbers don't add up (and gives them the current actual sum). Participants can then correct the allocations. If you have any questions, please don't hesitate to contact Millisecond Software. DATA 1) raw data: constantsum_demo.iqdat.iqdat date, time, subject: date and time script was run with the current subjectnumber blockcode, blocknum: the name and number of the current block trialcode, trialnum: the name and number of the currently recorded trial (Note: not all trials that are run might record data) response: the participant's response latency: the response latency /productX: sets the label for productX (default: "ProductX") /attribute1: set the label for attribute1 (default: "Attribute1") /number_attribute1: stores the number allocated to attribute1 /attribute2: set the label for attribute2 (default: "Attribute2") /number_attribute2: stores the number allocated to attribute2 /attribute3: set the label for attribute3 (default: "Attribute3") /number_attribute3: stores the number allocated to attribute3 /remainder: stores the current remainder sum 2) summary data script.startdate: date script was run script.starttime: time script was started script.subjectid: subject id number script.groupid: group id number script.elapsedtime: time it took to run script (in ms) /completed: 0 = script was not completed; 1 = script was completed (all conditions run) /productX: sets the label for productX (default: "ProductX") /attribute1: set the label for attribute1 (default: "Attribute1") /number_attribute1: stores the number allocated to attribute1 /attribute2: set the label for attribute2 (default: "Attribute2") /number_attribute2: stores the number allocated to attribute2 /attribute3: set the label for attribute3 (default: "Attribute3") /number_attribute3: stores the number allocated to attribute3 /remainder: stores the current remainder sum /counts_attempts: counts how often participant had to correct her responses as they did not add up to 100 EDITABLE PARAMETERS /productX: sets the label for productX (default: "ProductX") /attribute1: sets the label for attribute1 (default: "Attribute1") /attribute2: sets the label for attribute2 (default: "Attribute2") /attribute3: sets the label for attribute3 (default: "Attribute3") /productX = "ProductX" /attribute1 = "Attribute1" /attribute2 = "Attribute2" /attribute3 = "Attribute3" *************************************************************************************** ********************************************* Editable Instructions ********************************************* *************************************************************************************** / fontstyle = ("Arial", 3.00%, false, false, false, false, 5, 1) You have reached the end of the task. ^^Thank you! ******************************************************************************************************************* ******************************************************************************************************************* DATA: this section contains data file information ******************************************************************************************************************* ******************************************************************************************************************* ******************** raw data: constantsum_demo.iqdat.iqdat ******************** /columns = [date, time, subject, group, blockcode, blocknum, trialcode, trialnum, response, latency, parameters.productx, parameters.attribute1, values.number_attribute1, parameters.attribute2, values.number_attribute2, parameters.attribute3, values.number_attribute3, expressions.remainder] /columns = [script.startdate, script.starttime, script.subjectid, script.groupid, script.elapsedtime, computer.platform, values.completed, parameters.productx, parameters.attribute1, values.number_attribute1, parameters.attribute2, values.number_attribute2, parameters.attribute3, values.number_attribute3, expressions.remainder, values.count_attempts] ******************************************************************************************************************* ******************************************************************************************************************* REMAINING CODE: Customize after careful consideration only ******************************************************************************************************************* ******************************************************************************************************************* ******************************************************************************************************************* ******************************************************************************************************************* DEFAULTS: ******************************************************************************************************************* ******************************************************************************************************************* requires Inquisit 4.0.5.0 /minimumversion = "4.0.5.0" ******************************************************************************************************************* ******************************************************************************************************************* VALUES: automatically updated ******************************************************************************************************************* ******************************************************************************************************************* /completed: 0 = script was not completed; 1 = script was completed (all conditions run) /number_attribute1: stores the number allocated to attribute1 /number_attribute2: stores the number allocated to attribute2 /number_attribute3: stores the number allocated to attribute3 /counts_attempts: counts how often participant had to correct her responses as they did not add up to 100 /completed = 0 /number_attribute1 = "" /number_attribute2 = "" /number_attribute3 = "" /count_attempts = 0 ******************************************************************************************************************* ******************************************************************************************************************* EXPRESSIONS ******************************************************************************************************************* ******************************************************************************************************************* /sum = values.number_attribute1 + values.number_attribute2 + values.number_attribute3 /remainder = 100 - expressions.sum ******************************************************************************************************************* ******************************************************************************************************************* STIMULI ******************************************************************************************************************* ******************************************************************************************************************* /caption = "<%parameters.attribute1%>" /range = (0,100) /textboxsize = (5%, 5%) /caption = "<%parameters.attribute2%>" /range = (0,100) /textboxsize = (5%, 5%) /caption = "<%parameters.attribute3%>" /range = (0,100) /textboxsize = (5%, 5%) /caption = "___________________________________________________________ 100 possible points to allocate - please make sure the numbers add up to 100" /items = ("THE NUMBERS DON'T ADD UP TO 100 - they add up to <%expressions.sum%>") / fontstyle = ("Arial", 2%, false, false, false, false, 5, 1) / txcolor = red /halign = left /valign = top /erase = false /position = (50%, 70%) ******************************************************************************************************************* ******************************************************************************************************************* SURVEYPAGE ******************************************************************************************************************* ******************************************************************************************************************* /caption = "Allocate 100 points to the importance of these 3 attributes of product <%parameters.productX%>. " / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) /itemfontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1) /responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1) /ontrialbegin = [ values.count_attempts += 1; if (values.count_attempts != 1 && expressions.remainder != 0) surveypage.constantsum.insertstimulusframe(text.remainder_warning, 1)] /ontrialend = [ surveypage.constantsum.resetstimulusframes(); values.number_attribute1 = textbox.attribute1.response; values.number_attribute2 = textbox.attribute2.response; values.number_attribute3 = textbox.attribute3.response; ] /questions = [1 = attribute1, attribute2, attribute3, sum] /branch = [if (expressions.remainder != 0 && !monkey.monkeymode) surveypage.constantsum] /showpagenumbers = false /showquestionnumbers = false /showbackbutton = false /finishlabel = "submit" / navigationbuttonsize = (20%, 5%) / navigationbuttonfontstyle = ("Arial", 3%, false, false, false, false, 5, 1) ******************************************************************************************************************* ******************************************************************************************************************* SURVEY ******************************************************************************************************************* ******************************************************************************************************************* /pages = [1 = constantsum] ******************************************************************************************************************* ******************************************************************************************************************* EXPERIMENT ******************************************************************************************************************* ******************************************************************************************************************* /blocks = [1 = constantsum_demo] /onexptend = [values.completed = 1] ******************************************************************************************************************* End of File *******************************************************************************************************************