{"action":"created","comment":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments/57501892","id":57501892,"diff_hunk":"@@ -0,0 +1,76 @@\n+class Plc::CourseUnitsController < ApplicationController\n+  load_and_authorize_resource\n+\n+  # GET /plc/course_units\n+  # GET /plc/course_units.json\n+  def index\n+  end\n+\n+  # GET /plc/course_units/1\n+  # GET /plc/course_units/1.json\n+  def show\n+  end\n+\n+  # GET /plc/course_units/new\n+  def new\n+    @course_unit.plc_course_id = params[:plc_course_id]\n+  end\n+\n+  # GET /plc/course_units/1/edit\n+  def edit\n+  end\n+\n+  # POST /plc/course_units\n+  # POST /plc/course_units.json\n+  def create\n+    if @course_unit.save\n+      redirect_to @course_unit, notice: 'Course unit was successfully created.'\n+    else\n+      redirect_to action: :new\n+    end\n+  end\n+\n+  # PATCH/PUT /plc/course_units/1\n+  # PATCH/PUT /plc/course_units/1.json\n+  def update\n+    if @course_unit.update(course_unit_params)\n+      redirect_to @course_unit, notice: 'Course unit was successfully created.'\n+    else\n+      redirect_to action: :edit\n+    end\n+  end\n+\n+  # DELETE /plc/course_units/1\n+  # DELETE /plc/course_units/1.json\n+  def destroy\n+    @course_unit.destroy\n+    redirect_to plc_content_creator_show_courses_and_modules_path\n+  end\n+\n+  def submit_new_questions_and_answers\n+    JSON.parse(new_questions_params).each do |question|\n+      Plc::EvaluationQuestion.create(plc_course_unit: @course_unit, question: question)\n+    end\n+\n+    JSON.parse(new_answers_params).each do |question_id, answer_list|\n+      answer_list.each do |answer_properties|\n+        Plc::EvaluationAnswer.create(plc_evaluation_question_id: question_id, answer: answer_properties['answer'], plc_learning_module_id: answer_properties['learningModuleId'] == '' ? nil : answer_properties['learningModuleId'])","path":"dashboard/app/controllers/plc/course_units_controller.rb","position":57,"original_position":57,"commit_id":"b9fd83f5c6762650c152d243b13ff193eebd2523","original_commit_id":"b9fd83f5c6762650c152d243b13ff193eebd2523","user":{"login":"mehalshah","id":14246419,"avatar_url":"https://avatars.githubusercontent.com/u/14246419?v=3","gravatar_id":"","url":"https://api.github.com/users/mehalshah","html_url":"https://github.com/mehalshah","followers_url":"https://api.github.com/users/mehalshah/followers","following_url":"https://api.github.com/users/mehalshah/following{/other_user}","gists_url":"https://api.github.com/users/mehalshah/gists{/gist_id}","starred_url":"https://api.github.com/users/mehalshah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mehalshah/subscriptions","organizations_url":"https://api.github.com/users/mehalshah/orgs","repos_url":"https://api.github.com/users/mehalshah/repos","events_url":"https://api.github.com/users/mehalshah/events{/privacy}","received_events_url":"https://api.github.com/users/mehalshah/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2016-03-25T23:23:06Z","updated_at":"2016-03-25T23:23:06Z","html_url":"https://github.com/code-dot-org/code-dot-org/pull/7508#discussion_r57501892","pull_request_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/7508","_links":{"self":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments/57501892"},"html":{"href":"https://github.com/code-dot-org/code-dot-org/pull/7508#discussion_r57501892"},"pull_request":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/7508"}}},"pull_request":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/7508","id":64201224,"html_url":"https://github.com/code-dot-org/code-dot-org/pull/7508","diff_url":"https://github.com/code-dot-org/code-dot-org/pull/7508.diff","patch_url":"https://github.com/code-dot-org/code-dot-org/pull/7508.patch","issue_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/7508","number":7508,"state":"open","locked":false,"title":"Course units","user":{"login":"mehalshah","id":14246419,"avatar_url":"https://avatars.githubusercontent.com/u/14246419?v=3","gravatar_id":"","url":"https://api.github.com/users/mehalshah","html_url":"https://github.com/mehalshah","followers_url":"https://api.github.com/users/mehalshah/followers","following_url":"https://api.github.com/users/mehalshah/following{/other_user}","gists_url":"https://api.github.com/users/mehalshah/gists{/gist_id}","starred_url":"https://api.github.com/users/mehalshah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mehalshah/subscriptions","organizations_url":"https://api.github.com/users/mehalshah/orgs","repos_url":"https://api.github.com/users/mehalshah/repos","events_url":"https://api.github.com/users/mehalshah/events{/privacy}","received_events_url":"https://api.github.com/users/mehalshah/received_events","type":"User","site_admin":false},"body":"Course units are now a thing! They are used to\r\n\r\n- Break the course up into sections\r\n- Each course unit will have an assessment\r\n- Upon completing the assessment, you will be assigned given modules for a particular course unit\r\n\r\nhttp://wiki.code.org/display/Operations/Explanation+of+PLC+Model is the new diagram\r\n\r\nhttp://wiki.code.org/pages/diffpagesbyversion.action?pageId=692444&selectedPageVersions=7&selectedPageVersions=6 shows what changed\r\n\r\nI didn't want this PR to sprawl so much - so all the logic for enrolling users in course units will come later. Additionally, instead of building out the full UI for viewing your course unit assignment, I just threw out the existing teacher dashboard since we haven't launched it yet.\r\n\r\n![Course units](https://docs.google.com/drawings/u/1/d/sCaLDj6e0dWtGIys0U9E2SA/image?w=624&h=421&rev=686&ac=1)","created_at":"2016-03-25T20:00:42Z","updated_at":"2016-03-25T23:23:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"37dcc1907ca0a3fae94b73338983ac656630efc1","assignee":{"login":"philbogle","id":5198586,"avatar_url":"https://avatars.githubusercontent.com/u/5198586?v=3","gravatar_id":"","url":"https://api.github.com/users/philbogle","html_url":"https://github.com/philbogle","followers_url":"https://api.github.com/users/philbogle/followers","following_url":"https://api.github.com/users/philbogle/following{/other_user}","gists_url":"https://api.github.com/users/philbogle/gists{/gist_id}","starred_url":"https://api.github.com/users/philbogle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philbogle/subscriptions","organizations_url":"https://api.github.com/users/philbogle/orgs","repos_url":"https://api.github.com/users/philbogle/repos","events_url":"https://api.github.com/users/philbogle/events{/privacy}","received_events_url":"https://api.github.com/users/philbogle/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/7508/commits","review_comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/7508/comments","review_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments{/number}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/7508/comments","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/b9fd83f5c6762650c152d243b13ff193eebd2523","head":{"label":"code-dot-org:course_units","ref":"course_units","sha":"b9fd83f5c6762650c152d243b13ff193eebd2523","user":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24250009,"name":"code-dot-org","full_name":"code-dot-org/code-dot-org","owner":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-dot-org/code-dot-org","description":"The code powering code.org and studio.code.org","fork":false,"url":"https://api.github.com/repos/code-dot-org/code-dot-org","forks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/forks","keys_url":"https://api.github.com/repos/code-dot-org/code-dot-org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-dot-org/code-dot-org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-dot-org/code-dot-org/teams","hooks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/hooks","issue_events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/events{/number}","events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/events","assignees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/assignees{/user}","branches_url":"https://api.github.com/repos/code-dot-org/code-dot-org/branches{/branch}","tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/tags","blobs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/{sha}","languages_url":"https://api.github.com/repos/code-dot-org/code-dot-org/languages","stargazers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/stargazers","contributors_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contributors","subscribers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscribers","subscription_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscription","commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contents/{+path}","compare_url":"https://api.github.com/repos/code-dot-org/code-dot-org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-dot-org/code-dot-org/merges","archive_url":"https://api.github.com/repos/code-dot-org/code-dot-org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-dot-org/code-dot-org/downloads","issues_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues{/number}","pulls_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls{/number}","milestones_url":"https://api.github.com/repos/code-dot-org/code-dot-org/milestones{/number}","notifications_url":"https://api.github.com/repos/code-dot-org/code-dot-org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels{/name}","releases_url":"https://api.github.com/repos/code-dot-org/code-dot-org/releases{/id}","deployments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/deployments","created_at":"2014-09-20T00:46:11Z","updated_at":"2016-03-25T08:11:02Z","pushed_at":"2016-03-25T22:47:30Z","git_url":"git://github.com/code-dot-org/code-dot-org.git","ssh_url":"git@github.com:code-dot-org/code-dot-org.git","clone_url":"https://github.com/code-dot-org/code-dot-org.git","svn_url":"https://github.com/code-dot-org/code-dot-org","homepage":"http://code.org","size":4427747,"stargazers_count":105,"watchers_count":105,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":56,"mirror_url":null,"open_issues_count":65,"forks":56,"open_issues":65,"watchers":105,"default_branch":"staging"}},"base":{"label":"code-dot-org:staging","ref":"staging","sha":"510d4fcb51ef27aae225ab209d9f05357ad6e8b0","user":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24250009,"name":"code-dot-org","full_name":"code-dot-org/code-dot-org","owner":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-dot-org/code-dot-org","description":"The code powering code.org and studio.code.org","fork":false,"url":"https://api.github.com/repos/code-dot-org/code-dot-org","forks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/forks","keys_url":"https://api.github.com/repos/code-dot-org/code-dot-org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-dot-org/code-dot-org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-dot-org/code-dot-org/teams","hooks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/hooks","issue_events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/events{/number}","events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/events","assignees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/assignees{/user}","branches_url":"https://api.github.com/repos/code-dot-org/code-dot-org/branches{/branch}","tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/tags","blobs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/{sha}","languages_url":"https://api.github.com/repos/code-dot-org/code-dot-org/languages","stargazers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/stargazers","contributors_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contributors","subscribers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscribers","subscription_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscription","commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contents/{+path}","compare_url":"https://api.github.com/repos/code-dot-org/code-dot-org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-dot-org/code-dot-org/merges","archive_url":"https://api.github.com/repos/code-dot-org/code-dot-org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-dot-org/code-dot-org/downloads","issues_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues{/number}","pulls_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls{/number}","milestones_url":"https://api.github.com/repos/code-dot-org/code-dot-org/milestones{/number}","notifications_url":"https://api.github.com/repos/code-dot-org/code-dot-org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels{/name}","releases_url":"https://api.github.com/repos/code-dot-org/code-dot-org/releases{/id}","deployments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/deployments","created_at":"2014-09-20T00:46:11Z","updated_at":"2016-03-25T08:11:02Z","pushed_at":"2016-03-25T22:47:30Z","git_url":"git://github.com/code-dot-org/code-dot-org.git","ssh_url":"git@github.com:code-dot-org/code-dot-org.git","clone_url":"https://github.com/code-dot-org/code-dot-org.git","svn_url":"https://github.com/code-dot-org/code-dot-org","homepage":"http://code.org","size":4427747,"stargazers_count":105,"watchers_count":105,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":56,"mirror_url":null,"open_issues_count":65,"forks":56,"open_issues":65,"watchers":105,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/7508"},"html":{"href":"https://github.com/code-dot-org/code-dot-org/pull/7508"},"issue":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/7508"},"comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/7508/comments"},"review_comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/7508/comments"},"review_comment":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/7508/commits"},"statuses":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/b9fd83f5c6762650c152d243b13ff193eebd2523"}}}}