{"action":"created","comment":{"url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/pulls/comments/199335701","pull_request_review_id":133439894,"id":199335701,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5OTMzNTcwMQ==","diff_hunk":"@@ -53,9 +53,34 @@ class Question extends Component {\n     /* check if current question was already answered correctly */\n     const alreadyAnswered =\n       score.books[bookId].chapters[chapterId].questions[questionIndex].answered;\n+    const alreadyCorrect =\n+      score.books[bookId].chapters[chapterId].questions[questionIndex].correct;\n \n-    let newScore = score;\n-    const newBookScore = score.books.map((book, index) => {\n+    /* calculate the numeric score difference \n+     * based on current score state */\n+    const scoreDiff = {\n+      correct: isCorrect && !alreadyCorrect ? 1 : 0,\n+      incorrect: alreadyCorrect\n+        ? 0 // previously answered correctly\n+        : alreadyAnswered\n+          ? isCorrect\n+            ? -1 // previously answered, correct answer given\n+            : 0 // previously answered, incorrect answer given\n+          : isCorrect\n+            ? 0 // first attempt, correct answer given\n+            : 1, // first attempt, incorrect answer given\n+    };\n+\n+    // return a new score object\n+    // NOTE: possible bug; if we declare `newScore` by initializing to\n+    // `score`'s properties ( newScore = { books: ..., } etc. )\n+    // vs. initializing it as it is below (line 80)\n+    // the result is that the newScore object doesn't actually\n+    // get updated","path":"src/components/Question/Question.js","position":29,"original_position":29,"commit_id":"2f1614dd6f512a04a53a671a5e8bec3bb900a502","original_commit_id":"2f1614dd6f512a04a53a671a5e8bec3bb900a502","user":{"login":"radotreyes","id":25578179,"node_id":"MDQ6VXNlcjI1NTc4MTc5","avatar_url":"https://avatars0.githubusercontent.com/u/25578179?v=4","gravatar_id":"","url":"https://api.github.com/users/radotreyes","html_url":"https://github.com/radotreyes","followers_url":"https://api.github.com/users/radotreyes/followers","following_url":"https://api.github.com/users/radotreyes/following{/other_user}","gists_url":"https://api.github.com/users/radotreyes/gists{/gist_id}","starred_url":"https://api.github.com/users/radotreyes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radotreyes/subscriptions","organizations_url":"https://api.github.com/users/radotreyes/orgs","repos_url":"https://api.github.com/users/radotreyes/repos","events_url":"https://api.github.com/users/radotreyes/events{/privacy}","received_events_url":"https://api.github.com/users/radotreyes/received_events","type":"User","site_admin":false},"body":"Also, when implementing the updated score object, I ran into this weird bug(?). My goal was to remove `newScore` altogether and just contain the entire \"newScore\" object as an argument to `updateScore()` (line 92) without an additional variable declaration. However, this (lines 75 - 79) happens. \r\n\r\nThe app behaves as expected with the changes as they are now, but would just like to know why this happens and if I can indeed minify the code a little as I described.","created_at":"2018-07-01T00:56:21Z","updated_at":"2018-07-01T00:56:21Z","html_url":"https://github.com/austintackaberry/ydkjs-exercises/pull/104#discussion_r199335701","pull_request_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/pulls/104","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/pulls/comments/199335701"},"html":{"href":"https://github.com/austintackaberry/ydkjs-exercises/pull/104#discussion_r199335701"},"pull_request":{"href":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/pulls/104"}}},"pull_request":{"url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/pulls/104","id":198500635,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4NTAwNjM1","html_url":"https://github.com/austintackaberry/ydkjs-exercises/pull/104","diff_url":"https://github.com/austintackaberry/ydkjs-exercises/pull/104.diff","patch_url":"https://github.com/austintackaberry/ydkjs-exercises/pull/104.patch","issue_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/issues/104","number":104,"state":"open","locked":false,"title":"Add progress bar and score percentage as discussed in #102","user":{"login":"radotreyes","id":25578179,"node_id":"MDQ6VXNlcjI1NTc4MTc5","avatar_url":"https://avatars0.githubusercontent.com/u/25578179?v=4","gravatar_id":"","url":"https://api.github.com/users/radotreyes","html_url":"https://github.com/radotreyes","followers_url":"https://api.github.com/users/radotreyes/followers","following_url":"https://api.github.com/users/radotreyes/following{/other_user}","gists_url":"https://api.github.com/users/radotreyes/gists{/gist_id}","starred_url":"https://api.github.com/users/radotreyes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radotreyes/subscriptions","organizations_url":"https://api.github.com/users/radotreyes/orgs","repos_url":"https://api.github.com/users/radotreyes/repos","events_url":"https://api.github.com/users/radotreyes/events{/privacy}","received_events_url":"https://api.github.com/users/radotreyes/received_events","type":"User","site_admin":false},"body":"Small issue:\r\n<img width=\"525\" alt=\"screen shot 2018-06-30 at 4 52 25 pm\" src=\"https://user-images.githubusercontent.com/25578179/42130013-c530c774-7c8a-11e8-8860-09f4ca3bafd9.png\">\r\nThis is what the progress bar looks like right now. There's not anything behaviorally wrong with it, but I just noticed that the red segment appears to be slightly lower than the green segment (it's not, if you check the page source). I'm not sure if I should bother trying to fix this as it's mostly a design issue right now, but if anyone has any suggestions I'm all ears!","created_at":"2018-07-01T00:28:00Z","updated_at":"2018-07-01T00:56:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4f68f33d0e58c77490155012c6a92082731ad4eb","assignee":null,"assignees":[],"requested_reviewers":[{"login":"nikrb","id":16709534,"node_id":"MDQ6VXNlcjE2NzA5NTM0","avatar_url":"https://avatars3.githubusercontent.com/u/16709534?v=4","gravatar_id":"","url":"https://api.github.com/users/nikrb","html_url":"https://github.com/nikrb","followers_url":"https://api.github.com/users/nikrb/followers","following_url":"https://api.github.com/users/nikrb/following{/other_user}","gists_url":"https://api.github.com/users/nikrb/gists{/gist_id}","starred_url":"https://api.github.com/users/nikrb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikrb/subscriptions","organizations_url":"https://api.github.com/users/nikrb/orgs","repos_url":"https://api.github.com/users/nikrb/repos","events_url":"https://api.github.com/users/nikrb/events{/privacy}","received_events_url":"https://api.github.com/users/nikrb/received_events","type":"User","site_admin":false},{"login":"austintackaberry","id":29493001,"node_id":"MDQ6VXNlcjI5NDkzMDAx","avatar_url":"https://avatars0.githubusercontent.com/u/29493001?v=4","gravatar_id":"","url":"https://api.github.com/users/austintackaberry","html_url":"https://github.com/austintackaberry","followers_url":"https://api.github.com/users/austintackaberry/followers","following_url":"https://api.github.com/users/austintackaberry/following{/other_user}","gists_url":"https://api.github.com/users/austintackaberry/gists{/gist_id}","starred_url":"https://api.github.com/users/austintackaberry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/austintackaberry/subscriptions","organizations_url":"https://api.github.com/users/austintackaberry/orgs","repos_url":"https://api.github.com/users/austintackaberry/repos","events_url":"https://api.github.com/users/austintackaberry/events{/privacy}","received_events_url":"https://api.github.com/users/austintackaberry/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/pulls/104/commits","review_comments_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/pulls/104/comments","review_comment_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/pulls/comments{/number}","comments_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/issues/104/comments","statuses_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/statuses/2f1614dd6f512a04a53a671a5e8bec3bb900a502","head":{"label":"radotreyes:add/sidebar-progress","ref":"add/sidebar-progress","sha":"2f1614dd6f512a04a53a671a5e8bec3bb900a502","user":{"login":"radotreyes","id":25578179,"node_id":"MDQ6VXNlcjI1NTc4MTc5","avatar_url":"https://avatars0.githubusercontent.com/u/25578179?v=4","gravatar_id":"","url":"https://api.github.com/users/radotreyes","html_url":"https://github.com/radotreyes","followers_url":"https://api.github.com/users/radotreyes/followers","following_url":"https://api.github.com/users/radotreyes/following{/other_user}","gists_url":"https://api.github.com/users/radotreyes/gists{/gist_id}","starred_url":"https://api.github.com/users/radotreyes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radotreyes/subscriptions","organizations_url":"https://api.github.com/users/radotreyes/orgs","repos_url":"https://api.github.com/users/radotreyes/repos","events_url":"https://api.github.com/users/radotreyes/events{/privacy}","received_events_url":"https://api.github.com/users/radotreyes/received_events","type":"User","site_admin":false},"repo":{"id":136991972,"node_id":"MDEwOlJlcG9zaXRvcnkxMzY5OTE5NzI=","name":"ydkjs-exercises","full_name":"radotreyes/ydkjs-exercises","owner":{"login":"radotreyes","id":25578179,"node_id":"MDQ6VXNlcjI1NTc4MTc5","avatar_url":"https://avatars0.githubusercontent.com/u/25578179?v=4","gravatar_id":"","url":"https://api.github.com/users/radotreyes","html_url":"https://github.com/radotreyes","followers_url":"https://api.github.com/users/radotreyes/followers","following_url":"https://api.github.com/users/radotreyes/following{/other_user}","gists_url":"https://api.github.com/users/radotreyes/gists{/gist_id}","starred_url":"https://api.github.com/users/radotreyes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radotreyes/subscriptions","organizations_url":"https://api.github.com/users/radotreyes/orgs","repos_url":"https://api.github.com/users/radotreyes/repos","events_url":"https://api.github.com/users/radotreyes/events{/privacy}","received_events_url":"https://api.github.com/users/radotreyes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/radotreyes/ydkjs-exercises","description":"Exercises to go along with You Don't Know JavaScript","fork":true,"url":"https://api.github.com/repos/radotreyes/ydkjs-exercises","forks_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/forks","keys_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/keys{/key_id}","collaborators_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/teams","hooks_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/hooks","issue_events_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/issues/events{/number}","events_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/events","assignees_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/assignees{/user}","branches_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/branches{/branch}","tags_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/tags","blobs_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/git/refs{/sha}","trees_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/git/trees{/sha}","statuses_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/statuses/{sha}","languages_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/languages","stargazers_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/stargazers","contributors_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/contributors","subscribers_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/subscribers","subscription_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/subscription","commits_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/commits{/sha}","git_commits_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/git/commits{/sha}","comments_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/comments{/number}","issue_comment_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/issues/comments{/number}","contents_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/contents/{+path}","compare_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/compare/{base}...{head}","merges_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/merges","archive_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/downloads","issues_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/issues{/number}","pulls_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/pulls{/number}","milestones_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/milestones{/number}","notifications_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/labels{/name}","releases_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/releases{/id}","deployments_url":"https://api.github.com/repos/radotreyes/ydkjs-exercises/deployments","created_at":"2018-06-11T23:30:23Z","updated_at":"2018-06-30T21:07:35Z","pushed_at":"2018-07-01T00:24:44Z","git_url":"git://github.com/radotreyes/ydkjs-exercises.git","ssh_url":"git@github.com:radotreyes/ydkjs-exercises.git","clone_url":"https://github.com/radotreyes/ydkjs-exercises.git","svn_url":"https://github.com/radotreyes/ydkjs-exercises","homepage":null,"size":797,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"austintackaberry:master","ref":"master","sha":"2067c753510361871314eccb5882424b7793fa77","user":{"login":"austintackaberry","id":29493001,"node_id":"MDQ6VXNlcjI5NDkzMDAx","avatar_url":"https://avatars0.githubusercontent.com/u/29493001?v=4","gravatar_id":"","url":"https://api.github.com/users/austintackaberry","html_url":"https://github.com/austintackaberry","followers_url":"https://api.github.com/users/austintackaberry/followers","following_url":"https://api.github.com/users/austintackaberry/following{/other_user}","gists_url":"https://api.github.com/users/austintackaberry/gists{/gist_id}","starred_url":"https://api.github.com/users/austintackaberry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/austintackaberry/subscriptions","organizations_url":"https://api.github.com/users/austintackaberry/orgs","repos_url":"https://api.github.com/users/austintackaberry/repos","events_url":"https://api.github.com/users/austintackaberry/events{/privacy}","received_events_url":"https://api.github.com/users/austintackaberry/received_events","type":"User","site_admin":false},"repo":{"id":126095293,"node_id":"MDEwOlJlcG9zaXRvcnkxMjYwOTUyOTM=","name":"ydkjs-exercises","full_name":"austintackaberry/ydkjs-exercises","owner":{"login":"austintackaberry","id":29493001,"node_id":"MDQ6VXNlcjI5NDkzMDAx","avatar_url":"https://avatars0.githubusercontent.com/u/29493001?v=4","gravatar_id":"","url":"https://api.github.com/users/austintackaberry","html_url":"https://github.com/austintackaberry","followers_url":"https://api.github.com/users/austintackaberry/followers","following_url":"https://api.github.com/users/austintackaberry/following{/other_user}","gists_url":"https://api.github.com/users/austintackaberry/gists{/gist_id}","starred_url":"https://api.github.com/users/austintackaberry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/austintackaberry/subscriptions","organizations_url":"https://api.github.com/users/austintackaberry/orgs","repos_url":"https://api.github.com/users/austintackaberry/repos","events_url":"https://api.github.com/users/austintackaberry/events{/privacy}","received_events_url":"https://api.github.com/users/austintackaberry/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/austintackaberry/ydkjs-exercises","description":"Exercises to go along with You Don't Know JavaScript","fork":false,"url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises","forks_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/forks","keys_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/keys{/key_id}","collaborators_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/teams","hooks_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/hooks","issue_events_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/issues/events{/number}","events_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/events","assignees_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/assignees{/user}","branches_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/branches{/branch}","tags_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/tags","blobs_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/git/refs{/sha}","trees_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/git/trees{/sha}","statuses_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/statuses/{sha}","languages_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/languages","stargazers_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/stargazers","contributors_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/contributors","subscribers_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/subscribers","subscription_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/subscription","commits_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/commits{/sha}","git_commits_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/git/commits{/sha}","comments_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/comments{/number}","issue_comment_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/issues/comments{/number}","contents_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/contents/{+path}","compare_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/compare/{base}...{head}","merges_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/merges","archive_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/downloads","issues_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/issues{/number}","pulls_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/pulls{/number}","milestones_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/milestones{/number}","notifications_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/labels{/name}","releases_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/releases{/id}","deployments_url":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/deployments","created_at":"2018-03-20T23:22:10Z","updated_at":"2018-06-30T22:24:22Z","pushed_at":"2018-07-01T00:28:01Z","git_url":"git://github.com/austintackaberry/ydkjs-exercises.git","ssh_url":"git@github.com:austintackaberry/ydkjs-exercises.git","clone_url":"https://github.com/austintackaberry/ydkjs-exercises.git","svn_url":"https://github.com/austintackaberry/ydkjs-exercises","homepage":null,"size":800,"stargazers_count":57,"watchers_count":57,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":33,"open_issues":11,"watchers":57,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/pulls/104"},"html":{"href":"https://github.com/austintackaberry/ydkjs-exercises/pull/104"},"issue":{"href":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/issues/104"},"comments":{"href":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/issues/104/comments"},"review_comments":{"href":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/pulls/104/comments"},"review_comment":{"href":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/pulls/104/commits"},"statuses":{"href":"https://api.github.com/repos/austintackaberry/ydkjs-exercises/statuses/2f1614dd6f512a04a53a671a5e8bec3bb900a502"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"radotreyes"}}