You are here

function opigno_lrs_stats_aggregate_statements_by_verb in Opigno TinCan API 7

Aggregate statements by verb

Output example: array( 'http://opigno.org/node/104' => statements, 'http://opigno.org/node/106' => statements, 'http://opigno.org/node/109' => statements )

Return value

array

2 string references to 'opigno_lrs_stats_aggregate_statements_by_verb'
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 161
Implements functions to aggregate statements

Code

function opigno_lrs_stats_aggregate_statements_by_verb($statements) {
  $statements_per_verb = array();
  foreach ($statements as $statement) {
    $statements_per_verb[$statement->verb->id][] = $statement;
  }
  return $statements_per_verb;
}