add role and expose reason field to Instructor Dashboard Manual Enrollment

WL-1473
This commit is contained in:
Ibrahim
2018-03-06 16:35:42 +05:00
parent 4e82734cc2
commit 2bb790680a
10 changed files with 144 additions and 58 deletions

View File

@@ -593,8 +593,8 @@ such that the value can be defined later than this assignment (file load order).
var batchEnroll = this;
this.$container = $container;
this.$identifier_input = this.$container.find("textarea[name='student-ids']");
this.$role = this.$container.find("select[name='role']");
this.$enrollment_button = this.$container.find('.enrollment-button');
this.$is_course_white_label = this.$container.find('#is_course_white_label').val();
this.$reason_field = this.$container.find("textarea[name='reason-field']");
this.$checkbox_autoenroll = this.$container.find("input[name='auto-enroll']");
this.$checkbox_emailstudents = this.$container.find("input[name='email-students']");
@@ -603,16 +603,20 @@ such that the value can be defined later than this assignment (file load order).
this.$request_response_error = this.$container.find('.request-response-error');
this.$enrollment_button.click(function(event) {
var sendData;
if (batchEnroll.$is_course_white_label === 'True') {
if (!batchEnroll.$reason_field.val()) {
batchEnroll.fail_with_error(gettext('Reason field should not be left blank.'));
return false;
}
if (!batchEnroll.$reason_field.val()) {
batchEnroll.fail_with_error(gettext('Reason field should not be left blank.'));
return false;
}
if (!batchEnroll.$role.val()) {
batchEnroll.fail_with_error(gettext('Role field should not be left unselected.'));
return false;
}
emailStudents = batchEnroll.$checkbox_emailstudents.is(':checked');
sendData = {
action: $(event.target).data('action'),
identifiers: batchEnroll.$identifier_input.val(),
role: batchEnroll.$role.val(),
auto_enroll: batchEnroll.$checkbox_autoenroll.is(':checked'),
email_students: emailStudents,
reason: batchEnroll.$reason_field.val()