{"action":"created","comment":{"url":"https://api.github.com/repos/chimple/maui/pulls/comments/211917311","pull_request_review_id":148436161,"id":211917311,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTkxNzMxMQ==","diff_hunk":"@@ -0,0 +1,84 @@\n+import 'dart:async';\n+import 'package:maui/app_database.dart';\n+import 'package:maui/db/entity/quiz_progress.dart';\n+import 'package:maui/db/entity/user.dart';\n+import 'package:maui/db/entity/topic.dart';\n+import 'package:maui/db/entity/quiz.dart';\n+import 'package:sqflite/sqflite.dart';\n+\n+class QuizProgressDao {\n+  Future<QuizProgress> getQuizprogress(String id, {Database db}) async {\n+    db = db ?? await new AppDatabase().getDb();\n+    List<Map> maps = await db.query(QuizProgress.table,\n+        columns: [\n+          QuizProgress.idCol,\n+          QuizProgress.userIdCol,\n+          QuizProgress.topicIdCol,\n+          QuizProgress.quizIdCol,\n+          QuizProgress.doneCol\n+        ],\n+        where: \"${QuizProgress.idCol} = ? \",\n+        whereArgs: [id]);\n+    if (maps.length > 0) {\n+      return QuizProgress.fromMap(maps.first);\n+    }\n+    return null;\n+  }\n+\n+  Future<List<QuizProgress>> getQuizProgressByTopicId(String topicId,\n+      {Database db}) async {\n+    db = db ?? await new AppDatabase().getDb();\n+    List<Map> maps =\n+        await db.query('${QuizProgress.table} a,${Topic.table} t', columns: [\n+      'a.${QuizProgress.idCol}',\n+      'a.${QuizProgress.userIdCol}',\n+      'a.${QuizProgress.topicIdCol}',\n+      'a.${QuizProgress.quizIdCol}',\n+      'a.${QuizProgress.doneCol}',\n+    ], where: '''\n+      a.${QuizProgress.topicIdCol} = t.${Topic.idCol} \n+      AND  a.${QuizProgress.topicIdCol} = ?\n+        ''', whereArgs: [\n+      topicId\n+    ]);\n+    return maps.map((el) => new QuizProgress.fromMap(el)).toList();\n+  }\n+\n+  Future<List<QuizProgress>> getQuizProgressByUserId(String userId,\n+      {Database db}) async {\n+    db = db ?? await new AppDatabase().getDb();\n+    List<Map> maps =\n+        await db.query('${QuizProgress.table} a,${User.table} u', columns: [\n+      'a.${QuizProgress.idCol}',\n+      'a.${QuizProgress.userIdCol}',\n+      'a.${QuizProgress.topicIdCol}',\n+      'a.${QuizProgress.quizIdCol}',\n+      'a.${QuizProgress.doneCol}',\n+    ], where: '''\n+      a.${QuizProgress.topicIdCol} = u.${User.columnId} \n+      AND  a.${QuizProgress.userIdCol} = ?\n+        ''', whereArgs: [\n+      userId\n+    ]);\n+    return maps.map((el) => new QuizProgress.fromMap(el)).toList();\n+  }\n+\n+  Future<List<QuizProgress>> getQuizProgressByQuizId(String quizId,\n+      {Database db}) async {\n+    db = db ?? await new AppDatabase().getDb();\n+    List<Map> maps =\n+        await db.query('${QuizProgress.table} a,${Quiz.table} q', columns: [","path":"lib/db/dao/quiz_progress_dao.dart","position":70,"original_position":70,"commit_id":"dc56f7d107cac726d64e2d8c0076f28a5540f117","original_commit_id":"dc56f7d107cac726d64e2d8c0076f28a5540f117","user":{"login":"talapadi","id":11287996,"node_id":"MDQ6VXNlcjExMjg3OTk2","avatar_url":"https://avatars0.githubusercontent.com/u/11287996?v=4","gravatar_id":"","url":"https://api.github.com/users/talapadi","html_url":"https://github.com/talapadi","followers_url":"https://api.github.com/users/talapadi/followers","following_url":"https://api.github.com/users/talapadi/following{/other_user}","gists_url":"https://api.github.com/users/talapadi/gists{/gist_id}","starred_url":"https://api.github.com/users/talapadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talapadi/subscriptions","organizations_url":"https://api.github.com/users/talapadi/orgs","repos_url":"https://api.github.com/users/talapadi/repos","events_url":"https://api.github.com/users/talapadi/events{/privacy}","received_events_url":"https://api.github.com/users/talapadi/received_events","type":"User","site_admin":false},"body":"No need for join with Quiz table","created_at":"2018-08-22T11:18:47Z","updated_at":"2018-08-22T11:18:52Z","html_url":"https://github.com/chimple/maui/pull/777#discussion_r211917311","pull_request_url":"https://api.github.com/repos/chimple/maui/pulls/777","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/chimple/maui/pulls/comments/211917311"},"html":{"href":"https://github.com/chimple/maui/pull/777#discussion_r211917311"},"pull_request":{"href":"https://api.github.com/repos/chimple/maui/pulls/777"}}},"pull_request":{"url":"https://api.github.com/repos/chimple/maui/pulls/777","id":209480370,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5NDgwMzcw","html_url":"https://github.com/chimple/maui/pull/777","diff_url":"https://github.com/chimple/maui/pull/777.diff","patch_url":"https://github.com/chimple/maui/pull/777.patch","issue_url":"https://api.github.com/repos/chimple/maui/issues/777","number":777,"state":"open","locked":false,"title":"Sequence game to display correct/incorrect on completion of the sequence selection","user":{"login":"KaranChimple","id":35517558,"node_id":"MDQ6VXNlcjM1NTE3NTU4","avatar_url":"https://avatars1.githubusercontent.com/u/35517558?v=4","gravatar_id":"","url":"https://api.github.com/users/KaranChimple","html_url":"https://github.com/KaranChimple","followers_url":"https://api.github.com/users/KaranChimple/followers","following_url":"https://api.github.com/users/KaranChimple/following{/other_user}","gists_url":"https://api.github.com/users/KaranChimple/gists{/gist_id}","starred_url":"https://api.github.com/users/KaranChimple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KaranChimple/subscriptions","organizations_url":"https://api.github.com/users/KaranChimple/orgs","repos_url":"https://api.github.com/users/KaranChimple/repos","events_url":"https://api.github.com/users/KaranChimple/events{/privacy}","received_events_url":"https://api.github.com/users/KaranChimple/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-20T10:42:53Z","updated_at":"2018-08-22T11:18:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c1b8ace753fc0d58fab17e28b4df7baa6755a1f4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/chimple/maui/pulls/777/commits","review_comments_url":"https://api.github.com/repos/chimple/maui/pulls/777/comments","review_comment_url":"https://api.github.com/repos/chimple/maui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chimple/maui/issues/777/comments","statuses_url":"https://api.github.com/repos/chimple/maui/statuses/dc56f7d107cac726d64e2d8c0076f28a5540f117","head":{"label":"chimple:Karan-Maui","ref":"Karan-Maui","sha":"dc56f7d107cac726d64e2d8c0076f28a5540f117","user":{"login":"chimple","id":11288006,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMjg4MDA2","avatar_url":"https://avatars3.githubusercontent.com/u/11288006?v=4","gravatar_id":"","url":"https://api.github.com/users/chimple","html_url":"https://github.com/chimple","followers_url":"https://api.github.com/users/chimple/followers","following_url":"https://api.github.com/users/chimple/following{/other_user}","gists_url":"https://api.github.com/users/chimple/gists{/gist_id}","starred_url":"https://api.github.com/users/chimple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chimple/subscriptions","organizations_url":"https://api.github.com/users/chimple/orgs","repos_url":"https://api.github.com/users/chimple/repos","events_url":"https://api.github.com/users/chimple/events{/privacy}","received_events_url":"https://api.github.com/users/chimple/received_events","type":"Organization","site_admin":false},"repo":{"id":125797761,"node_id":"MDEwOlJlcG9zaXRvcnkxMjU3OTc3NjE=","name":"maui","full_name":"chimple/maui","owner":{"login":"chimple","id":11288006,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMjg4MDA2","avatar_url":"https://avatars3.githubusercontent.com/u/11288006?v=4","gravatar_id":"","url":"https://api.github.com/users/chimple","html_url":"https://github.com/chimple","followers_url":"https://api.github.com/users/chimple/followers","following_url":"https://api.github.com/users/chimple/following{/other_user}","gists_url":"https://api.github.com/users/chimple/gists{/gist_id}","starred_url":"https://api.github.com/users/chimple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chimple/subscriptions","organizations_url":"https://api.github.com/users/chimple/orgs","repos_url":"https://api.github.com/users/chimple/repos","events_url":"https://api.github.com/users/chimple/events{/privacy}","received_events_url":"https://api.github.com/users/chimple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chimple/maui","description":null,"fork":false,"url":"https://api.github.com/repos/chimple/maui","forks_url":"https://api.github.com/repos/chimple/maui/forks","keys_url":"https://api.github.com/repos/chimple/maui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chimple/maui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chimple/maui/teams","hooks_url":"https://api.github.com/repos/chimple/maui/hooks","issue_events_url":"https://api.github.com/repos/chimple/maui/issues/events{/number}","events_url":"https://api.github.com/repos/chimple/maui/events","assignees_url":"https://api.github.com/repos/chimple/maui/assignees{/user}","branches_url":"https://api.github.com/repos/chimple/maui/branches{/branch}","tags_url":"https://api.github.com/repos/chimple/maui/tags","blobs_url":"https://api.github.com/repos/chimple/maui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chimple/maui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chimple/maui/git/refs{/sha}","trees_url":"https://api.github.com/repos/chimple/maui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chimple/maui/statuses/{sha}","languages_url":"https://api.github.com/repos/chimple/maui/languages","stargazers_url":"https://api.github.com/repos/chimple/maui/stargazers","contributors_url":"https://api.github.com/repos/chimple/maui/contributors","subscribers_url":"https://api.github.com/repos/chimple/maui/subscribers","subscription_url":"https://api.github.com/repos/chimple/maui/subscription","commits_url":"https://api.github.com/repos/chimple/maui/commits{/sha}","git_commits_url":"https://api.github.com/repos/chimple/maui/git/commits{/sha}","comments_url":"https://api.github.com/repos/chimple/maui/comments{/number}","issue_comment_url":"https://api.github.com/repos/chimple/maui/issues/comments{/number}","contents_url":"https://api.github.com/repos/chimple/maui/contents/{+path}","compare_url":"https://api.github.com/repos/chimple/maui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chimple/maui/merges","archive_url":"https://api.github.com/repos/chimple/maui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chimple/maui/downloads","issues_url":"https://api.github.com/repos/chimple/maui/issues{/number}","pulls_url":"https://api.github.com/repos/chimple/maui/pulls{/number}","milestones_url":"https://api.github.com/repos/chimple/maui/milestones{/number}","notifications_url":"https://api.github.com/repos/chimple/maui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chimple/maui/labels{/name}","releases_url":"https://api.github.com/repos/chimple/maui/releases{/id}","deployments_url":"https://api.github.com/repos/chimple/maui/deployments","created_at":"2018-03-19T03:42:08Z","updated_at":"2018-08-22T11:01:56Z","pushed_at":"2018-08-22T11:09:52Z","git_url":"git://github.com/chimple/maui.git","ssh_url":"git@github.com:chimple/maui.git","clone_url":"https://github.com/chimple/maui.git","svn_url":"https://github.com/chimple/maui","homepage":null,"size":145495,"stargazers_count":19,"watchers_count":19,"language":"Dart","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":64,"license":null,"forks":0,"open_issues":64,"watchers":19,"default_branch":"master"}},"base":{"label":"chimple:master","ref":"master","sha":"b206f47ff43edf5f4a79f8f9d183837813d1c6dd","user":{"login":"chimple","id":11288006,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMjg4MDA2","avatar_url":"https://avatars3.githubusercontent.com/u/11288006?v=4","gravatar_id":"","url":"https://api.github.com/users/chimple","html_url":"https://github.com/chimple","followers_url":"https://api.github.com/users/chimple/followers","following_url":"https://api.github.com/users/chimple/following{/other_user}","gists_url":"https://api.github.com/users/chimple/gists{/gist_id}","starred_url":"https://api.github.com/users/chimple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chimple/subscriptions","organizations_url":"https://api.github.com/users/chimple/orgs","repos_url":"https://api.github.com/users/chimple/repos","events_url":"https://api.github.com/users/chimple/events{/privacy}","received_events_url":"https://api.github.com/users/chimple/received_events","type":"Organization","site_admin":false},"repo":{"id":125797761,"node_id":"MDEwOlJlcG9zaXRvcnkxMjU3OTc3NjE=","name":"maui","full_name":"chimple/maui","owner":{"login":"chimple","id":11288006,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMjg4MDA2","avatar_url":"https://avatars3.githubusercontent.com/u/11288006?v=4","gravatar_id":"","url":"https://api.github.com/users/chimple","html_url":"https://github.com/chimple","followers_url":"https://api.github.com/users/chimple/followers","following_url":"https://api.github.com/users/chimple/following{/other_user}","gists_url":"https://api.github.com/users/chimple/gists{/gist_id}","starred_url":"https://api.github.com/users/chimple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chimple/subscriptions","organizations_url":"https://api.github.com/users/chimple/orgs","repos_url":"https://api.github.com/users/chimple/repos","events_url":"https://api.github.com/users/chimple/events{/privacy}","received_events_url":"https://api.github.com/users/chimple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chimple/maui","description":null,"fork":false,"url":"https://api.github.com/repos/chimple/maui","forks_url":"https://api.github.com/repos/chimple/maui/forks","keys_url":"https://api.github.com/repos/chimple/maui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chimple/maui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chimple/maui/teams","hooks_url":"https://api.github.com/repos/chimple/maui/hooks","issue_events_url":"https://api.github.com/repos/chimple/maui/issues/events{/number}","events_url":"https://api.github.com/repos/chimple/maui/events","assignees_url":"https://api.github.com/repos/chimple/maui/assignees{/user}","branches_url":"https://api.github.com/repos/chimple/maui/branches{/branch}","tags_url":"https://api.github.com/repos/chimple/maui/tags","blobs_url":"https://api.github.com/repos/chimple/maui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chimple/maui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chimple/maui/git/refs{/sha}","trees_url":"https://api.github.com/repos/chimple/maui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chimple/maui/statuses/{sha}","languages_url":"https://api.github.com/repos/chimple/maui/languages","stargazers_url":"https://api.github.com/repos/chimple/maui/stargazers","contributors_url":"https://api.github.com/repos/chimple/maui/contributors","subscribers_url":"https://api.github.com/repos/chimple/maui/subscribers","subscription_url":"https://api.github.com/repos/chimple/maui/subscription","commits_url":"https://api.github.com/repos/chimple/maui/commits{/sha}","git_commits_url":"https://api.github.com/repos/chimple/maui/git/commits{/sha}","comments_url":"https://api.github.com/repos/chimple/maui/comments{/number}","issue_comment_url":"https://api.github.com/repos/chimple/maui/issues/comments{/number}","contents_url":"https://api.github.com/repos/chimple/maui/contents/{+path}","compare_url":"https://api.github.com/repos/chimple/maui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chimple/maui/merges","archive_url":"https://api.github.com/repos/chimple/maui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chimple/maui/downloads","issues_url":"https://api.github.com/repos/chimple/maui/issues{/number}","pulls_url":"https://api.github.com/repos/chimple/maui/pulls{/number}","milestones_url":"https://api.github.com/repos/chimple/maui/milestones{/number}","notifications_url":"https://api.github.com/repos/chimple/maui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chimple/maui/labels{/name}","releases_url":"https://api.github.com/repos/chimple/maui/releases{/id}","deployments_url":"https://api.github.com/repos/chimple/maui/deployments","created_at":"2018-03-19T03:42:08Z","updated_at":"2018-08-22T11:01:56Z","pushed_at":"2018-08-22T11:09:52Z","git_url":"git://github.com/chimple/maui.git","ssh_url":"git@github.com:chimple/maui.git","clone_url":"https://github.com/chimple/maui.git","svn_url":"https://github.com/chimple/maui","homepage":null,"size":145495,"stargazers_count":19,"watchers_count":19,"language":"Dart","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":64,"license":null,"forks":0,"open_issues":64,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chimple/maui/pulls/777"},"html":{"href":"https://github.com/chimple/maui/pull/777"},"issue":{"href":"https://api.github.com/repos/chimple/maui/issues/777"},"comments":{"href":"https://api.github.com/repos/chimple/maui/issues/777/comments"},"review_comments":{"href":"https://api.github.com/repos/chimple/maui/pulls/777/comments"},"review_comment":{"href":"https://api.github.com/repos/chimple/maui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chimple/maui/pulls/777/commits"},"statuses":{"href":"https://api.github.com/repos/chimple/maui/statuses/dc56f7d107cac726d64e2d8c0076f28a5540f117"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"talapadi"}}