Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove course outline question count and estimates by default for nutmeg release. #232

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions lms/djangoapps/course_home_api/outline/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Outline Tab Serializers.
"""

from django.conf import settings # lint-amnesty, pylint: disable=wrong-import-order
from django.utils.translation import ngettext
from rest_framework import serializers

Expand All @@ -28,7 +29,8 @@ def get_blocks(self, block): # pylint: disable=missing-function-docstring
num_graded_problems = block.get('num_graded_problems', 0)
scored = block.get('scored')

if num_graded_problems and block_type == 'sequential':
if (settings.FEATURES.get('ENABLE_COURSEWARE_OUTLINE_QUESTION_COUNT') and
num_graded_problems and block_type == 'sequential'):
questions = ngettext('({number} Question)', '({number} Questions)', num_graded_problems)
display_name += ' ' + questions.format(number=num_graded_problems)

Expand All @@ -39,6 +41,12 @@ def get_blocks(self, block): # pylint: disable=missing-function-docstring
description = block['special_exam_info'].get('short_description')
icon = block['special_exam_info'].get('suggested_icon', 'fa-pencil-square-o')

effort_activities = None
effort_time = None
if settings.FEATURES.get('ENABLE_COURSEWARE_OUTLINE_EFFORT_ESTIMATES'):
effort_activities = block.get('effort_activities')
effort_time = block.get('effort_time')

serialized = {
block_key: {
'badge_progress': block.get('badge_progress', False),
Expand All @@ -47,8 +55,8 @@ def get_blocks(self, block): # pylint: disable=missing-function-docstring
'description': description,
'display_name': display_name,
'due': block.get('due'),
'effort_activities': block.get('effort_activities'),
'effort_time': block.get('effort_time'),
'effort_activities': effort_activities,
'effort_time': effort_time,
'icon': icon,
'id': block_key,
'lms_web_url': block['lms_web_url'] if enable_links else None,
Expand Down
2 changes: 2 additions & 0 deletions lms/djangoapps/course_home_api/outline/tests/test_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ def test_proctored_exam(self, mock_summary):
assert exam_data['due'] is not None
assert exam_data['icon'] == 'fa-foo-bar'

@patch.dict('django.conf.settings.FEATURES', {'ENABLE_COURSEWARE_OUTLINE_QUESTION_COUNT': True})
@patch.dict('django.conf.settings.FEATURES', {'ENABLE_COURSEWARE_OUTLINE_EFFORT_ESTIMATES': True})
def test_assignment(self):
course = CourseFactory.create()
with self.store.bulk_operations(course.id):
Expand Down
6 changes: 6 additions & 0 deletions lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,12 @@
# .. toggle_tickets: https://openedx.atlassian.net/browse/OSPR-1320
'ENABLE_COMBINED_LOGIN_REGISTRATION_FOOTER': False,

# Enable courseware outline question count
'ENABLE_COURSEWARE_OUTLINE_QUESTION_COUNT': False,

# Enable courseware outline effort estimates
'ENABLE_COURSEWARE_OUTLINE_EFFORT_ESTIMATES': False,

# Enable organizational email opt-in
'ENABLE_MKTG_EMAIL_OPT_IN': False,

Expand Down
Loading