Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
chore: deprecate learner view
Browse files Browse the repository at this point in the history
  • Loading branch information
alangsto committed Jul 18, 2022
1 parent 0b31888 commit b83bcd5
Show file tree
Hide file tree
Showing 22 changed files with 3 additions and 878 deletions.
8 changes: 1 addition & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ runserver_a11y:
$(TOX)python manage.py runserver 0.0.0.0:9000 --noreload --traceback > dashboard.log 2>&1 &

accept: runserver_a11y
ifeq ("${DISPLAY_LEARNER_ANALYTICS}", "True")
$(TOX)python manage.py waffle_flag enable_learner_analytics --create --everyone
endif
ifeq ("${ENABLE_COURSE_LIST_FILTERS}", "True")
$(TOX)python manage.py waffle_switch enable_course_filters on --create
endif
Expand All @@ -102,9 +99,6 @@ accept_devstack:
# TODO: implement this

a11y:
ifeq ("${DISPLAY_LEARNER_ANALYTICS}", "True")
$(TOX)python manage.py waffle_flag enable_learner_analytics --create --everyone
endif
cat dashboard.log
$(TOX)pytest -v a11y_tests -k 'not NUM_PROCESSES==1'

Expand Down Expand Up @@ -202,7 +196,7 @@ upgrade: $(COMMON_CONSTRAINTS_TXT)

docs:
tox -e docs

install_transifex_client: ## Install the Transifex client
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
git checkout -- LICENSE README.md
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,6 @@ functionality on request (e.g. turning on beta functionality for superusers). Cr

$ ./manage.py waffle_flag name-of-my-flag --everyone --create

The following flags are available:

| Flag | Purpose |
|--------------------------------|-------------------------------------------------------|
| display_learner_analytics | Display Learner Analytics links |


Settings describe features which are not expected to be toggled on and off without significant system changes.

The following setting is available:
Expand Down
3 changes: 0 additions & 3 deletions acceptance_tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ def str2bool(s):
# Video preview
ENABLE_VIDEO_PREVIEW = str2bool(os.environ.get('ENABLE_VIDEO_PREVIEW', False))

# Learner analytics
DISPLAY_LEARNER_ANALYTICS = str2bool(os.environ.get('DISPLAY_LEARNER_ANALYTICS', False))

# Course listing
ENABLE_COURSE_LIST_FILTERS = str2bool(os.environ.get('ENABLE_COURSE_LIST_FILTERS', False))
ENABLE_COURSE_LIST_PASSING = str2bool(os.environ.get('ENABLE_COURSE_LIST_PASSING', False))
Expand Down
27 changes: 0 additions & 27 deletions acceptance_tests/test_course_learners.py

This file was deleted.

34 changes: 0 additions & 34 deletions analytics_dashboard/courses/templates/courses/learners.html

This file was deleted.

135 changes: 0 additions & 135 deletions analytics_dashboard/courses/tests/test_views/test_learners.py

This file was deleted.

6 changes: 0 additions & 6 deletions analytics_dashboard/courses/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
csv,
engagement,
enrollment,
learners,
performance,
)

Expand Down Expand Up @@ -120,18 +119,13 @@
url(r'problem_responses/', csv.PerformanceProblemResponseCSV.as_view(), name='performance_problem_responses')
], 'csv')

LEARNER_URLS = ([
url(r'^$', learners.LearnersView.as_view(), name='learners'),
], 'learners')

COURSE_URLS = [
# Course homepage. This should be the entry point for other applications linking to the course.
url(r'^$', views.CourseHome.as_view(), name='home'),
url(r'^enrollment/', include(ENROLLMENT_URLS)),
url(r'^engagement/', include(ENGAGEMENT_URLS)),
url(r'^performance/', include(PERFORMANCE_URLS)),
url(r'^csv/', include(CSV_URLS)),
url(r'^learners/', include(LEARNER_URLS)),
]

app_name = 'courses'
Expand Down
70 changes: 1 addition & 69 deletions analytics_dashboard/courses/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
from analytics_dashboard.courses.presenters.performance import CourseReportDownloadPresenter
from analytics_dashboard.courses.serializers import LazyEncoder
from analytics_dashboard.courses.utils import get_page_name, is_feature_enabled
from analytics_dashboard.courses.waffle import (
DISPLAY_LEARNER_ANALYTICS, age_available,
)
from analytics_dashboard.courses.waffle import age_available
from analytics_dashboard.help.views import ContextSensitiveHelpMixin

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -337,18 +335,6 @@ def get_primary_nav_items(self, request):
'lens': 'performance',
'report': 'graded',
'depth': ''
},
{
'name': 'learners',
'text': ugettext_noop('Learners'),
'view': 'courses:learners:learners',
'icon': 'fa-users',
'flag': 'display_learner_analytics',
'fragment': '#?ignore_segments=inactive',
'scope': 'course',
'lens': 'learners',
'report': 'roster',
'depth': ''
}

]
Expand Down Expand Up @@ -692,44 +678,6 @@ def get_table_items(self):
'items': subitems
})

if DISPLAY_LEARNER_ANALYTICS.is_enabled():
items.append({
'name': _('Learners'),
'icon': 'fa-users',
'heading': _('What are individual learners doing?'),
'items': [
{
'title': ugettext_noop("Who is engaged? Who isn't?"),
'view': 'courses:learners:learners',
'breadcrumbs': [_('All Learners')],
'fragment': '#?ignore_segments=inactive',
'scope': 'course',
'lens': 'learners',
'report': 'roster',
'depth': ''
},
# TODO: this is commented out until we complete the deep linking work, AN-6671
# {
# 'title': _('Who has been active recently?'),
# 'view': 'courses:learners:learners', # TODO: map this to the actual action in AN-6205
# # TODO: what would the breadcrumbs be?
# 'breadcrumbs': [_('Learners')]
# },
# {
# 'title': _('Who is most engaged in the discussions?'),
# 'view': 'courses:learners:learners', # TODO: map this to the actual action in AN-6205
# # TODO: what would the breadcrumbs be?
# 'breadcrumbs': [_('Learners')]
# },
# {
# 'title': _("Who hasn't watched videos recently?"),
# 'view': 'courses:learners:learners', # TODO: map this to the actual action in AN-6205
# # TODO: what would the breadcrumbs be?
# 'breadcrumbs': [_('Learners')]
# }
]
})

translate_dict_values(items, ('name',))
for item in items:
translate_dict_values(item['items'], ('title',))
Expand All @@ -745,22 +693,6 @@ def get_context_data(self, **kwargs):

context['page_data'] = self.get_page_data(context)

# Some orgs do not wish to allow access to learner analytics.
# See https://openedx.atlassian.net/browse/DENG-536
course_org = CourseKey.from_string(self.course_id).org
if course_org in settings.BLOCK_LEARNER_ANALYTICS_ORG_LIST:
user = self.request.user.get_username()
logger.info(
'Removing learner analytics from the %s course home page user %s',
self.course_id, user
)
context['primary_nav_items'] = [
item for item in context['primary_nav_items'] if item['name'] != 'learners'
]
context['table_items'] = [
item for item in context['table_items'] if item['name'] != _('Learners')
]

overview_data = []
if self.course_api_enabled:
if switch_is_active('display_course_name_in_nav'):
Expand Down
Loading

0 comments on commit b83bcd5

Please sign in to comment.