{"action":"created","issue":{"url":"https://api.github.com/repos/woothemes/sensei/issues/953","labels_url":"https://api.github.com/repos/woothemes/sensei/issues/953/labels{/name}","comments_url":"https://api.github.com/repos/woothemes/sensei/issues/953/comments","events_url":"https://api.github.com/repos/woothemes/sensei/issues/953/events","html_url":"https://github.com/woothemes/sensei/issues/953","id":89486600,"number":953,"title":"Sensei handles course and module completion .","user":{"login":"dwainm","id":1713474,"avatar_url":"https://avatars.githubusercontent.com/u/1713474?v=3","gravatar_id":"","url":"https://api.github.com/users/dwainm","html_url":"https://github.com/dwainm","followers_url":"https://api.github.com/users/dwainm/followers","following_url":"https://api.github.com/users/dwainm/following{/other_user}","gists_url":"https://api.github.com/users/dwainm/gists{/gist_id}","starred_url":"https://api.github.com/users/dwainm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwainm/subscriptions","organizations_url":"https://api.github.com/users/dwainm/orgs","repos_url":"https://api.github.com/users/dwainm/repos","events_url":"https://api.github.com/users/dwainm/events{/privacy}","received_events_url":"https://api.github.com/users/dwainm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/woothemes/sensei/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/woothemes/sensei/milestones/27","html_url":"https://github.com/woothemes/sensei/milestones/1.9%20Front%20end%20enhancements","labels_url":"https://api.github.com/repos/woothemes/sensei/milestones/27/labels","id":1164752,"number":27,"title":"1.9 Front end enhancements","description":"","creator":{"login":"danjjohnson","id":1990037,"avatar_url":"https://avatars.githubusercontent.com/u/1990037?v=3","gravatar_id":"","url":"https://api.github.com/users/danjjohnson","html_url":"https://github.com/danjjohnson","followers_url":"https://api.github.com/users/danjjohnson/followers","following_url":"https://api.github.com/users/danjjohnson/following{/other_user}","gists_url":"https://api.github.com/users/danjjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/danjjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danjjohnson/subscriptions","organizations_url":"https://api.github.com/users/danjjohnson/orgs","repos_url":"https://api.github.com/users/danjjohnson/repos","events_url":"https://api.github.com/users/danjjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/danjjohnson/received_events","type":"User","site_admin":false},"open_issues":22,"closed_issues":0,"state":"open","created_at":"2015-06-15T12:00:02Z","updated_at":"2015-06-19T07:00:56Z","due_on":"2015-08-13T22:00:00Z","closed_at":null},"comments":1,"created_at":"2015-06-19T07:00:56Z","updated_at":"2015-06-19T09:33:59Z","closed_at":null,"body":"The completion data for Courses and Modules is stored independently from it's lessons. It is only linked in the code at certain points in the user's process.\r\n\r\nThis is wrong because there should be a single source of truth: if all lessons are completed, so should the course and modules they belong to.\r\n\r\nThe code should not check the completion on the course or on the module, but rather each lesson they contain.\r\n\r\nThis needs to be coupled with caching and the cache should be updated when the lesson status changes. "},"comment":{"url":"https://api.github.com/repos/woothemes/sensei/issues/comments/113445940","html_url":"https://github.com/woothemes/sensei/issues/953#issuecomment-113445940","issue_url":"https://api.github.com/repos/woothemes/sensei/issues/953","id":113445940,"user":{"login":"davidpagepsycle","id":8223525,"avatar_url":"https://avatars.githubusercontent.com/u/8223525?v=3","gravatar_id":"","url":"https://api.github.com/users/davidpagepsycle","html_url":"https://github.com/davidpagepsycle","followers_url":"https://api.github.com/users/davidpagepsycle/followers","following_url":"https://api.github.com/users/davidpagepsycle/following{/other_user}","gists_url":"https://api.github.com/users/davidpagepsycle/gists{/gist_id}","starred_url":"https://api.github.com/users/davidpagepsycle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidpagepsycle/subscriptions","organizations_url":"https://api.github.com/users/davidpagepsycle/orgs","repos_url":"https://api.github.com/users/davidpagepsycle/repos","events_url":"https://api.github.com/users/davidpagepsycle/events{/privacy}","received_events_url":"https://api.github.com/users/davidpagepsycle/received_events","type":"User","site_admin":false},"created_at":"2015-06-19T09:33:59Z","updated_at":"2015-06-19T09:33:59Z","body":"Very true. I noticed that for Modules that the 'completeness' of them is stored as user meta, which can massively increase data for each user, quite bad for large sites. After all on WP.com and VIP storing user meta data is practically a no-go.\r\n\r\nWith the Course completeness it's stored separately and updated every time a lesson changes specifically so that the system doesn't have to check all lessons for a user, which was extremely slow pre 1.7. This also means a lot of the work related to checking of Course in the admin is shifted to the database where it's quicker rather than within PHP. Caching is good, but if the cache is empty then an awful lot of work would need to occur to re-populate it all, and even with caching the work is shifted back to PHP again."}}