Commit caef5850 by Clinton Blackburn

Removed Enrollment Stats for Previous Day and Month

parent 8b7000bf
...@@ -80,10 +80,11 @@ class CourseEnrollmentActivityTests(CourseEnrollmentTests, WebAppTest): ...@@ -80,10 +80,11 @@ class CourseEnrollmentActivityTests(CourseEnrollmentTests, WebAppTest):
current_enrollment_count = current_enrollment['count'] current_enrollment_count = current_enrollment['count']
self.assertSummaryPointValueEquals('current_enrollment', current_enrollment_count) self.assertSummaryPointValueEquals('current_enrollment', current_enrollment_count)
for i in [1, 7, 30]: # Check value of summary box for last week
stat_type = 'enrollment_change_last_%s_days' % i i = 7
value = current_enrollment_count - enrollment_data[-(i + 1)]['count'] stat_type = 'enrollment_change_last_%s_days' % i
self.assertSummaryPointValueEquals(stat_type, value) 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 # Verify *something* rendered where the graph should be. We cannot easily verify what rendered
self.assertElementHasContent("[data-section=enrollment-basics] #enrollment-trend-view") self.assertElementHasContent("[data-section=enrollment-basics] #enrollment-trend-view")
......
...@@ -131,9 +131,7 @@ class CourseEnrollmentPresenter(BasePresenter): ...@@ -131,9 +131,7 @@ class CourseEnrollmentPresenter(BasePresenter):
data = { data = {
'date': None, 'date': None,
'current_enrollment': None, 'current_enrollment': None,
'enrollment_change_last_1_days': None,
'enrollment_change_last_7_days': None, 'enrollment_change_last_7_days': None,
'enrollment_change_last_30_days': None,
} }
# Get most-recent enrollment # Get most-recent enrollment
...@@ -158,12 +156,12 @@ class CourseEnrollmentPresenter(BasePresenter): ...@@ -158,12 +156,12 @@ class CourseEnrollmentPresenter(BasePresenter):
# the loop below. # the loop below.
num_days_of_data = len(last_month_enrollment) num_days_of_data = len(last_month_enrollment)
# Get enrollment differentials between today for yesterday, a week ago, and a month ago # Get difference in enrollment for last week
for interval in [1, 7, 30]: interval = 7
count = None count = None
if num_days_of_data > interval: if num_days_of_data > interval:
index = -interval - 1 index = -interval - 1
count = current_enrollment - last_month_enrollment[index]['count'] count = current_enrollment - last_month_enrollment[index]['count']
data['enrollment_change_last_%s_days' % interval] = count data['enrollment_change_last_%s_days' % interval] = count
return data return data
...@@ -54,23 +54,11 @@ Individual course-centric enrollment activity view. ...@@ -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 %} {% include "summary_point.html" with count=summary.current_enrollment label=label tooltip=tooltips.current_enrollment only %}
</div> </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 %}&#916; {% 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"> <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 %} {% comment %}Translators: This is a sub-heading used to specify the change in student enrollment compared to the previous week.{% endcomment %}
{% captureas label %}&#916; {% trans "Previous Week" %}{% endcaptureas %} {% captureas label %}&#916; {% 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 %} {% include "summary_point.html" with count=summary.enrollment_change_last_7_days label=label tooltip=tooltips.enrollment_change_last_7_days only %}
</div> </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 %}&#916; {% 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>
</div> </div>
......
...@@ -81,9 +81,7 @@ class CourseEnrollmentPresenterTests(TestCase): ...@@ -81,9 +81,7 @@ class CourseEnrollmentPresenterTests(TestCase):
expected = { expected = {
'date': None, 'date': None,
'current_enrollment': None, 'current_enrollment': None,
'enrollment_change_last_1_days': None,
'enrollment_change_last_7_days': None, 'enrollment_change_last_7_days': None,
'enrollment_change_last_30_days': None,
} }
self.assertDictEqual(actual, expected) self.assertDictEqual(actual, expected)
......
...@@ -231,9 +231,7 @@ class CourseEnrollmentActivityViewTests(CourseEnrollmentViewTestMixin, TestCase) ...@@ -231,9 +231,7 @@ class CourseEnrollmentActivityViewTests(CourseEnrollmentViewTestMixin, TestCase)
# check to make sure that we have tooltips # check to make sure that we have tooltips
expected = { expected = {
'current_enrollment': 'Students enrolled in course.', '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_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) self.assertDictEqual(context['tooltips'], expected)
...@@ -244,9 +242,7 @@ class CourseEnrollmentActivityViewTests(CourseEnrollmentViewTestMixin, TestCase) ...@@ -244,9 +242,7 @@ class CourseEnrollmentActivityViewTests(CourseEnrollmentViewTestMixin, TestCase)
expected = { expected = {
'date': datetime.date(year=2014, month=1, day=31), 'date': datetime.date(year=2014, month=1, day=31),
'current_enrollment': 30, 'current_enrollment': 30,
'enrollment_change_last_1_days': 1,
'enrollment_change_last_7_days': 7, 'enrollment_change_last_7_days': 7,
'enrollment_change_last_30_days': 30
} }
self.assertDictEqual(context['summary'], expected) self.assertDictEqual(context['summary'], expected)
......
...@@ -27,9 +27,7 @@ def get_mock_enrollment_summary(): ...@@ -27,9 +27,7 @@ def get_mock_enrollment_summary():
return { return {
'date': datetime.date(year=2014, month=1, day=31), 'date': datetime.date(year=2014, month=1, day=31),
'current_enrollment': 30, 'current_enrollment': 30,
'enrollment_change_last_1_days': 1,
'enrollment_change_last_7_days': 7, 'enrollment_change_last_7_days': 7,
'enrollment_change_last_30_days': 30,
} }
......
...@@ -270,13 +270,7 @@ class EnrollmentActivityView(EnrollmentTemplateView): ...@@ -270,13 +270,7 @@ class EnrollmentActivityView(EnrollmentTemplateView):
'current_enrollment': _('Students enrolled in course.'), 'current_enrollment': _('Students enrolled in course.'),
# Translators: Please keep this time in UTC. Do not translate it into another timezone. # 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).'), '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_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).')
} }
presenter = CourseEnrollmentPresenter(self.course_id) presenter = CourseEnrollmentPresenter(self.course_id)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment