@@ -695,20 +695,74 @@ class EdxappGrade(UserQueryMixin, APIView):
695695 permission_classes = (EoxCoreAPIPermission ,)
696696 renderer_classes = (JSONRenderer , BrowsableAPIRenderer )
697697
698+ @apidocs .schema (
699+ parameters = [
700+ apidocs .query_parameter (
701+ name = "username" ,
702+ param_type = str ,
703+ description = "**required**, The username used to identify a user enrolled on the course. Use either username or email." ,
704+ ),
705+ apidocs .query_parameter (
706+ name = "email" ,
707+ param_type = str ,
708+ description = "**required**, The email used to identify a user enrolled on the course. Use either username or email." ,
709+ ),
710+ apidocs .query_parameter (
711+ name = "course_id" ,
712+ param_type = str ,
713+ description = "**required**, The course id for the enrollment you want to check." ,
714+ ),
715+ apidocs .query_parameter (
716+ name = "detailed" ,
717+ param_type = bool ,
718+ description = "**optional**, If true include detailed data for each graded subsection" ,
719+ ),
720+ apidocs .query_parameter (
721+ name = "grading_policy" ,
722+ param_type = bool ,
723+ description = "**optional**, If true include course grading policy." ,
724+ ),
725+ ],
726+ responses = {
727+ 200 : EdxappGradeSerializer ,
728+ 400 : "Bad request, missing course_id or either email or username" ,
729+ 404 : "User, course or enrollment not found" ,
730+ },
731+ )
698732 def get (self , request ):
699733 """
700734 Retrieves Grades information for given a user and course_id
701735
702736 **Example Requests**
703737
704- GET /eox-core/api/v1/grade/?username=johndoe&
705- course_id=course-v1:edX+DemoX+Demo_Course
738+ GET /eox-core/api/v1/grade/?username=johndoe&course_id=course-v1:edX+DemoX+Demo_Course
706739
707740 Request data: {
708741 "username": "johndoe",
709742 "course_id": "course-v1:edX+DemoX+Demo_Course",
710743 }
711744
745+ **Response details**
746+
747+ - `earned_grade`: Final user score for the course.
748+ - `section_breakdown` (**optional**): Details of each grade subsection.
749+ - `attempted`: Whether the learner attempted the assignment.
750+ - `assignment_type`: General category of the assignment.
751+ - `percent`: Grade obtained by the user on this subsection.
752+ - `score_earned`: The score a user earned on this subsection.
753+ - `score_possible`: Highest possible score a user can earn on this subsection.
754+ - `subsection_name`: Name of the subsection.
755+ - `grading_policy` (**optional**): Course grading policy.
756+ - `grade_cutoff`: Score needed to reach each grade.
757+ - `grader`: Details of each assignment type used by the Grader.
758+ - `assignment_type`: General category of the assignment.
759+ - `count`: Number of assignments of this type.
760+ - `dropped`: The number of assignments of this type that the grader will drop. The grader will drop the lowest-scored assignments first.
761+ - `weight`: Weight of this type of assignment towards the final grade.
762+
763+ More information about grading can be found in the
764+ [edX documentation](https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/latest/student_progress/course_grades.html).
765+
712766 **Returns**
713767
714768 - 200: Success.
0 commit comments