feat: notify the user if a sequence is hidden because of due date (#636)

Normally, these sequences are skipped. But if the user manually
goes to the section, they should be notified why they can't access
it. That can easily happen if they bookmarked the page or something.

AA-1000
This commit is contained in:
Michael Terry
2021-09-10 11:13:48 -04:00
committed by GitHub
parent 73302d72cb
commit 90d6ea8137
9 changed files with 119 additions and 0 deletions

View File

@@ -58,6 +58,7 @@ Factory.define('sequenceMetadata')
save_position: true,
prev_url: null,
is_time_limited: false,
is_hidden_after_due: false,
show_completion: true,
banner_text: null,
format: 'Homework',

View File

@@ -253,6 +253,7 @@ function normalizeSequenceMetadata(sequence) {
gatedContent: camelCaseObject(sequence.gated_content),
isTimeLimited: sequence.is_time_limited,
isProctored: sequence.is_proctored,
isHiddenAfterDue: sequence.is_hidden_after_due,
// Position comes back from the server 1-indexed. Adjust here.
activeUnitIndex: sequence.position ? sequence.position - 1 : 0,
saveUnitPosition: sequence.save_position,

View File

@@ -331,6 +331,7 @@ describe('Courseware Service', () => {
item_id: string('block-v1:edX+DemoX+Demo_Course+type@sequential+block@basic_questions'),
is_time_limited: boolean(false),
is_proctored: boolean(false),
is_hidden_after_due: boolean(false),
position: null,
tag: boolean('sequential'),
banner_text: null,
@@ -367,6 +368,7 @@ describe('Courseware Service', () => {
},
isTimeLimited: false,
isProctored: false,
isHiddenAfterDue: false,
activeUnitIndex: 0,
saveUnitPosition: false,
showCompletion: false,