{"action":"created","comment":{"url":"https://api.github.com/repos/fsr-itse/EvaP/pulls/comments/61684536","id":61684536,"diff_hunk":"@@ -357,6 +361,60 @@ def semester_export(request, semester_id):\n \n \n @staff_required\n+def semester_raw_export(request, semester_id):\n+    semester = get_object_or_404(Semester, id=semester_id)\n+\n+    filename = \"Evaluation-%s-%s_raw.csv\" % (semester.name, get_language())\n+    response = HttpResponse(content_type=\"text/csv\")\n+    response[\"Content-Disposition\"] = \"attachment; filename=\\\"%s\\\"\" % filename\n+\n+    writer = csv.writer(response, delimiter=\";\")\n+    writer.writerow([_('Name'), _('Degrees'), _('Type'), _('Single result'), _('State'), _('#Voters'),\n+        _('#Participants'), _('#Comments'), _('Average degree')])\n+    for course in semester.course_set.all():\n+        degrees = \",\".join([degree.name for degree in course.degrees.all()])\n+        course.avg_grade, course.avg_deviation = calculate_average_grades_and_deviation(course)\n+        if course.state in ['evaluated', 'reviewed', 'published'] and course.avg_grade is not None:\n+            course.avg_grade = ('%.1f' % float(course.avg_grade)).replace('.',',')\n+        else:\n+            course.avg_grade = \"\"\n+        writer.writerow([course.name, degrees, course.type.name, course.is_single_result(), course.state,\n+            course.num_voters, course.num_participants, len(course.textanswer_set.all()), course.avg_grade])","path":"evap/staff/views.py","position":51,"original_position":51,"commit_id":"fa2b51d68c353c1fe7fc65b314dde0b5d8dfec6c","original_commit_id":"fa2b51d68c353c1fe7fc65b314dde0b5d8dfec6c","user":{"login":"karyon","id":1891915,"avatar_url":"https://avatars.githubusercontent.com/u/1891915?v=3","gravatar_id":"","url":"https://api.github.com/users/karyon","html_url":"https://github.com/karyon","followers_url":"https://api.github.com/users/karyon/followers","following_url":"https://api.github.com/users/karyon/following{/other_user}","gists_url":"https://api.github.com/users/karyon/gists{/gist_id}","starred_url":"https://api.github.com/users/karyon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karyon/subscriptions","organizations_url":"https://api.github.com/users/karyon/orgs","repos_url":"https://api.github.com/users/karyon/repos","events_url":"https://api.github.com/users/karyon/events{/privacy}","received_events_url":"https://api.github.com/users/karyon/received_events","type":"User","site_admin":false},"body":".count instead of len","created_at":"2016-05-01T09:48:44Z","updated_at":"2016-05-01T09:48:44Z","html_url":"https://github.com/fsr-itse/EvaP/pull/785#discussion_r61684536","pull_request_url":"https://api.github.com/repos/fsr-itse/EvaP/pulls/785","_links":{"self":{"href":"https://api.github.com/repos/fsr-itse/EvaP/pulls/comments/61684536"},"html":{"href":"https://github.com/fsr-itse/EvaP/pull/785#discussion_r61684536"},"pull_request":{"href":"https://api.github.com/repos/fsr-itse/EvaP/pulls/785"}}},"pull_request":{"url":"https://api.github.com/repos/fsr-itse/EvaP/pulls/785","id":68491667,"html_url":"https://github.com/fsr-itse/EvaP/pull/785","diff_url":"https://github.com/fsr-itse/EvaP/pull/785.diff","patch_url":"https://github.com/fsr-itse/EvaP/pull/785.patch","issue_url":"https://api.github.com/repos/fsr-itse/EvaP/issues/785","number":785,"state":"open","locked":false,"title":"Raw data export","user":{"login":"janno42","id":1781719,"avatar_url":"https://avatars.githubusercontent.com/u/1781719?v=3","gravatar_id":"","url":"https://api.github.com/users/janno42","html_url":"https://github.com/janno42","followers_url":"https://api.github.com/users/janno42/followers","following_url":"https://api.github.com/users/janno42/following{/other_user}","gists_url":"https://api.github.com/users/janno42/gists{/gist_id}","starred_url":"https://api.github.com/users/janno42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janno42/subscriptions","organizations_url":"https://api.github.com/users/janno42/orgs","repos_url":"https://api.github.com/users/janno42/repos","events_url":"https://api.github.com/users/janno42/events{/privacy}","received_events_url":"https://api.github.com/users/janno42/received_events","type":"User","site_admin":false},"body":"Fix #681 \r\n\r\nThis allows exporting raw course data per semester as well as a participation overview in CSV format. Both are helpful for creating detailed statistics about a semester.","created_at":"2016-05-01T09:28:41Z","updated_at":"2016-05-01T09:48:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0afbc6ce3250b485037abdb4c3c6321ec170d743","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fsr-itse/EvaP/pulls/785/commits","review_comments_url":"https://api.github.com/repos/fsr-itse/EvaP/pulls/785/comments","review_comment_url":"https://api.github.com/repos/fsr-itse/EvaP/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fsr-itse/EvaP/issues/785/comments","statuses_url":"https://api.github.com/repos/fsr-itse/EvaP/statuses/fa2b51d68c353c1fe7fc65b314dde0b5d8dfec6c","head":{"label":"janno42:raw_export","ref":"raw_export","sha":"fa2b51d68c353c1fe7fc65b314dde0b5d8dfec6c","user":{"login":"janno42","id":1781719,"avatar_url":"https://avatars.githubusercontent.com/u/1781719?v=3","gravatar_id":"","url":"https://api.github.com/users/janno42","html_url":"https://github.com/janno42","followers_url":"https://api.github.com/users/janno42/followers","following_url":"https://api.github.com/users/janno42/following{/other_user}","gists_url":"https://api.github.com/users/janno42/gists{/gist_id}","starred_url":"https://api.github.com/users/janno42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janno42/subscriptions","organizations_url":"https://api.github.com/users/janno42/orgs","repos_url":"https://api.github.com/users/janno42/repos","events_url":"https://api.github.com/users/janno42/events{/privacy}","received_events_url":"https://api.github.com/users/janno42/received_events","type":"User","site_admin":false},"repo":{"id":20739629,"name":"EvaP","full_name":"janno42/EvaP","owner":{"login":"janno42","id":1781719,"avatar_url":"https://avatars.githubusercontent.com/u/1781719?v=3","gravatar_id":"","url":"https://api.github.com/users/janno42","html_url":"https://github.com/janno42","followers_url":"https://api.github.com/users/janno42/followers","following_url":"https://api.github.com/users/janno42/following{/other_user}","gists_url":"https://api.github.com/users/janno42/gists{/gist_id}","starred_url":"https://api.github.com/users/janno42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janno42/subscriptions","organizations_url":"https://api.github.com/users/janno42/orgs","repos_url":"https://api.github.com/users/janno42/repos","events_url":"https://api.github.com/users/janno42/events{/privacy}","received_events_url":"https://api.github.com/users/janno42/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/janno42/EvaP","description":"a university course evaluation system written in Python using Django","fork":true,"url":"https://api.github.com/repos/janno42/EvaP","forks_url":"https://api.github.com/repos/janno42/EvaP/forks","keys_url":"https://api.github.com/repos/janno42/EvaP/keys{/key_id}","collaborators_url":"https://api.github.com/repos/janno42/EvaP/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/janno42/EvaP/teams","hooks_url":"https://api.github.com/repos/janno42/EvaP/hooks","issue_events_url":"https://api.github.com/repos/janno42/EvaP/issues/events{/number}","events_url":"https://api.github.com/repos/janno42/EvaP/events","assignees_url":"https://api.github.com/repos/janno42/EvaP/assignees{/user}","branches_url":"https://api.github.com/repos/janno42/EvaP/branches{/branch}","tags_url":"https://api.github.com/repos/janno42/EvaP/tags","blobs_url":"https://api.github.com/repos/janno42/EvaP/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/janno42/EvaP/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/janno42/EvaP/git/refs{/sha}","trees_url":"https://api.github.com/repos/janno42/EvaP/git/trees{/sha}","statuses_url":"https://api.github.com/repos/janno42/EvaP/statuses/{sha}","languages_url":"https://api.github.com/repos/janno42/EvaP/languages","stargazers_url":"https://api.github.com/repos/janno42/EvaP/stargazers","contributors_url":"https://api.github.com/repos/janno42/EvaP/contributors","subscribers_url":"https://api.github.com/repos/janno42/EvaP/subscribers","subscription_url":"https://api.github.com/repos/janno42/EvaP/subscription","commits_url":"https://api.github.com/repos/janno42/EvaP/commits{/sha}","git_commits_url":"https://api.github.com/repos/janno42/EvaP/git/commits{/sha}","comments_url":"https://api.github.com/repos/janno42/EvaP/comments{/number}","issue_comment_url":"https://api.github.com/repos/janno42/EvaP/issues/comments{/number}","contents_url":"https://api.github.com/repos/janno42/EvaP/contents/{+path}","compare_url":"https://api.github.com/repos/janno42/EvaP/compare/{base}...{head}","merges_url":"https://api.github.com/repos/janno42/EvaP/merges","archive_url":"https://api.github.com/repos/janno42/EvaP/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/janno42/EvaP/downloads","issues_url":"https://api.github.com/repos/janno42/EvaP/issues{/number}","pulls_url":"https://api.github.com/repos/janno42/EvaP/pulls{/number}","milestones_url":"https://api.github.com/repos/janno42/EvaP/milestones{/number}","notifications_url":"https://api.github.com/repos/janno42/EvaP/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/janno42/EvaP/labels{/name}","releases_url":"https://api.github.com/repos/janno42/EvaP/releases{/id}","deployments_url":"https://api.github.com/repos/janno42/EvaP/deployments","created_at":"2014-06-11T20:15:30Z","updated_at":"2015-01-06T21:08:30Z","pushed_at":"2016-05-01T09:33:50Z","git_url":"git://github.com/janno42/EvaP.git","ssh_url":"git@github.com:janno42/EvaP.git","clone_url":"https://github.com/janno42/EvaP.git","svn_url":"https://github.com/janno42/EvaP","homepage":"","size":11151,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fsr-itse:master","ref":"master","sha":"803ac9825aac1024137220bed631e4302d580d18","user":{"login":"fsr-itse","id":1298457,"avatar_url":"https://avatars.githubusercontent.com/u/1298457?v=3","gravatar_id":"","url":"https://api.github.com/users/fsr-itse","html_url":"https://github.com/fsr-itse","followers_url":"https://api.github.com/users/fsr-itse/followers","following_url":"https://api.github.com/users/fsr-itse/following{/other_user}","gists_url":"https://api.github.com/users/fsr-itse/gists{/gist_id}","starred_url":"https://api.github.com/users/fsr-itse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsr-itse/subscriptions","organizations_url":"https://api.github.com/users/fsr-itse/orgs","repos_url":"https://api.github.com/users/fsr-itse/repos","events_url":"https://api.github.com/users/fsr-itse/events{/privacy}","received_events_url":"https://api.github.com/users/fsr-itse/received_events","type":"Organization","site_admin":false},"repo":{"id":3110378,"name":"EvaP","full_name":"fsr-itse/EvaP","owner":{"login":"fsr-itse","id":1298457,"avatar_url":"https://avatars.githubusercontent.com/u/1298457?v=3","gravatar_id":"","url":"https://api.github.com/users/fsr-itse","html_url":"https://github.com/fsr-itse","followers_url":"https://api.github.com/users/fsr-itse/followers","following_url":"https://api.github.com/users/fsr-itse/following{/other_user}","gists_url":"https://api.github.com/users/fsr-itse/gists{/gist_id}","starred_url":"https://api.github.com/users/fsr-itse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsr-itse/subscriptions","organizations_url":"https://api.github.com/users/fsr-itse/orgs","repos_url":"https://api.github.com/users/fsr-itse/repos","events_url":"https://api.github.com/users/fsr-itse/events{/privacy}","received_events_url":"https://api.github.com/users/fsr-itse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fsr-itse/EvaP","description":"a university course evaluation system written in Python using Django","fork":false,"url":"https://api.github.com/repos/fsr-itse/EvaP","forks_url":"https://api.github.com/repos/fsr-itse/EvaP/forks","keys_url":"https://api.github.com/repos/fsr-itse/EvaP/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fsr-itse/EvaP/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fsr-itse/EvaP/teams","hooks_url":"https://api.github.com/repos/fsr-itse/EvaP/hooks","issue_events_url":"https://api.github.com/repos/fsr-itse/EvaP/issues/events{/number}","events_url":"https://api.github.com/repos/fsr-itse/EvaP/events","assignees_url":"https://api.github.com/repos/fsr-itse/EvaP/assignees{/user}","branches_url":"https://api.github.com/repos/fsr-itse/EvaP/branches{/branch}","tags_url":"https://api.github.com/repos/fsr-itse/EvaP/tags","blobs_url":"https://api.github.com/repos/fsr-itse/EvaP/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fsr-itse/EvaP/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fsr-itse/EvaP/git/refs{/sha}","trees_url":"https://api.github.com/repos/fsr-itse/EvaP/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fsr-itse/EvaP/statuses/{sha}","languages_url":"https://api.github.com/repos/fsr-itse/EvaP/languages","stargazers_url":"https://api.github.com/repos/fsr-itse/EvaP/stargazers","contributors_url":"https://api.github.com/repos/fsr-itse/EvaP/contributors","subscribers_url":"https://api.github.com/repos/fsr-itse/EvaP/subscribers","subscription_url":"https://api.github.com/repos/fsr-itse/EvaP/subscription","commits_url":"https://api.github.com/repos/fsr-itse/EvaP/commits{/sha}","git_commits_url":"https://api.github.com/repos/fsr-itse/EvaP/git/commits{/sha}","comments_url":"https://api.github.com/repos/fsr-itse/EvaP/comments{/number}","issue_comment_url":"https://api.github.com/repos/fsr-itse/EvaP/issues/comments{/number}","contents_url":"https://api.github.com/repos/fsr-itse/EvaP/contents/{+path}","compare_url":"https://api.github.com/repos/fsr-itse/EvaP/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fsr-itse/EvaP/merges","archive_url":"https://api.github.com/repos/fsr-itse/EvaP/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fsr-itse/EvaP/downloads","issues_url":"https://api.github.com/repos/fsr-itse/EvaP/issues{/number}","pulls_url":"https://api.github.com/repos/fsr-itse/EvaP/pulls{/number}","milestones_url":"https://api.github.com/repos/fsr-itse/EvaP/milestones{/number}","notifications_url":"https://api.github.com/repos/fsr-itse/EvaP/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fsr-itse/EvaP/labels{/name}","releases_url":"https://api.github.com/repos/fsr-itse/EvaP/releases{/id}","deployments_url":"https://api.github.com/repos/fsr-itse/EvaP/deployments","created_at":"2012-01-05T13:56:45Z","updated_at":"2016-03-02T20:11:16Z","pushed_at":"2016-05-01T09:33:50Z","git_url":"git://github.com/fsr-itse/EvaP.git","ssh_url":"git@github.com:fsr-itse/EvaP.git","clone_url":"https://github.com/fsr-itse/EvaP.git","svn_url":"https://github.com/fsr-itse/EvaP","homepage":"","size":50544,"stargazers_count":26,"watchers_count":26,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":57,"mirror_url":null,"open_issues_count":39,"forks":57,"open_issues":39,"watchers":26,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fsr-itse/EvaP/pulls/785"},"html":{"href":"https://github.com/fsr-itse/EvaP/pull/785"},"issue":{"href":"https://api.github.com/repos/fsr-itse/EvaP/issues/785"},"comments":{"href":"https://api.github.com/repos/fsr-itse/EvaP/issues/785/comments"},"review_comments":{"href":"https://api.github.com/repos/fsr-itse/EvaP/pulls/785/comments"},"review_comment":{"href":"https://api.github.com/repos/fsr-itse/EvaP/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fsr-itse/EvaP/pulls/785/commits"},"statuses":{"href":"https://api.github.com/repos/fsr-itse/EvaP/statuses/fa2b51d68c353c1fe7fc65b314dde0b5d8dfec6c"}}}}