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
a817d2c8
Commit
a817d2c8
authored
Sep 08, 2014
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Another Update for Fake Activity Data
- Start dates are on Mondays - Adhering to closed-open intervals
parent
8b2becbf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
analytics_data_api/management/commands/generate_fake_course_data.py
+2
-2
No files found.
analytics_data_api/management/commands/generate_fake_course_data.py
View file @
a817d2c8
...
@@ -109,7 +109,7 @@ class Command(BaseCommand):
...
@@ -109,7 +109,7 @@ class Command(BaseCommand):
activity_types
=
[
'PLAYED_VIDEO'
,
'ATTEMPTED_PROBLEM'
,
'POSTED_FORUM'
]
activity_types
=
[
'PLAYED_VIDEO'
,
'ATTEMPTED_PROBLEM'
,
'POSTED_FORUM'
]
# Ensure we start on a Sunday 00:00
# Ensure we start on a Sunday 00:00
days_ahead
=
6
-
start_date
.
weekday
()
days_ahead
=
-
start_date
.
weekday
()
start
=
start_date
+
datetime
.
timedelta
(
days_ahead
)
start
=
start_date
+
datetime
.
timedelta
(
days_ahead
)
models
.
CourseActivityWeekly
.
objects
.
all
()
.
delete
()
models
.
CourseActivityWeekly
.
objects
.
all
()
.
delete
()
...
@@ -120,7 +120,7 @@ class Command(BaseCommand):
...
@@ -120,7 +120,7 @@ class Command(BaseCommand):
while
start
<
end_date
:
while
start
<
end_date
:
active_students
=
random
.
randint
(
100
,
4000
)
active_students
=
random
.
randint
(
100
,
4000
)
# End date should occur on Saturday at 23:59:59
# End date should occur on Saturday at 23:59:59
end
=
start
+
datetime
.
timedelta
(
weeks
=
1
,
milliseconds
=-
1
)
end
=
start
+
datetime
.
timedelta
(
weeks
=
1
)
counts
=
constrained_sum_sample_pos
(
len
(
activity_types
),
active_students
)
counts
=
constrained_sum_sample_pos
(
len
(
activity_types
),
active_students
)
...
...
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