Skip to content

Commit

Permalink
feat(JISC): Adds jisc extensions behind send_jisc_data setting. (#547)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryasmi authored May 17, 2019
1 parent 2281a17 commit da6298a
Show file tree
Hide file tree
Showing 65 changed files with 379 additions and 155 deletions.
2 changes: 2 additions & 0 deletions classes/log/store.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ public function process_events(array $events) {
'send_short_course_id' => $this->get_config('shortcourseid', false),
'send_course_and_module_idnumber' => $this->get_config('sendidnumber', false),
'send_username' => $this->get_config('send_username', false),
'send_jisc_data' => $this->get_config('send_jisc_data', false),
'session_id' => sesskey(),
'plugin_url' => 'https://github.com/xAPI-vle/moodle-logstore_xapi',
'plugin_version' => $plugin->release,
'repo' => new \src\transformer\repos\MoodleRepository($DB),
Expand Down
2 changes: 2 additions & 0 deletions lang/en/logstore_xapi.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
$string['mbox_desc'] = 'Statements will identify users with their email (mbox) when this box is ticked.';
$string['send_username'] = 'Identify users by id';
$string['send_username_desc'] = 'Statements will identify users with their username when this box is ticked, but only if identifying users by email is disabled.';
$string['send_jisc_data'] = 'Adds JISC data to statements';
$string['send_jisc_data_desc'] = 'Statements will contain data required by JISC.';
$string['shortcourseid'] = 'Send short course name';
$string['shortcourseid_desc'] = 'Statements will contain the shortname for a course as a short course id extension';
$string['sendidnumber'] = 'Send course and activity ID number';
Expand Down
4 changes: 4 additions & 0 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
get_string('send_username', 'logstore_xapi'),
get_string('send_username_desc', 'logstore_xapi'), 0));

$settings->add(new admin_setting_configcheckbox('logstore_xapi/send_jisc_data',
get_string('send_jisc_data', 'logstore_xapi'),
get_string('send_jisc_data_desc', 'logstore_xapi'), 0));

$settings->add(new admin_setting_configcheckbox('logstore_xapi/sendresponsechoices',
get_string('send_response_choices', 'logstore_xapi'),
get_string('send_response_choices_desc', 'logstore_xapi'), 0));
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/all/course_module_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ function course_module_viewed(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/core/course_completed.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ function course_completed(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ function course_module_completion_updated(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/core/course_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ function course_viewed(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config)
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/core/user_created.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ function user_created(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, null),
'contextActivities' => [
'category' => [
utils\get_activity\source($config)
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/core/user_enrolment_created.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ function user_enrolment_created(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config)
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/core/user_loggedin.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ function user_loggedin(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, null),
'contextActivities' => [
'category' => [
utils\get_activity\source($config)
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/core/user_loggedout.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ function user_loggedout(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, null),
'contextActivities' => [
'category' => [
utils\get_activity\source($config)
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/mod_assign/assignment_graded.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ function assignment_graded(array $config, \stdClass $event) {
'instructor' => utils\get_user($config, $instructor),
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/mod_assign/assignment_submitted.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ function assignment_submitted(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/mod_book/chapter_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ function chapter_viewed(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/mod_book/course_module_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ function course_module_viewed(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/mod_chat/course_module_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ function course_module_viewed(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/mod_facetoface/cancel_booking.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ function cancel_booking(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ function course_module_viewed(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/mod_facetoface/signup_success.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ function signup_success(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/mod_facetoface/take_attendance.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ function take_attendance(array $config, \stdClass $event) {
'platform' => $config['source_name'],
'language' => $lang,
'instructor' => utils\get_user($config, $user),
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/mod_feedback/course_module_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ function course_module_viewed(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ function multichoice(array $config, \stdClass $event, \stdClass $feedbackvalue,
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ function multichoicerated(array $config, \stdClass $event, \stdClass $feedbackva
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ function numerical(array $config, \stdClass $event, \stdClass $feedbackvalue, \s
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ function textarea(array $config, \stdClass $event, \stdClass $feedbackvalue, \st
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ function textfield(array $config, \stdClass $event, \stdClass $feedbackvalue, \s
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ function response_submitted(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/mod_forum/course_module_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ function course_module_viewed(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/mod_forum/discussion_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ function discussion_viewed(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/mod_forum/user_report_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ function user_report_viewed(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/mod_lesson/course_module_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ function course_module_viewed(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/mod_page/course_module_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ function course_module_viewed(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/mod_quiz/attempt_reviewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ function attempt_reviewed(array $config, \stdClass $event) {
'instructor' => utils\get_user($config, $instructor),
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/mod_quiz/attempt_started.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ function attempt_started(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'other' => [
utils\get_activity\quiz_attempt($config, $attempt->id, $event->contextinstanceid),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ function attempt_submitted(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'other' => [
utils\get_activity\quiz_attempt($config, $attempt->id, $coursemodule->id),
Expand Down
4 changes: 1 addition & 3 deletions src/transformer/events/mod_quiz/attempt_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ function attempt_viewed(array $config, \stdClass $event) {
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => [
utils\INFO_EXTENSION => utils\get_info($config, $event),
],
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
utils\get_activity\site($config),
Expand Down
Loading

0 comments on commit da6298a

Please sign in to comment.