From 9475c6edacff878dbf3d56157dda6359b0d44312 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Tue, 5 Mar 2013 14:41:08 -0500 Subject: [PATCH] Address review comments --- common/lib/xmodule/xmodule/peer_grading_module.py | 2 -- lms/djangoapps/open_ended_grading/views.py | 7 ++++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/peer_grading_module.py b/common/lib/xmodule/xmodule/peer_grading_module.py index 067834a7a0..3eb18300c3 100644 --- a/common/lib/xmodule/xmodule/peer_grading_module.py +++ b/common/lib/xmodule/xmodule/peer_grading_module.py @@ -456,7 +456,6 @@ class PeerGradingModule(XModule): try: problem_list_json = self.peer_gs.get_problem_list(self.system.course_id, self.system.anonymous_student_id) problem_list_dict = problem_list_json - log.debug(problem_list_dict) success = problem_list_dict['success'] if 'error' in problem_list_dict: error_text = problem_list_dict['error'] @@ -593,7 +592,6 @@ class PeerGradingDescriptor(XmlDescriptor, EditingDescriptor): 'task_xml': dictionary of xml strings, } """ - log.debug("In definition") expected_children = [] for child in expected_children: if len(xml_object.xpath(child)) == 0: diff --git a/lms/djangoapps/open_ended_grading/views.py b/lms/djangoapps/open_ended_grading/views.py index beae034105..55e8088c3f 100644 --- a/lms/djangoapps/open_ended_grading/views.py +++ b/lms/djangoapps/open_ended_grading/views.py @@ -89,18 +89,23 @@ def peer_grading(request, course_id): Show a peer grading interface ''' + #Get the current course course = get_course_with_access(request.user, course_id, 'load') course_id_parts = course.id.split("/") false_dict = [False,"False", "false", "FALSE"] + #Reverse the base course url base_course_url = reverse('courses') try: #TODO: This will not work with multiple runs of a course. Make it work. The last key in the Location passed #to get_items is called revision. Is this the same as run? + #Get the peer grading modules currently in the course items = modulestore().get_items(['i4x', None, course_id_parts[1], 'peergrading', None]) + #See if any of the modules are centralized modules (ie display info from multiple problems) items = [i for i in items if i.metadata.get("use_for_single_location", True) in false_dict] + #Get the first one item_location = items[0].location - item_location_url = item_location.url() + #Generate a url for the first module and redirect the user to it problem_url_parts = search.path_to_location(modulestore(), course.id, item_location) problem_url = generate_problem_url(problem_url_parts, base_course_url)