1,007
edits
(Created page with '== General == Test Pilot experiments and surveys are implemented as Javascript Securable Modules. They will be loaded using Cuddlefish. They are expected to export objects wit…') |
No edit summary |
||
Line 7: | Line 7: | ||
== Surveys == | == Surveys == | ||
Surveys are very simple to write, because we currently use SurveyMonkey to host the actual questions, meaning that the JS | Surveys are very simple to write, because we currently use SurveyMonkey to host the actual questions, meaning that the JS module on testpilot.mozillalabs.com only has to provide metadata. The survey js file simply has to export an object named surveyInfo which has the following properties: | ||
* surveyId: a unique string that identifies this survey. Can be anything but must be distinct from the ids of any other surveys. Will be used as part of a Mozilla preference so it must not contain spaces. | * surveyInfo.surveyId: a unique string that identifies this survey. Can be anything but must be distinct from the ids of any other surveys. Will be used as part of a Mozilla preference so it must not contain spaces. | ||
* surveyName: a string containing the human-readable name of the survey, which will be displayed in the extension's menus, etc. | * surveyInfo.surveyName: a string containing the human-readable name of the survey, which will be displayed in the extension's menus, etc. | ||
* surveyUrl: the URL where the survey is hosted - users who choose to take the survey will be sent here. | * surveyInfo.surveyUrl: the URL where the survey is hosted - users who choose to take the survey will be sent here. | ||
* resultsUrl: the URL where the survey results are hosted - users who choose to see survey results will be sent here. If there are no survey results yet (e.g. if it's a new survey), then resultsUrl should be undefined (i.e. don't specify it at all). | * surveyInfo.resultsUrl: the URL where the survey results are hosted - users who choose to see survey results will be sent here. If there are no survey results yet (e.g. if it's a new survey), then resultsUrl should be undefined (i.e. don't specify it at all). | ||
The presence or absence of the surveyInfo object is used by the extension to determine whether a JS module is a survey or an experiment. Any JS module that exports an object named surveyInfo will be treated as a survey. If you are writing an experiment, make sure not to export an object named surveyInfo! | |||
=== Example === | === Example === | ||
Line 24: | Line 26: | ||
resultsUrl: "http://www.surveymonkey.com/sr.aspx?sm=oZPWdDCVgnJqkmPERROH6AWWPcmTImSDiMyFunw16b8_3d" | resultsUrl: "http://www.surveymonkey.com/sr.aspx?sm=oZPWdDCVgnJqkmPERROH6AWWPcmTImSDiMyFunw16b8_3d" | ||
}; | }; | ||
== Experiments == | |||
Experiments are much more involved than surveys |
edits