You are here

function opigno_lrs_stats_aggregate_statements_by_object in Opigno TinCan API 7

Aggregate statements by object

Output example: array( 'http://opigno.org/node/100' => statements, 'http://opigno.org/node/101' => statements, 'http://opigno.org/node/102' => statements )

Return value

array

1 call to opigno_lrs_stats_aggregate_statements_by_object()
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 122
Implements functions to aggregate statements

Code

function opigno_lrs_stats_aggregate_statements_by_object($statements) {
  $statements_per_object = array();
  foreach ($statements as $statement) {
    $statements_per_object[$statement->object->id][] = $statement;
  }
  return $statements_per_object;
}