<commit_before>/* 1. the modules needed to turn this into a STUDY */
const xutils = require("shield-studies-addon-utils");
const addonPrefs = require("sdk/simple-prefs").prefs;

/* 2. configuration / setup constants for the study.
 *  These are only ones needed, or supported
 */
const {quickCodes, modes} = require("./experiment-modes");

let variations = {};

Object.keys(quickCodes).forEach(function(v){
  variations[v] = function(){addonPrefs["shield.variation"] = v};
});

let variationsMod = {
  variations: variations,
  isEligible: function () {return true},
  cleanup: function () {}
};

const forSetup = {
  name: require("sdk/self").id, // unique for Telemetry
  choices: Object.keys(variationsMod.variations), // names of branches.
  duration: 30,   // in days,
  /* Get surveyUrl from Strategy + Insights */
  surveyUrl: "https://qsurvey.mozilla.com/s3/Shield-Study-Example-Survey"
};

// 3. Study Object (module singleton);
var ourConfig = xutils.xsetup(forSetup); 
// branch is now chosen; change the url
let mode = modes[quickCodes[ourConfig.variation]];

ourConfig.surveyUrl = "https://qsurvey.mozilla.com/s3/cfr-end-of-study?"
         + [
            "coeff=" + mode.coeff,<commit_msg>Firefox Guide Study 1 survey link added<commit_after>/* 1. the modules needed to turn this into a STUDY */
const xutils = require("shield-studies-addon-utils");
const addonPrefs = require("sdk/simple-prefs").prefs;

/* 2. configuration / setup constants for the study.
 *  These are only ones needed, or supported
 */
const {quickCodes, modes} = require("./experiment-modes");

let variations = {};

Object.keys(quickCodes).forEach(function(v){
  variations[v] = function(){addonPrefs["shield.variation"] = v};
});

let variationsMod = {
  variations: variations,
  isEligible: function () {return true},
  cleanup: function () {}
};

const forSetup = {
  name: require("sdk/self").id, // unique for Telemetry
  choices: Object.keys(variationsMod.variations), // names of branches.
  duration: 30,   // in days,
  /* Get surveyUrl from Strategy + Insights */
  surveyUrl: "https://qsurvey.mozilla.com/s3/Firefox-Guide-Study-1-End-of-Study"
};

// 3. Study Object (module singleton);
var ourConfig = xutils.xsetup(forSetup); 
// branch is now chosen; change the url
let mode = modes[quickCodes[ourConfig.variation]];

ourConfig.surveyUrl = "https://qsurvey.mozilla.com/s3/Firefox-Guide-Study-1-End-of-Study?"
         + [
            "coeff=" + mode.coeff,
{'fraction_non_alphanumeric': 0.15128100854005694, 'fraction_numerical': 0.0069133794225294835, 'mean_word_length': 3.929859719438878, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1446891', 'n_tokens_mistral': 812, 'n_tokens_neox': 790, 'n_words': 197}