DoSomething/ds-mdata-responder — pull request #307 by tongxiang (2014-11-12 19:00:31+00:00)
Title: Add A/B testing branch & beta single-touch sign-in :squirrel:

#### What's this PR do?
1. In order to facilitate A/B testing of features for Science Sleuth, we've created a new gameconfig file for a copy of ScienceSleuth. @ArielSD is working on a branch incorporating new opt-in-paths for the `888888` placeholders we currently have in the file.

2. Previously, when betas were invited to a game our app needed two 'Y' responses from them to join a game. We'd like betas to only have to respond once in order to be opted into a game. This PR will allow us to selectively test this alternate version of the beta join story. How does this alternate version work? Well, let's see! :neckbeard:

Note that we've first made changes to the BullyText game on the MobileCommons side. Once we verifies that this all works on the deployed app and the new Science Sleuth copy config is deployed, we'll be able to check that this all works with Science Sleuth.

**Alternate beta join story**
1. A specified percentage of users who create games on the Drupal web form will be given different body params hitting our responder's backend to create an instance of the alternate Science Sleuth game, the one with a gameId of 201.
2. The post request to our backend creating this game will have a `abtest=true` query param flag on it. In the code block below from the `.createGame()` function, note that the presence of this flag will **not** opt in betas to the `beta_join_ask_oip`, but instead to the `beta_wait_oip`.
```javascript
if (self.createdGameDoc.game_type !== 'solo' && self.request.query.abtest != 'true') {
optinGroup(self.createdGameDoc.alpha_phone, self.gameConfig[self.storyId.toString()].alpha_wait_oip, betaOptInArray, self.gameConfig[self.storyId.toString()].beta_join_ask_oip)
} else if (self.request.query.abtest == 'true') {
optinGroup(self.createdGameDoc.alpha_phone, self.gameConfig[self.storyId.toString()].alpha_wait_oip, betaOptInArray, self.gameConfig[self.storyId.toString()].beta_wait_oip)
}
```
3. On the MobileCommons side, we've modified the `beta_wait_oip` [config](https://secure.mcommons.com/campaigns/127839/opt_in_paths/169847) so that when it's initially sent to a friend, the message says:

```
{{sender}} has invited you to play the Bully Text game with DoSomething.org! Text back "ACCEPT" to join the game.
```
4. We've also created a new MData, [MP SMS - [AB-Testing] Beta Join (CompetitiveStory)](https://secure.mcommons.com/mdatas/11789) which is triggered by this **ACCEPT** keyword. This MData hits a modified URL on our responder-side, which is:
```
http://localhost:4711/sms-multiplayer-game/beta-join?story_type=competitive-story&args=Y
```
5. This modified URL contains the `args=Y` query param, which is then parsed by the `.betaJoin()` function in our SGCompetitiveStoryController and the beta is thus able to join the game.

#### Where should the reviewer start?
Check out the changes in the `SgCompetitiveStoryController.js` file.

#### How should this be manually tested?
While normal gameplay has been tested locally, we aren't able to test this change without deploying this version of our app (either to a new app, or to our current one.)

#### What are the relevant tickets?
Begins the process of closing #306.