function opigno_lrs_stats_aggregate_viewed_statements_by_page in Opigno TinCan API 7
Aggregate statements by page
Output example: array( 'http://opigno.org/node/50' => statements, 'http://opigno.org/node/51' => statements, 'http://opigno.org/node/55' => statements )
Parameters
$statements:
Return value
array
1 call to opigno_lrs_stats_aggregate_viewed_statements_by_page()
- opigno_lrs_stats_dashboard_top_ten_viewed_pages in modules/
opigno_tincan_api_stats/ includes/ dashboard/ model.inc - Retrieve top ten viewed pages from tincan statements
File
- modules/
opigno_tincan_api_stats/ includes/ model/ aggregations.inc, line 84 - Implements functions to aggregate statements
Code
function opigno_lrs_stats_aggregate_viewed_statements_by_page($statements) {
$statements_per_page = array();
foreach ($statements as $statement) {
$statements_per_page[$statement->object->id][] = $statement;
}
return $statements_per_page;
}