From b98c89117c6d040646a173608a63ad54e83d6cd9 Mon Sep 17 00:00:00 2001 From: Peter Fogg Date: Wed, 4 Nov 2015 09:39:28 -0500 Subject: [PATCH] Course pacing template changes. Instructor-led is changed to instructor-paced. Adds a label to the course outline page to show the course pacing. ECOM-2794 ECOM-2800 --- cms/static/js/views/settings/main.js | 10 +++---- cms/static/sass/views/_outline.scss | 26 +++++++++++-------- cms/static/sass/views/_settings.scss | 2 +- cms/templates/course_outline.html | 11 ++++++++ cms/templates/settings.html | 6 ++--- .../test/acceptance/pages/studio/settings.py | 2 +- .../studio/test_studio_settings_details.py | 6 ++--- .../courseware/tests/test_course_info.py | 6 ++--- .../tests/test_self_paced_overrides.py | 6 ++--- lms/djangoapps/courseware/tests/test_views.py | 2 +- 10 files changed, 46 insertions(+), 31 deletions(-) diff --git a/cms/static/js/views/settings/main.js b/cms/static/js/views/settings/main.js index f730afaaa5..82703ac734 100644 --- a/cms/static/js/views/settings/main.js +++ b/cms/static/js/views/settings/main.js @@ -101,17 +101,17 @@ var DetailsView = ValidatingView.extend({ this.$('#' + this.fieldToSelectorMap['entrance_exam_minimum_score_pct']).val(this.model.get('entrance_exam_minimum_score_pct')); var selfPacedButton = this.$('#course-pace-self-paced'), - instructorLedButton = this.$('#course-pace-instructor-led'), + instructorPacedButton = this.$('#course-pace-instructor-paced'), paceToggleTip = this.$('#course-pace-toggle-tip'); - (this.model.get('self_paced') ? selfPacedButton : instructorLedButton).attr('checked', true); + (this.model.get('self_paced') ? selfPacedButton : instructorPacedButton).attr('checked', true); if (this.model.canTogglePace()) { selfPacedButton.removeAttr('disabled'); - instructorLedButton.removeAttr('disabled'); + instructorPacedButton.removeAttr('disabled'); paceToggleTip.text(''); } else { selfPacedButton.attr('disabled', true); - instructorLedButton.attr('disabled', true); + instructorPacedButton.attr('disabled', true); paceToggleTip.text(gettext('Course pacing cannot be changed once a course has started.')); } @@ -254,7 +254,7 @@ var DetailsView = ValidatingView.extend({ break; case 'course-pace-self-paced': // Fallthrough to handle both radio buttons - case 'course-pace-instructor-led': + case 'course-pace-instructor-paced': this.model.set('self_paced', JSON.parse(event.currentTarget.value)); break; default: // Everything else is handled by datepickers and CodeMirror. diff --git a/cms/static/sass/views/_outline.scss b/cms/static/sass/views/_outline.scss index 1b45ed2493..92e7240227 100644 --- a/cms/static/sass/views/_outline.scss +++ b/cms/static/sass/views/_outline.scss @@ -178,25 +178,37 @@ .course-status { margin-bottom: $baseline; - .status-release { + .status-release, + .status-pacing { @extend %t-copy-base; display: inline-block; color: $color-copy-base; + + // STATE: hover + &:hover { + .status-actions { + opacity: 1.0; + } + } } .status-release-label, .status-release-value, + .status-pacing-label, + .status-pacing-value, .status-actions { display: inline-block; vertical-align: middle; margin-bottom: 0; } - .status-release-label { + .status-release-label, + .status-pacing-label { margin-right: ($baseline/4); } - .status-release-value { + .status-release-value, + .status-pacing-value { @extend %t-strong; } @@ -206,14 +218,6 @@ margin-left: ($baseline/4); opacity: 0.0; } - - // STATE: hover - &:hover { - - .status-actions { - opacity: 1.0; - } - } } // outline diff --git a/cms/static/sass/views/_settings.scss b/cms/static/sass/views/_settings.scss index bd808b98a0..f753a42d20 100644 --- a/cms/static/sass/views/_settings.scss +++ b/cms/static/sass/views/_settings.scss @@ -1044,7 +1044,7 @@ .group-settings.pacing { .list-input { margin-top: $baseline/2; - background-color: $gray-l4; + background-color: $gray-l6; border-radius: 3px; padding: ($baseline/2); } diff --git a/cms/templates/course_outline.html b/cms/templates/course_outline.html index 839689d6ef..b863023782 100644 --- a/cms/templates/course_outline.html +++ b/cms/templates/course_outline.html @@ -7,6 +7,7 @@ from util.date_utils import get_default_time_display from django.utils.translation import ugettext as _ from contentstore.utils import reverse_usage_url from microsite_configuration import microsite +from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration %> <%block name="title">${_("Course Outline")} <%block name="bodyclass">is-signedin course view-outline @@ -161,6 +162,16 @@ from microsite_configuration import microsite + % if SelfPacedConfiguration.current().enabled: +
+

${_("Course Pacing:")}

+ % if context_course.self_paced: +

${_("Self-Paced")}

+ % else: +

${_("Instructor-Paced")}

+ % endif +
+ % endif
diff --git a/cms/templates/settings.html b/cms/templates/settings.html index b9456eb036..be7406bfd8 100644 --- a/cms/templates/settings.html +++ b/cms/templates/settings.html @@ -425,9 +425,9 @@ CMS.URL.UPLOAD_ASSET = '${upload_asset_url}';
  1. - - - ${_("Instructor-led courses progress at the pace that the course author sets. You can configure release dates for course content and due dates for assignments.")} + + + ${_("Instructor-paced courses progress at the pace that the course author sets. You can configure release dates for course content and due dates for assignments.")}
  2. diff --git a/common/test/acceptance/pages/studio/settings.py b/common/test/acceptance/pages/studio/settings.py index 288a089c56..2adfb161ca 100644 --- a/common/test/acceptance/pages/studio/settings.py +++ b/common/test/acceptance/pages/studio/settings.py @@ -151,7 +151,7 @@ class SettingsPage(CoursePage): @course_pacing.setter def course_pacing(self, pacing): """ - Sets the course to either self-paced or instructor-led by checking + Sets the course to either self-paced or instructor-paced by checking the appropriate radio button. """ self.wait_for_element_presence(self.checked_pacing_css, 'course pacing controls present') diff --git a/common/test/acceptance/tests/studio/test_studio_settings_details.py b/common/test/acceptance/tests/studio/test_studio_settings_details.py index 72a9793543..7c361b7230 100644 --- a/common/test/acceptance/tests/studio/test_studio_settings_details.py +++ b/common/test/acceptance/tests/studio/test_studio_settings_details.py @@ -209,11 +209,11 @@ class CoursePacingTest(StudioSettingsDetailsTest): # Set the course start date to tomorrow in order to allow setting pacing self.course_fixture.add_course_details({'start_date': datetime.now() + timedelta(days=1)}) - def test_default_instructor_led(self): + def test_default_instructor_paced(self): """ - Test that the 'instructor led' button is checked by default. + Test that the 'instructor paced' button is checked by default. """ - self.assertEqual(self.settings_detail.course_pacing, 'Instructor-Led') + self.assertEqual(self.settings_detail.course_pacing, 'Instructor-Paced') def test_self_paced(self): """ diff --git a/lms/djangoapps/courseware/tests/test_course_info.py b/lms/djangoapps/courseware/tests/test_course_info.py index 3d1f18b3de..9feb521a23 100644 --- a/lms/djangoapps/courseware/tests/test_course_info.py +++ b/lms/djangoapps/courseware/tests/test_course_info.py @@ -126,7 +126,7 @@ class SelfPacedCourseInfoTestCase(LoginEnrollmentTestCase, SharedModuleStoreTest def setUp(self): super(SelfPacedCourseInfoTestCase, self).setUp() - self.instructor_led_course = CourseFactory.create(self_paced=False) + self.instructor_paced_course = CourseFactory.create(self_paced=False) self.self_paced_course = CourseFactory.create(self_paced=True) self.setup_user() @@ -141,8 +141,8 @@ class SelfPacedCourseInfoTestCase(LoginEnrollmentTestCase, SharedModuleStoreTest resp = self.client.get(url) self.assertEqual(resp.status_code, 200) - def test_num_queries_instructor_led(self): - self.fetch_course_info_with_queries(self.instructor_led_course, 14, 4) + def test_num_queries_instructor_paced(self): + self.fetch_course_info_with_queries(self.instructor_paced_course, 14, 4) def test_num_queries_self_paced(self): self.fetch_course_info_with_queries(self.self_paced_course, 14, 4) diff --git a/lms/djangoapps/courseware/tests/test_self_paced_overrides.py b/lms/djangoapps/courseware/tests/test_self_paced_overrides.py index 7142927e1e..26a49cf07e 100644 --- a/lms/djangoapps/courseware/tests/test_self_paced_overrides.py +++ b/lms/djangoapps/courseware/tests/test_self_paced_overrides.py @@ -42,9 +42,9 @@ class SelfPacedDateOverrideTest(ModuleStoreTestCase): inject_field_overrides((course, section), course, UserFactory.create()) return (course, section) - def test_instructor_led(self): - __, il_section = self.setup_course("Instructor Led Course", False) - self.assertEqual(self.due_date, il_section.due) + def test_instructor_paced(self): + __, ip_section = self.setup_course("Instructor Paced Course", False) + self.assertEqual(self.due_date, ip_section.due) def test_self_paced(self): __, sp_section = self.setup_course("Self-Paced Course", True) diff --git a/lms/djangoapps/courseware/tests/test_views.py b/lms/djangoapps/courseware/tests/test_views.py index 7bd8acc4c6..e32d3078a4 100644 --- a/lms/djangoapps/courseware/tests/test_views.py +++ b/lms/djangoapps/courseware/tests/test_views.py @@ -822,7 +822,7 @@ class ProgressPageTests(ModuleStoreTestCase): ) @ddt.unpack def test_query_counts(self, (sql_calls, mongo_calls, self_paced), self_paced_enabled): - """Test that query counts remain the same for self-paced and instructor-led courses.""" + """Test that query counts remain the same for self-paced and instructor-paced courses.""" SelfPacedConfiguration(enabled=self_paced_enabled).save() self.setup_course(self_paced=self_paced) with self.assertNumQueries(sql_calls), check_mongo_calls(mongo_calls):