Skip to content

Commit

Permalink
Merge pull request #281 from uw-it-aca/task/export-fixes
Browse files Browse the repository at this point in the history
correct adoption_rate to not count xlist_ind_study_courses twice
  • Loading branch information
jlaney authored Jan 8, 2025
2 parents bbe66d2 + 61adcd2 commit f3336a7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion data_aggregator/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ def adoption_rate(self):
try:
rate = round(
((active_courses - active_ind_study_courses) /
(courses - xlist_courses - ind_study_courses -
(courses - xlist_courses - ind_study_courses +
xlist_ind_study_courses)) * 100, ndigits=1)
except ZeroDivisionError:
rate = 0.0
Expand Down
4 changes: 2 additions & 2 deletions data_aggregator/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,13 +845,13 @@ def test_get_subaccount_activity(self):
subaccount = report.subaccounts[0]
self.assertEqual(subaccount.term_id, term)
self.assertEqual(subaccount.subaccount_id, "uwcourse:tacoma")
self.assertEqual(subaccount.adoption_rate(), 30.1)
self.assertEqual(subaccount.adoption_rate(), 30.0)

subaccount = report.subaccounts[1]
self.assertEqual(subaccount.term_id, term)
self.assertEqual(
subaccount.subaccount_id, "uwcourse:tacoma:test-college")
self.assertEqual(subaccount.adoption_rate(), 96.2)
self.assertEqual(subaccount.adoption_rate(), 95.2)

subaccount = report.subaccounts[2]
self.assertEqual(subaccount.term_id, term)
Expand Down
4 changes: 2 additions & 2 deletions data_aggregator/tests/test_report_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,11 @@ def test_generate_report_csv(self):
"conferences_views,discussions_views,files_views,general_views,"
"grades_views,groups_views,modules_views,other_views,pages_views,"
"quizzes_views\n"
"2013-spring,10,uwcourse:tacoma,Tacoma,Tacoma,,,30.1,595,151,91,"
"2013-spring,10,uwcourse:tacoma,Tacoma,Tacoma,,,30.0,595,151,91,"
"3,12,1,1154,1121,11678,11528,1112,11631,113,118,1165,11786,11453,"
"11678,112,1123,11456,11776,11900,114,1141,1133,1177,1176,1198\n"
"2013-spring,10,uwcourse:tacoma:test-college,College of Test,"
"Tacoma,Test College,,96.2,268,202,51,2,8,1,154,121,1678,1528,"
"Tacoma,Test College,,95.2,268,202,51,2,8,1,154,121,1678,1528,"
"112,1631,13,18,165,1786,1453,1678,12,123,1456,1776,1900,14,141,"
"133,177,176,198\n"
"2013-spring,10,uwcourse:tacoma:test-college:test-department,"
Expand Down

0 comments on commit f3336a7

Please sign in to comment.