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
from courseware.access import has_access
from util.json_request import expect_json
from xmodule.course_module import CourseDescriptor
from student.models import unique_id_for_user
log = logging.getLogger(__name__)
......@@ -206,11 +207,11 @@ def get_next(request, course_id):
if len(missing) > 0:
return _err_response('Missing required keys {0}'.format(
', '.join(missing)))
grader_id = request.user.id
grader_id = unique_id_for_user(request.user)
p = request.POST
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")
......@@ -238,7 +239,7 @@ def get_problem_list(request, course_id):
"""
_check_access(request.user, course_id)
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,
mimetype="application/json")
except GradingServiceError:
......@@ -287,7 +288,7 @@ def save_grade(request, course_id):
return _err_response('Missing required keys {0}'.format(
', '.join(missing)))
grader_id = request.user.id
grader_id = unique_id_for_user(request.user)
p = request.POST
......
......@@ -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 psychometrics import psychoanalyze
from student.models import CourseEnrollment
from student.models import unique_id_for_user
from xmodule.course_module import CourseDescriptor
from xmodule.modulestore import Location
from xmodule.modulestore.django import modulestore
......@@ -78,7 +79,7 @@ def peer_grading(request, course_id):
error_text = ""
problem_list = []
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)
success = problem_list_json['success']
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