Peter Love This is our production and as developers, we don't have access to any of LMS course views that this error is happening.
Payload is accepting for all other assignment submissions except for some students. I think it shouldn't be a problem with the payload that we are sending.
Furthermore, we went though the Canvas code base at GitHub (https://github.com/instructure/canvas-lms) for this assignment submission route and could able to find below code snippets,
Snippet1
raise GradeError.new("Student is required") unless original_student
unless context.includes_user?(original_student, context.admin_visible_student_enrollments) # allows inactive users to be graded
raise GradeError.new("Student must be enrolled in the course as a student to be graded")
Snippet2
has_many :admin_visible_student_enrollments, -> {
where("enrollments.workflow_state NOT IN ('rejected', 'completed', 'deleted')
AND enrollments.type IN ('StudentEnrollment', 'StudentViewEnrollment')").preload(:user) }, class_name: 'Enrollment'
According to the above code snippets, it seems like it is checking a workflow state and enrollment type to return "400 - Bad request"
We tried to recreate this with development environment data but unfortunately, we couldn't able to recreate it.
Any idea on how to get any of 'rejected', 'completed', 'deleted' workflow states for a student and what are the enrollment types other than 'StudentEnrollment', 'StudentViewEnrollment'?