GET /api/instructor/v2/courses/<course_key>/grading-config returns text/html: the v1 debugging dump from instructor_analytics.basic.dump_grading_context, wrapped in <pre>…</pre>. The published v2 spec describes it differently: instructor-v2-grading-api-spec.yaml (getGradingConfig) says it produces application/json matching the GradingConfig schema (graders[] with type/min_count/drop_count/weight, plus grade_cutoffs).
The view's docstring (GradingConfigView, lms/djangoapps/instructor/views/api_v2.py:2834) calls the HTML deliberate, carried over from v1 "so the MFE can render it directly inside a <pre> block". But the MFE doesn't render it as HTML. frontend-app-instructor-dashboard passes the response to a CodeEditor in the "View Grading Configuration" modal, so instructors see the raw dump, <pre> tags included, with Python class reprs such as <class 'xmodule.graders.WeightedSubsectionsGrader'>.
Every other endpoint in the v2 instructor API returns JSON, and #38989 (CCX grading policy) was written assuming this one did too.
Suggested fix: implement the endpoint as specified, returning JSON GradingConfig built from course.grading_policy (GRADER + GRADE_CUTOFFS), and have the MFE render that. If the HTML dump is meant to stay, update the spec and the MFE to treat it as preformatted text.
Environment: Tutor main, 2026-09-15; code references are to master @ 2e46ebdf50.
Found by the Open edX end-to-end test suite (INSTR-003).
GET /api/instructor/v2/courses/<course_key>/grading-configreturnstext/html: the v1 debugging dump frominstructor_analytics.basic.dump_grading_context, wrapped in<pre>…</pre>. The published v2 spec describes it differently:instructor-v2-grading-api-spec.yaml(getGradingConfig) says it producesapplication/jsonmatching theGradingConfigschema (graders[]withtype/min_count/drop_count/weight, plusgrade_cutoffs).The view's docstring (
GradingConfigView,lms/djangoapps/instructor/views/api_v2.py:2834) calls the HTML deliberate, carried over from v1 "so the MFE can render it directly inside a<pre>block". But the MFE doesn't render it as HTML.frontend-app-instructor-dashboardpasses the response to aCodeEditorin the "View Grading Configuration" modal, so instructors see the raw dump,<pre>tags included, with Python class reprs such as<class 'xmodule.graders.WeightedSubsectionsGrader'>.Every other endpoint in the v2 instructor API returns JSON, and #38989 (CCX grading policy) was written assuming this one did too.
Suggested fix: implement the endpoint as specified, returning JSON
GradingConfigbuilt fromcourse.grading_policy(GRADER+GRADE_CUTOFFS), and have the MFE render that. If the HTML dump is meant to stay, update the spec and the MFE to treat it as preformatted text.Environment: Tutor
main, 2026-09-15; code references are tomaster@2e46ebdf50.Found by the Open edX end-to-end test suite (
INSTR-003).