Conditionally display gated content in courseware

Display gated sections in course outline, navigation and in the course
when user has met prerequiste condition.

WL-1273, WL-1317
This commit is contained in:
Bill Filler
2017-09-05 10:47:56 -04:00
parent 2a38e25601
commit 4fe5f3457d
28 changed files with 753 additions and 104 deletions

View File

@@ -56,10 +56,14 @@ def get_blocks(
requested_fields = []
include_completion = 'completion' in requested_fields
include_special_exams = 'special_exam_info' in requested_fields
include_gated_sections = 'show_gated_sections' in requested_fields
if user is not None:
transformers += COURSE_BLOCK_ACCESS_TRANSFORMERS
transformers += [MilestonesAndSpecialExamsTransformer(include_special_exams), HiddenContentTransformer()]
transformers += [MilestonesAndSpecialExamsTransformer(
include_special_exams=include_special_exams,
include_gated_sections=include_gated_sections)]
transformers += [HiddenContentTransformer()]
transformers += [
BlocksAPITransformer(
block_counts,