course.php 928 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. $reports_modules['course'] = array ();
  3. function reports_modules_course_init() {
  4. }
  5. function reports_modules_course_init_forEachCourses($course_code, $course_id, $course_db) {
  6. global $reports_modules;
  7. // $reports_modules_course_toolid = reports_getToolId(TOOL_QUIZ);
  8. array_push($reports_modules['course'],
  9. array('keys_query' =>
  10. 'select '.$course_id.' as course_id, "'.$course_code.'" as course_code',
  11. 'values_query_function' => 'reports_modules_course_val'));
  12. }
  13. function reports_modules_course_val($course, $key_id) {
  14. return array('type'=> 'sql', 'sql' =>
  15. 'select '.$key_id.', user_id as uid, '.
  16. '-1 as session_id, -1 as attempt, null as score, '.
  17. 'NULL as progress, '.
  18. '(sum(logout_course_date) - sum(login_course_date)) as time, null as ts from '.
  19. Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS).
  20. ' where c_id = '."'".$course['course_id']."'".
  21. ' group by user_id');
  22. }