Commit 27b85fb7 by Cliff Dyer

Merge pull request #10554 from edx/release

Verifying release branch for release-2015-11-09
parents 2ae8ee26 e042ee23
...@@ -17,7 +17,6 @@ require.config({ ...@@ -17,7 +17,6 @@ require.config({
paths: { paths: {
"domReady": "js/vendor/domReady", "domReady": "js/vendor/domReady",
"gettext": "/i18n", "gettext": "/i18n",
"json2": "js/vendor/json2",
"mustache": "js/vendor/mustache", "mustache": "js/vendor/mustache",
"codemirror": "js/vendor/codemirror-compressed", "codemirror": "js/vendor/codemirror-compressed",
"codemirror/stex": "js/vendor/CodeMirror/stex", "codemirror/stex": "js/vendor/CodeMirror/stex",
...@@ -96,9 +95,6 @@ require.config({ ...@@ -96,9 +95,6 @@ require.config({
] ]
}, },
shim: { shim: {
"json2": {
exports: "JSON"
},
"gettext": { "gettext": {
exports: "gettext" exports: "gettext"
}, },
......
...@@ -23,7 +23,6 @@ requirejs.config({ ...@@ -23,7 +23,6 @@ requirejs.config({
"jquery.simulate": "xmodule_js/common_static/js/vendor/jquery.simulate", "jquery.simulate": "xmodule_js/common_static/js/vendor/jquery.simulate",
"datepair": "xmodule_js/common_static/js/vendor/timepicker/datepair", "datepair": "xmodule_js/common_static/js/vendor/timepicker/datepair",
"date": "xmodule_js/common_static/js/vendor/date", "date": "xmodule_js/common_static/js/vendor/date",
"json2": "xmodule_js/common_static/js/vendor/json2",
"moment": "xmodule_js/common_static/js/vendor/moment.min", "moment": "xmodule_js/common_static/js/vendor/moment.min",
"moment-with-locales": "xmodule_js/common_static/js/vendor/moment-with-locales.min", "moment-with-locales": "xmodule_js/common_static/js/vendor/moment-with-locales.min",
"text": "xmodule_js/common_static/js/vendor/requirejs/text", "text": "xmodule_js/common_static/js/vendor/requirejs/text",
...@@ -59,9 +58,6 @@ requirejs.config({ ...@@ -59,9 +58,6 @@ requirejs.config({
"js/spec/test_utils": "js/spec/test_utils", "js/spec/test_utils": "js/spec/test_utils",
} }
shim: { shim: {
"json2": {
exports: "JSON"
},
"gettext": { "gettext": {
exports: "gettext" exports: "gettext"
}, },
......
...@@ -31,23 +31,6 @@ function(_, str, Backbone, BackboneRelational, gettext) { ...@@ -31,23 +31,6 @@ function(_, str, Backbone, BackboneRelational, gettext) {
return response; return response;
}, },
validate: function(attrs) {
var errors = null;
if(_.has(attrs, 'title')){
var title = attrs.title;
var lines = title.split(/\r\n|\r|\n/);
if (lines.length > 2) {
errors = _.extend({
'title': gettext('Signatory title should span over maximum of 2 lines.')
}, errors);
}
}
if (errors !== null){
return errors;
}
},
setOriginalAttributes: function() { setOriginalAttributes: function() {
// Remember the current state of this model (enables edit->cancel use cases) // Remember the current state of this model (enables edit->cancel use cases)
this._originalAttributes = this.parse(this.toJSON()); this._originalAttributes = this.parse(this.toJSON());
......
...@@ -244,24 +244,6 @@ function(_, Course, CertificatesCollection, CertificateModel, CertificateDetails ...@@ -244,24 +244,6 @@ function(_, Course, CertificatesCollection, CertificateModel, CertificateDetails
this.view.$(SELECTORS.signatory_organization_value) this.view.$(SELECTORS.signatory_organization_value)
).toContainText('New Signatory Test Organization'); ).toContainText('New Signatory Test Organization');
}); });
it('should not allow invalid data when saving changes made during in-line signatory editing', function() {
this.view.$(SELECTORS.edit_signatory).click();
setValuesToInputs(this.view, {
inputSignatoryName: 'New Signatory Test Name'
});
setValuesToInputs(this.view, {
inputSignatoryTitle: 'Signatory Title \non three \nlines'
});
setValuesToInputs(this.view, {
inputSignatoryOrganization: 'New Signatory Test Organization'
});
this.view.$(SELECTORS.signatory_panel_save).click();
expect(this.view.$(SELECTORS.inputSignatoryTitle).parent()).toHaveClass('error');
});
}); });
}); });
}); });
...@@ -246,7 +246,7 @@ function(_, Course, CertificateModel, SignatoryModel, CertificatesCollection, Ce ...@@ -246,7 +246,7 @@ function(_, Course, CertificateModel, SignatoryModel, CertificatesCollection, Ce
expect(this.view.$('.certificate-edit-error')).not.toHaveClass('is-shown'); expect(this.view.$('.certificate-edit-error')).not.toHaveClass('is-shown');
}); });
it('signatories should not save when title span on more than 2 lines', function() { it('signatories should save when title span on more than 2 lines', function() {
this.view.$(SELECTORS.addSignatoryButton).click(); this.view.$(SELECTORS.addSignatoryButton).click();
setValuesToInputs(this.view, { setValuesToInputs(this.view, {
inputCertificateName: 'New Certificate Name' inputCertificateName: 'New Certificate Name'
...@@ -265,7 +265,7 @@ function(_, Course, CertificateModel, SignatoryModel, CertificatesCollection, Ce ...@@ -265,7 +265,7 @@ function(_, Course, CertificateModel, SignatoryModel, CertificatesCollection, Ce
}); });
this.view.$(SELECTORS.saveCertificateButton).click(); this.view.$(SELECTORS.saveCertificateButton).click();
expect(this.view.$('.certificate-edit-error')).toHaveClass('is-shown'); expect(this.view.$('.certificate-edit-error')).not.toHaveClass('is-shown');
}); });
it('user can delete those signatories already saved', function() { it('user can delete those signatories already saved', function() {
......
define(["jquery", "jquery.ui", "underscore", "json2", "gettext", "draggabilly", define(["jquery", "jquery.ui", "underscore", "gettext", "draggabilly",
"js/utils/module", "common/js/components/views/feedback_notification"], "js/utils/module", "common/js/components/views/feedback_notification"],
function ($, ui, _, JSON, gettext, Draggabilly, ModuleUtils, NotificationView) { function ($, ui, _, gettext, Draggabilly, ModuleUtils, NotificationView) {
'use strict'; 'use strict';
var contentDragger = { var contentDragger = {
......
...@@ -59,7 +59,6 @@ lib_paths: ...@@ -59,7 +59,6 @@ lib_paths:
- xmodule_js/common_static/js/vendor/draggabilly.pkgd.js - xmodule_js/common_static/js/vendor/draggabilly.pkgd.js
- xmodule_js/common_static/js/vendor/date.js - xmodule_js/common_static/js/vendor/date.js
- xmodule_js/common_static/js/vendor/domReady.js - xmodule_js/common_static/js/vendor/domReady.js
- xmodule_js/common_static/js/vendor/json2.js
- xmodule_js/common_static/js/vendor/URI.min.js - xmodule_js/common_static/js/vendor/URI.min.js
- xmodule_js/common_static/js/vendor/jquery.smooth-scroll.min.js - xmodule_js/common_static/js/vendor/jquery.smooth-scroll.min.js
- xmodule_js/common_static/coffee/src/jquery.immediateDescendents.js - xmodule_js/common_static/coffee/src/jquery.immediateDescendents.js
......
...@@ -136,8 +136,12 @@ class CourseEnrollmentAdmin(admin.ModelAdmin): ...@@ -136,8 +136,12 @@ class CourseEnrollmentAdmin(admin.ModelAdmin):
""" Admin interface for the CourseEnrollment model. """ """ Admin interface for the CourseEnrollment model. """
list_display = ('id', 'course_id', 'mode', 'user', 'is_active',) list_display = ('id', 'course_id', 'mode', 'user', 'is_active',)
list_filter = ('mode', 'is_active',) list_filter = ('mode', 'is_active',)
raw_id_fields = ('user',)
search_fields = ('course_id', 'mode', 'user__username',) search_fields = ('course_id', 'mode', 'user__username',)
def queryset(self, request):
return super(CourseEnrollmentAdmin, self).queryset(request).select_related('user')
class Meta(object): class Meta(object):
model = CourseEnrollment model = CourseEnrollment
...@@ -145,6 +149,7 @@ class CourseEnrollmentAdmin(admin.ModelAdmin): ...@@ -145,6 +149,7 @@ class CourseEnrollmentAdmin(admin.ModelAdmin):
class UserProfileAdmin(admin.ModelAdmin): class UserProfileAdmin(admin.ModelAdmin):
""" Admin interface for UserProfile model. """ """ Admin interface for UserProfile model. """
list_display = ('user', 'name',) list_display = ('user', 'name',)
raw_id_fields = ('user',)
search_fields = ('user__username', 'user__first_name', 'user__last_name', 'user__email', 'name',) search_fields = ('user__username', 'user__first_name', 'user__last_name', 'user__email', 'name',)
def get_readonly_fields(self, request, obj=None): def get_readonly_fields(self, request, obj=None):
......
...@@ -538,19 +538,6 @@ describe 'Problem', -> ...@@ -538,19 +538,6 @@ describe 'Problem', ->
runs -> runs ->
expect(window.SR.readElts).toHaveBeenCalled() expect(window.SR.readElts).toHaveBeenCalled()
it 'disables check button while posting', ->
runs ->
spyOn($, 'postWithPrefix').andCallFake (url, answers, callback) -> callback(success: 'OK')
spyOn @problem, 'enableCheckButton'
@problem.save()
expect(@problem.enableCheckButton).toHaveBeenCalledWith false
waitsFor (->
return jQuery.active == 0
), "jQuery requests finished", 1000
runs ->
expect(@problem.enableCheckButton).toHaveBeenCalledWith true
describe 'refreshMath', -> describe 'refreshMath', ->
beforeEach -> beforeEach ->
@problem = new Problem($('.xblock-student_view')) @problem = new Problem($('.xblock-student_view'))
......
...@@ -412,13 +412,11 @@ class @Problem ...@@ -412,13 +412,11 @@ class @Problem
@save_internal() @save_internal()
save_internal: => save_internal: =>
@enableCheckButton false
Logger.log 'problem_save', @answers Logger.log 'problem_save', @answers
$.postWithPrefix "#{@url}/problem_save", @answers, (response) => $.postWithPrefix "#{@url}/problem_save", @answers, (response) =>
saveMessage = response.msg saveMessage = response.msg
@gentle_alert saveMessage @gentle_alert saveMessage
@updateProgress response @updateProgress response
@enableCheckButton true
refreshMath: (event, element) => refreshMath: (event, element) =>
element = event.target unless element element = event.target unless element
......
...@@ -1748,7 +1748,14 @@ return Unidragger; ...@@ -1748,7 +1748,14 @@ return Unidragger;
if ( typeof define == 'function' && define.amd ) { if ( typeof define == 'function' && define.amd ) {
// AMD // AMD
define( [ // Note: fixed by andy-armstrong to include a name for the definition
// so that this works when optimized using r.js. This is only an issue
// in Studio, as the LMS uses a namespaced version of RequireJS so
// this clause isn't reached.
// See http://requirejs.org/docs/errors.html#mismatch
define(
'draggabilly',
[
'classie/classie', 'classie/classie',
'get-style-property/get-style-property', 'get-style-property/get-style-property',
'get-size/get-size', 'get-size/get-size',
......
...@@ -204,7 +204,7 @@ def calculate_students_features_csv(entry_id, xmodule_instance_args): ...@@ -204,7 +204,7 @@ def calculate_students_features_csv(entry_id, xmodule_instance_args):
return run_main_task(entry_id, task_fn, action_name) return run_main_task(entry_id, task_fn, action_name)
@task(base=BaseInstructorTask, routing_key=settings.GRADES_DOWNLOAD_ROUTING_KEY) # pylint: disable=not-callable @task(base=BaseInstructorTask) # pylint: disable=not-callable
def enrollment_report_features_csv(entry_id, xmodule_instance_args): def enrollment_report_features_csv(entry_id, xmodule_instance_args):
""" """
Compute student profile information for a course and upload the Compute student profile information for a course and upload the
...@@ -216,7 +216,7 @@ def enrollment_report_features_csv(entry_id, xmodule_instance_args): ...@@ -216,7 +216,7 @@ def enrollment_report_features_csv(entry_id, xmodule_instance_args):
return run_main_task(entry_id, task_fn, action_name) return run_main_task(entry_id, task_fn, action_name)
@task(base=BaseInstructorTask, routing_key=settings.GRADES_DOWNLOAD_ROUTING_KEY) # pylint: disable=not-callable @task(base=BaseInstructorTask) # pylint: disable=not-callable
def exec_summary_report_csv(entry_id, xmodule_instance_args): def exec_summary_report_csv(entry_id, xmodule_instance_args):
""" """
Compute executive summary report for a course and upload the Compute executive summary report for a course and upload the
...@@ -228,7 +228,7 @@ def exec_summary_report_csv(entry_id, xmodule_instance_args): ...@@ -228,7 +228,7 @@ def exec_summary_report_csv(entry_id, xmodule_instance_args):
return run_main_task(entry_id, task_fn, action_name) return run_main_task(entry_id, task_fn, action_name)
@task(base=BaseInstructorTask, routing_key=settings.GRADES_DOWNLOAD_ROUTING_KEY) # pylint: disable=not-callable @task(base=BaseInstructorTask) # pylint: disable=not-callable
def course_survey_report_csv(entry_id, xmodule_instance_args): def course_survey_report_csv(entry_id, xmodule_instance_args):
""" """
Compute the survey report for a course and upload the Compute the survey report for a course and upload the
...@@ -240,7 +240,7 @@ def course_survey_report_csv(entry_id, xmodule_instance_args): ...@@ -240,7 +240,7 @@ def course_survey_report_csv(entry_id, xmodule_instance_args):
return run_main_task(entry_id, task_fn, action_name) return run_main_task(entry_id, task_fn, action_name)
@task(base=BaseInstructorTask, routing_key=settings.GRADES_DOWNLOAD_ROUTING_KEY) # pylint: disable=not-callable @task(base=BaseInstructorTask) # pylint: disable=not-callable
def proctored_exam_results_csv(entry_id, xmodule_instance_args): def proctored_exam_results_csv(entry_id, xmodule_instance_args):
""" """
Compute proctored exam results report for a course and upload the Compute proctored exam results report for a course and upload the
......
...@@ -1327,12 +1327,15 @@ def upload_course_survey_report(_xmodule_instance_args, _entry_id, course_id, _t ...@@ -1327,12 +1327,15 @@ def upload_course_survey_report(_xmodule_instance_args, _entry_id, course_id, _t
survey_fields.sort() survey_fields.sort()
user_survey_answers = OrderedDict() user_survey_answers = OrderedDict()
survey_answers_for_course = SurveyAnswer.objects.filter(course_key=course_id) survey_answers_for_course = SurveyAnswer.objects.filter(course_key=course_id).select_related('user')
for survey_field_record in survey_answers_for_course: for survey_field_record in survey_answers_for_course:
user_id = survey_field_record.user.id user_id = survey_field_record.user.id
if user_id not in user_survey_answers.keys(): if user_id not in user_survey_answers.keys():
user_survey_answers[user_id] = {} user_survey_answers[user_id] = {
'username': survey_field_record.user.username,
'email': survey_field_record.user.email
}
user_survey_answers[user_id][survey_field_record.field_name] = survey_field_record.field_value user_survey_answers[user_id][survey_field_record.field_name] = survey_field_record.field_value
...@@ -1343,9 +1346,8 @@ def upload_course_survey_report(_xmodule_instance_args, _entry_id, course_id, _t ...@@ -1343,9 +1346,8 @@ def upload_course_survey_report(_xmodule_instance_args, _entry_id, course_id, _t
for user_id in user_survey_answers.keys(): for user_id in user_survey_answers.keys():
row = [] row = []
row.append(user_id) row.append(user_id)
user_obj = User.objects.get(id=user_id) row.append(user_survey_answers[user_id].get('username', ''))
row.append(user_obj.username) row.append(user_survey_answers[user_id].get('email', ''))
row.append(user_obj.email)
for survey_field in survey_fields: for survey_field in survey_fields:
row.append(user_survey_answers[user_id].get(survey_field, '')) row.append(user_survey_answers[user_id].get(survey_field, ''))
csv_rows.append(row) csv_rows.append(row)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment