Skip to content

Instructor v2 grading-config returns an HTML debug dump, but its spec says JSON GradingConfig #39212

Description

@bmtcril

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).

Activity

  1. added
    bugReport of or fix for something that isn't working as intended
    on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugReport of or fix for something that isn't working as intended

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions