From 507e621ccc01382ee0d150813ed4bb433c7468bd Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Wed, 18 Jan 2017 10:56:13 -0500 Subject: [PATCH] Revert "Merge pull request #14324 from edx/efischer/revertins" This reverts commit c7d2d601b86d0e3347015be23d10eb42964e909e, reversing changes made to fb2173f43e0fbf3fe0fcaef12667131cd52852a0. --- cms/djangoapps/contentstore/views/item.py | 1 + .../js/views/modals/course_outline_modals.js | 5 +- .../js/content-visibility-editor.underscore | 16 ++- cms/templates/js/course-outline.underscore | 7 +- common/lib/xmodule/xmodule/seq_module.py | 32 ++--- .../xmodule/xmodule/tests/test_sequence.py | 133 +++++++++--------- .../test/acceptance/pages/lms/courseware.py | 4 +- .../transformers/hidden_content.py | 14 +- lms/djangoapps/courseware/tests/test_views.py | 2 +- lms/templates/hidden_content.html | 49 ++++--- 10 files changed, 151 insertions(+), 112 deletions(-) diff --git a/cms/djangoapps/contentstore/views/item.py b/cms/djangoapps/contentstore/views/item.py index df448141fd..f1789eeff8 100644 --- a/cms/djangoapps/contentstore/views/item.py +++ b/cms/djangoapps/contentstore/views/item.py @@ -981,6 +981,7 @@ def create_xblock_info(xblock, data=None, metadata=None, include_ancestor_info=F "release_date": release_date, "visibility_state": visibility_state, "has_explicit_staff_lock": xblock.fields['visible_to_staff_only'].is_set_on(xblock), + "self_paced": is_self_paced(course), "start": xblock.fields['start'].to_json(xblock.start), "graded": xblock.graded, "due_date": get_default_time_display(xblock.due), diff --git a/cms/static/js/views/modals/course_outline_modals.js b/cms/static/js/views/modals/course_outline_modals.js index 281c4243d3..8bfe529220 100644 --- a/cms/static/js/views/modals/course_outline_modals.js +++ b/cms/static/js/views/modals/course_outline_modals.js @@ -712,7 +712,10 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview', return $.extend( {}, AbstractVisibilityEditor.prototype.getContext.call(this), - {hide_after_due: this.modelVisibility() === 'hide_after_due'} + { + hide_after_due: this.modelVisibility() === 'hide_after_due', + self_paced: this.model.get('self_paced') === true + } ); } }); diff --git a/cms/templates/js/content-visibility-editor.underscore b/cms/templates/js/content-visibility-editor.underscore index e80830ecd0..e66ae634c8 100644 --- a/cms/templates/js/content-visibility-editor.underscore +++ b/cms/templates/js/content-visibility-editor.underscore @@ -12,9 +12,19 @@
  • -

    <%- gettext('After the subsection\'s due date has passed, learners can no longer access its content. The subsection remains included in grade calculations.') %>

    +

    + <% if (self_paced) { %> + <%- gettext('After the course\'s end date has passed, learners can no longer access subsection content. The subsection remains included in grade calculations.') %> + <% } else { %> + <%- gettext('After the subsection\'s due date has passed, learners can no longer access its content. The subsection remains included in grade calculations.') %> + <% } %> +