1,007
edits
| Line 209: | Line 209: | ||
=== webContent === | === webContent === | ||
( | The webContent object is used to fill in the content of the experiment status page, which lives on the client side as part of the extension (it's shown to the user at url chrome://testpilot/content/status.html). webContent must expose a certain list of properties, documented below. Instead of implementing all of these from scratch, you should probably extend the base webContent class in '''study_base_classes.js''' and override only the properites you want to customize. | ||
The | Each of these properties is a string (or a getter that returns a string) containing a chunk of HTML. The HTML chunks appropriate to the experiment's current status will be selected by logic in the extension, and slotted into place on the experiment status page. | ||
* upcomingHtml: Shown before the experiment begins. | |||
* inProgressHtml: Shown while experiment is in progress. | |||
* canceledHtml: Shown if the experiment was canceled by the user. | |||
* completedHtml: Shown after the experiment is complete, before it is submitted. | |||
* remainDataHtml: Shown after experiment data submitted but before it expires. | |||
* dataExpiredHtml: Shown if data expired without being submitted. | |||
* deletedRemainDataHtml: Shown if data expired after being submitted. | |||
* inProgressDataPrivacyHtml: Shown in privacy info sidebar while experiment is in progress. | |||
* canceledDataPrivacyHtml: Shown in privacy info sidebar if experiment was canceled by the user. | |||
* completedDataPrivacyHtml: Shown in privacy info sidebar after experiment is complete, before it is submitted. | |||
* remainDataPrivacyHtml: Shown in privacy info sidebar after experiment data is submitted, before it expires. | |||
* dataExpiredDataPrivacyHtml: Shown in privacy info sidebar if data expired without being submitted. | |||
* deletedRemainDataPrivacyHtml: Shown in privacy info sidebar if data expired after being submitted. | |||
webContent must also provide the following function: | |||
* onPageLoad: A function, that will be called when the status page has loaded. This can do whatever the experiment needs to do to finish rendering the page. For example, it can pull data from the data store and draw graphs on canvas elements. | * onPageLoad: A function, that will be called when the status page has loaded. This can do whatever the experiment needs to do to finish rendering the page. For example, it can pull data from the data store and draw graphs on canvas elements. | ||
edits