DoSomething/ds-mdata-responder — pull request #77 by jonuy (2014-07-17 23:44:12+00:00)
Title: End Level Handling

#### What's this PR do?
The end level transition looks something like this...
```
--> All players reach end of level
--> All players auto-receive a group message based on player results from this level
--> All players auto-receive the start message for the next level
```
This PR handles the sending of those messages. Which one it should send and sending the messages in an ordered series with some time delay worked in between messages.

#### Where should the reviewer start?
`competitive-stories.json -- 'END-LEVEL1-GROUP'`
`choices.next` denotes what message to send to the entire group.
`choices.majority_players_result` denotes what opt-in path the majority of the group has to be in in order to receive that message.

`SGCompetitiveStoryController.js`
Everything in this block `if (nextOip.match(/^END-LEVEL/)) {` is the logic for:
* what end-level message should individual people get
* are all players at the end of the level? then let's figure out what group message to now send
* use `scheduleMobileCommonsOptIn` to send the group message on a delay followed shortly by the next level message

#### Questions?
Is there some logic here that can be refactored to make more sense? I admittedly felt a little all over the place with this one and feel like I might be overcomplicating this.

#### What are the relevant tickets?
Closes DoSomething#70
Closes DoSomething#71