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
5f989371
Unverified
Commit
5f989371
authored
Jun 13, 2016
by
Gabe Mulley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial API attempt
parent
1dbec29c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
1 deletions
+29
-1
analytics_data_api/v0/models.py
+11
-0
analytics_data_api/v0/serializers.py
+6
-0
analytics_data_api/v0/urls/courses.py
+2
-1
analytics_data_api/v0/views/courses.py
+10
-0
No files found.
analytics_data_api/v0/models.py
View file @
5f989371
...
@@ -497,3 +497,14 @@ class ModuleEngagementMetricRanges(models.Model):
...
@@ -497,3 +497,14 @@ class ModuleEngagementMetricRanges(models.Model):
class
Meta
(
object
):
class
Meta
(
object
):
db_table
=
'module_engagement_metric_ranges'
db_table
=
'module_engagement_metric_ranges'
class
ViewDistribution
(
models
.
Model
):
course_id
=
models
.
CharField
(
db_index
=
True
,
max_length
=
255
)
section
=
models
.
CharField
(
db_index
=
True
,
max_length
=
255
)
subsection
=
models
.
CharField
(
db_index
=
True
,
max_length
=
255
)
unique_user_views
=
models
.
IntegerField
()
total_views
=
models
.
IntegerField
()
class
Meta
(
object
):
db_table
=
'content_views'
analytics_data_api/v0/serializers.py
View file @
5f989371
...
@@ -478,3 +478,9 @@ class CourseLearnerMetadataSerializer(serializers.Serializer):
...
@@ -478,3 +478,9 @@ class CourseLearnerMetadataSerializer(serializers.Serializer):
})
})
return
engagement_ranges
return
engagement_ranges
class
ViewDistributionSerializer
(
ModelSerializerWithCreatedField
):
class
Meta
(
object
):
model
=
models
.
ViewDistribution
analytics_data_api/v0/urls/courses.py
View file @
5f989371
...
@@ -14,7 +14,8 @@ COURSE_URLS = [
...
@@ -14,7 +14,8 @@ COURSE_URLS = [
(
'enrollment/location'
,
views
.
CourseEnrollmentByLocationView
,
'enrollment_by_location'
),
(
'enrollment/location'
,
views
.
CourseEnrollmentByLocationView
,
'enrollment_by_location'
),
(
'problems'
,
views
.
ProblemsListView
,
'problems'
),
(
'problems'
,
views
.
ProblemsListView
,
'problems'
),
(
'problems_and_tags'
,
views
.
ProblemsAndTagsListView
,
'problems_and_tags'
),
(
'problems_and_tags'
,
views
.
ProblemsAndTagsListView
,
'problems_and_tags'
),
(
'videos'
,
views
.
VideosListView
,
'videos'
)
(
'videos'
,
views
.
VideosListView
,
'videos'
),
(
'views'
,
views
.
ViewDistributionView
,
'views'
)
]
]
urlpatterns
=
[]
urlpatterns
=
[]
...
...
analytics_data_api/v0/views/courses.py
View file @
5f989371
...
@@ -765,3 +765,12 @@ class VideosListView(BaseCourseView):
...
@@ -765,3 +765,12 @@ class VideosListView(BaseCourseView):
def
apply_date_filtering
(
self
,
queryset
):
def
apply_date_filtering
(
self
,
queryset
):
# no date filtering for videos -- just return the queryset
# no date filtering for videos -- just return the queryset
return
queryset
return
queryset
class
ViewDistributionView
(
BaseCourseView
):
slug
=
'view-distribution'
serializer_class
=
serializers
.
ViewDistributionSerializer
model
=
models
.
ViewDistribution
def
apply_date_filtering
(
self
,
queryset
):
return
queryset
\ No newline at end of file
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