lms.djangoapps.grades.signals package#
Submodules#
lms.djangoapps.grades.signals.handlers module#
Grades related signals.
- lms.djangoapps.grades.signals.handlers.disconnect_submissions_signal_receiver(signal)#
Context manager to be used for temporarily disconnecting edx-submission’s set or reset signal.
Clear Student State on ORA problems currently results in a set->reset signal pair getting fired from submissions which leads to tasks being enqueued, one of which can never succeed. This context manager fixes the issue by disconnecting the “set” handler during the clear_state operation.
- lms.djangoapps.grades.signals.handlers.enqueue_subsection_update(sender, **kwargs)#
Handles the PROBLEM_WEIGHTED_SCORE_CHANGED or SUBSECTION_OVERRIDE_CHANGED signals by enqueueing a subsection update operation to occur asynchronously.
- lms.djangoapps.grades.signals.handlers.exam_attempt_rejected_event_handler(sender, signal, **kwargs)#
Consume EXAM_ATTEMPT_REJECTED events from the event bus. This will trigger a subsection override.
- lms.djangoapps.grades.signals.handlers.exam_attempt_verified_event_handler(sender, signal, **kwargs)#
Consume EXAM_ATTEMPT_VERIFIED events from the event bus. This will trigger an undo section override, if one exists.
- lms.djangoapps.grades.signals.handlers.handle_external_grader_score(signal, sender, score, **kwargs)#
Event handler for external grader score submissions.
This function is triggered when an external grader submits a score through the EXTERNAL_GRADER_SCORE_SUBMITTED signal. It processes the score and updates the corresponding XBlock instance with the grading results.
- Parameters:
signal – The signal that triggered this handler
sender – The object that sent the signal
score – An object containing the score data with attributes: - score_msg: The actual score message/response from the grader - course_id: String ID of the course - user_id: ID of the user who submitted the problem - module_id: ID of the module/problem - submission_id: ID of the submission - queue_key: Key identifying the submission in the queue - queue_name: Name of the queue used for grading
**kwargs – Additional keyword arguments passed with the signal
The function logs details about the score event, formats the grader message appropriately, and then calls the module’s score_update handler to record the grade in the learning management system.
- lms.djangoapps.grades.signals.handlers.listen_for_course_grade_passed_first_time(sender, user_id, course_id, **kwargs)#
Listen for a signal indicating that the user has passed course grade first time.
Emits an event edx.course.grade.passed.first_time
- lms.djangoapps.grades.signals.handlers.listen_for_failing_grade(sender, user, course_id, **kwargs)#
Listen for a signal indicating that the user has failed a course run.
Emits an edx.course.grade.now_failed event
- lms.djangoapps.grades.signals.handlers.listen_for_passing_grade(sender, user, course_id, **kwargs)#
Listen for a signal indicating that the user has passed a course run.
Emits an edx.course.grade.now_passed event
- lms.djangoapps.grades.signals.handlers.problem_raw_score_changed_handler(sender, **kwargs)#
Handles the raw score changed signal, converting the score to a weighted score and firing the PROBLEM_WEIGHTED_SCORE_CHANGED signal.
- lms.djangoapps.grades.signals.handlers.recalculate_course_and_subsection_grades(sender, user, course_key, countdown=None, **kwargs)#
Updates a saved course grade, forcing the subsection grades from which it is calculated to update along the way.
- lms.djangoapps.grades.signals.handlers.recalculate_course_grade_only(sender, course, course_structure, user, **kwargs)#
Updates a saved course grade, but does not update the subsection grades the user has in this course.
- lms.djangoapps.grades.signals.handlers.score_published_handler(sender, block, user, raw_earned, raw_possible, only_if_higher, **kwargs)#
Handles whenever a block’s score is published. Returns whether the score was actually updated.
- lms.djangoapps.grades.signals.handlers.submissions_score_reset_handler(sender, **kwargs)#
Consume the score_reset signal defined in the Submissions API, and convert it to a PROBLEM_WEIGHTED_SCORE_CHANGED signal indicating that the score has been set to 0/0. Converts the unicode keys for user, course and item into the standard representation for the PROBLEM_WEIGHTED_SCORE_CHANGED signal.
This method expects that the kwargs dictionary will contain the following entries (See the definition of score_reset):
‘anonymous_user_id’: unicode,
‘course_id’: unicode,
‘item_id’: unicode
- lms.djangoapps.grades.signals.handlers.submissions_score_set_handler(sender, **kwargs)#
Consume the score_set signal defined in the Submissions API, and convert it to a PROBLEM_WEIGHTED_SCORE_CHANGED signal defined in this module. Converts the unicode keys for user, course and item into the standard representation for the PROBLEM_WEIGHTED_SCORE_CHANGED signal.
This method expects that the kwargs dictionary will contain the following entries (See the definition of score_set):
‘points_possible’: integer,
‘points_earned’: integer,
‘anonymous_user_id’: unicode,
‘course_id’: unicode,
‘item_id’: unicode
lms.djangoapps.grades.signals.signals module#
Grades related signals.