From f7558c40e89994e99cd0980ef6ce83ca6fbf8ea0 Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Tue, 20 May 2014 11:44:51 -0400 Subject: [PATCH 1/2] Fixes ../courseware/Peer_Grading_Panel/peergrading:L12P5_grading/ reported bug --- common/lib/xmodule/xmodule/peer_grading_module.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/peer_grading_module.py b/common/lib/xmodule/xmodule/peer_grading_module.py index c9fe618b10..cfe8667213 100644 --- a/common/lib/xmodule/xmodule/peer_grading_module.py +++ b/common/lib/xmodule/xmodule/peer_grading_module.py @@ -191,7 +191,8 @@ class PeerGradingModule(PeerGradingFields, XModule): if not self.use_for_single_location_local: return self.peer_grading() else: - return self.peer_grading_problem({'location': self.link_to_location})['html'] + # b/c handle_ajax expects serialized data payload and directly calls peer_grading + return self.peer_grading_problem({'location': self.link_to_location.to_deprecated_string()})['html'] def handle_ajax(self, dispatch, data): """ From 08aaa97bfbdfbd98acfd19b56dab4cf05199b621 Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Tue, 20 May 2014 11:58:03 -0400 Subject: [PATCH 2/2] Serialize course_key at last possible code junction --- lms/djangoapps/open_ended_grading/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lms/djangoapps/open_ended_grading/views.py b/lms/djangoapps/open_ended_grading/views.py index 508c07eac5..26c6bbe021 100644 --- a/lms/djangoapps/open_ended_grading/views.py +++ b/lms/djangoapps/open_ended_grading/views.py @@ -35,14 +35,14 @@ def _reverse_with_slash(url_name, course_key): @param course_id: The id of the course object (eg course.id). @returns: The reversed url with a trailing slash. """ - course_id = course_key.to_deprecated_string() - ajax_url = _reverse_without_slash(url_name, course_id) + ajax_url = _reverse_without_slash(url_name, course_key) if not ajax_url.endswith('/'): ajax_url += '/' return ajax_url -def _reverse_without_slash(url_name, course_id): +def _reverse_without_slash(url_name, course_key): + course_id = course_key.to_deprecated_string() ajax_url = reverse(url_name, kwargs={'course_id': course_id}) return ajax_url