Commit 3a29d260 by Diana Huang

Merge branch 'diana/peer-grading-views' into diana/peer-grading-improvements

parents 393ee353 19bc6574
...@@ -16,6 +16,7 @@ from django.http import HttpResponse, Http404 ...@@ -16,6 +16,7 @@ from django.http import HttpResponse, Http404
from courseware.access import has_access from courseware.access import has_access
from util.json_request import expect_json from util.json_request import expect_json
from xmodule.course_module import CourseDescriptor from xmodule.course_module import CourseDescriptor
from student.models import unique_id_for_user
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
...@@ -206,11 +207,11 @@ def get_next(request, course_id): ...@@ -206,11 +207,11 @@ def get_next(request, course_id):
if len(missing) > 0: if len(missing) > 0:
return _err_response('Missing required keys {0}'.format( return _err_response('Missing required keys {0}'.format(
', '.join(missing))) ', '.join(missing)))
grader_id = request.user.id grader_id = unique_id_for_user(request.user)
p = request.POST p = request.POST
location = p['location'] location = p['location']
return HttpResponse(_get_next(course_id, request.user.id, location), return HttpResponse(_get_next(course_id, grader_id, location),
mimetype="application/json") mimetype="application/json")
...@@ -238,7 +239,7 @@ def get_problem_list(request, course_id): ...@@ -238,7 +239,7 @@ def get_problem_list(request, course_id):
""" """
_check_access(request.user, course_id) _check_access(request.user, course_id)
try: try:
response = staff_grading_service().get_problem_list(course_id, request.user.id) response = staff_grading_service().get_problem_list(course_id, unique_id_for_user(request.user))
return HttpResponse(response, return HttpResponse(response,
mimetype="application/json") mimetype="application/json")
except GradingServiceError: except GradingServiceError:
...@@ -287,7 +288,7 @@ def save_grade(request, course_id): ...@@ -287,7 +288,7 @@ def save_grade(request, course_id):
return _err_response('Missing required keys {0}'.format( return _err_response('Missing required keys {0}'.format(
', '.join(missing))) ', '.join(missing)))
grader_id = request.user.id grader_id = unique_id_for_user(request.user)
p = request.POST p = request.POST
......
...@@ -21,6 +21,7 @@ from django_comment_client.models import Role, FORUM_ROLE_ADMINISTRATOR, FORUM_R ...@@ -21,6 +21,7 @@ from django_comment_client.models import Role, FORUM_ROLE_ADMINISTRATOR, FORUM_R
from django_comment_client.utils import has_forum_access from django_comment_client.utils import has_forum_access
from psychometrics import psychoanalyze from psychometrics import psychoanalyze
from student.models import CourseEnrollment from student.models import CourseEnrollment
from student.models import unique_id_for_user
from xmodule.course_module import CourseDescriptor from xmodule.course_module import CourseDescriptor
from xmodule.modulestore import Location from xmodule.modulestore import Location
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
...@@ -78,7 +79,7 @@ def peer_grading(request, course_id): ...@@ -78,7 +79,7 @@ def peer_grading(request, course_id):
error_text = "" error_text = ""
problem_list = [] 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, unique_id_for_user(request.user))
problem_list_json = json.loads(problem_list_text) problem_list_json = json.loads(problem_list_text)
success = problem_list_json['success'] success = problem_list_json['success']
if 'error' in problem_list_json: if 'error' in problem_list_json:
......
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