Moodle course analysable.
More...
|
const | MAX_TIME = 9999999999 |
| Max timestamp.
|
|
Moodle course analysable.
- Copyright
- 2016 David Monllao http://www.davidmonllao.com
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
core_analytics\course::__construct |
( |
|
$course, |
|
|
?\context |
$context = null |
|
) |
| |
Course manager constructor.
Use self::instance() instead to get cached copies of the course. Instances obtained through this constructor will not be cached.
- Parameters
-
int | stdClass | $course | Course id or mdl_course record |
context | null | $context | |
- Return values
-
◆ course_students_query_filter()
core_analytics\course::course_students_query_filter |
( |
|
$prefix = false | ) |
|
|
protected |
Returns the query and params used to filter the logstore by this course students.
- Parameters
-
- Return values
-
◆ filter_user_id()
core_analytics\course::filter_user_id |
( |
|
$record | ) |
|
|
protected |
Used by get_user_ids to extract the user id.
- Parameters
-
- Return values
-
◆ get_all_activities()
core_analytics\course::get_all_activities |
( |
|
$activitytype | ) |
|
Returns all the activities of the provided type the course has.
- Parameters
-
- Return values
-
◆ get_context()
core_analytics\course::get_context |
( |
| ) |
|
◆ get_course_data()
core_analytics\course::get_course_data |
( |
| ) |
|
Returns a course plain object.
- Return values
-
◆ get_end()
core_analytics\course::get_end |
( |
| ) |
|
◆ get_id()
core_analytics\course::get_id |
( |
| ) |
|
◆ get_name()
core_analytics\course::get_name |
( |
| ) |
|
◆ get_start()
core_analytics\course::get_start |
( |
| ) |
|
Get the course start timestamp.
- Return values
-
int | Timestamp or 0 if has not started yet. |
Implements core_analytics\analysable.
◆ get_student_grades()
core_analytics\course::get_student_grades |
( |
|
$courseactivities | ) |
|
Returns the course students grades.
- Parameters
-
- Return values
-
◆ get_students()
core_analytics\course::get_students |
( |
| ) |
|
Returns the course students.
- Return values
-
◆ get_total_logs()
core_analytics\course::get_total_logs |
( |
| ) |
|
Returns the total number of student logs in the course.
- Return values
-
◆ get_user_ids()
core_analytics\course::get_user_ids |
( |
|
$roleids | ) |
|
Returns a list of user ids matching the specified roles in this course.
- Parameters
-
- Return values
-
◆ guess_end()
core_analytics\course::guess_end |
( |
| ) |
|
Get the course end timestamp.
- Return values
-
int | Timestamp, core_analytics\analysable::MAX_TIME if we don't know but ongoing and 0 if we can not work it out. |
◆ guess_start()
core_analytics\course::guess_start |
( |
| ) |
|
Guesses the start of the course based on students' activity and enrolment start dates.
- Return values
-
◆ instance()
static core_analytics\course::instance |
( |
|
$course, |
|
|
?\context |
$context = null |
|
) |
| |
|
static |
Returns an analytics course instance.
Lazy load of course data, students and teachers.
- Parameters
-
int | stdClass | $course | Course object or course id |
context | null | $context | |
- Return values
-
◆ is_finished()
core_analytics\course::is_finished |
( |
| ) |
|
Has the course finished?
- Return values
-
◆ load()
core_analytics\course::load |
( |
| ) |
|
|
protected |
Loads the analytics course object.
- Return values
-
◆ median()
core_analytics\course::median |
( |
|
$values | ) |
|
|
protected |
Calculate median.
Keys are ignored.
- Parameters
-
int[] | float[] | $values | Sorted array of values |
- Return values
-
◆ update_loop_times()
core_analytics\course::update_loop_times |
( |
|
$start, |
|
|
|
$end |
|
) |
| |
|
protected |
Returns the average time between 2 timestamps.
- Parameters
-
- Return values
-
array | [starttime, averagetime, endtime] |
◆ was_started()
core_analytics\course::was_started |
( |
| ) |
|
Has the course started?
- Return values
-
The documentation for this class was generated from the following file: