Commit 1c1034c6 by Diana Huang

Pass location as a parameter, not as a part of the url

parent 962d83d7
...@@ -71,6 +71,7 @@ def peer_grading(request, course_id): ...@@ -71,6 +71,7 @@ def peer_grading(request, course_id):
# call problem list service # call problem list service
success = False success = False
error_text = "" error_text = ""
problem_list = []
try: try:
problem_list_text = peer_gs.get_problem_list(course_id, request.user.id) problem_list_text = peer_gs.get_problem_list(course_id, request.user.id)
problem_list_json = json.loads(problem_list_text) problem_list_json = json.loads(problem_list_text)
...@@ -83,6 +84,9 @@ def peer_grading(request, course_id): ...@@ -83,6 +84,9 @@ def peer_grading(request, course_id):
except GradingServiceError: except GradingServiceError:
error_text = "Error occured while contacting the grading service" error_text = "Error occured while contacting the grading service"
success = False success = False
except ValueError:
error_text = "Could not get problem list"
success = False
ajax_url = reverse('peer_grading', kwargs={'course_id': course_id}) ajax_url = reverse('peer_grading', kwargs={'course_id': course_id})
if not ajax_url.endswith('/'): if not ajax_url.endswith('/'):
...@@ -100,11 +104,12 @@ def peer_grading(request, course_id): ...@@ -100,11 +104,12 @@ def peer_grading(request, course_id):
'staff_access': False, }) 'staff_access': False, })
def peer_grading_problem(request, course_id, problem_location): def peer_grading_problem(request, course_id):
''' '''
Show individual problem interface Show individual problem interface
''' '''
course = get_course_with_access(request.user, course_id, 'load') course = get_course_with_access(request.user, course_id, 'load')
problem_location = request.GET.get("location")
ajax_url = reverse('peer_grading', kwargs={'course_id': course_id}) ajax_url = reverse('peer_grading', kwargs={'course_id': course_id})
if not ajax_url.endswith('/'): if not ajax_url.endswith('/'):
......
...@@ -255,7 +255,7 @@ if settings.COURSEWARE_ENABLED: ...@@ -255,7 +255,7 @@ if settings.COURSEWARE_ENABLED:
# Peer Grading # Peer Grading
url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/peer_grading$', url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/peer_grading$',
'open_ended_grading.views.peer_grading', name='peer_grading'), 'open_ended_grading.views.peer_grading', name='peer_grading'),
url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/peer_grading/problem/(?P<problem_location>.*)$', url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/peer_grading/problem$',
'open_ended_grading.views.peer_grading_problem', name='peer_grading_problem'), 'open_ended_grading.views.peer_grading_problem', name='peer_grading_problem'),
url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/peer_grading/get_next_submission$', url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/peer_grading/get_next_submission$',
'open_ended_grading.peer_grading_service.get_next_submission', name='peer_grading_get_next_submission'), 'open_ended_grading.peer_grading_service.get_next_submission', name='peer_grading_get_next_submission'),
......
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