Merge pull request #15045 from edx/neem/handle_unrescorable

400 for non-rescorable blocks
This commit is contained in:
sanfordstudent
2017-05-16 10:36:33 -04:00
committed by GitHub
5 changed files with 98 additions and 25 deletions

View File

@@ -2118,18 +2118,24 @@ def rescore_problem(request, course_id):
if student:
response_payload['student'] = student_identifier
lms.djangoapps.instructor_task.api.submit_rescore_problem_for_student(
request,
module_state_key,
student,
only_if_higher,
)
try:
lms.djangoapps.instructor_task.api.submit_rescore_problem_for_student(
request,
module_state_key,
student,
only_if_higher,
)
except NotImplementedError as exc:
return HttpResponseBadRequest(exc.message)
elif all_students:
lms.djangoapps.instructor_task.api.submit_rescore_problem_for_all_students(
request,
module_state_key,
only_if_higher,
)
try:
lms.djangoapps.instructor_task.api.submit_rescore_problem_for_all_students(
request,
module_state_key,
only_if_higher,
)
except NotImplementedError as exc:
return HttpResponseBadRequest(exc.message)
else:
return HttpResponseBadRequest()