diff --git a/lms/djangoapps/instructor/views/api.py b/lms/djangoapps/instructor/views/api.py index 5b0e4a7b0fd1..77f76dec9bf8 100644 --- a/lms/djangoapps/instructor/views/api.py +++ b/lms/djangoapps/instructor/views/api.py @@ -2088,10 +2088,9 @@ def post(self, request, course_id): # lint-amnesty, pylint: disable=missing-fun - score a value unique_student_identifier student username or email. """ - course_key = CourseKey.from_string(course_id) - serializer_data = self.serializer_class(data=request.data) + if not serializer_data.is_valid(): return HttpResponseBadRequest(reason=serializer_data.errors) @@ -2120,6 +2119,7 @@ def post(self, request, course_id): # lint-amnesty, pylint: disable=missing-fun 'problem_to_reset': problem_to_reset, 'student': student_identifier } + try: task_api.submit_override_score( request, diff --git a/lms/djangoapps/instructor/views/serializer.py b/lms/djangoapps/instructor/views/serializer.py index da422a051b57..b48f6de3136b 100644 --- a/lms/djangoapps/instructor/views/serializer.py +++ b/lms/djangoapps/instructor/views/serializer.py @@ -237,6 +237,6 @@ class ProblemSerializer(UniqueStudentIdentifierSerializer): 'blank': _("Problem URL name cannot be blank."), } ) - score = serializers.BooleanField( - help_text=_("new score value"), + score = serializers.CharField( + help_text="Score must be a valid number or decimal, e.g., 1.00" )