Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-analytics-dashboard
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-dashboard
Commits
caef5850
Commit
caef5850
authored
Sep 09, 2014
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed Enrollment Stats for Previous Day and Month
parent
8b7000bf
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
40 deletions
+13
-40
acceptance_tests/test_course_enrollment.py
+5
-4
analytics_dashboard/courses/presenters.py
+7
-9
analytics_dashboard/courses/templates/courses/enrollment_activity.html
+0
-12
analytics_dashboard/courses/tests/test_presenters.py
+0
-2
analytics_dashboard/courses/tests/test_views.py
+0
-4
analytics_dashboard/courses/tests/utils.py
+0
-2
analytics_dashboard/courses/views.py
+1
-7
No files found.
acceptance_tests/test_course_enrollment.py
View file @
caef5850
...
...
@@ -80,10 +80,11 @@ class CourseEnrollmentActivityTests(CourseEnrollmentTests, WebAppTest):
current_enrollment_count
=
current_enrollment
[
'count'
]
self
.
assertSummaryPointValueEquals
(
'current_enrollment'
,
current_enrollment_count
)
for
i
in
[
1
,
7
,
30
]:
stat_type
=
'enrollment_change_last_
%
s_days'
%
i
value
=
current_enrollment_count
-
enrollment_data
[
-
(
i
+
1
)][
'count'
]
self
.
assertSummaryPointValueEquals
(
stat_type
,
value
)
# Check value of summary box for last week
i
=
7
stat_type
=
'enrollment_change_last_
%
s_days'
%
i
value
=
current_enrollment_count
-
enrollment_data
[
-
(
i
+
1
)][
'count'
]
self
.
assertSummaryPointValueEquals
(
stat_type
,
value
)
# Verify *something* rendered where the graph should be. We cannot easily verify what rendered
self
.
assertElementHasContent
(
"[data-section=enrollment-basics] #enrollment-trend-view"
)
...
...
analytics_dashboard/courses/presenters.py
View file @
caef5850
...
...
@@ -131,9 +131,7 @@ class CourseEnrollmentPresenter(BasePresenter):
data
=
{
'date'
:
None
,
'current_enrollment'
:
None
,
'enrollment_change_last_1_days'
:
None
,
'enrollment_change_last_7_days'
:
None
,
'enrollment_change_last_30_days'
:
None
,
}
# Get most-recent enrollment
...
...
@@ -158,12 +156,12 @@ class CourseEnrollmentPresenter(BasePresenter):
# the loop below.
num_days_of_data
=
len
(
last_month_enrollment
)
# Get
enrollment differentials between today for yesterday, a week ago, and a month ago
for
interval
in
[
1
,
7
,
30
]:
count
=
None
if
num_days_of_data
>
interval
:
index
=
-
interval
-
1
count
=
current_enrollment
-
last_month_enrollment
[
index
][
'count'
]
data
[
'enrollment_change_last_
%
s_days'
%
interval
]
=
count
# Get
difference in enrollment for last week
interval
=
7
count
=
None
if
num_days_of_data
>
interval
:
index
=
-
interval
-
1
count
=
current_enrollment
-
last_month_enrollment
[
index
][
'count'
]
data
[
'enrollment_change_last_
%
s_days'
%
interval
]
=
count
return
data
analytics_dashboard/courses/templates/courses/enrollment_activity.html
View file @
caef5850
...
...
@@ -54,23 +54,11 @@ Individual course-centric enrollment activity view.
{% include "summary_point.html" with count=summary.current_enrollment label=label tooltip=tooltips.current_enrollment only %}
</div>
<div
class=
"col-xs-12 col-sm-3"
data-stat-type=
"enrollment_change_last_1_days"
>
{% comment %}Translators: This is a sub-heading used to specify the change in student enrollment compared to the previous day.{% endcomment %}
{% captureas label %}
Δ
{% trans "Previous Day" %}{% endcaptureas %}
{% include "summary_point.html" with count=summary.enrollment_change_last_1_days label=label tooltip=tooltips.enrollment_change_last_1_days only %}
</div>
<div
class=
"col-xs-12 col-sm-3"
data-stat-type=
"enrollment_change_last_7_days"
>
{% comment %}Translators: This is a sub-heading used to specify the change in student enrollment compared to the previous week.{% endcomment %}
{% captureas label %}
Δ
{% trans "Previous Week" %}{% endcaptureas %}
{% include "summary_point.html" with count=summary.enrollment_change_last_7_days label=label tooltip=tooltips.enrollment_change_last_7_days only %}
</div>
<div
class=
"col-xs-12 col-sm-3"
data-stat-type=
"enrollment_change_last_30_days"
>
{% comment %}Translators: This is a sub-heading used to specify the change in student enrollment compared to the previous month.{% endcomment %}
{% captureas label %}
Δ
{% trans "Previous Month" %}{% endcaptureas %}
{% include "summary_point.html" with count=summary.enrollment_change_last_30_days label=label tooltip=tooltips.enrollment_change_last_30_days only %}
</div>
</div>
</div>
...
...
analytics_dashboard/courses/tests/test_presenters.py
View file @
caef5850
...
...
@@ -81,9 +81,7 @@ class CourseEnrollmentPresenterTests(TestCase):
expected
=
{
'date'
:
None
,
'current_enrollment'
:
None
,
'enrollment_change_last_1_days'
:
None
,
'enrollment_change_last_7_days'
:
None
,
'enrollment_change_last_30_days'
:
None
,
}
self
.
assertDictEqual
(
actual
,
expected
)
...
...
analytics_dashboard/courses/tests/test_views.py
View file @
caef5850
...
...
@@ -231,9 +231,7 @@ class CourseEnrollmentActivityViewTests(CourseEnrollmentViewTestMixin, TestCase)
# check to make sure that we have tooltips
expected
=
{
'current_enrollment'
:
'Students enrolled in course.'
,
'enrollment_change_last_1_days'
:
'Change in enrollment for the last full day (00:00-23:59 UTC).'
,
'enrollment_change_last_7_days'
:
'Change in enrollment during the last 7 days (through 23:59 UTC).'
,
'enrollment_change_last_30_days'
:
'Change in enrollment during the last 30 days (through 23:59 UTC).'
}
self
.
assertDictEqual
(
context
[
'tooltips'
],
expected
)
...
...
@@ -244,9 +242,7 @@ class CourseEnrollmentActivityViewTests(CourseEnrollmentViewTestMixin, TestCase)
expected
=
{
'date'
:
datetime
.
date
(
year
=
2014
,
month
=
1
,
day
=
31
),
'current_enrollment'
:
30
,
'enrollment_change_last_1_days'
:
1
,
'enrollment_change_last_7_days'
:
7
,
'enrollment_change_last_30_days'
:
30
}
self
.
assertDictEqual
(
context
[
'summary'
],
expected
)
...
...
analytics_dashboard/courses/tests/utils.py
View file @
caef5850
...
...
@@ -27,9 +27,7 @@ def get_mock_enrollment_summary():
return
{
'date'
:
datetime
.
date
(
year
=
2014
,
month
=
1
,
day
=
31
),
'current_enrollment'
:
30
,
'enrollment_change_last_1_days'
:
1
,
'enrollment_change_last_7_days'
:
7
,
'enrollment_change_last_30_days'
:
30
,
}
...
...
analytics_dashboard/courses/views.py
View file @
caef5850
...
...
@@ -270,13 +270,7 @@ class EnrollmentActivityView(EnrollmentTemplateView):
'current_enrollment'
:
_
(
'Students enrolled in course.'
),
# Translators: Please keep this time in UTC. Do not translate it into another timezone.
'enrollment_change_last_1_days'
:
_
(
'Change in enrollment for the last full day (00:00-23:59 UTC).'
),
# Translators: Please keep this time in UTC. Do not translate it into another timezone.
'enrollment_change_last_7_days'
:
_
(
'Change in enrollment during the last 7 days (through 23:59 UTC).'
),
# Translators: Please keep this time in UTC. Do not translate it into another timezone.
'enrollment_change_last_30_days'
:
_
(
'Change in enrollment during the last 30 days (through 23:59 UTC).'
)
'enrollment_change_last_7_days'
:
_
(
'Change in enrollment during the last 7 days (through 23:59 UTC).'
)
}
presenter
=
CourseEnrollmentPresenter
(
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