/** * Reads data for an event. * @param [String => Mixed] $opts * @return [String => Mixed] * @override CourseViewed */ public function read(array $opts) { return array_merge(parent::read($opts), ['recipe' => 'module_viewed', 'module_url' => $opts['module']->url, 'module_name' => $opts['module']->name, 'module_description' => $opts['module']->intro ?: 'A module', 'module_type' => static::$xapi_type . $opts['module']->type, 'module_ext' => $opts['module'], 'module_ext_key' => 'http://lrs.learninglocker.net/define/extensions/moodle_module']); }
/** * Reads data for an event. * @param [String => Mixed] $opts * @return [String => Mixed] * @override CourseViewed */ public function read(array $opts) { return [array_merge(parent::read($opts)[0], ['recipe' => 'enrolment_created', 'user_id' => $opts['relateduser']->id, 'user_url' => $opts['relateduser']->url, 'user_name' => $opts['relateduser']->username, 'instructor_id' => $opts['user']->id, 'instructor_url' => $opts['user']->url, 'instructor_name' => $opts['user']->username])]; }
/** * overides CourseViewed recipe. * @param array $opts * @return array */ public function read(array $opts) { return [array_merge(parent::read($opts)[0], ['recipe' => 'course_completed'])]; }