Labs/Test Pilot/Experiment Tutorial: Difference between revisions

(//)
Line 199: Line 199:
  BackButtonGlobalObserver.prototype.onExperimentStartup = function(store) {
  BackButtonGlobalObserver.prototype.onExperimentStartup = function(store) {
   // store is a reference to the live database table connection
   // store is a reference to the live database table connection
   // you MUST call the base class onExperimentStartup and give it the store
   // you MUST call the base class onExperimentStartup and give it the store
   // reference:
   // reference:
   BackButtonGlobalObserver.superClass.onExperimentStartup.call(this, store);
   BackButtonGlobalObserver.superClass.onExperimentStartup.call(this, store);
   // Put your other code here!
   // Put your other code here!
   console.info("Back button study is starting up!");
   console.info("Back button study is starting up!");
Line 209: Line 207:


I strongly recommend recording a study version number whenever the study starts up.  This way, if you have need to modify your study later, you can update the study version number, and then when we're analyzing the data we can tell apart data that came from the earlier version and data that came from the later version.  (You could also make a column for the study version and put in the study version with every event recorded, but that will unnecessarily increase the size of the final data upload...)
I strongly recommend recording a study version number whenever the study starts up.  This way, if you have need to modify your study later, you can update the study version number, and then when we're analyzing the data we can tell apart data that came from the earlier version and data that came from the later version.  (You could also make a column for the study version and put in the study version with every event recorded, but that will unnecessarily increase the size of the final data upload...)


  const EVENT_CODE_STUDY_STARTUP = 0;
  const EVENT_CODE_STUDY_STARTUP = 0;
  exports.experimentInfo = {
  exports.experimentInfo = {
   versionNumber: 1,
   versionNumber: 1,
Line 220: Line 216:
  BackButtonGlobalObserver.prototype.onExperimentStartup = function(store) {
  BackButtonGlobalObserver.prototype.onExperimentStartup = function(store) {
   BackButtonGlobalObserver.superClass.onExperimentStartup.call(this, store);
   BackButtonGlobalObserver.superClass.onExperimentStartup.call(this, store);
   record({event_code: EVENT_CODE_STUDY_STARTUP,
   record({event_code: EVENT_CODE_STUDY_STARTUP,
           value: exports.experimentInfo.versionNumber,
           value: exports.experimentInfo.versionNumber,
1,007

edits