function opigno_lrs_stats_aggregate_statements_by_user in Opigno TinCan API 7
Aggregate statements by user
Output example: array( 'toto1' => statements, 'toto2' => statements, 'toto3' => statements )
Parameters
$statements:
Return value
array
3 calls to opigno_lrs_stats_aggregate_statements_by_user()
- opigno_lrs_stats_course_content_course_contexts_statistics in modules/
opigno_tincan_api_stats/ includes/ course_content/ model.inc - Present course contexts statistics
- opigno_lrs_stats_course_content_total_number_of_active_users in modules/
opigno_tincan_api_stats/ includes/ course_content/ model.inc - Count total number of active users for all course contents
- opigno_lrs_stats_dashboard_present_most_active_users in modules/
opigno_tincan_api_stats/ includes/ dashboard/ model.inc - Retrieve most active users (max 10) from tincan statements
2 string references to 'opigno_lrs_stats_aggregate_statements_by_user'
- opigno_lrs_stats_course_content_course_contexts_statistics in modules/
opigno_tincan_api_stats/ includes/ course_content/ model.inc - Present course contexts statistics
- opigno_lrs_stats_quizzes_quizzes_statistics in modules/
opigno_tincan_api_stats/ includes/ quizzes/ model.inc - Present quizzes statistics
File
- modules/
opigno_tincan_api_stats/ includes/ model/ aggregations.inc, line 104 - Implements functions to aggregate statements
Code
function opigno_lrs_stats_aggregate_statements_by_user($statements) {
$statements_per_user = array();
foreach ($statements as $statement) {
$statements_per_user[$statement->actor->name][] = $statement;
}
return $statements_per_user;
}