Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Social breadth indicator - quiz. More...
Public Member Functions | |
add_sample_data ($data) | |
add_sample_data More... | |
calculate ($sampleids, $samplesorigin, $starttime=false, $endtime=false, $existingcalculations=array()) | |
Calculates the indicator. More... | |
clear_sample_data () | |
clear_sample_data More... | |
fill_per_analysable_caches (\core_analytics\analysable $analysable) | |
Fetch the course grades of this activity type instances. More... | |
string | get_activity_type () |
Returns the activity type. More... | |
get_calculation_outcome ($value, $subtype=false) | |
get_calculation_outcome More... | |
get_cognitive_depth_level (\cm_info $cm) | |
Returns the potential level of cognitive depth. More... | |
get_display_value ($value, $subtype=false) | |
get_display_value More... | |
get_id () | |
The class id is the calculable class full qualified class name. More... | |
get_indicator_type () | |
Defines indicator type. More... | |
get_social_breadth_level (\cm_info $cm) | |
Returns the potential level of social breadth. More... | |
save_calculation_info (\core_analytics\local\time_splitting\base $timesplitting, int $rangeindex) | |
Stores in MUC the previously added data and it associates it to the provided $calculable. More... | |
should_be_displayed ($value, $subtype) | |
Show only the main feature. More... | |
Static Public Member Functions | |
static | get_feature_headers () |
get_feature_headers More... | |
static | get_max_value () |
Returns the maximum value an indicator calculation can return. More... | |
static | get_min_value () |
Returns the minimum value an indicator calculation can return. More... | |
static | get_name () |
Returns the name. More... | |
static | instance () |
Returns an instance of the indicator. More... | |
static | required_sample_data () |
required_sample_data More... | |
Public Attributes | |
const | COGNITIVE_LEVEL_1 = 1 |
Constant for this cognitive level. | |
const | COGNITIVE_LEVEL_2 = 2 |
Constant for this cognitive level. | |
const | COGNITIVE_LEVEL_3 = 3 |
Constant for this cognitive level. | |
const | COGNITIVE_LEVEL_4 = 4 |
Constant for this cognitive level. | |
const | COGNITIVE_LEVEL_5 = 5 |
Constant for this cognitive level. | |
const | INDICATOR_COGNITIVE = "cognitve" |
Constant cognitive indicator type. | |
const | INDICATOR_SOCIAL = "social" |
Constant social indicator type. | |
const | MAX_COGNITIVE_LEVEL = 5 |
Max cognitive depth level accepted. | |
const | MAX_SOCIAL_LEVEL = 5 |
Max social breadth level accepted. | |
const | MAX_VALUE = 1 |
Max value an indicator can return. | |
const | MIN_VALUE = -1 |
Min value an indicator can return. | |
const | OUTCOME_NEGATIVE = 3 |
Negative calculation outcome. | |
const | OUTCOME_NEUTRAL = 0 |
Neutral calculation outcome. | |
const | OUTCOME_OK = 2 |
Positive calculation outcome. | |
const | OUTCOME_VERY_NEGATIVE = 4 |
Very negative calculation outcome. | |
const | OUTCOME_VERY_POSITIVE = 1 |
Very positive calculation outcome. | |
const | SOCIAL_LEVEL_1 = 1 |
Constant for this social level. | |
const | SOCIAL_LEVEL_2 = 2 |
Constant for this social level. | |
const | SOCIAL_LEVEL_3 = 3 |
Constant for this social level. | |
const | SOCIAL_LEVEL_4 = 4 |
Constant for this social level. | |
const | SOCIAL_LEVEL_5 = 5 |
Constant for this social level. | |
Protected Member Functions | |
activity_completed_by (\cm_info $activity, $starttime, $endtime, $student=false) | |
Was the activity supposed to be completed during the provided time range?. More... | |
activity_type_completed_by (\cm_info $activity, $starttime, $endtime, $student=false) | |
True if the activity is due or it has been closed during this period, false if during another period, null if no due time. More... | |
add_shared_calculation_info (int $sampleid, array $info) | |
Adds info related to the current calculation for later use when generating insights. More... | |
any_feedback ($action, cm_info $cm, $contextid, $user) | |
Is there any feedback activity log for this user in this context? More... | |
any_log ($contextid, $user) | |
Do activity logs contain any log of user in this context? More... | |
any_write_log ($contextid, $user) | |
Do activity logs contain any write log of user in this context? More... | |
availability_completed_by (\core_availability\info $info, $starttime, $endtime) | |
Check if the activity/section should have been completed during the provided period according to its availability rules. More... | |
calculate_sample ($sampleid, $tablename, $starttime=false, $endtime=false) | |
calculate_sample More... | |
classify_value ($value, $ranges) | |
Classifies the provided value into the provided range according to the ranges predicates. More... | |
cognitive_calculate_sample ($sampleid, $tablename, $starttime=false, $endtime=false) | |
Calculates the cognitive depth of a sample. More... | |
feedback_check_grades () | |
feedback_check_grades More... | |
feedback_post_action (\cm_info $cm, $contextid, $userid, $eventnames, $after=null) | |
Whether this user in this context did any of the provided actions (events) More... | |
feedback_replied (\cm_info $cm, $contextid, $userid, $after=null) | |
$cm is used for this method overrides. More... | |
feedback_replied_events () | |
Returns the list of events that involve replying to feedback from other users. More... | |
feedback_submitted (\cm_info $cm, $contextid, $userid, $after=null) | |
$cm is used for this method overrides. More... | |
feedback_submitted_events () | |
Returns the list of events that involve submitting something after receiving feedback from other users. More... | |
feedback_viewed (\cm_info $cm, $contextid, $userid, $after=null) | |
$cm is used for this method overrides. More... | |
feedback_viewed_events () | |
feedback_viewed_events More... | |
fetch_activity_logs ($activities, $starttime=false, $endtime=false) | |
Fetch acitivity logs from database. More... | |
fetch_student_grades (\core_analytics\course $course) | |
Gets the course student grades. More... | |
fill_instance_data (\cm_info $cm) | |
Fills in activity instance data. More... | |
get_activities ($starttime, $endtime, $student=false) | |
Guesses all activities that were available during a period of time. More... | |
get_graded_date ($contextid, $userid, $checkfeedback=false) | |
Returns the date a user was graded. More... | |
get_student_activities ($sampleid, $tablename, $starttime, $endtime) | |
Returns the activities the user had access to between a time period. More... | |
get_time_range_weeks_number ($starttime, $endtime) | |
Returns the number of weeks a time range contains. More... | |
get_timeclose_field () | |
Returns the name of the field that controls activity availability. More... | |
limit_value ($calculatedvalue) | |
Limits the calculated value to the minimum and maximum values. More... | |
retrieve ($elementname, $sampleid) | |
Retrieve the specified element associated to $sampleid. More... | |
social_calculate_sample ($sampleid, $tablename, $starttime=false, $endtime=false) | |
Calculates the social breadth of a sample. More... | |
to_features ($calculatedvalues) | |
Converts the calculated values to a list of features for the dataset. More... | |
validate_calculated_value ($calculatedvalue) | |
Validates the calculated value. More... | |
Static Protected Member Functions | |
static | include_averages () |
Set to false to avoid context features to be added as dataset features. More... | |
Protected Attributes | |
array | $activitylogs = null |
Array of logs by [contextid][userid]. | |
core_analytics calculation_info null | $calculationinfo = null |
core_analytics course | $course = null |
array | $grades = null |
Array of grades by [contextid][userid]. | |
array | $instancedata = array() |
instancedata | |
array[] | $sampledata = array() |
Social breadth indicator - quiz.
|
protectedinherited |
Was the activity supposed to be completed during the provided time range?.
cm_info | $activity | |
int | $starttime | |
int | $endtime | |
stdClass | false | $student |
bool |
|
protectedinherited |
True if the activity is due or it has been closed during this period, false if during another period, null if no due time.
It can be overwritten by activities that allow teachers to set a due date or a time close separately from Moodle availability system. Note that in most of the cases overwriting get_timeclose_field should be enough.
Returns true or false if the time close date falls into the provided time range. Null otherwise.
cm_info | $activity | |
int | $starttime | |
int | $endtime | |
stdClass | false | $student |
null |
|
inherited |
add_sample_data
array | $data |
void |
|
finalprotectedinherited |
Adds info related to the current calculation for later use when generating insights.
Note that the data in $info array is reused across multiple samples, if you want to add data just for this sample you can use the sample id as key.
Please, note that you should be careful with how much data you add here as it can kill the server memory.
int | $sampleid | The sample id this data is associated with |
array | $info | The data. Indexed by an id unique across the site. E.g. an activity id. |
null |
|
protectedinherited |
Is there any feedback activity log for this user in this context?
This method returns true if $user is empty and there is any feedback activity logs.
string | $action | |
cm_info | $cm | |
int | $contextid | |
stdClass | false | $user |
bool |
|
finalprotectedinherited |
Do activity logs contain any log of user in this context?
If user is empty we look for any log in this context.
int | $contextid | |
stdClass | false | $user |
bool |
|
finalprotectedinherited |
Do activity logs contain any write log of user in this context?
If user is empty we look for any write log in this context.
int | $contextid | |
stdClass | false | $user |
bool |
|
protectedinherited |
Check if the activity/section should have been completed during the provided period according to its availability rules.
core_availability\info | $info | |
int | $starttime | |
int | $endtime |
bool|null |
|
inherited |
Calculates the indicator.
Returns an array of values which size matches $sampleids size.
int[] | $sampleids | |
string | $samplesorigin | |
integer | $starttime | Limit the calculation to this timestart |
integer | $endtime | Limit the calculation to this timeend |
array | $existingcalculations | Existing calculations of this indicator, indexed by sampleid. |
array | [0] = [$sampleid => int[]|float[]], [1] = [$sampleid => int|float], [2] = [$sampleid => $sampleid] |
|
protectedinherited |
calculate_sample
coding_exception |
int | $sampleid | |
string | $tablename | |
int | $starttime | |
int | $endtime |
float|int|null |
Reimplemented from core_analytics\local\indicator\base.
|
protectedinherited |
Classifies the provided value into the provided range according to the ranges predicates.
Use:
coding_exception |
int | float | $value | |
array | $ranges | e.g. [ ['lt', 20], ['ge', 20] ] |
float |
|
inherited |
clear_sample_data
void |
|
protectedinherited |
Calculates the cognitive depth of a sample.
int | $sampleid | |
string | $tablename | |
int | $starttime | |
int | $endtime |
float|int|null |
coding_exception |
|
protectedinherited |
feedback_check_grades
bool |
Reimplemented from core_analytics\local\indicator\community_of_inquiry_activity.
|
protectedinherited |
Whether this user in this context did any of the provided actions (events)
cm_info | $cm | |
int | $contextid | |
int | $userid | |
string[] | $eventnames | |
int | false | $after |
bool |
Reimplemented in mod_forum\analytics\indicator\activity_base, and mod_chat\analytics\indicator\activity_base.
|
protectedinherited |
$cm is used for this method overrides.
This function must be fast.
cm_info | $cm | |
mixed | $contextid | |
mixed | $userid | |
int | $after | Timestamp, defaults to the graded date or false if we don't check the date. |
bool |
Reimplemented in mod_quiz\analytics\indicator\cognitive_depth, mod_lesson\analytics\indicator\cognitive_depth, and mod_assign\analytics\indicator\cognitive_depth.
|
protectedinherited |
Returns the list of events that involve replying to feedback from other users.
string[] |
Reimplemented in mod_workshop\analytics\indicator\cognitive_depth, mod_forum\analytics\indicator\cognitive_depth, and mod_chat\analytics\indicator\activity_base.
|
protectedinherited |
$cm is used for this method overrides.
This function must be fast.
cm_info | $cm | |
mixed | $contextid | |
mixed | $userid | |
int | $after | Timestamp, defaults to the graded date or false if we don't check the date. |
bool |
Reimplemented in mod_lesson\analytics\indicator\cognitive_depth.
|
protectedinherited |
Returns the list of events that involve submitting something after receiving feedback from other users.
string[] |
Reimplemented in mod_workshop\analytics\indicator\cognitive_depth, mod_quiz\analytics\indicator\cognitive_depth, and mod_assign\analytics\indicator\cognitive_depth.
|
protectedinherited |
$cm is used for this method overrides.
This function must be fast.
cm_info | $cm | |
mixed | $contextid | |
mixed | $userid | |
int | $after | Timestamp, defaults to the graded date or false if we don't check the date. |
bool |
Reimplemented in mod_feedback\analytics\indicator\activity_base, and mod_choice\analytics\indicator\activity_base.
|
protectedinherited |
feedback_viewed_events
string[] |
Reimplemented from core_analytics\local\indicator\community_of_inquiry_activity.
|
protectedinherited |
Fetch acitivity logs from database.
array | $activities | |
int | $starttime | |
int | $endtime |
array |
|
protectedinherited |
Gets the course student grades.
core_analytics\course | $course |
void |
|
protectedinherited |
|
inherited |
Fetch the course grades of this activity type instances.
core_analytics\analysable | $analysable |
void |
Reimplemented from core_analytics\local\indicator\base.
|
protectedinherited |
Guesses all activities that were available during a period of time.
int | $starttime | |
int | $endtime | |
stdClass | false | $student |
array |
|
finalinherited |
Returns the activity type.
No point in changing this class in children classes.
The activity name (e.g. assign or quiz)
|
inherited |
get_calculation_outcome
float | $value | |
string | $subtype |
int |
Reimplemented from core_analytics\calculable.
|
inherited |
Returns the potential level of cognitive depth.
cm_info | $cm |
int |
Reimplemented in mod_workshop\analytics\indicator\cognitive_depth, mod_wiki\analytics\indicator\cognitive_depth, mod_url\analytics\indicator\cognitive_depth, mod_survey\analytics\indicator\cognitive_depth, mod_scorm\analytics\indicator\cognitive_depth, mod_resource\analytics\indicator\cognitive_depth, mod_quiz\analytics\indicator\cognitive_depth, mod_page\analytics\indicator\cognitive_depth, mod_lti\analytics\indicator\cognitive_depth, mod_lesson\analytics\indicator\cognitive_depth, mod_label\analytics\indicator\cognitive_depth, mod_imscp\analytics\indicator\cognitive_depth, mod_glossary\analytics\indicator\cognitive_depth, mod_forum\analytics\indicator\cognitive_depth, mod_folder\analytics\indicator\cognitive_depth, mod_feedback\analytics\indicator\cognitive_depth, mod_data\analytics\indicator\cognitive_depth, mod_choice\analytics\indicator\cognitive_depth, mod_chat\analytics\indicator\cognitive_depth, mod_book\analytics\indicator\cognitive_depth, and mod_assign\analytics\indicator\cognitive_depth.
|
inherited |
get_display_value
float | $value | |
string | $subtype |
string |
Reimplemented from core_analytics\calculable.
|
staticinherited |
get_feature_headers
array |
|
protectedinherited |
Returns the date a user was graded.
int | $contextid | |
int | $userid | |
bool | $checkfeedback | Check that the student was graded or check that feedback was given |
int|false |
|
inherited |
The class id is the calculable class full qualified class name.
string |
mod_quiz\analytics\indicator\social_breadth::get_indicator_type | ( | ) |
Defines indicator type.
string |
Reimplemented from core_analytics\local\indicator\community_of_inquiry_activity.
|
staticinherited |
Returns the maximum value an indicator calculation can return.
float |
|
staticinherited |
Returns the minimum value an indicator calculation can return.
float |
|
static |
Returns the name.
If there is a corresponding '_help' string this will be shown as well.
lang_string |
Reimplemented from core_analytics\calculable.
mod_quiz\analytics\indicator\social_breadth::get_social_breadth_level | ( | \cm_info | $cm | ) |
Returns the potential level of social breadth.
cm_info | $cm |
int |
Reimplemented from core_analytics\local\indicator\community_of_inquiry_activity.
|
protectedinherited |
Returns the activities the user had access to between a time period.
int | $sampleid | |
string | $tablename | |
int | $starttime | |
int | $endtime |
array |
|
protectedinherited |
Returns the number of weeks a time range contains.
Useful for calculations that depend on the time range duration. Note that it returns a float, rounding the float may lead to inaccurate results.
int | $starttime | |
int | $endtime |
float |
|
protectedinherited |
Returns the name of the field that controls activity availability.
null|string |
Reimplemented from core_analytics\local\indicator\community_of_inquiry_activity.
|
staticprotectedinherited |
Set to false to avoid context features to be added as dataset features.
bool |
|
staticinherited |
|
protectedinherited |
Limits the calculated value to the minimum and maximum values.
float | $calculatedvalue |
float|null |
|
staticinherited |
|
protectedinherited |
Retrieve the specified element associated to $sampleid.
string | $elementname | |
int | $sampleid |
stdClass|false | An stdClass object or false if it can not be found. |
|
finalinherited |
Stores in MUC the previously added data and it associates it to the provided $calculable.
Flagged as final as we don't want people to extend this, it is likely to be moved to core_analytics\calculable
core_analytics\local\time_splitting\base | $timesplitting | |
int | $rangeindex |
null |
|
inherited |
Show only the main feature.
float | $value | |
string | $subtype |
bool |
Reimplemented from core_analytics\local\indicator\base.
|
protectedinherited |
Calculates the social breadth of a sample.
int | $sampleid | |
string | $tablename | |
int | $starttime | |
int | $endtime |
float|int|null |
|
protectedinherited |
Converts the calculated values to a list of features for the dataset.
array | $calculatedvalues |
array |
Reimplemented from core_analytics\local\indicator\base.
|
protectedinherited |
Validates the calculated value.
coding_exception |
float | $calculatedvalue |
true |
Reimplemented in core_analytics\local\indicator\discrete.