Show graded icons in more places

In the course outline, if a subsection has any graded content,
show a graded icon (the pencil icon).

Also, show the graded icon for LTI xmodule units (xblocks is a
different repo, but will get same treatment).

AA-75
This commit is contained in:
Michael Terry
2020-04-21 12:43:53 -04:00
parent a9efd30c4c
commit 0f81765ac7
4 changed files with 10 additions and 5 deletions

View File

@@ -79,7 +79,7 @@ reset_deadlines_banner_displayed = False
class="subsection-text outline-button"
id="${ subsection['id'] }"
>
% if num_graded_problems and not (subsection.get('format') or 'special_exam_info' in subsection):
% if graded and scored and 'special_exam_info' not in subsection:
<span class="icon fa fa-pencil-square-o" aria-hidden="true"></span>
% endif
<h4 class="subsection-title">

View File

@@ -149,8 +149,10 @@ def get_course_outline_block_tree(request, course_id, user=None):
"""
is_scored = block.get('has_score') and block.get('weight', 1) > 0
is_graded = block.get('graded')
is_countable = block.get('type') not in ('lti', 'lti_consumer')
is_graded_problem = is_scored and is_graded and is_countable
num_graded_problems = 1 if is_scored and is_graded else 0
num_graded_problems = 1 if is_graded_problem else 0
num_graded_problems += sum(recurse_num_graded_problems(child) for child in block.get('children', []))
block['num_graded_problems'] = num_graded_problems
@@ -186,7 +188,9 @@ def get_course_outline_block_tree(request, course_id, user=None):
'discussion',
'drag-and-drop-v2',
'poll',
'word_cloud'
'word_cloud',
'lti',
'lti_consumer',
]
all_blocks = get_blocks(
request,