lms.djangoapps.course_home_api.progress package#
Submodules#
lms.djangoapps.course_home_api.progress.api module#
Python APIs exposed for the progress tracking functionality of the course home API.
- lms.djangoapps.course_home_api.progress.api.aggregate_assignment_type_grade_summary(course_grade, grading_policy: dict, has_staff_access: bool = False) dict#
Aggregate subsection grades by assignment type and return summary data. :param course_grade: CourseGrade object containing chapter and subsection grades. :param grading_policy: Dictionary representing the course’s grading policy. :param has_staff_access: Boolean indicating if the user has staff access to view all grades.
- Returns:
results: list of per-assignment-type summary dicts final_grades: overall weighted contribution (float, 4 decimal rounding)
- Return type:
Dictionary with keys
lms.djangoapps.course_home_api.progress.serializers module#
Progress Tab Serializers
- class lms.djangoapps.course_home_api.progress.serializers.AssignmentTypeScoresSerializer(*args, **kwargs)#
Bases:
ReadOnlySerializerSerializer for aggregated scores per assignment type.
- class lms.djangoapps.course_home_api.progress.serializers.CertificateDataSerializer(*args, **kwargs)#
Bases:
ReadOnlySerializerSerializer for certificate data
- class lms.djangoapps.course_home_api.progress.serializers.CourseGradeSerializer(*args, **kwargs)#
Bases:
ReadOnlySerializerSerializer for course grade
- class lms.djangoapps.course_home_api.progress.serializers.GradingPolicySerializer(*args, **kwargs)#
Bases:
ReadOnlySerializerSerializer for grading policy
- ASSIGNMENT_COLORS = ['#D24242', '#7B9645', '#5A5AD8', '#B0842C', '#2E90C2', '#D13F88', '#36A17D', '#AE5AD8', '#3BA03B']#
- get_assignment_colors(obj)#
- get_assignment_policies(grading_policy)#
- class lms.djangoapps.course_home_api.progress.serializers.ProgressTabSerializer(*args, **kwargs)#
Bases:
VerifiedModeSerializerSerializer for progress tab
- class lms.djangoapps.course_home_api.progress.serializers.SectionScoresSerializer(*args, **kwargs)#
Bases:
ReadOnlySerializerSerializer for sections in section_scores
- class lms.djangoapps.course_home_api.progress.serializers.SubsectionScoresSerializer(*args, **kwargs)#
Bases:
ReadOnlySerializerSerializer for subsections in section_scores
- get_block_key(subsection)#
- get_learner_has_access(subsection)#
- get_override(subsection)#
Proctoring or grading score override
- get_problem_scores(subsection)#
Problem scores for this subsection
- get_show_grades(subsection)#
- get_url(subsection)#
Returns the URL for the subsection while taking into account if the course team has marked the subsection’s visibility as hide after due.
- class lms.djangoapps.course_home_api.progress.serializers.VerificationDataSerializer(*args, **kwargs)#
Bases:
ReadOnlySerializerSerializer for verification data object
lms.djangoapps.course_home_api.progress.views module#
Progress Tab Views
- class lms.djangoapps.course_home_api.progress.views.ProgressTabView(**kwargs)#
Bases:
RetrieveAPIViewUse Cases
Request details for the Progress Tab
Example Requests
GET api/course_home/v1/progress/{course_key} GET api/course_home/v1/progress/{course_key}/{student_id}/
Response Values
Body consists of the following fields:
- access_expiration: An object detailing when access to this course will expire
expiration_date: (str) When the access expires, in ISO 8601 notation masquerading_expired_course: (bool) Whether this course is expired for the masqueraded user upgrade_deadline: (str) Last chance to upgrade, in ISO 8601 notation (or None if can’t upgrade anymore) upgrade_url: (str) Upgrade link (or None if can’t upgrade anymore)
- certificate_data: Object containing information about the user’s certificate status
- cert_status: (str) the status of a user’s certificate (full list of statuses are defined in
lms/djangoapps/certificates/models.py)
cert_web_view_url: (str) the url to view the certificate download_url: (str) the url to download the certificate
- completion_summary: Object containing unit completion counts with the following fields:
complete_count: (float) number of complete units incomplete_count: (float) number of incomplete units locked_count: (float) number of units where contains_gated_content is True
- course_grade: Object containing the following fields:
is_passing: (bool) whether the user’s grade is above the passing grade cutoff letter_grade: (str) the user’s letter grade based on the set grade range.
If user is passing, value may be ‘A’, ‘B’, ‘C’, ‘D’, ‘Pass’, otherwise none
percent: (float) the user’s total graded percent in the course
- credit_course_requirements: Object containing credit course requirements with the following fields:
- eligibility_status: (str) Indicates if the user is eligible to receive credit. Value may be
“eligible”, “not_eligible”, or “partial_eligible”
- requirements: List of requirements that must be fulfilled to be eligible to receive credit. See
get_credit_requirement_status for details on the fields
end: (date) end date of the course enrollment_mode: (str) a str representing the enrollment the user has (‘audit’, ‘verified’, …) grading_policy:
- assignment_policies: List of serialized assignment grading policy objects, each has the following fields:
- num_droppable: (int) the number of lowest scored assignments that will not be counted towards the final
grade
short_label: (str) the abbreviated name given to the assignment type type: (str) the assignment type weight: (float) the percent weight the given assigment type has on the overall grade
- grade_range: an object containing the grade range cutoffs. The exact keys in the object can vary, but they
range from just ‘Pass’, to a combination of ‘A’, ‘B’, ‘C’, and ‘D’. If a letter grade is present, ‘Pass’ is not included.
has_scheduled_content: (bool) boolean on if the course has content scheduled with a release date in the future section_scores: List of serialized Chapters. Each Chapter has the following fields:
display_name: (str) a str of what the name of the Chapter is for displaying on the site subsections: List of serialized Subsections, each has the following fields:
assignment_type: (str) the format, if any, of the Subsection (Homework, Exam, etc) block_key: (str) the key of the given subsection block display_name: (str) a str of what the name of the Subsection is for displaying on the site due: (str or None) the due date of the subsection in ISO 8601 format, or None if no due date is set has_graded_assignment: (bool) whether or not the Subsection is a graded assignment learner_has_access: (bool) whether the learner has access to the subsection (could be FBE gated) num_points_earned: (int) the amount of points the user has earned for the given subsection num_points_possible: (int) the total amount of points possible for the given subsection override: Optional object if grade has been overridden by proctor or grading change
system: (str) either GRADING or PROCTORING reason: (str) a comment on the grading override
- percent_graded: (float) the percentage of total points the user has received a grade for in a given
subsection
- problem_scores: List of objects that represent individual problem scores with the following fields:
earned: (float) number of earned points possible: (float) number of possible points
- show_correctness: (str) a str representing whether to show the problem/practice scores based on due date
- (‘always’, ‘never’, ‘past_due’, values defined in
xmodule/modulestore/inheritance.py)
show_grades: (bool) a bool for whether to show grades based on the access the user has url: (str or None) the absolute path url to the Subsection or None if the Subsection is no longer
accessible to the learner due to a hide_after_due course team setting
studio_url: (str) a str of the link to the grading in studio for the course user_has_passing_grade: (bool) boolean on if the user has a passing grade in the course username: (str) username of the student whose progress information is being displayed. verification_data: an object containing
link: (str) the link to either start or retry ID verification status: (str) the status of the ID verification status_date: (str) the date time string of when the ID verification status was set
Returns
200 on success with above fields.
401 if the user is not authenticated or not enrolled.
403 if the user does not have access to the course.
404 if the course is not available or cannot be seen.
- authentication_classes = (<class 'edx_rest_framework_extensions.auth.jwt.authentication.JwtAuthentication'>, <class 'openedx.core.lib.api.authentication.BearerAuthenticationAllowInactiveUser'>, <class 'edx_rest_framework_extensions.auth.session.authentication.SessionAuthenticationAllowInactiveUser'>)#
- get(request, *args, **kwargs)#
- permission_classes = (<class 'rest_framework.permissions.IsAuthenticated'>,)#
- serializer_class#
alias of
ProgressTabSerializer
- lms.djangoapps.course_home_api.progress.views.obfuscated_username(request, student)#
Return an obfuscated username for the student, or None (indicating student’s real name should be used).
This function can be overridden by an installed plugin via the OVERRIDE_COURSE_HOME_PROGRESS_USERNAME setting to return a generic name for learners who should not have their real username exposed.