{"action":"created","comment":{"url":"https://api.github.com/repos/oppia/oppia/pulls/comments/146099783","pull_request_review_id":71001775,"id":146099783,"diff_hunk":"@@ -0,0 +1,58 @@\n+// Copyright 2017 The Oppia Authors. All Rights Reserved.\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//\n+//      http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS-IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+\n+\n+oppia.directive('fractionEditor', [\n+  '$compile', 'FractionObjectFactory', 'OBJECT_EDITOR_URL_PREFIX',\n+  function($compile, FractionObjectFactory, OBJECT_EDITOR_URL_PREFIX) {\n+    return {\n+      link: function(scope, element) {\n+        scope.getTemplateUrl = function() {\n+          return OBJECT_EDITOR_URL_PREFIX + 'Fraction';\n+        };\n+        $compile(element.contents())(scope);\n+      },\n+      restrict: 'E',\n+      scope: true,\n+      template: '<span ng-include=\"getTemplateUrl()\"></span>',\n+      controller: ['$scope', function($scope) {\n+        $scope.alwaysEditable = true;\n+        $scope.largeInput = false;","path":"extensions/objects/templates/FractionEditor.js","position":31,"original_position":31,"commit_id":"a064a141ba414e1afdad76cb263c5e4462b785fd","original_commit_id":"a064a141ba414e1afdad76cb263c5e4462b785fd","user":{"login":"seanlip","id":10575562,"avatar_url":"https://avatars0.githubusercontent.com/u/10575562?v=4","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":"Btw, I think you might want to just go ahead and create a separate HTML file for the fractions template. It is going to be sufficiently different (fractions have validation, accepted characters, etc. and plaintext has large/small input field options) that I think we ought to just have them be different from the start.","created_at":"2017-10-21T08:12:32Z","updated_at":"2017-10-21T08:12:58Z","html_url":"https://github.com/oppia/oppia/pull/3967#discussion_r146099783","pull_request_url":"https://api.github.com/repos/oppia/oppia/pulls/3967","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/oppia/oppia/pulls/comments/146099783"},"html":{"href":"https://github.com/oppia/oppia/pull/3967#discussion_r146099783"},"pull_request":{"href":"https://api.github.com/repos/oppia/oppia/pulls/3967"}}},"pull_request":{"url":"https://api.github.com/repos/oppia/oppia/pulls/3967","id":146539117,"html_url":"https://github.com/oppia/oppia/pull/3967","diff_url":"https://github.com/oppia/oppia/pull/3967.diff","patch_url":"https://github.com/oppia/oppia/pull/3967.patch","issue_url":"https://api.github.com/repos/oppia/oppia/issues/3967","number":3967,"state":"open","locked":false,"title":"Fix #3794: Complete milestone one of introducing the new fraction interaction.","user":{"login":"Anthony-Alridge","id":16727074,"avatar_url":"https://avatars2.githubusercontent.com/u/16727074?v=4","gravatar_id":"","url":"https://api.github.com/users/Anthony-Alridge","html_url":"https://github.com/Anthony-Alridge","followers_url":"https://api.github.com/users/Anthony-Alridge/followers","following_url":"https://api.github.com/users/Anthony-Alridge/following{/other_user}","gists_url":"https://api.github.com/users/Anthony-Alridge/gists{/gist_id}","starred_url":"https://api.github.com/users/Anthony-Alridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Anthony-Alridge/subscriptions","organizations_url":"https://api.github.com/users/Anthony-Alridge/orgs","repos_url":"https://api.github.com/users/Anthony-Alridge/repos","events_url":"https://api.github.com/users/Anthony-Alridge/events{/privacy}","received_events_url":"https://api.github.com/users/Anthony-Alridge/received_events","type":"User","site_admin":false},"body":"This commit introduces a new object type to represent fractions in the backend, along with the files required to enable the fraction to be used in rules. \r\nA few things to note:\r\n* I chose to introduce a domain object to represent the fractions on the front-end side due to the need to parse fractions in various forms (parsing strings, javascript objects, converting between representations). This would be repeated when parsing learner submissions so it makes sense to create an abstraction for it. It is currently in the FractionEditor.js file but a more suitable place may become apparent in future milestones.\r\n* The parseString method of the domain object mentioned above is incomplete in that it does not fully check user input. I will complete the method in the next milestone (which is concerned with creating rules). The domain object will also need unit tests too of course.\r\n* I reused the HTML file from the Unicode text input rather than making my own. This seems to make sense until I reach a stage where the existing file seems not to be sufficient. \r\n* I did some manual testing of the FractionEditor.js methods by temporarily using it as a rule in the TextInput.js interaction. Based on this it seems to be working (although not with incorrect inputs of course, which will need to be handled in the next milestone).\r\n\r\nIf you want me to add unit tests for the FractionDomainObject in this milestone that is of course totally fine. One small issue I foresee is that I'm not sure where they should go. Normally it would be in-line with the file but as the other files don't have tests this feels a little strange. Or maybe the domain object should have its own separate file (although I'm not sure which folder would be most appropriate to put it in)?\r\n\r\nAlso, one last thing. I had an arrow function (or lambda) in my code and it was called up as a lint error. Just wondering if that's expected behaviour or not (for reference the linter found an unexpected character '>').\r\n\r\nThanks!","created_at":"2017-10-13T19:41:48Z","updated_at":"2017-10-21T08:12:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9b45f9c4d5784acdccddd952975b7c633306d2e2","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/oppia/oppia/pulls/3967/commits","review_comments_url":"https://api.github.com/repos/oppia/oppia/pulls/3967/comments","review_comment_url":"https://api.github.com/repos/oppia/oppia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oppia/oppia/issues/3967/comments","statuses_url":"https://api.github.com/repos/oppia/oppia/statuses/a064a141ba414e1afdad76cb263c5e4462b785fd","head":{"label":"Anthony-Alridge:fraction_interaction","ref":"fraction_interaction","sha":"a064a141ba414e1afdad76cb263c5e4462b785fd","user":{"login":"Anthony-Alridge","id":16727074,"avatar_url":"https://avatars2.githubusercontent.com/u/16727074?v=4","gravatar_id":"","url":"https://api.github.com/users/Anthony-Alridge","html_url":"https://github.com/Anthony-Alridge","followers_url":"https://api.github.com/users/Anthony-Alridge/followers","following_url":"https://api.github.com/users/Anthony-Alridge/following{/other_user}","gists_url":"https://api.github.com/users/Anthony-Alridge/gists{/gist_id}","starred_url":"https://api.github.com/users/Anthony-Alridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Anthony-Alridge/subscriptions","organizations_url":"https://api.github.com/users/Anthony-Alridge/orgs","repos_url":"https://api.github.com/users/Anthony-Alridge/repos","events_url":"https://api.github.com/users/Anthony-Alridge/events{/privacy}","received_events_url":"https://api.github.com/users/Anthony-Alridge/received_events","type":"User","site_admin":false},"repo":{"id":79559781,"name":"oppia","full_name":"Anthony-Alridge/oppia","owner":{"login":"Anthony-Alridge","id":16727074,"avatar_url":"https://avatars2.githubusercontent.com/u/16727074?v=4","gravatar_id":"","url":"https://api.github.com/users/Anthony-Alridge","html_url":"https://github.com/Anthony-Alridge","followers_url":"https://api.github.com/users/Anthony-Alridge/followers","following_url":"https://api.github.com/users/Anthony-Alridge/following{/other_user}","gists_url":"https://api.github.com/users/Anthony-Alridge/gists{/gist_id}","starred_url":"https://api.github.com/users/Anthony-Alridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Anthony-Alridge/subscriptions","organizations_url":"https://api.github.com/users/Anthony-Alridge/orgs","repos_url":"https://api.github.com/users/Anthony-Alridge/repos","events_url":"https://api.github.com/users/Anthony-Alridge/events{/privacy}","received_events_url":"https://api.github.com/users/Anthony-Alridge/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Anthony-Alridge/oppia","description":"Tool for collaboratively building interactive lessons.","fork":true,"url":"https://api.github.com/repos/Anthony-Alridge/oppia","forks_url":"https://api.github.com/repos/Anthony-Alridge/oppia/forks","keys_url":"https://api.github.com/repos/Anthony-Alridge/oppia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Anthony-Alridge/oppia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Anthony-Alridge/oppia/teams","hooks_url":"https://api.github.com/repos/Anthony-Alridge/oppia/hooks","issue_events_url":"https://api.github.com/repos/Anthony-Alridge/oppia/issues/events{/number}","events_url":"https://api.github.com/repos/Anthony-Alridge/oppia/events","assignees_url":"https://api.github.com/repos/Anthony-Alridge/oppia/assignees{/user}","branches_url":"https://api.github.com/repos/Anthony-Alridge/oppia/branches{/branch}","tags_url":"https://api.github.com/repos/Anthony-Alridge/oppia/tags","blobs_url":"https://api.github.com/repos/Anthony-Alridge/oppia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Anthony-Alridge/oppia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Anthony-Alridge/oppia/git/refs{/sha}","trees_url":"https://api.github.com/repos/Anthony-Alridge/oppia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Anthony-Alridge/oppia/statuses/{sha}","languages_url":"https://api.github.com/repos/Anthony-Alridge/oppia/languages","stargazers_url":"https://api.github.com/repos/Anthony-Alridge/oppia/stargazers","contributors_url":"https://api.github.com/repos/Anthony-Alridge/oppia/contributors","subscribers_url":"https://api.github.com/repos/Anthony-Alridge/oppia/subscribers","subscription_url":"https://api.github.com/repos/Anthony-Alridge/oppia/subscription","commits_url":"https://api.github.com/repos/Anthony-Alridge/oppia/commits{/sha}","git_commits_url":"https://api.github.com/repos/Anthony-Alridge/oppia/git/commits{/sha}","comments_url":"https://api.github.com/repos/Anthony-Alridge/oppia/comments{/number}","issue_comment_url":"https://api.github.com/repos/Anthony-Alridge/oppia/issues/comments{/number}","contents_url":"https://api.github.com/repos/Anthony-Alridge/oppia/contents/{+path}","compare_url":"https://api.github.com/repos/Anthony-Alridge/oppia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Anthony-Alridge/oppia/merges","archive_url":"https://api.github.com/repos/Anthony-Alridge/oppia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Anthony-Alridge/oppia/downloads","issues_url":"https://api.github.com/repos/Anthony-Alridge/oppia/issues{/number}","pulls_url":"https://api.github.com/repos/Anthony-Alridge/oppia/pulls{/number}","milestones_url":"https://api.github.com/repos/Anthony-Alridge/oppia/milestones{/number}","notifications_url":"https://api.github.com/repos/Anthony-Alridge/oppia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Anthony-Alridge/oppia/labels{/name}","releases_url":"https://api.github.com/repos/Anthony-Alridge/oppia/releases{/id}","deployments_url":"https://api.github.com/repos/Anthony-Alridge/oppia/deployments","created_at":"2017-01-20T13:06:26Z","updated_at":"2017-01-20T13:06:32Z","pushed_at":"2017-10-19T08:27:22Z","git_url":"git://github.com/Anthony-Alridge/oppia.git","ssh_url":"git@github.com:Anthony-Alridge/oppia.git","clone_url":"https://github.com/Anthony-Alridge/oppia.git","svn_url":"https://github.com/Anthony-Alridge/oppia","homepage":"https://www.oppia.org","size":69036,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"oppia:develop","ref":"develop","sha":"53fbe86f9ff8ad9de7234332a4ffb26d682e028b","user":{"login":"oppia","id":11620230,"avatar_url":"https://avatars1.githubusercontent.com/u/11620230?v=4","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://avatars1.githubusercontent.com/u/11620230?v=4","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 lessons.","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}","deployments_url":"https://api.github.com/repos/oppia/oppia/deployments","created_at":"2015-08-14T00:16:14Z","updated_at":"2017-10-18T18:35:30Z","pushed_at":"2017-10-21T06:27:18Z","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":69566,"stargazers_count":391,"watchers_count":391,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":480,"mirror_url":null,"archived":false,"open_issues_count":324,"forks":480,"open_issues":324,"watchers":391,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/oppia/oppia/pulls/3967"},"html":{"href":"https://github.com/oppia/oppia/pull/3967"},"issue":{"href":"https://api.github.com/repos/oppia/oppia/issues/3967"},"comments":{"href":"https://api.github.com/repos/oppia/oppia/issues/3967/comments"},"review_comments":{"href":"https://api.github.com/repos/oppia/oppia/pulls/3967/comments"},"review_comment":{"href":"https://api.github.com/repos/oppia/oppia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oppia/oppia/pulls/3967/commits"},"statuses":{"href":"https://api.github.com/repos/oppia/oppia/statuses/a064a141ba414e1afdad76cb263c5e4462b785fd"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"seanlip"}}