Skip to content

Commit

Permalink
Merge pull request #231 from CUCWD/feature.nutmeg/jrsteel/outline-add…
Browse files Browse the repository at this point in the history
…-subsection-links

Adding vertical pages to the course outline API call and moving the n questions to the vertical layer
  • Loading branch information
becdavid authored Jun 20, 2024
2 parents a5fcf14 + 01350a8 commit e2f63be
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/migrations-check-mysql8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
pip uninstall -y mysqlclient
pip install --no-binary mysqlclient mysqlclient
pip uninstall -y xmlsec
pip install --no-binary xmlsec xmlsec
pip install --no-binary xmlsec xmlsec==1.3.13
- name: Initiate Services
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/migrations-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
pip uninstall -y mysqlclient
pip install --no-binary mysqlclient mysqlclient
pip uninstall -y xmlsec
pip install --no-binary xmlsec xmlsec
pip install --no-binary xmlsec xmlsec==1.3.13
- name: Initiate Services
run: |
Expand Down
4 changes: 2 additions & 2 deletions lms/djangoapps/course_home_api/outline/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CourseBlockSerializer(serializers.Serializer):
def get_blocks(self, block): # pylint: disable=missing-function-docstring
block_key = block['id']
block_type = block['type']
children = block.get('children', []) if block_type != 'sequential' else [] # Don't descend past sequential
children = block.get('children', []) if block_type != 'vertical' else [] # Don't descend past vertical
description = block.get('format')
display_name = block['display_name']
enable_links = self.context.get('enable_links')
Expand All @@ -30,7 +30,7 @@ def get_blocks(self, block): # pylint: disable=missing-function-docstring
scored = block.get('scored')

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

Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/course_home_api/outline/tests/test_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def test_assignment(self):
assert response.status_code == 200

exam_data = response.data['course_blocks']['blocks'][str(sequential.location)]
assert exam_data['display_name'] == 'Test (2 Questions)'
assert exam_data['display_name'] == 'Test'
assert exam_data['icon'] == 'fa-pencil-square-o'

ungraded_data = response.data['course_blocks']['blocks'][str(sequential2.location)]
Expand Down

0 comments on commit e2f63be

Please sign in to comment.