{"action":"created","issue":{"url":"https://api.github.com/repos/DoSomething/intertwine/issues/41","labels_url":"https://api.github.com/repos/DoSomething/intertwine/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/DoSomething/intertwine/issues/41/comments","events_url":"https://api.github.com/repos/DoSomething/intertwine/issues/41/events","html_url":"https://github.com/DoSomething/intertwine/pull/41","id":58801069,"number":41,"title":"add changes which allow exported configs to pass responder tests","user":{"login":"tongxiang","id":5678066,"avatar_url":"https://avatars.githubusercontent.com/u/5678066?v=3","gravatar_id":"","url":"https://api.github.com/users/tongxiang","html_url":"https://github.com/tongxiang","followers_url":"https://api.github.com/users/tongxiang/followers","following_url":"https://api.github.com/users/tongxiang/following{/other_user}","gists_url":"https://api.github.com/users/tongxiang/gists{/gist_id}","starred_url":"https://api.github.com/users/tongxiang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tongxiang/subscriptions","organizations_url":"https://api.github.com/users/tongxiang/orgs","repos_url":"https://api.github.com/users/tongxiang/repos","events_url":"https://api.github.com/users/tongxiang/events{/privacy}","received_events_url":"https://api.github.com/users/tongxiang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-24T20:45:00Z","updated_at":"2015-02-24T21:48:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/DoSomething/intertwine/pulls/41","html_url":"https://github.com/DoSomething/intertwine/pull/41","diff_url":"https://github.com/DoSomething/intertwine/pull/41.diff","patch_url":"https://github.com/DoSomething/intertwine/pull/41.patch"},"body":"#### What's this PR do?\r\nWhile at first glance, the config files previously exported by intertwine seemed to be able to run games. After setting up an actual science sleuth game in intertwine, storing the produced config in our local config database, and running `npm test`, we (Tong) quickly realized that these config files were **wildly** full of erroneous holes produced by us (Tong). \r\n\r\nWhat changed? \r\n\r\n1. We added a `story_id` property to `passageStoryConfig.js`, and all the attendant places the new property needs to be. During the `exportsms.js` step, this `story_id` becomes `_id` in the document created. \r\n2. Within `exportsms.js`, our `_buildStoryConfig` function now also creates a `story_start_oip` property, which we were missing before. \r\n3. Because we are now referencing the first level name string, `L10`, in more than one place, I created a `config.js` file to store global variables. (Perhaps a place for a hard-coded number of levels?)\r\n4. All necessary opt-in-paths are run through `parseInt()` before exported.\r\n\r\n#### Where should the reviewer start?\r\nMost changes are fairly small and easy to understand. The `_buildStoryConfig()` and `_buildRegularLevels` function have the greatest change. \r\n\r\n#### How should this be manually tested?\r\n1. Upload [this HTML gist](https://gist.github.com/tongxiang/cf00bde4fa3c5140046c) of the real McCoy Science Sleuth 2014 SMS game into your version of intertwine. \r\n2. export it\r\n3. copy-and-paste the exported JSON into your `ds-mdata-responder`'s `competitive-stories.json` file, in place of the old Science Sleuth 2014 game. (**NOT** the A/B test version.)\r\n4. comment out the top section of `pull_config.sh` which imports config files from production, ensuring that the second section--that section which exports JSON config files stored in the app and puts them in your local db--remains. \r\n5. run `npm test`. Your tests should pass!\r\n\r\n#### What are the relevant tickets?\r\nCloses #9!!!\r\n\r\n#### Questions:\r\nIt seems to me that there might be some obvious refactors. (For instance, finding a more intelligent way to `parseInt()` all exported opt-in-paths.) Let me know if you think of any others. \r\n\r\nAlso, I think for the time being it might be reasonable add the `numberOfLevels` param to `config.js` to avoid working on #34 right now, as we prioritize working on validations the rest of this week? What are your thoughts?"},"comment":{"url":"https://api.github.com/repos/DoSomething/intertwine/issues/comments/75853687","html_url":"https://github.com/DoSomething/intertwine/pull/41#issuecomment-75853687","issue_url":"https://api.github.com/repos/DoSomething/intertwine/issues/41","id":75853687,"user":{"login":"jonuy","id":696595,"avatar_url":"https://avatars.githubusercontent.com/u/696595?v=3","gravatar_id":"","url":"https://api.github.com/users/jonuy","html_url":"https://github.com/jonuy","followers_url":"https://api.github.com/users/jonuy/followers","following_url":"https://api.github.com/users/jonuy/following{/other_user}","gists_url":"https://api.github.com/users/jonuy/gists{/gist_id}","starred_url":"https://api.github.com/users/jonuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonuy/subscriptions","organizations_url":"https://api.github.com/users/jonuy/orgs","repos_url":"https://api.github.com/users/jonuy/repos","events_url":"https://api.github.com/users/jonuy/events{/privacy}","received_events_url":"https://api.github.com/users/jonuy/received_events","type":"User","site_admin":false},"created_at":"2015-02-24T21:48:17Z","updated_at":"2015-02-24T21:48:17Z","body":"Tested with the ds-mdata-responder config branch and tests pass. :+1: "}}