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

Đang mở
#39,212 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, python
Lĩnh vực
api, backend

Hướng nghiên cứu

Start in GradingConfigView in lms/djangoapps/instructor/views/api_v2.py, where the HTML response from instructor_analytics.basic.dump_grading_context is returned, and compare it with the getGradingConfig entry in instructor-v2-grading-api-spec.yaml. Done means either a JSON GradingConfig built from course.grading_policy (GRADER and GRADE_CUTOFFS), or an updated spec and MFE handling of the preformatted text. The issue leaves the choice between these open, so confirm it with a maintainer before writing code.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

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

Ngôn ngữ chính
Python
Star
8.2k
Fork
4.4k
Merge trung bình
2 ngày 10 giờ
Pull request đã merge (30 ngày)
40

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của openedx/openedx-platform

Tất cả issue của openedx/openedx-platform

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.