{"action":"created","comment":{"url":"https://api.github.com/repos/oppia/oppia/pulls/comments/43991767","id":43991767,"diff_hunk":"@@ -1102,6 +1102,43 @@ def test_update_interaction_answer_groups(self):\n         self.assertEqual(outcome.dest, self.init_state_name)\n         self.assertEqual(init_interaction.default_outcome.dest, 'State 2')\n \n+    def test_update_interaction_fallbacks(self):\n+        \"\"\"Test updating of interaction_fallbacks.\"\"\"\n+        # We create a second state to use as a rule destination\n+        exploration = exp_services.get_exploration_by_id(self.EXP_ID)\n+        exploration.add_states(['State 2'])\n+        exploration.states['State 2'].update_interaction_id('TextInput')\n+        exp_services._save_exploration(self.OWNER_ID, exploration, '', [])\n+\n+        exploration = exp_services.get_exploration_by_id(self.EXP_ID)\n+        exp_services.update_exploration(\n+            self.OWNER_ID, self.EXP_ID,\n+            _get_change_list(\n+                self.init_state_name,\n+                exp_domain.STATE_PROPERTY_INTERACTION_FALLBACKS,\n+                [{\n+                    'trigger': {\n+                        'trigger_type': 'NthResubmission',\n+                        'customization_args': {\n+                            'num_submits': 5,\n+                        },\n+                    },\n+                    'outcome': self.interaction_default_outcome,\n+                }]),\n+            '')\n+\n+        exploration = exp_services.get_exploration_by_id(self.EXP_ID)\n+        init_state = exploration.init_state\n+        init_interaction = init_state.interaction\n+        fallbacks = init_interaction.fallbacks\n+        self.assertEqual(len(fallbacks), 1)\n+        self.assertEqual(fallbacks[0].trigger.trigger_type, 'NthResubmission')\n+        self.assertEqual(\n+            fallbacks[0].trigger.customization_args, {'num_submits': 5})\n+        self.assertEqual(fallbacks[0].outcome.feedback, [\n+            'Incorrect', '<b>Wrong answer</b>'])\n+        self.assertEqual(fallbacks[0].outcome.dest, self.init_state_name)\n+\n     def test_update_state_invalid_state(self):","path":"core/domain/exp_services_test.py","position":41,"original_position":41,"commit_id":"0bd8010217907b683c594d2f2625cfbff5f90e18","original_commit_id":"0bd8010217907b683c594d2f2625cfbff5f90e18","user":{"login":"seanlip","id":10575562,"avatar_url":"https://avatars.githubusercontent.com/u/10575562?v=3","gravatar_id":"","url":"https://api.github.com/users/seanlip","html_url":"https://github.com/seanlip","followers_url":"https://api.github.com/users/seanlip/followers","following_url":"https://api.github.com/users/seanlip/following{/other_user}","gists_url":"https://api.github.com/users/seanlip/gists{/gist_id}","starred_url":"https://api.github.com/users/seanlip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanlip/subscriptions","organizations_url":"https://api.github.com/users/seanlip/orgs","repos_url":"https://api.github.com/users/seanlip/repos","events_url":"https://api.github.com/users/seanlip/events{/privacy}","received_events_url":"https://api.github.com/users/seanlip/received_events","type":"User","site_admin":false},"body":"Good idea; I added a test.","created_at":"2015-11-05T09:33:47Z","updated_at":"2015-11-05T09:33:47Z","html_url":"https://github.com/oppia/oppia/pull/1096#discussion_r43991767","pull_request_url":"https://api.github.com/repos/oppia/oppia/pulls/1096","_links":{"self":{"href":"https://api.github.com/repos/oppia/oppia/pulls/comments/43991767"},"html":{"href":"https://github.com/oppia/oppia/pull/1096#discussion_r43991767"},"pull_request":{"href":"https://api.github.com/repos/oppia/oppia/pulls/1096"}}},"pull_request":{"url":"https://api.github.com/repos/oppia/oppia/pulls/1096","id":49238332,"html_url":"https://github.com/oppia/oppia/pull/1096","diff_url":"https://github.com/oppia/oppia/pull/1096.diff","patch_url":"https://github.com/oppia/oppia/pull/1096.patch","issue_url":"https://api.github.com/repos/oppia/oppia/issues/1096","number":1096,"state":"open","locked":false,"title":"Add functionality for fallbacks.","user":{"login":"seanlip","id":10575562,"avatar_url":"https://avatars.githubusercontent.com/u/10575562?v=3","gravatar_id":"","url":"https://api.github.com/users/seanlip","html_url":"https://github.com/seanlip","followers_url":"https://api.github.com/users/seanlip/followers","following_url":"https://api.github.com/users/seanlip/following{/other_user}","gists_url":"https://api.github.com/users/seanlip/gists{/gist_id}","starred_url":"https://api.github.com/users/seanlip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanlip/subscriptions","organizations_url":"https://api.github.com/users/seanlip/orgs","repos_url":"https://api.github.com/users/seanlip/repos","events_url":"https://api.github.com/users/seanlip/events{/privacy}","received_events_url":"https://api.github.com/users/seanlip/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-30T07:16:45Z","updated_at":"2015-11-05T09:33:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4eb5b3f85d10773c5b2cb94949e2df048c555fb8","assignee":{"login":"jacobdavis11","id":13726796,"avatar_url":"https://avatars.githubusercontent.com/u/13726796?v=3","gravatar_id":"","url":"https://api.github.com/users/jacobdavis11","html_url":"https://github.com/jacobdavis11","followers_url":"https://api.github.com/users/jacobdavis11/followers","following_url":"https://api.github.com/users/jacobdavis11/following{/other_user}","gists_url":"https://api.github.com/users/jacobdavis11/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobdavis11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobdavis11/subscriptions","organizations_url":"https://api.github.com/users/jacobdavis11/orgs","repos_url":"https://api.github.com/users/jacobdavis11/repos","events_url":"https://api.github.com/users/jacobdavis11/events{/privacy}","received_events_url":"https://api.github.com/users/jacobdavis11/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/oppia/oppia/pulls/1096/commits","review_comments_url":"https://api.github.com/repos/oppia/oppia/pulls/1096/comments","review_comment_url":"https://api.github.com/repos/oppia/oppia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oppia/oppia/issues/1096/comments","statuses_url":"https://api.github.com/repos/oppia/oppia/statuses/0bd8010217907b683c594d2f2625cfbff5f90e18","head":{"label":"oppia:fallbacks-frontend","ref":"fallbacks-frontend","sha":"0bd8010217907b683c594d2f2625cfbff5f90e18","user":{"login":"oppia","id":11620230,"avatar_url":"https://avatars.githubusercontent.com/u/11620230?v=3","gravatar_id":"","url":"https://api.github.com/users/oppia","html_url":"https://github.com/oppia","followers_url":"https://api.github.com/users/oppia/followers","following_url":"https://api.github.com/users/oppia/following{/other_user}","gists_url":"https://api.github.com/users/oppia/gists{/gist_id}","starred_url":"https://api.github.com/users/oppia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oppia/subscriptions","organizations_url":"https://api.github.com/users/oppia/orgs","repos_url":"https://api.github.com/users/oppia/repos","events_url":"https://api.github.com/users/oppia/events{/privacy}","received_events_url":"https://api.github.com/users/oppia/received_events","type":"Organization","site_admin":false},"repo":{"id":40687563,"name":"oppia","full_name":"oppia/oppia","owner":{"login":"oppia","id":11620230,"avatar_url":"https://avatars.githubusercontent.com/u/11620230?v=3","gravatar_id":"","url":"https://api.github.com/users/oppia","html_url":"https://github.com/oppia","followers_url":"https://api.github.com/users/oppia/followers","following_url":"https://api.github.com/users/oppia/following{/other_user}","gists_url":"https://api.github.com/users/oppia/gists{/gist_id}","starred_url":"https://api.github.com/users/oppia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oppia/subscriptions","organizations_url":"https://api.github.com/users/oppia/orgs","repos_url":"https://api.github.com/users/oppia/repos","events_url":"https://api.github.com/users/oppia/events{/privacy}","received_events_url":"https://api.github.com/users/oppia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oppia/oppia","description":"Tool for collaboratively building interactive tutors.","fork":false,"url":"https://api.github.com/repos/oppia/oppia","forks_url":"https://api.github.com/repos/oppia/oppia/forks","keys_url":"https://api.github.com/repos/oppia/oppia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oppia/oppia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oppia/oppia/teams","hooks_url":"https://api.github.com/repos/oppia/oppia/hooks","issue_events_url":"https://api.github.com/repos/oppia/oppia/issues/events{/number}","events_url":"https://api.github.com/repos/oppia/oppia/events","assignees_url":"https://api.github.com/repos/oppia/oppia/assignees{/user}","branches_url":"https://api.github.com/repos/oppia/oppia/branches{/branch}","tags_url":"https://api.github.com/repos/oppia/oppia/tags","blobs_url":"https://api.github.com/repos/oppia/oppia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oppia/oppia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oppia/oppia/git/refs{/sha}","trees_url":"https://api.github.com/repos/oppia/oppia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oppia/oppia/statuses/{sha}","languages_url":"https://api.github.com/repos/oppia/oppia/languages","stargazers_url":"https://api.github.com/repos/oppia/oppia/stargazers","contributors_url":"https://api.github.com/repos/oppia/oppia/contributors","subscribers_url":"https://api.github.com/repos/oppia/oppia/subscribers","subscription_url":"https://api.github.com/repos/oppia/oppia/subscription","commits_url":"https://api.github.com/repos/oppia/oppia/commits{/sha}","git_commits_url":"https://api.github.com/repos/oppia/oppia/git/commits{/sha}","comments_url":"https://api.github.com/repos/oppia/oppia/comments{/number}","issue_comment_url":"https://api.github.com/repos/oppia/oppia/issues/comments{/number}","contents_url":"https://api.github.com/repos/oppia/oppia/contents/{+path}","compare_url":"https://api.github.com/repos/oppia/oppia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oppia/oppia/merges","archive_url":"https://api.github.com/repos/oppia/oppia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oppia/oppia/downloads","issues_url":"https://api.github.com/repos/oppia/oppia/issues{/number}","pulls_url":"https://api.github.com/repos/oppia/oppia/pulls{/number}","milestones_url":"https://api.github.com/repos/oppia/oppia/milestones{/number}","notifications_url":"https://api.github.com/repos/oppia/oppia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oppia/oppia/labels{/name}","releases_url":"https://api.github.com/repos/oppia/oppia/releases{/id}","created_at":"2015-08-14T00:16:14Z","updated_at":"2015-11-04T22:03:49Z","pushed_at":"2015-11-05T01:47:13Z","git_url":"git://github.com/oppia/oppia.git","ssh_url":"git@github.com:oppia/oppia.git","clone_url":"https://github.com/oppia/oppia.git","svn_url":"https://github.com/oppia/oppia","homepage":"https://www.oppia.org","size":44832,"stargazers_count":50,"watchers_count":50,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":65,"mirror_url":null,"open_issues_count":206,"forks":65,"open_issues":206,"watchers":50,"default_branch":"develop"}},"base":{"label":"oppia:develop","ref":"develop","sha":"2e0f368debe8ac60bbb1025ff2eabbf97ab0d799","user":{"login":"oppia","id":11620230,"avatar_url":"https://avatars.githubusercontent.com/u/11620230?v=3","gravatar_id":"","url":"https://api.github.com/users/oppia","html_url":"https://github.com/oppia","followers_url":"https://api.github.com/users/oppia/followers","following_url":"https://api.github.com/users/oppia/following{/other_user}","gists_url":"https://api.github.com/users/oppia/gists{/gist_id}","starred_url":"https://api.github.com/users/oppia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oppia/subscriptions","organizations_url":"https://api.github.com/users/oppia/orgs","repos_url":"https://api.github.com/users/oppia/repos","events_url":"https://api.github.com/users/oppia/events{/privacy}","received_events_url":"https://api.github.com/users/oppia/received_events","type":"Organization","site_admin":false},"repo":{"id":40687563,"name":"oppia","full_name":"oppia/oppia","owner":{"login":"oppia","id":11620230,"avatar_url":"https://avatars.githubusercontent.com/u/11620230?v=3","gravatar_id":"","url":"https://api.github.com/users/oppia","html_url":"https://github.com/oppia","followers_url":"https://api.github.com/users/oppia/followers","following_url":"https://api.github.com/users/oppia/following{/other_user}","gists_url":"https://api.github.com/users/oppia/gists{/gist_id}","starred_url":"https://api.github.com/users/oppia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oppia/subscriptions","organizations_url":"https://api.github.com/users/oppia/orgs","repos_url":"https://api.github.com/users/oppia/repos","events_url":"https://api.github.com/users/oppia/events{/privacy}","received_events_url":"https://api.github.com/users/oppia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oppia/oppia","description":"Tool for collaboratively building interactive tutors.","fork":false,"url":"https://api.github.com/repos/oppia/oppia","forks_url":"https://api.github.com/repos/oppia/oppia/forks","keys_url":"https://api.github.com/repos/oppia/oppia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oppia/oppia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oppia/oppia/teams","hooks_url":"https://api.github.com/repos/oppia/oppia/hooks","issue_events_url":"https://api.github.com/repos/oppia/oppia/issues/events{/number}","events_url":"https://api.github.com/repos/oppia/oppia/events","assignees_url":"https://api.github.com/repos/oppia/oppia/assignees{/user}","branches_url":"https://api.github.com/repos/oppia/oppia/branches{/branch}","tags_url":"https://api.github.com/repos/oppia/oppia/tags","blobs_url":"https://api.github.com/repos/oppia/oppia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oppia/oppia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oppia/oppia/git/refs{/sha}","trees_url":"https://api.github.com/repos/oppia/oppia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oppia/oppia/statuses/{sha}","languages_url":"https://api.github.com/repos/oppia/oppia/languages","stargazers_url":"https://api.github.com/repos/oppia/oppia/stargazers","contributors_url":"https://api.github.com/repos/oppia/oppia/contributors","subscribers_url":"https://api.github.com/repos/oppia/oppia/subscribers","subscription_url":"https://api.github.com/repos/oppia/oppia/subscription","commits_url":"https://api.github.com/repos/oppia/oppia/commits{/sha}","git_commits_url":"https://api.github.com/repos/oppia/oppia/git/commits{/sha}","comments_url":"https://api.github.com/repos/oppia/oppia/comments{/number}","issue_comment_url":"https://api.github.com/repos/oppia/oppia/issues/comments{/number}","contents_url":"https://api.github.com/repos/oppia/oppia/contents/{+path}","compare_url":"https://api.github.com/repos/oppia/oppia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oppia/oppia/merges","archive_url":"https://api.github.com/repos/oppia/oppia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oppia/oppia/downloads","issues_url":"https://api.github.com/repos/oppia/oppia/issues{/number}","pulls_url":"https://api.github.com/repos/oppia/oppia/pulls{/number}","milestones_url":"https://api.github.com/repos/oppia/oppia/milestones{/number}","notifications_url":"https://api.github.com/repos/oppia/oppia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oppia/oppia/labels{/name}","releases_url":"https://api.github.com/repos/oppia/oppia/releases{/id}","created_at":"2015-08-14T00:16:14Z","updated_at":"2015-11-04T22:03:49Z","pushed_at":"2015-11-05T01:47:13Z","git_url":"git://github.com/oppia/oppia.git","ssh_url":"git@github.com:oppia/oppia.git","clone_url":"https://github.com/oppia/oppia.git","svn_url":"https://github.com/oppia/oppia","homepage":"https://www.oppia.org","size":44832,"stargazers_count":50,"watchers_count":50,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":65,"mirror_url":null,"open_issues_count":206,"forks":65,"open_issues":206,"watchers":50,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/oppia/oppia/pulls/1096"},"html":{"href":"https://github.com/oppia/oppia/pull/1096"},"issue":{"href":"https://api.github.com/repos/oppia/oppia/issues/1096"},"comments":{"href":"https://api.github.com/repos/oppia/oppia/issues/1096/comments"},"review_comments":{"href":"https://api.github.com/repos/oppia/oppia/pulls/1096/comments"},"review_comment":{"href":"https://api.github.com/repos/oppia/oppia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oppia/oppia/pulls/1096/commits"},"statuses":{"href":"https://api.github.com/repos/oppia/oppia/statuses/0bd8010217907b683c594d2f2625cfbff5f90e18"}}}}