Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-analytics-data-api
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-analytics-data-api
Commits
99f9c79f
Commit
99f9c79f
authored
Jun 05, 2015
by
Dennis Jen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #77 from edx/dsjen/aggregate-problem-submissions
Updated problem endpoint to return problem submissions.
parents
3b8f7fc3
5812dbdf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
analytics_data_api/v0/tests/views/test_courses.py
+2
-2
analytics_data_api/v0/views/courses.py
+5
-2
No files found.
analytics_data_api/v0/tests/views/test_courses.py
View file @
99f9c79f
...
...
@@ -620,8 +620,8 @@ class CourseProblemsListViewTests(DemoCourseMixin, TestCaseWithAuthentication):
expected
=
[
{
'module_id'
:
module_id
,
'total_submissions'
:
30
0
,
'correct_submissions'
:
10
0
,
'total_submissions'
:
15
0
,
'correct_submissions'
:
5
0
,
'part_ids'
:
[
o1
.
part_id
,
o3
.
part_id
],
'created'
:
alt_created
.
strftime
(
settings
.
DATETIME_FORMAT
)
},
...
...
analytics_data_api/v0/views/courses.py
View file @
99f9c79f
...
...
@@ -632,11 +632,14 @@ class ProblemsListView(BaseCourseView):
allow_empty
=
False
def
get_queryset
(
self
):
# last_response_count is the number of submissions for the problem part and must
# be divided by the number of problem parts to get the problem submission rather
# than the problem *part* submissions
aggregation_query
=
"""
SELECT
module_id,
SUM(last_response_count) AS total_submissions,
SUM(CASE WHEN correct=1 THEN last_response_count ELSE 0 END) AS correct_submissions,
SUM(last_response_count)
/COUNT(DISTINCT part_id)
AS total_submissions,
SUM(CASE WHEN correct=1 THEN last_response_count ELSE 0 END)
/COUNT(DISTINCT part_id)
AS correct_submissions,
GROUP_CONCAT(DISTINCT part_id) AS part_ids,
MAX(created) AS created
FROM answer_distribution
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment