Allow setting self-paced on schedule & details page.

Currently unstyled.

ECOM-2462
This commit is contained in:
Peter Fogg
2015-10-08 13:39:59 -04:00
parent 0107525d41
commit 7f673604fb
5 changed files with 94 additions and 5 deletions

View File

@@ -135,6 +135,11 @@ class CourseDetailsTestCase(CourseTestCase):
jsondetails.self_paced
)
@override_settings(FEATURES=dict(settings.FEATURES, ENABLE_SELF_PACED_COURSES=False))
def test_enable_self_paced(self):
details = CourseDetails.fetch(self.course.id)
self.assertNotIn('self_paced', details.__dict__)
@override_settings(MKTG_URLS={'ROOT': 'dummy-root'})
def test_marketing_site_fetch(self):
settings_details_url = get_url(self.course.id)

View File

@@ -99,6 +99,13 @@ var DetailsView = ValidatingView.extend({
}
this.$('#' + this.fieldToSelectorMap['entrance_exam_minimum_score_pct']).val(this.model.get('entrance_exam_minimum_score_pct'));
if (this.model.get('self_paced')) {
this.$('#course-pace-self-paced').attr('checked', true);
}
else {
this.$('#course-pace-instructor-led').attr('checked', true);
}
this.licenseView.render()
return this;
@@ -236,6 +243,11 @@ var DetailsView = ValidatingView.extend({
}
}, this), 1000);
break;
case 'course-pace-self-paced':
// Fallthrough to handle both radio buttons
case 'course-pace-instructor-led':
this.model.set('self_paced', JSON.parse(event.currentTarget.value));
break;
default: // Everything else is handled by datepickers and CodeMirror.
break;
}

View File

@@ -412,6 +412,24 @@ CMS.URL.UPLOAD_ASSET = '${upload_asset_url}';
</section>
% endif
% if settings.FEATURES.get("ENABLE_SELF_PACED_COURSES", False):
<hr class="divide" />
<section class="group-settings pacing">
<header>
<h2 class="title-2">${_("Course Pacing")}</h2>
<span class="tip">${_("Set the pacing for this course")}</span>
</header>
<input type="radio" name="self-paced" id="course-pace-self-paced" value="true"/>
<label for="course-pace-self-paced">Self-Paced</label>
<input type="radio" name="self-paced" id="course-pace-instructor-led" value="false"/>
<label for="course-pace-instructor-led">Instructor Led</label>
</section>
% endif
% if settings.FEATURES.get("LICENSING", False):
<hr class="divide" />