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
93cf3a0a
Commit
93cf3a0a
authored
Jun 24, 2016
by
Tyler Hallada
Committed by
GitHub
Jun 24, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #123 from edx/distinct-enrollment-timeline
Add DISTINCT to distinct_entity_count query
parents
55e9c00d
ec1780a8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
analytics_data_api/v0/models.py
+1
-1
analytics_data_api/v0/tests/views/test_engagement_timelines.py
+1
-1
No files found.
analytics_data_api/v0/models.py
View file @
93cf3a0a
...
@@ -413,7 +413,7 @@ class ModuleEngagementTimelineManager(models.Manager):
...
@@ -413,7 +413,7 @@ class ModuleEngagementTimelineManager(models.Manager):
queryset
=
ModuleEngagement
.
objects
.
all
()
.
filter
(
course_id
=
course_id
,
username
=
username
)
\
queryset
=
ModuleEngagement
.
objects
.
all
()
.
filter
(
course_id
=
course_id
,
username
=
username
)
\
.
values
(
'date'
,
'entity_type'
,
'event'
)
\
.
values
(
'date'
,
'entity_type'
,
'event'
)
\
.
annotate
(
total_count
=
Sum
(
'count'
))
\
.
annotate
(
total_count
=
Sum
(
'count'
))
\
.
annotate
(
distinct_entity_count
=
Count
(
'entity_id'
))
\
.
annotate
(
distinct_entity_count
=
Count
(
'entity_id'
,
distinct
=
True
))
\
.
order_by
(
'date'
)
.
order_by
(
'date'
)
timelines
=
[]
timelines
=
[]
...
...
analytics_data_api/v0/tests/views/test_engagement_timelines.py
View file @
93cf3a0a
...
@@ -61,7 +61,7 @@ class EngagementTimelineTests(DemoCourseMixin, VerifyCourseIdMixin, TestCaseWith
...
@@ -61,7 +61,7 @@ class EngagementTimelineTests(DemoCourseMixin, VerifyCourseIdMixin, TestCaseWith
]
]
}
}
if
expect_id_aggregation
:
if
expect_id_aggregation
:
expected_data
[
'days'
][
0
][
metric_display_name
]
=
2
expected_data
[
'days'
][
0
][
metric_display_name
]
=
1
else
:
else
:
expected_data
[
'days'
][
0
][
metric_display_name
]
=
10
expected_data
[
'days'
][
0
][
metric_display_name
]
=
10
path
=
self
.
path_template
.
format
(
self
.
DEFAULT_USERNAME
,
urlquote
(
self
.
course_id
))
path
=
self
.
path_template
.
format
(
self
.
DEFAULT_USERNAME
,
urlquote
(
self
.
course_id
))
...
...
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