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
16acff74
Commit
16acff74
authored
Jun 13, 2016
by
Dennis Jen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: generate course view data
parent
155d04ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
analytics_data_api/management/commands/generate_fake_course_data.py
+16
-0
No files found.
analytics_data_api/management/commands/generate_fake_course_data.py
View file @
16acff74
...
...
@@ -253,6 +253,18 @@ class Command(BaseCommand):
total_submissions
=
total_submissions
,
correct_submissions
=
correct_submissions
)
def
generate_video_module_data
(
self
,
course_id
,
section_num
,
subsection_num
):
unique_user_views
=
random
.
randint
(
1
,
100
)
total_views
=
unique_user_views
+
random
.
randint
(
1
,
100
)
models
.
ViewDistribution
.
objects
.
create
(
course_id
=
course_id
,
section
=
'section_{}'
.
format
(
section_num
),
subsection
=
'subsection_{}'
.
format
(
section_num
),
unique_user_views
=
unique_user_views
,
total_views
=
total_views
)
def
handle
(
self
,
*
args
,
**
options
):
course_id
=
options
[
'course_id'
]
username
=
options
[
'username'
]
...
...
@@ -274,3 +286,7 @@ class Command(BaseCommand):
self
.
generate_learner_engagement_data
(
course_id
,
username
,
start_date
,
end_date
)
self
.
generate_learner_engagement_range_data
(
course_id
,
start_date
,
end_date
)
self
.
generate_tags_distribution_data
(
course_id
)
for
i
in
range
(
10
):
for
j
in
range
(
10
):
self
.
generate_video_module_data
(
course_id
,
i
,
j
)
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