#/bin/sh

curl -b ~/.paco_lh_cookie -d '[{"title":"TestOne","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":1,"questionsChange":false,"modifyDate":"2013/04/15","inputs":[{"id":4,"questionType":"question","text":"How Much is it?","mandatory":false,"responseType":"likert","likertSteps":5,"name":"howmuch","conditional":false,"listChoices":[],"invisibleInput":false},{"id":5,"questionType":"question","text":"Thoughts","mandatory":false,"responseType":"open text","likertSteps":5,"name":"thoughts","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":3,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"signalSchedule","id":2,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[57600000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":2,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[57600000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"TestOneEOD","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":34,"questionsChange":false,"modifyDate":"2013/04/16","inputs":[{"id":37,"questionType":"question","text":"What","mandatory":false,"responseType":"open text","likertSteps":5,"name":"what","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":36,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"signalSchedule","id":35,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[64800000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":35,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[64800000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"Tom's Demo","description":"saklsdjfa;slkdfjasdflkjasdf","informedConsentForm":"","creator":"rbe5000@gmail.com","fixedDuration":false,"id":60,"questionsChange":false,"modifyDate":"2013/05/23","inputs":[{"id":63,"questionType":"question","text":"Are you here now?","mandatory":false,"responseType":"likert","likertSteps":2,"leftSideLabel":"Yes","rightSideLabel":"No","name":"here","conditional":false,"listChoices":[],"invisibleInput":false},{"id":64,"questionType":"question","text":"How do you feel right now?","mandatory":false,"responseType":"open text","likertSteps":5,"name":"feeling","conditional":true,"conditionExpression":"here == 1","listChoices":[],"invisibleInput":false}],"feedback":[{"id":68,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["rbe5000@gmail.com","tom.pennings@gmail.com","bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":2,"signalingMechanisms":[{"type":"signalSchedule","timeout":15,"id":61,"scheduleType":4,"esmFrequency":6,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":79200000,"times":[50400000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":true,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","timeout":15,"id":61,"scheduleType":4,"esmFrequency":6,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":79200000,"times":[50400000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":true,"byDayOfWeek":false},"customRendering":false},{"title":"DIN Example","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":true,"startDate":"2013/07/14","endDate":"2013/07/19","id":97,"questionsChange":false,"modifyDate":"2013/05/29","inputs":[{"id":100,"questionType":"question","text":"Have you wanted any information recently","mandatory":false,"responseType":"open text","likertSteps":5,"name":"info_need","conditional":false,"listChoices":[],"invisibleInput":false},{"id":101,"questionType":"question","text":"Are you doing this because you want to?","mandatory":false,"responseType":"likert","likertSteps":2,"leftSideLabel":"Yes","rightSideLabel":"No","name":"locus_of_control","conditional":false,"listChoices":[""],"invisibleInput":false},{"id":102,"questionType":"question","text":"Why are you doing it?","mandatory":false,"responseType":"list","likertSteps":5,"name":"why_doing","conditional":true,"conditionExpression":"locus_of_control == 2","listChoices":["For a friend","For work"],"invisibleInput":false},{"id":103,"questionType":"question","text":"","mandatory":false,"responseType":"photo","likertSteps":5,"name":"photo","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":560,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com","kathyb@google.com"],"publishedUsers":[],"deleted":false,"version":2,"signalingMechanisms":[{"type":"signalSchedule","id":98,"scheduleType":4,"esmFrequency":8,"esmPeriodInDays":0,"esmStartHour":36000000,"esmEndHour":72000000,"times":[39600000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":true,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":98,"scheduleType":4,"esmFrequency":8,"esmPeriodInDays":0,"esmStartHour":36000000,"esmEndHour":72000000,"times":[39600000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":true,"byDayOfWeek":false},"customRendering":false},{"title":"DIN EOD Example ","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":106,"questionsChange":false,"modifyDate":"2013/05/29","inputs":[{"id":109,"questionType":"question","text":"Did you succeed in your search?","mandatory":false,"responseType":"likert","likertSteps":2,"leftSideLabel":"Yes","rightSideLabel":"No","name":"success","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":108,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"signalSchedule","id":107,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[75600000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":107,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[75600000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"UserPresent","description":"","informedConsentForm":"","creator":"rbe5000@gmail.com","fixedDuration":false,"id":214,"questionsChange":false,"modifyDate":"2013/06/13","inputs":[{"id":217,"questionType":"question","text":"How cool is this?","mandatory":false,"responseType":"likert","likertSteps":5,"leftSideLabel":"Not at all","rightSideLabel":"Totally","name":"coolness","conditional":false,"listChoices":[],"invisibleInput":false},{"id":239,"questionType":"question","text":"Notes","mandatory":false,"responseType":"open text","likertSteps":5,"name":"open","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":363,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["rbe5000@gmail.com","bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":9,"signalingMechanisms":[{"type":"trigger","timeout":5,"eventCode":2,"delay":1000,"id":215}],"schedule":{"type":"signalSchedule","scheduleType":5,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"PacoTrigger","description":"","informedConsentForm":"","creator":"rbe5000@gmail.com","fixedDuration":false,"id":375,"questionsChange":false,"modifyDate":"2013/06/19","inputs":[{"id":378,"questionType":"question","text":"How was testapp?","mandatory":false,"responseType":"likert","likertSteps":2,"leftSideLabel":"No","rightSideLabel":"Yes","name":"miss_me","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":392,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["rbe5000@gmail.com","bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":5,"signalingMechanisms":[{"type":"trigger","timeout":10,"eventCode":3,"delay":5000,"id":376,"sourceIdentifier":"testapp"}],"schedule":{"type":"signalSchedule","scheduleType":5,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"PhotoMonkey","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":440,"questionsChange":false,"modifyDate":"2013/06/26","inputs":[{"id":443,"questionType":"question","text":"","mandatory":false,"responseType":"photo","likertSteps":5,"name":"photo1","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":442,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"signalSchedule","id":441,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[64800000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":441,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[64800000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"PlateCoach","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":468,"questionsChange":false,"modifyDate":"2013/06/28","inputs":[{"id":471,"questionType":"question","text":"How energetic do you feel?","mandatory":false,"responseType":"likert","likertSteps":5,"leftSideLabel":"Exhausted","rightSideLabel":"Amped","name":"energy","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":546,"feedbackType":"display","text":"<script>\n // This function will become boilerplate, but it shows how the ui is completely controllable for the feedback/intervention\n  function createDisplay() {\n    var output = document.createElement(\"div\");\n    output.setAttribute(\"id\", \"output\");\n    document.body.appendChild(output);\n    var display = $(\"#output\");\n    return {\n        title : function(titlemsg) {\n          display.html(\"<h1>\"+titlemsg+\"</h1>\\n\" + display.html());\n        },\n        add : function(msg) {\n          display.html(display.html() + \"\\n<p style=\\\"font-size: large;\\\">\"+msg+\"</p>\");\n        }\n    };\n  };\n\n  // This function is also boilerplate that brings the data from the phone's datastore into the javascript environment\n  // so that is can be used to create a custom response for the user.\n  function getData() {\n        var jsondata = window.eventLoader.loadAllEvents();\n        var experimentData = $.parseJSON(jsondata);\n        if (!experimentData) {\n          // hack for samsung tmobile phones\n          experimentData = eval('(' + jsondata + ')');\n        }\n        return experimentData;    \n  };\n\n  // This is a function to compute the average value of the numerical response, \"item\", over the last \"numPast\" responses.\n  // This shows that we can create custom functions for analysing the data which is stored in an environmental variable, \"experimentData\".\n  function averageOfLastNResponses(experimentData, item, numPast) {\n     var total = 0;\n     var count = numPast;\n     if (count > experimentData.length) {\n       count = experimentData.length;\n     }\n     for (var i = 0; i < count; i++) {\n        for (var j =0 ; j < experimentData[i].responses.length; j++) {\n          if (experimentData[i].responses[j][\"inputName\"] === item) {\n            total = total + parseInt(experimentData[i].responses[j][\"answer\"]);\n            break;\n          }\n        }        \n     }\n    if (count > 0) {\n     return total / count;\n    } else {\n      return 0;\n    }\n  };\n\n  function lastResponse(experimentData, item, numPast) {\n     var total = 0;\n     var count = numPast;\n     if (count > experimentData.length) {\n       count = experimentData.length;\n     }\n     for (var i = 0; i < count; i++) {\n        for (var j =0 ; j < experimentData[i].responses.length; j++) {\n          if (experimentData[i].responses[j][\"inputName\"] === item) {\n            return parseInt(experimentData[i].responses[j][\"answer\"]);\n          }\n        }        \n     }\n    if (count > 0) {\n     return total / count;\n    } else {\n      return 0;\n    }\n  };\n   \n  // This is the key function for showing feedback predicated on their responses\n  function computeFeedback(averageResponse) {\n      if (averageResponse > 4) {\n        return \"Eat something lighter\";\n      } else if (averageResponse < 2) {\n        return \"You need energy!\";\n      } else {\n        return \"You're doing great with your choices.\";\n      }\n  };\n\n  // This is the main part of the script that creates the display, gets the data, and \n  // shows conditional feedback based on analysis.\n  function main() {\n    var experimentData = getData();\n    var display = createDisplay();\n\n    display.title(\"Your Progress Report\");\n \n    if (experimentData === undefined || experimentData.length == 0) {\n      display.add(\"No responses yet to give feedback on\");\n    } else {\n      var averageResponse = lastResponse(experimentData, \"energy\", 3);\n      var intervention = computeFeedback(averageResponse);\n\n      display.add(intervention);\n      display.add(\"Average of last 3 responses: \" + averageAnswer);\n    }\n  };\n  main();\n\n</script>"}],"published":true,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":2,"signalingMechanisms":[{"type":"signalSchedule","id":469,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[39600000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":469,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[39600000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"TestExperiment","description":"description!","informedConsentForm":"be wary of sharing your data with strangers","creator":"bobevans999@gmail.com","fixedDuration":false,"id":541,"questionsChange":false,"modifyDate":"2013/07/03","inputs":[{"id":544,"questionType":"question","text":"What is your favorite color?","mandatory":false,"responseType":"list","likertSteps":5,"name":"q1","conditional":false,"listChoices":["red","blue"],"invisibleInput":false}],"feedback":[{"id":543,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"signalSchedule","id":542,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[57600000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":542,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[57600000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"t1","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":552,"questionsChange":false,"modifyDate":"2013/07/15","inputs":[{"id":555,"questionType":"question","text":"f","mandatory":false,"responseType":"likert","likertSteps":5,"name":"f","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":554,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"signalSchedule","id":553,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[50400000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":553,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[50400000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"DIN 2013.5","description":"This is a study of your information usage.","informedConsentForm":"Refer to your recruitment materials","creator":"bobevans999@gmail.com","fixedDuration":true,"startDate":"2013/07/15","endDate":"2013/07/22","id":562,"questionsChange":false,"modifyDate":"2013/07/15","inputs":[{"id":565,"questionType":"question","text":"Did you want or need any info since you were pinged last?","mandatory":false,"responseType":"likert","likertSteps":2,"leftSideLabel":"Yes","rightSideLabel":"No","name":"had_need","conditional":false,"listChoices":[],"invisibleInput":false},{"id":566,"questionType":"question","text":"What did you want or need to know?","mandatory":false,"responseType":"open text","likertSteps":5,"name":"need","conditional":true,"conditionExpression":"had_need == 1","listChoices":[],"invisibleInput":false},{"id":567,"questionType":"question","text":"","mandatory":false,"responseType":"photo","likertSteps":5,"name":"photo","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":564,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com","kathyb@google.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"signalSchedule","timeout":15,"id":563,"scheduleType":4,"esmFrequency":8,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":75600000,"times":[54000000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":true,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","timeout":15,"id":563,"scheduleType":4,"esmFrequency":8,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":75600000,"times":[54000000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":true,"byDayOfWeek":false},"customRendering":false},{"title":"TestNullContentAfterEdit","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":791,"questionsChange":false,"modifyDate":"2013/07/30","inputs":[{"id":794,"questionType":"question","text":"floop ti floop ti floop","mandatory":false,"responseType":"likert","likertSteps":5,"name":"q1","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":796,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":2,"signalingMechanisms":[{"type":"signalSchedule","id":792,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[64800000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":792,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[64800000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"conditional1","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":874,"questionsChange":false,"modifyDate":"2013/10/04","inputs":[{"id":877,"questionType":"question","text":"list","mandatory":false,"responseType":"list","likertSteps":5,"name":"list","conditional":false,"listChoices":["one","two"],"invisibleInput":false},{"id":878,"questionType":"question","text":"two","mandatory":false,"responseType":"likert","likertSteps":5,"name":"two","conditional":true,"conditionExpression":"list != 1","listChoices":[],"invisibleInput":false}],"feedback":[{"id":876,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"signalSchedule","id":875,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[0],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":875,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[0],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"VikramTest","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":true,"startDate":"2013/10/04","endDate":"2013/10/05","id":883,"questionsChange":false,"modifyDate":"2013/10/04","inputs":[{"id":886,"questionType":"question","text":"What was your goal with opening settings?","mandatory":false,"responseType":"open text","likertSteps":5,"name":"goal","conditional":false,"listChoices":[],"invisibleInput":false},{"id":887,"questionType":"question","text":"How satisifed were you with your actions in Settings","mandatory":false,"responseType":"likert","likertSteps":5,"leftSideLabel":"Not satisfied","rightSideLabel":"Very satisfied","name":"satisfaction","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":885,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com","markiv@google.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"trigger","timeout":10,"eventCode":3,"delay":300000,"id":884,"sourceIdentifier":"settings"}],"schedule":{"type":"signalSchedule","scheduleType":5,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"triggerswitch","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":890,"questionsChange":false,"modifyDate":"2013/11/01","inputs":[{"id":893,"questionType":"question","text":"ddd","mandatory":false,"responseType":"likert","likertSteps":5,"name":"d","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":902,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":4,"signalingMechanisms":[{"type":"trigger","eventCode":2,"delay":5000,"id":891}],"schedule":{"type":"signalSchedule","scheduleType":5,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"atrigtest","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":985,"questionsChange":false,"modifyDate":"2013/11/04","inputs":[{"id":988,"questionType":"question","text":"a","mandatory":false,"responseType":"likert","likertSteps":5,"name":"a","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":993,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":3,"signalingMechanisms":[{"type":"signalSchedule","id":990,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[46800000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":990,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[46800000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":true,"customRenderingCode":"fooo"},{"title":"CustomHtml","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":995,"questionsChange":false,"modifyDate":"2013/11/05","inputs":[{"id":998,"questionType":"question","text":"What time is it?","mandatory":false,"responseType":"likert","likertSteps":5,"name":"q1","conditional":false,"listChoices":[],"invisibleInput":false},{"id":999,"questionType":"question","text":"How do you feel?","mandatory":false,"responseType":"open text","likertSteps":5,"name":"q2","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":1196,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":28,"signalingMechanisms":[{"type":"signalSchedule","id":996,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[0],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":996,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[0],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":true,"customRenderingCode":"<script>\nfunction save() {\n    var experiment = paco.experiment();\n    var inputs = experiment.inputs;\n    var responses = [];\n    for (var i in inputs) {\n        var input = inputs[i];\n        var element = $('input[name='+input.name+']');\n        var value = element.val();\n        var responseObject = paco.createResponseForInput(input);\n        responseObject.answerOrder = value;   \n        responseObject.answer = value;   \n        responses.push(responseObject);\n    }\n    var event = paco.createResponseEventForExperimentWithResponses(experiment, responses);\n    \n    var dbSaveOutcomeCallback = function(status) {\n      if (status[\"status\"] === \"success\") {    \n        alert(\"Saved. \" + JSON.stringify(event));        \n        paco.executor.done();\n        // var form_root = $('#root');\n        // form_root.html(\"\");\n        // paco.renderer.renderFeedback(experiment, paco.db, form_root);        \n      } else {\n        alert(\"Could not store data. You might try again. Error: \" + status[\"error\"]);\n      }   \n    };\n\n    paco.db.saveEvent(event, dbSaveOutcomeCallback);        \n\n}\n\n \n</script>\n<div id=\"root\">\n<h1>Please answer the following</h1>\nQ1 <input type=text name=q1></br>\nQ2 <input type=text name=q2></br>\n<input type=submit name=submit onclick=\"save()\">\n</div>"},{"title":"A Location Demo","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":1026,"questionsChange":false,"modifyDate":"2013/11/06","inputs":[{"id":1029,"questionType":"question","text":"Location?","mandatory":false,"responseType":"location","likertSteps":5,"name":"location","conditional":false,"listChoices":[],"invisibleInput":true},{"id":1030,"questionType":"question","text":"Foo?","mandatory":false,"responseType":"open text","likertSteps":5,"name":"foo","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":1028,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"signalSchedule","id":1027,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[36000000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":1027,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[36000000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"A Location Demo 2","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":1043,"questionsChange":false,"modifyDate":"2013/11/06","inputs":[{"id":1046,"questionType":"question","text":"Location?","mandatory":false,"responseType":"location","likertSteps":5,"name":"location","conditional":false,"listChoices":[],"invisibleInput":true},{"id":1047,"questionType":"question","text":"Foo?","mandatory":false,"responseType":"open text","likertSteps":5,"name":"foo","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":1045,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"signalSchedule","id":1044,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[36000000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":1044,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[36000000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"A locatin Demo 2 EOD","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":1056,"questionsChange":false,"modifyDate":"2013/11/06","inputs":[{"id":1059,"questionType":"question","text":"q1","mandatory":false,"responseType":"likert","likertSteps":5,"name":"q1","conditional":false,"listChoices":[],"invisibleInput":false},{"id":1060,"questionType":"question","text":"q2","mandatory":false,"responseType":"likert","likertSteps":5,"name":"q2","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":1058,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"signalSchedule","id":1057,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[43200000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":1057,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[43200000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"CustomFeedback","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":1198,"questionsChange":false,"modifyDate":"2013/11/13","inputs":[{"id":1201,"questionType":"question","text":"How much?","mandatory":false,"responseType":"likert","likertSteps":5,"leftSideLabel":"not at all","rightSideLabel":"a lot","name":"q1","conditional":false,"listChoices":[],"invisibleInput":false},{"id":1202,"questionType":"question","text":"what","mandatory":false,"responseType":"open text","likertSteps":5,"name":"q2","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":1200,"feedbackType":"display","text":"Thanks for participating!\n\nHere is some more text."}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"signalSchedule","id":1199,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[43200000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":1199,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[43200000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"CustomBoth","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":1234,"questionsChange":false,"modifyDate":"2013/11/05","inputs":[{"id":1237,"questionType":"question","text":"What time is it?","mandatory":true,"responseType":"likert","likertSteps":5,"name":"q1","conditional":false,"listChoices":[],"invisibleInput":false},{"id":1238,"questionType":"question","text":"How do you feel?","mandatory":false,"responseType":"open text","likertSteps":5,"name":"q2","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":1460,"feedbackType":"display","text":"<script>\n\nfunction answer() {\n    var event = paco.db.getLastEvent();\n    var responses = event[0].responses;\n    for (var r in responses) {\n        var response = responses[r];\n        if (response.name == \"q1\") {\n            if (response.answer == \"1\") {\n                return \"got a 1\";\n            } else if (response.answer == \"5\") {\n                return \"got a 5\";\n            } else {\n                return \"somewhere in the middle\";\n            }\n        } else {\n            return \"no response for q1\";\n        }\n    }\n    return \"no responses\";\n}\n\nfunction main() {\n    var display = paco.createDisplay();\n    display.title(\"Feedback title\");\n    display.add(\"recommendation: \" + answer());\n}\n\nmain();\n</script>\n"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":22,"signalingMechanisms":[{"type":"signalSchedule","id":1235,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[0],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":1235,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[0],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":true,"customRenderingCode":"<script>\nfunction save() {\n    var experiment = paco.experiment();\n    var inputs = experiment.inputs;\n    var responses = [];\n    for (var i in inputs) {\n        var input = inputs[i];\n        var element = $('input[name='+input.name+']');\n        var value = element.val();\n        var responseObject = paco.createResponseForInput(input);\n        responseObject.answerOrder = value;   \n        responseObject.answer = value;   \n        responses.push(responseObject);\n    }\n    var event = paco.createResponseEventForExperimentWithResponses(experiment, responses, window.env.getValue(\"scheduledTime\"));\n    \n    var dbSaveOutcomeCallback = function(status) {\n      if (status[\"status\"] === \"success\") {    \n        //alert(\"Saved. \" + JSON.stringify(event));        \n        paco.executor.done();\n        // var form_root = $('#root');\n        // form_root.html(\"\");\n        // paco.renderer.renderFeedback(experiment, paco.db, form_root);        \n      } else {\n        alert(\"Could not store data. You might try again. Error: \" + status[\"error\"]);\n      }   \n    };\n\n    paco.db.saveEvent(event, dbSaveOutcomeCallback);        \n\n}\n\nfunction repl() {\n    var js = $('input[name=cmdline]').val();\n    var log = $('#log');\n    var output = eval(js);\n    log.html(log.html()  + \"<br>\" + js + \":<br>\" + output);\n}\n\nfunction main(experiment, form_root) {\n    // no op\n}\n</script>\n<div id=\"root\">\n<h1>Please answer the following</h1>\nQ1 <input type=text name=q1></br>\nQ2 <input type=text name=q2></br>\n<input type=submit name=submit onclick=\"save()\"></br>\n<input type=text name=cmdline><input type=button value=\"eval\" onclick=\"repl()\">\n<div id=\"log\"></div>\n</div>"},{"title":"CustomRenderDefault","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":1358,"questionsChange":false,"modifyDate":"2013/11/05","inputs":[{"id":1361,"questionType":"question","text":"What time is it?","mandatory":true,"responseType":"likert","likertSteps":5,"leftSideLabel":"Early","rightSideLabel":"Late","name":"q1","conditional":false,"listChoices":[],"invisibleInput":false},{"id":1362,"questionType":"question","text":"How do you feel?","mandatory":false,"responseType":"open text","likertSteps":5,"name":"q2","conditional":false,"listChoices":[],"invisibleInput":false},{"id":1390,"questionType":"question","text":"Which one?","mandatory":false,"responseType":"list","likertSteps":5,"name":"q3","conditional":false,"listChoices":["Red","Green"],"invisibleInput":false},{"id":1391,"questionType":"question","text":"Pick many","mandatory":false,"responseType":"list","likertSteps":5,"name":"q4","conditional":false,"listChoices":["one","two","three","four"],"multiselect":true,"invisibleInput":false},{"id":1392,"questionType":"question","text":"Numero","mandatory":true,"responseType":"number","likertSteps":5,"name":"q5","conditional":false,"listChoices":[],"invisibleInput":false},{"id":1393,"questionType":"question","text":"Conditionally?","mandatory":false,"responseType":"open text","likertSteps":5,"name":"q6","conditional":true,"conditionExpression":"q1 == 1","listChoices":[],"invisibleInput":false}],"feedback":[{"id":1469,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":21,"signalingMechanisms":[{"type":"signalSchedule","id":1359,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[0],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":1359,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[0],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":true,"customRenderingCode":"<script>\nfunction main(experiment, form_root) {\n    var conditionalListener = (function() {\n        var inputs = [];\n\n        var obj = {};\n        obj.addInput = function(input, responseHolder, visualElement) {\n            inputs.push({ \"input\" : input, \"responseHolder\" : responseHolder, \"viz\" : visualElement});\n        };\n\n        obj.inputChanged = function() {\n            var values = {};\n      \n            for (var inputIdx in inputs) {\n                var inputPair = inputs[inputIdx];\n                var input = inputPair.input;\n                var value = inputPair.responseHolder.answerOrder;\n                values[input.name] = value; \n            }\n\n            for (var inputIdx in inputs) {\n                var inputPair = inputs[inputIdx];\n                var input = inputPair.input;\n                if (input.conditional) {\n                    var valid = parser.parse(input.conditionExpression, values);\n                    if (!valid) {\n                        inputPair.viz[0].style.display = \"none\";\n                    } else {\n                        inputPair.viz[0].style.display = \"\";\n                    }\n                }\n            }      \n        };\n\n        return obj;\n    })();\n\n    var dbSaveOutcomeCallback = function(status) {\n      if (status[\"status\"] === \"success\") {    \n        form_root.html(\"Feedback\");\n        if (experiment.showFeedback) {\n            paco.renderer.renderFeedback(experiment, paco.db, form_root);\n        } else {\n            paco.executor.done();\n        }\n      } else {\n        alert(\"Could not store data. You might try again. Error: \" + status[\"error\"]);\n      }   \n    };\n\n    var saveDataCallback = function(event) {\n      paco.db.saveEvent(event, dbSaveOutcomeCallback);\n    };\n    \n    var responseEvent = paco.createResponseEventForExperiment(experiment, window.env.getValue(\"scheduledTime\"));\n\n    paco.renderer.renderForm(experiment, responseEvent, form_root, saveDataCallback, conditionalListener);    \n};\n</script>"},{"title":"Custom HTML w Email","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":1486,"questionsChange":false,"modifyDate":"2013/11/05","inputs":[{"id":1489,"questionType":"question","text":"What time is it?","mandatory":false,"responseType":"likert","likertSteps":5,"name":"q1","conditional":false,"listChoices":[],"invisibleInput":false},{"id":1490,"questionType":"question","text":"How do you feel?","mandatory":false,"responseType":"open text","likertSteps":5,"name":"q2","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":1503,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":7,"signalingMechanisms":[{"type":"signalSchedule","id":1487,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[0],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":1487,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[0],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":true,"customRenderingCode":"<script>\nfunction save() {\n    var experiment = paco.experiment();\n    var inputs = experiment.inputs;\n    var responses = [];\n    for (var i in inputs) {\n        var input = inputs[i];\n        var element = $('input[name='+input.name+']');\n        var value = element.val();\n        var responseObject = paco.createResponseForInput(input);\n        responseObject.answerOrder = value;   \n        responseObject.answer = value;   \n        responses.push(responseObject);\n    }\n    var event = paco.createResponseEventForExperimentWithResponses(experiment, responses);\n    \n    var dbSaveOutcomeCallback = function(status) {\n      if (status[\"status\"] === \"success\") {    \n        alert(\"Saved. \" + JSON.stringify(event));        \n        paco.executor.done();\n        // var form_root = $('#root');\n        // form_root.html(\"\");\n        // paco.renderer.renderFeedback(experiment, paco.db, form_root);        \n      } else {\n        alert(\"Could not store data. You might try again. Error: \" + status[\"error\"]);\n      }   \n    };\n\n    paco.db.saveEvent(event, dbSaveOutcomeCallback);        \n\n}\n\nfunction startMail() {\n    confirm(\"Attempting to launch email\");\n    window.email.sendEmail(\"this is the body\", \"subject here\", \"\");\n    alert(\"Launched it!?\");\n}\n \nfunction main(experiment, form_root) {\n     \n}\n</script>\n<div id=\"root\">\n<h1>Please answer the following</h1>\nQ1 <input type=text name=q1></br>\nQ2 <input type=text name=q2></br>\nEmail <input type=button name=email onclick=\"startMail()\"></br>\n<input type=submit name=submit onclick=\"save()\">\n</div>"},{"title":"Custom w Photo","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":1505,"questionsChange":false,"modifyDate":"2013/11/05","inputs":[{"id":1508,"questionType":"question","text":"What time is it?","mandatory":false,"responseType":"likert","likertSteps":5,"leftSideLabel":"Early","rightSideLabel":"Late","name":"q1","conditional":false,"listChoices":[],"invisibleInput":false},{"id":1509,"questionType":"question","text":"Take a picture!","mandatory":false,"responseType":"photo","likertSteps":5,"name":"photo","conditional":false,"listChoices":[],"invisibleInput":false},{"id":1510,"questionType":"question","text":"Subject?","mandatory":false,"responseType":"open text","likertSteps":5,"name":"subject","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":1507,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"signalSchedule","id":1506,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[0],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":1506,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[0],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":true,"customRenderingCode":"<script>\nfunction main(experiment, form_root) {\n    var conditionalListener = (function() {\n        var inputs = [];\n\n        var obj = {};\n        obj.addInput = function(input, responseHolder, visualElement) {\n            inputs.push({ \"input\" : input, \"responseHolder\" : responseHolder, \"viz\" : visualElement});\n        };\n\n        obj.inputChanged = function() {\n            var values = {};\n      \n            for (var inputIdx in inputs) {\n                var inputPair = inputs[inputIdx];\n                var input = inputPair.input;\n                var value = inputPair.responseHolder.answerOrder;\n                values[input.name] = value; \n            }\n\n            for (var inputIdx in inputs) {\n                var inputPair = inputs[inputIdx];\n                var input = inputPair.input;\n                if (input.conditional) {\n                    var valid = parser.parse(input.conditionExpression, values);\n                    if (!valid) {\n                        inputPair.viz[0].style.display = \"none\";\n                    } else {\n                        inputPair.viz[0].style.display = \"\";\n                    }\n                }\n            }      \n        };\n\n        return obj;\n    })();\n\n    var dbSaveOutcomeCallback = function(status) {\n      if (status[\"status\"] === \"success\") {    \n        form_root.html(\"Feedback\");\n        if (experiment.showFeedback) {\n            paco.renderer.renderFeedback(experiment, paco.db, form_root);\n        } else {\n            paco.executor.done();\n        }\n      } else {\n        alert(\"Could not store data. You might try again. Error: \" + status[\"error\"]);\n      }   \n    };\n\n    var saveDataCallback = function(event) {\n      paco.db.saveEvent(event, dbSaveOutcomeCallback);\n    };\n    \n    var responseEvent = paco.createResponseEventForExperiment(experiment, window.env.getValue(\"scheduledTime\"));\n\n    paco.renderer.renderForm(experiment, responseEvent, form_root, saveDataCallback, conditionalListener);    \n};\n</script>"},{"title":"AAA Daily Experiment","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":1544,"questionsChange":false,"modifyDate":"2013/11/20","inputs":[{"id":1547,"questionType":"question","text":"w","mandatory":false,"responseType":"likert","likertSteps":5,"name":"wq","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":1546,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"signalSchedule","id":1545,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[46800000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":1545,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[46800000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"AAA Eod","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":1549,"questionsChange":false,"modifyDate":"2013/11/20","inputs":[{"id":1552,"questionType":"question","text":"q","mandatory":false,"responseType":"open text","likertSteps":5,"name":"q","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":1551,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"signalSchedule","id":1550,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[46800000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":1550,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[46800000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"ProcPoller","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":1575,"questionsChange":false,"modifyDate":"2013/11/21","inputs":[{"id":1578,"questionType":"question","text":"Did it happen?","mandatory":false,"responseType":"likert","likertSteps":2,"leftSideLabel":"Yes","rightSideLabel":"No","name":"didit","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":1584,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":2,"signalingMechanisms":[{"type":"trigger","timeout":5,"minimumBuffer":1,"eventCode":4,"delay":5000,"id":1576,"sourceIdentifier":"com.android.gallery/com.android.camera.GalleryPicker"}],"schedule":{"type":"signalSchedule","scheduleType":5,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"AddPhotoExample","description":"Show how to override the default experiment rendering to include an \"Add a photo\" button to allow adding more photos to responses.","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":1634,"questionsChange":false,"modifyDate":"2014/01/16","inputs":[{"id":1637,"questionType":"question","text":"Add a photo","mandatory":false,"responseType":"photo","likertSteps":5,"name":"photo1","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":1636,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"signalSchedule","id":1635,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[54000000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":1635,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[54000000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":true,"customRenderingCode":"<script>\nfunction main(experiment, form_root) {\n    var conditionalListener = (function() {\n        var inputs = [];\n\n        var obj = {};\n        obj.addInput = function(input, responseHolder, visualElement) {\n            inputs.push({ \"input\" : input, \"responseHolder\" : responseHolder, \"viz\" : visualElement});\n        };\n\n        obj.inputChanged = function() {\n            var values = {};\n      \n            for (var inputIdx in inputs) {\n                var inputPair = inputs[inputIdx];\n                var input = inputPair.input;\n                var value = inputPair.responseHolder.answerOrder;\n                values[input.name] = value; \n            }\n\n            for (var inputIdx in inputs) {\n                var inputPair = inputs[inputIdx];\n                var input = inputPair.input;\n                if (input.conditional) {\n                    var valid = parser.parse(input.conditionExpression, values);\n                    if (!valid) {\n                        inputPair.viz[0].style.display = \"none\";\n                    } else {\n                        inputPair.viz[0].style.display = \"\";\n                    }\n                }\n            }      \n        };\n\n        return obj;\n    })();\n\n    var dbSaveOutcomeCallback = function(status) {\n      if (status[\"status\"] === \"success\") {    \n        form_root.html(\"Feedback\");\n        if (experiment.showFeedback) {\n            paco.renderer.renderFeedback(experiment, paco.db, form_root);\n        } else {\n            paco.executor.done();\n        }\n      } else {\n        alert(\"Could not store data. You might try again. Error: \" + status[\"error\"]);\n      }   \n    };\n\n    var saveDataCallback = function(event) {\n      paco.db.saveEvent(event, dbSaveOutcomeCallback);\n    };\n    \n    var responseEvent = paco.createResponseEventForExperiment(experiment, window.env.getValue(\"scheduledTime\"));\n\n    form_root.append(paco.renderer.renderExperimentTitle(experiment));\n    // render inputs\n    \n    paco.renderer.renderPhoto\n    // render save button\n    var saveButton = paco.renderer.renderSaveButton();\n    rootPanel.append(saveButton);\n    paco.renderer.registerValidationErrorMarkingCallback(experiment, responseEvent, saveButton, saveDataCallback);\n    // run this once to hide the hidden ones\n    conditionalListener.inputChanged();\n   \n};\n</script>"},{"title":"An EIN Daily Ping Example","description":"","informedConsentForm":"go/nda","creator":"bobevans999@gmail.com","fixedDuration":true,"startDate":"2014/01/29","endDate":"2014/01/31","id":1644,"questionsChange":false,"modifyDate":"2014/01/29","inputs":[{"id":1647,"questionType":"question","text":"What information have you sought since the last ping?","mandatory":false,"responseType":"open text","likertSteps":5,"name":"information","conditional":false,"listChoices":[],"invisibleInput":false},{"id":1648,"questionType":"question","text":"How urgently did you need to find this info?","mandatory":false,"responseType":"likert","likertSteps":5,"leftSideLabel":"Not at all","rightSideLabel":"Very ","name":"urgency","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":1646,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"signalSchedule","id":1645,"scheduleType":4,"esmFrequency":5,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[39600000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":1645,"scheduleType":4,"esmFrequency":5,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[39600000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"An EIN EOD Example","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":1650,"questionsChange":false,"modifyDate":"2014/01/29","inputs":[{"id":1653,"questionType":"question","text":"Did you find the info?","mandatory":false,"responseType":"list","likertSteps":5,"name":"success","conditional":false,"listChoices":["I found what i was looking for","I found part of it","I did not find it","I did not look"],"invisibleInput":false}],"feedback":[{"id":1652,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"signalSchedule","id":1651,"scheduleType":1,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[64800000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":1651,"scheduleType":1,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[64800000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"An EIN Daily 2 Example ","description":"","informedConsentForm":"go/nda","creator":"bobevans999@gmail.com","fixedDuration":true,"startDate":"2014/01/29","endDate":"2014/02/03","id":1669,"questionsChange":false,"modifyDate":"2014/01/29","inputs":[{"id":1672,"questionType":"question","text":"Did you want any information about work since you were last pinged?","mandatory":false,"responseType":"open text","likertSteps":5,"name":"information","conditional":false,"listChoices":[],"invisibleInput":false},{"id":1673,"questionType":"question","text":"How urgent was this need?","mandatory":false,"responseType":"likert","likertSteps":5,"leftSideLabel":"Not at all","rightSideLabel":"Very","name":"urgency","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":1671,"feedbackType":"display","text":"Thank you for participating."}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"signalSchedule","id":1670,"scheduleType":4,"esmFrequency":5,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[43200000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":1670,"scheduleType":4,"esmFrequency":5,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[43200000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"An EIN EOD 2 Example","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":true,"startDate":"2014/01/29","endDate":"2014/01/30","id":1675,"questionsChange":false,"modifyDate":"2014/01/29","inputs":[{"id":1678,"questionType":"question","text":"Did you find the information you wanted?","mandatory":false,"responseType":"list","likertSteps":5,"name":"success","conditional":false,"listChoices":["I found the info","I found part of the info","I found none of the info","I didn't look"],"invisibleInput":false}],"feedback":[{"id":1677,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"signalSchedule","id":1676,"scheduleType":1,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[64800000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":1676,"scheduleType":1,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[64800000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"NotificationTrayOpen","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":1701,"questionsChange":false,"modifyDate":"2014/01/30","inputs":[{"id":1704,"questionType":"question","text":"Did it work","mandatory":false,"responseType":"likert","likertSteps":5,"name":"worked","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":1703,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"trigger","eventCode":3,"delay":5000,"id":1702,"sourceIdentifier":"com.pacoapp.notificationlistener:notification_tray_opened"}],"schedule":{"type":"signalSchedule","scheduleType":5,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"NotificationClicked","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":1816,"questionsChange":false,"modifyDate":"2014/01/30","inputs":[{"id":1819,"questionType":"question","text":"Did it work","mandatory":false,"responseType":"likert","likertSteps":5,"name":"worked","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":1818,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":1,"signalingMechanisms":[{"type":"trigger","timeout":10,"minimumBuffer":15,"eventCode":3,"delay":5000,"id":1817,"sourceIdentifier":"com.pacoapp.notificationlistener:notification_clicked"}],"schedule":{"type":"signalSchedule","scheduleType":5,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false},{"title":"Whats On Your Mind - demo","description":"","informedConsentForm":"","creator":"bobevans999@gmail.com","fixedDuration":false,"id":1826,"questionsChange":false,"modifyDate":"2013/11/05","inputs":[{"id":1829,"questionType":"question","text":"olive oil cake recipes","mandatory":false,"responseType":"likert","likertSteps":2,"leftSideLabel":"Yes","rightSideLabel":"No","name":"q1","conditional":false,"listChoices":[],"invisibleInput":false},{"id":1830,"questionType":"question","text":"Melissa d'Arabian","mandatory":false,"responseType":"likert","likertSteps":2,"leftSideLabel":"Yes","rightSideLabel":"No","name":"q2","conditional":false,"listChoices":[],"invisibleInput":false},{"id":1831,"questionType":"question","text":"Stonehouse California Olive Oil","mandatory":false,"responseType":"likert","likertSteps":2,"leftSideLabel":"Yes","rightSideLabel":"No","name":"q3","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":1836,"feedbackType":"display","text":"Thanks for Participating!"}],"published":false,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":2,"signalingMechanisms":[{"type":"signalSchedule","id":1827,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[0],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":1827,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[0],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":true,"customRenderingCode":"<script>\nvar selections = {};\n\n// updown = 1 or 2 for up or down respectively\nfunction recordSelection(inputId, upDown) {\n  selections[inputId] = upDown;      \n}\n\nfunction save() {\n    var experiment = paco.experiment();\n    var inputs = experiment.inputs;\n    var responses = [];\n    for (var i in inputs) {\n        var input = inputs[i];\n        //var element = $('input[name='+input.name+']');\n        var value = selections[input.name];\n        var responseObject = paco.createResponseForInput(input);\n        responseObject.answerOrder = value;   \n        responseObject.answer = value;   \n        responses.push(responseObject);\n    }\n    var event = paco.createResponseEventForExperimentWithResponses(experiment, responses);\n    \n    var dbSaveOutcomeCallback = function(status) {\n      if (status[\"status\"] === \"success\") {    \n        alert(\"Saved. \" + JSON.stringify(event));        \n        paco.executor.done();\n        // var form_root = $('#root');\n        // form_root.html(\"\");\n        // paco.renderer.renderFeedback(experiment, paco.db, form_root);        \n      } else {\n        alert(\"Could not store data. You might try again. Error: \" + status[\"error\"]);\n      }   \n    };\n\n    paco.db.saveEvent(event, dbSaveOutcomeCallback);        \n\n}\n\nvar td =\n\"iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAIAAABLixI0AAAACXBIWXMAAAsTAAALEwEAmpwY\"+ \n\"AAAAB3RJTUUH3gIVFBkBDs+xEAAAB3dJREFUOBEBbAeT+AH///8AAAAAAAAAAAAAAAAAAAAA\"+ \n\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"+ \n\"AAAEAAAAAAAAAAAAAAAAAAAAAAAA////////AAAAAQEBAQEBAAAAAAAAAAAAAAAAAAAAAAAA\"+ \n\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAOTk5Nvb2wkJCQ4O\"+ \n\"DhAQEAoKCgYGBgYGBgUFBQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///8AAAAA\"+ \n\"AAAAAAAAAAD7+/vKysrp6ekAAAAAAAAAAAAEBAQGBgYHBwcICAgKCgoJCQkeHh729vb19fUB\"+ \n\"AQEVFRUHBwcAAAAAAAAEAAAAAAAAAAAAAAAAAAAA8fHx7OzsAAAAAAAAAAAAAAAA/Pz8/Pz8\"+ \n\"9vb2AAAAAAAAAgICEhIS4ODg4uLiAgICPDw8BwcHAAAAAAAAAgAAAAAAAAAAAAAAAP39/eDg\"+ \n\"4P39/QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wAAAP///wAAAP///////wAAAAAA\"+ \n\"AAAAAAIAAAAAAAA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RUVAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"+ \n\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBARoaGggICAAAAAAAAAAAAAIA\"+ \n\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"+ \n\"AAAEBAQcHBwAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"+ \n\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQCwsLAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAA\"+ \n\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBARkZGQUFBQAA\"+ \n\"AAAAAAAAAAAAAAH///8AAAAAAAD6+vrv7+////8FBQUNDQ3s7Oz29vb39/f29vb5+fn4+Pj5\"+ \n\"+fn9/f3///8AAAAKCgo6OjoNDQ0AAAAAAAAAAAAAAAAB////AAAAAAAAAAAAAAAAAAAAAAAA\"+ \n\"AAAAAAAAAAAA////AAAA/f39/f39/f399vb28fHx9fX1ERERHR0dAAAAAAAAAAAAAAAAAAAA\"+ \n\"Af///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"+ \n\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"+ \n\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADo/eT5FmDLXgAA\"+ \n\"AABJRU5ErkJggg==\";\n\n\nfunction maketu(imgId) {\n    document.getElementById(imgId).src = \"data:image/png;base64, \" + tu;\n} \n\nfunction maketd(imgId) {\n    document.getElementById(imgId).src = \"data:image/png;base64, \" + td;\n}\n\nfunction main() {\n    maketu(\"q1tu\");\n    maketd(\"q1td\");\n    maketu(\"q2tu\");\n    maketd(\"q2td\");\n    maketu(\"q3tu\");\n    maketd(\"q3td\");\n}\n\nmain();\n\n</script>\n\n<div id=\"root\">\n<h1>What's on your mind?</h1>\n  <table style=\"vertical-align: top;text-align: left;\">\n<tr style=\"vertical-align: top;text-align: left;\"><td width='150' style=\"vertical-align: top;text-align: left;\">\n  <span>Olive oil cake recipes</span></td><td   style=\"vertical-align: top;text-align: right;\" >\n  <img id=\"q1tu\" src=\"file:///foo.png\" onclick=\"recordSelection('q1', 1);\"></td>\n    <td style=\"vertical-align: top;text-align: right;\" ><img id=\"q1td\"\n      src=\"file:///foo.png\" onclick=\"recordSelection('q1', 2);\"></td>\n    </tr>\n<tr style=\"vertical-align: top;text-align: left;\">\n  <td width='150'><span>Melissa d'Arabian</span></td>\n  <td>\n    <img id=\"q2tu\" src=\"file:///foo.png\"\n    onclick=\"recordSelection('q2', 1);\"></td>\n    <td><img id=\"q2td\" src=\"file:///foo.png\"\n      onclick=\"recordSelection('q2', 2);\"></td>\n    </tr>\n<tr style=\"vertical-align: top;text-align: left;\"><td\n  width='150'><span>Stonehouse California Olive Oil</span></td>\n  <td>\n  <img id=\"q3tu\" src=\"file:///foo.png\" onclick=\"recordSelection('q3',\n  1);\"></td>\n  <td><img id=\"q3td\" src=\"file:///foo.png\" onclick=\"recordSelection('q3', 2);\"></td></tr>\n<tr style=\"vertical-align: top;text-align: left;\"><td  width='150'><input type=submit name=submit onclick=\"save()\"></td></tr></table>\n</div>\n"},{"title":"CacheTesting","description":"","informedConsentForm":"tbd","creator":"bobevans999@gmail.com","fixedDuration":false,"id":1854,"questionsChange":false,"modifyDate":"2014/02/25","inputs":[{"id":1857,"questionType":"question","text":"foo","mandatory":false,"responseType":"likert","likertSteps":5,"name":"foo","conditional":false,"listChoices":[],"invisibleInput":false}],"feedback":[{"id":1863,"feedbackType":"display","text":"Thanks for Participating!"}],"published":true,"admins":["bobevans999@gmail.com"],"publishedUsers":[],"deleted":false,"version":4,"signalingMechanisms":[{"type":"signalSchedule","id":1855,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[36000000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false}],"schedule":{"type":"signalSchedule","id":1855,"scheduleType":0,"esmFrequency":3,"esmPeriodInDays":0,"esmStartHour":32400000,"esmEndHour":61200000,"times":[36000000],"repeatRate":1,"weekDaysScheduled":0,"nthOfMonth":1,"byDayOfMonth":true,"dayOfMonth":1,"esmWeekends":false,"byDayOfWeek":false},"customRendering":false}]' http://127.0.0.1:8080/experiments

