{"action":"created","comment":{"url":"https://api.github.com/repos/nastyastavitskaya/flashcards/pulls/comments/53264450","id":53264450,"diff_hunk":"@@ -0,0 +1,83 @@\n+class SuperMemo2\n+  def initialize(interval, efactor, repetition, quality_timer)\n+    @quality = assess_quality quality_timer\n+    @interval = interval\n+    @efactor = efactor\n+    @repetition = repetition\n+    set_repetition if @quality < 3\n+  end\n+  # After each repetition session of a given day repeat again all items\n+  # that scored below four in the quality assessment.\n+  # Continue the repetitions until all of these items score at least four.\n+  def repetition_session\n+    interval = set_interval\n+    calculate_efactor if @repetition > 0\n+    {\n+      interval: interval,\n+      efactor: @efactor,\n+      repetition: @repetition + 1,\n+      quality: @quality,\n+      review_date: DateTime.current + interval.days\n+    }\n+  end\n+\n+  def typo_repetition\n+    # interval = set_interval\n+    {\n+      quality: @quality - 1\n+    }\n+  end\n+  # After each repetition assess the quality of repetition response in 0-5 grade scale:\n+  # 5 - perfect response\n+  # 4 - correct response after a hesitation\n+  # 3 - correct response recalled with serious difficulty\n+  # 2 - incorrect response; where the correct one seemed easy to recall\n+  # 1 - incorrect response; the correct one remembered\n+  # 0 - complete blackout.\n+  def assess_quality(quality_timer)\n+    if quality_timer.nil?\n+      return 0\n+    end\n+    case quality_timer.to_i\n+    when 1000..5000 then 5\n+    when 6000..10000 then 4","path":"app/services/super_memo2.rb","position":43,"original_position":43,"commit_id":"6d16bcca4a46e7968fb3b2d97219cd617040f9da","original_commit_id":"6d16bcca4a46e7968fb3b2d97219cd617040f9da","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Separate every 3 digits in the integer portion of a number with underscores(_).","created_at":"2016-02-18T02:27:19Z","updated_at":"2016-02-18T02:27:19Z","html_url":"https://github.com/nastyastavitskaya/flashcards/pull/19#discussion_r53264450","pull_request_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/nastyastavitskaya/flashcards/pulls/comments/53264450"},"html":{"href":"https://github.com/nastyastavitskaya/flashcards/pull/19#discussion_r53264450"},"pull_request":{"href":"https://api.github.com/repos/nastyastavitskaya/flashcards/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/nastyastavitskaya/flashcards/pulls/19","id":58074872,"html_url":"https://github.com/nastyastavitskaya/flashcards/pull/19","diff_url":"https://github.com/nastyastavitskaya/flashcards/pull/19.diff","patch_url":"https://github.com/nastyastavitskaya/flashcards/pull/19.patch","issue_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/issues/19","number":19,"state":"open","locked":false,"title":"Seventeenth-task","user":{"login":"nastyastavitskaya","id":12608980,"avatar_url":"https://avatars.githubusercontent.com/u/12608980?v=3","gravatar_id":"","url":"https://api.github.com/users/nastyastavitskaya","html_url":"https://github.com/nastyastavitskaya","followers_url":"https://api.github.com/users/nastyastavitskaya/followers","following_url":"https://api.github.com/users/nastyastavitskaya/following{/other_user}","gists_url":"https://api.github.com/users/nastyastavitskaya/gists{/gist_id}","starred_url":"https://api.github.com/users/nastyastavitskaya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nastyastavitskaya/subscriptions","organizations_url":"https://api.github.com/users/nastyastavitskaya/orgs","repos_url":"https://api.github.com/users/nastyastavitskaya/repos","events_url":"https://api.github.com/users/nastyastavitskaya/events{/privacy}","received_events_url":"https://api.github.com/users/nastyastavitskaya/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-03T00:43:32Z","updated_at":"2016-02-18T02:27:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"53ab370066699119834e12482ac0d454d58e8bbb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/pulls/19/commits","review_comments_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/pulls/19/comments","review_comment_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/issues/19/comments","statuses_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/statuses/6d16bcca4a46e7968fb3b2d97219cd617040f9da","head":{"label":"nastyastavitskaya:seventeenth-task","ref":"seventeenth-task","sha":"6d16bcca4a46e7968fb3b2d97219cd617040f9da","user":{"login":"nastyastavitskaya","id":12608980,"avatar_url":"https://avatars.githubusercontent.com/u/12608980?v=3","gravatar_id":"","url":"https://api.github.com/users/nastyastavitskaya","html_url":"https://github.com/nastyastavitskaya","followers_url":"https://api.github.com/users/nastyastavitskaya/followers","following_url":"https://api.github.com/users/nastyastavitskaya/following{/other_user}","gists_url":"https://api.github.com/users/nastyastavitskaya/gists{/gist_id}","starred_url":"https://api.github.com/users/nastyastavitskaya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nastyastavitskaya/subscriptions","organizations_url":"https://api.github.com/users/nastyastavitskaya/orgs","repos_url":"https://api.github.com/users/nastyastavitskaya/repos","events_url":"https://api.github.com/users/nastyastavitskaya/events{/privacy}","received_events_url":"https://api.github.com/users/nastyastavitskaya/received_events","type":"User","site_admin":false},"repo":{"id":36800698,"name":"flashcards","full_name":"nastyastavitskaya/flashcards","owner":{"login":"nastyastavitskaya","id":12608980,"avatar_url":"https://avatars.githubusercontent.com/u/12608980?v=3","gravatar_id":"","url":"https://api.github.com/users/nastyastavitskaya","html_url":"https://github.com/nastyastavitskaya","followers_url":"https://api.github.com/users/nastyastavitskaya/followers","following_url":"https://api.github.com/users/nastyastavitskaya/following{/other_user}","gists_url":"https://api.github.com/users/nastyastavitskaya/gists{/gist_id}","starred_url":"https://api.github.com/users/nastyastavitskaya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nastyastavitskaya/subscriptions","organizations_url":"https://api.github.com/users/nastyastavitskaya/orgs","repos_url":"https://api.github.com/users/nastyastavitskaya/repos","events_url":"https://api.github.com/users/nastyastavitskaya/events{/privacy}","received_events_url":"https://api.github.com/users/nastyastavitskaya/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nastyastavitskaya/flashcards","description":"","fork":false,"url":"https://api.github.com/repos/nastyastavitskaya/flashcards","forks_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/forks","keys_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/teams","hooks_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/hooks","issue_events_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/events","assignees_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/tags","blobs_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/languages","stargazers_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/stargazers","contributors_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/contributors","subscribers_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/subscribers","subscription_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/subscription","commits_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/merges","archive_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/downloads","issues_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/releases{/id}","deployments_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/deployments","created_at":"2015-06-03T11:58:44Z","updated_at":"2016-02-03T00:57:09Z","pushed_at":"2016-02-18T02:26:32Z","git_url":"git://github.com/nastyastavitskaya/flashcards.git","ssh_url":"git@github.com:nastyastavitskaya/flashcards.git","clone_url":"https://github.com/nastyastavitskaya/flashcards.git","svn_url":"https://github.com/nastyastavitskaya/flashcards","homepage":null,"size":797,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"nastyastavitskaya:master","ref":"master","sha":"f40a535beedbfb2168e132af6683670482cb3ce8","user":{"login":"nastyastavitskaya","id":12608980,"avatar_url":"https://avatars.githubusercontent.com/u/12608980?v=3","gravatar_id":"","url":"https://api.github.com/users/nastyastavitskaya","html_url":"https://github.com/nastyastavitskaya","followers_url":"https://api.github.com/users/nastyastavitskaya/followers","following_url":"https://api.github.com/users/nastyastavitskaya/following{/other_user}","gists_url":"https://api.github.com/users/nastyastavitskaya/gists{/gist_id}","starred_url":"https://api.github.com/users/nastyastavitskaya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nastyastavitskaya/subscriptions","organizations_url":"https://api.github.com/users/nastyastavitskaya/orgs","repos_url":"https://api.github.com/users/nastyastavitskaya/repos","events_url":"https://api.github.com/users/nastyastavitskaya/events{/privacy}","received_events_url":"https://api.github.com/users/nastyastavitskaya/received_events","type":"User","site_admin":false},"repo":{"id":36800698,"name":"flashcards","full_name":"nastyastavitskaya/flashcards","owner":{"login":"nastyastavitskaya","id":12608980,"avatar_url":"https://avatars.githubusercontent.com/u/12608980?v=3","gravatar_id":"","url":"https://api.github.com/users/nastyastavitskaya","html_url":"https://github.com/nastyastavitskaya","followers_url":"https://api.github.com/users/nastyastavitskaya/followers","following_url":"https://api.github.com/users/nastyastavitskaya/following{/other_user}","gists_url":"https://api.github.com/users/nastyastavitskaya/gists{/gist_id}","starred_url":"https://api.github.com/users/nastyastavitskaya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nastyastavitskaya/subscriptions","organizations_url":"https://api.github.com/users/nastyastavitskaya/orgs","repos_url":"https://api.github.com/users/nastyastavitskaya/repos","events_url":"https://api.github.com/users/nastyastavitskaya/events{/privacy}","received_events_url":"https://api.github.com/users/nastyastavitskaya/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nastyastavitskaya/flashcards","description":"","fork":false,"url":"https://api.github.com/repos/nastyastavitskaya/flashcards","forks_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/forks","keys_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/teams","hooks_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/hooks","issue_events_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/events","assignees_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/tags","blobs_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/languages","stargazers_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/stargazers","contributors_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/contributors","subscribers_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/subscribers","subscription_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/subscription","commits_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/merges","archive_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/downloads","issues_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/releases{/id}","deployments_url":"https://api.github.com/repos/nastyastavitskaya/flashcards/deployments","created_at":"2015-06-03T11:58:44Z","updated_at":"2016-02-03T00:57:09Z","pushed_at":"2016-02-18T02:26:32Z","git_url":"git://github.com/nastyastavitskaya/flashcards.git","ssh_url":"git@github.com:nastyastavitskaya/flashcards.git","clone_url":"https://github.com/nastyastavitskaya/flashcards.git","svn_url":"https://github.com/nastyastavitskaya/flashcards","homepage":null,"size":797,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nastyastavitskaya/flashcards/pulls/19"},"html":{"href":"https://github.com/nastyastavitskaya/flashcards/pull/19"},"issue":{"href":"https://api.github.com/repos/nastyastavitskaya/flashcards/issues/19"},"comments":{"href":"https://api.github.com/repos/nastyastavitskaya/flashcards/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/nastyastavitskaya/flashcards/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/nastyastavitskaya/flashcards/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nastyastavitskaya/flashcards/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/nastyastavitskaya/flashcards/statuses/6d16bcca4a46e7968fb3b2d97219cd617040f9da"}}}}