LLMS_Processor_Course_Data
Description Description
Handle background processing of average progress & average grade for courses.
The background process calculates "expensive" aggregate course data and stores them on the wp_postmeta
table so the data can be access later with a single database read.
The process is queued for recalculation when:
- Students enroll.
- Students unenroll.
- Students complete lessons.
- Students complete quizzes.
Upon completion, the following values can be accessed via the LLMS_Course
model to retrieve the aggregate data for the course:
- Average grade:
LLMS_Course::get( 'average_grade' )
- Average progress:
LLMS_Course::get( 'average_progress' )
- Number of currently enrolled students:
LLMS_Course::get( 'enrolled_students' )
Source Source
File: includes/processors/class.llms.processor.course.data.php
Changelog Changelog
Version | Description |
---|---|
4.12.0 | Remove (protected) method LLMS_Processor_Course_Data::complete() , the override of the parent method is no longer needed. |
3.15.0 | Introduced. |
Methods Methods
- dispatch_calc — Action triggered to queue queries needed to make the calculation
- dispatch_calc_throttled — Schedule data calculation for the future
- get_last_run — Retrieve a timestamp for the last time data calculation was completed for a given course
- get_student_query_args — Retrieve arguments used to perform an LLMS_Student_Query for background data processing
- get_task_data — Retrieve structured task data array.
- init — Initializer
- is_already_processing_course — Determines if the supplied course is already being processed.
- maybe_throttle — For large courses, only recalculate once every 4 hours
- schedule_calculation — Schedule a calculation to execute
- schedule_from_course — Schedule recalculation from actions triggered against a course
- schedule_from_lesson — Schedule recalculation from actions triggered against a lesson
- schedule_from_quiz — Schedule recalculation from actions triggered against a quiz
- task — Execute calculation for each item in the queue until all students in the course have been polled
- task_complete — Complete a task