diff --git a/docs/configure-the-plugin.md b/docs/configure-the-plugin.md index a62990d68274c9e2b239421d417db94a1b965c9c..62421a77cc02ab0f2f2f9d4584b96c055289a66c 100644 --- a/docs/configure-the-plugin.md +++ b/docs/configure-the-plugin.md @@ -1,5 +1,7 @@ # Configure the plugin +**Note that by default the plugin now runs in background mode via a cron task to avoid blocking page responses. This can be changed on the configuration page.** + 1. Set your “endpoint†to your LRS endpoint (e.g. “<http://your.lrs/xAPI>â€). 1. Set your “username†to your LRS basic auth key/username (e.g. “d416e6220812740d3922eb09813ebb4163e8eb3eâ€). 1. Set your “password†to your LRS basic auth secret/password (e.g. “bc7e0a2edd5d1969b6d774e679d4eb4e7a35be13â€). diff --git a/lang/en/logstore_xapi.php b/lang/en/logstore_xapi.php index a003dd156d213b035177ff53155e924260d15134..f76f6531e0c855e285f03f60c7b5af577fa76e4a 100644 --- a/lang/en/logstore_xapi.php +++ b/lang/en/logstore_xapi.php @@ -28,7 +28,7 @@ $string['username'] = 'Username'; $string['xapisettingstitle'] = 'Logstore xAPI Settings'; $string['backgroundmode'] = 'Send statements by scheduled task?'; $string['backgroundmode_desc'] = 'This will force Moodle to send the statements to the LRS in the background, - via a cron task. This will make the process less close to real time, but will help to prevent unpredictable + via a cron task to avoid blocking page responses. This will make the process less close to real time, but will help to prevent unpredictable Moodle performance linked to the performance of the LRS.'; $string['maxbatchsize'] = 'Maximum batch size'; $string['maxbatchsize_desc'] = 'Statements are sent to the LRS in batches. This setting controls the maximum number of diff --git a/settings.php b/settings.php index fe41c38139f8501716b23943b5ff1370d595a600..3ef9e9624ce1154532073c9ba0920e6ec39302eb 100644 --- a/settings.php +++ b/settings.php @@ -33,7 +33,7 @@ if ($hassiteconfig) { // Switch background batch mode on. $settings->add(new admin_setting_configcheckbox('logstore_xapi/backgroundmode', get_string('backgroundmode', 'logstore_xapi'), - get_string('backgroundmode_desc', 'logstore_xapi'), 0)); + get_string('backgroundmode_desc', 'logstore_xapi'), 1)); $settings->add(new admin_setting_configtext('logstore_xapi/maxbatchsize', get_string('maxbatchsize', 'logstore_xapi'), diff --git a/src/transformer/utils/get_activity/site.php b/src/transformer/utils/get_activity/site.php index a5f57de8d05fb49d5ccd1ff3fdc5f81d67f8ef9e..01893c0276db28178d39f718e531ceccb0f70517 100644 --- a/src/transformer/utils/get_activity/site.php +++ b/src/transformer/utils/get_activity/site.php @@ -28,7 +28,7 @@ function site(array $config) { return [ 'id' => $config['app_url'], 'definition' => [ - 'type' => 'http://id.tincanapi.com/activitytype/site', + 'type' => 'http://id.tincanapi.com/activitytype/lms', 'name' => [ $sitelang => $sitename, ], diff --git a/tests/all/course_module_viewed/viewing_scorm_module/statements.json b/tests/all/course_module_viewed/viewing_scorm_module/statements.json index ce2998ac31af9661cf3805bb427841e2a22ee93d..8f7c6c9af0350c79babf5aa7f84da108bd98376b 100644 --- a/tests/all/course_module_viewed/viewing_scorm_module/statements.json +++ b/tests/all/course_module_viewed/viewing_scorm_module/statements.json @@ -39,7 +39,7 @@ { "id": "http:\/\/www.example.org", "definition": { - "type": "http:\/\/id.tincanapi.com\/activitytype\/site", + "type": "http:\/\/id.tincanapi.com\/activitytype\/lms", "name": { "en": "test_name" } diff --git a/tests/core/course_completed/completing_existing_course/statements.json b/tests/core/course_completed/completing_existing_course/statements.json index ef18028c07366d8854135ae82d0676551a632640..1cb5315ab040a941ea7ca57ff68b68cf917757e7 100644 --- a/tests/core/course_completed/completing_existing_course/statements.json +++ b/tests/core/course_completed/completing_existing_course/statements.json @@ -39,7 +39,7 @@ { "id": "http:\/\/www.example.org", "definition": { - "type": "http:\/\/id.tincanapi.com\/activitytype\/site", + "type": "http:\/\/id.tincanapi.com\/activitytype\/lms", "name": { "en": "test_name" } diff --git a/tests/core/course_viewed/viewing_existing_course/statements.json b/tests/core/course_viewed/viewing_existing_course/statements.json index e82866c2fa4074f0cc1a486463b07ad1aef35128..902e594c33fe77be4fd6685a7764f4ea9ca5e6df 100644 --- a/tests/core/course_viewed/viewing_existing_course/statements.json +++ b/tests/core/course_viewed/viewing_existing_course/statements.json @@ -39,7 +39,7 @@ { "id": "http:\/\/www.example.org", "definition": { - "type": "http:\/\/id.tincanapi.com\/activitytype\/site", + "type": "http:\/\/id.tincanapi.com\/activitytype\/lms", "name": { "en": "test_name" } diff --git a/tests/core/user_created/existing_user_created/statements.json b/tests/core/user_created/existing_user_created/statements.json index 95461c562ae1e67fd0ea72bf2831a5b96729e3eb..f11e083d26ce047236da7db368acbd0ddee0e204 100644 --- a/tests/core/user_created/existing_user_created/statements.json +++ b/tests/core/user_created/existing_user_created/statements.json @@ -16,7 +16,7 @@ "object": { "id": "http:\/\/www.example.org", "definition": { - "type": "http:\/\/id.tincanapi.com\/activitytype\/site", + "type": "http:\/\/id.tincanapi.com\/activitytype\/lms", "name": { "en": "test_name" } diff --git a/tests/core/user_enrolment_created/existing_user_enrolled/statements.json b/tests/core/user_enrolment_created/existing_user_enrolled/statements.json index ff38d1a1f8a8acd1c3907ea6f6eb6d3e2a6d2f94..c45bc30e2157285db9179bf0c7ef94b570aff889 100644 --- a/tests/core/user_enrolment_created/existing_user_enrolled/statements.json +++ b/tests/core/user_enrolment_created/existing_user_enrolled/statements.json @@ -39,7 +39,7 @@ { "id": "http:\/\/www.example.org", "definition": { - "type": "http:\/\/id.tincanapi.com\/activitytype\/site", + "type": "http:\/\/id.tincanapi.com\/activitytype\/lms", "name": { "en": "test_name" } diff --git a/tests/core/user_loggedin/existing_user_loggedin/statements.json b/tests/core/user_loggedin/existing_user_loggedin/statements.json index 84aa4b398760427fd1f462f84e9a3b0525176477..961147ea7bfe2a0d12bcccf97be23c0da4706d5e 100644 --- a/tests/core/user_loggedin/existing_user_loggedin/statements.json +++ b/tests/core/user_loggedin/existing_user_loggedin/statements.json @@ -16,7 +16,7 @@ "object": { "id": "http:\/\/www.example.org", "definition": { - "type": "http:\/\/id.tincanapi.com\/activitytype\/site", + "type": "http:\/\/id.tincanapi.com\/activitytype\/lms", "name": { "en": "test_name" } diff --git a/tests/core/user_loggedout/existing_user_loggedout/statements.json b/tests/core/user_loggedout/existing_user_loggedout/statements.json index 3382e9562c7dcc41ed804e349cd2ae0f6bf2b404..2b8b4c0a90ee52d156d2a835e97ca8ca7436e72c 100644 --- a/tests/core/user_loggedout/existing_user_loggedout/statements.json +++ b/tests/core/user_loggedout/existing_user_loggedout/statements.json @@ -16,7 +16,7 @@ "object": { "id": "http:\/\/www.example.org", "definition": { - "type": "http:\/\/id.tincanapi.com\/activitytype\/site", + "type": "http:\/\/id.tincanapi.com\/activitytype\/lms", "name": { "en": "test_name" } diff --git a/tests/mod_assign/assignment_graded/existing_assignment_graded/statements.json b/tests/mod_assign/assignment_graded/existing_assignment_graded/statements.json index 96a709201169c4668064dab84c6aa307749ff84f..a1c609f4f4e867f805bd14fd66899a9497129e46 100644 --- a/tests/mod_assign/assignment_graded/existing_assignment_graded/statements.json +++ b/tests/mod_assign/assignment_graded/existing_assignment_graded/statements.json @@ -67,7 +67,7 @@ { "id": "http:\/\/www.example.org", "definition": { - "type": "http:\/\/id.tincanapi.com\/activitytype\/site", + "type": "http:\/\/id.tincanapi.com\/activitytype\/lms", "name": { "en": "test_name" } diff --git a/tests/mod_assign/assignment_submitted/existing_assignment_submitted/statements.json b/tests/mod_assign/assignment_submitted/existing_assignment_submitted/statements.json index fbb8159d738d136b7a3a14f84ead923770ed62de..b07cb6ce4de5737a679764f0159073453da061a2 100644 --- a/tests/mod_assign/assignment_submitted/existing_assignment_submitted/statements.json +++ b/tests/mod_assign/assignment_submitted/existing_assignment_submitted/statements.json @@ -39,7 +39,7 @@ { "id": "http:\/\/www.example.org", "definition": { - "type": "http:\/\/id.tincanapi.com\/activitytype\/site", + "type": "http:\/\/id.tincanapi.com\/activitytype\/lms", "name": { "en": "test_name" } diff --git a/tests/mod_facetoface/cancel_booking/existing_booking_cancelled/statements.json b/tests/mod_facetoface/cancel_booking/existing_booking_cancelled/statements.json index d1eefb503161651863bf2e9f4f75c766e5eef6f2..e88ee7b81055aca69a8afd866055eae81ebe77de 100644 --- a/tests/mod_facetoface/cancel_booking/existing_booking_cancelled/statements.json +++ b/tests/mod_facetoface/cancel_booking/existing_booking_cancelled/statements.json @@ -39,7 +39,7 @@ { "id": "http:\/\/www.example.org", "definition": { - "type": "http:\/\/id.tincanapi.com\/activitytype\/site", + "type": "http:\/\/id.tincanapi.com\/activitytype\/lms", "name": { "en": "test_name" } diff --git a/tests/mod_facetoface/signup_success/existing_signup_success/statements.json b/tests/mod_facetoface/signup_success/existing_signup_success/statements.json index b163759a031a05f875006e32f7f1fb83a1c51e32..ff16f45af802fc9753421d8d4876645204eac036 100644 --- a/tests/mod_facetoface/signup_success/existing_signup_success/statements.json +++ b/tests/mod_facetoface/signup_success/existing_signup_success/statements.json @@ -39,7 +39,7 @@ { "id": "http:\/\/www.example.org", "definition": { - "type": "http:\/\/id.tincanapi.com\/activitytype\/site", + "type": "http:\/\/id.tincanapi.com\/activitytype\/lms", "name": { "en": "test_name" } diff --git a/tests/mod_facetoface/take_attendance/existing_attendance_taken/statements.json b/tests/mod_facetoface/take_attendance/existing_attendance_taken/statements.json index feb0a93357f4736b42d5008253db2a76d6de4d67..9e36627c43d35d0a2d117a4012a839b7698bca50 100644 --- a/tests/mod_facetoface/take_attendance/existing_attendance_taken/statements.json +++ b/tests/mod_facetoface/take_attendance/existing_attendance_taken/statements.json @@ -50,7 +50,7 @@ { "id": "http:\/\/www.example.org", "definition": { - "type": "http:\/\/id.tincanapi.com\/activitytype\/site", + "type": "http:\/\/id.tincanapi.com\/activitytype\/lms", "name": { "en": "test_name" } diff --git a/tests/mod_feedback/response_submitted/existing_response/statements.json b/tests/mod_feedback/response_submitted/existing_response/statements.json index 06329a66280360e5f0522b5789bce6de21b2ef44..5e61d058dfa1197e46eaac16654567b403f4d2e1 100644 --- a/tests/mod_feedback/response_submitted/existing_response/statements.json +++ b/tests/mod_feedback/response_submitted/existing_response/statements.json @@ -39,7 +39,7 @@ { "id": "http:\/\/www.example.org", "definition": { - "type": "http:\/\/id.tincanapi.com\/activitytype\/site", + "type": "http:\/\/id.tincanapi.com\/activitytype\/lms", "name": { "en": "test_name" } diff --git a/tests/mod_forum/discussion_viewed/existing_discussion_viewed/statements.json b/tests/mod_forum/discussion_viewed/existing_discussion_viewed/statements.json index 901216126302b2710429b59dd6654d3f20c21e2b..d65933479c8cae3d17b6d36c353a6b89bb9fd10a 100644 --- a/tests/mod_forum/discussion_viewed/existing_discussion_viewed/statements.json +++ b/tests/mod_forum/discussion_viewed/existing_discussion_viewed/statements.json @@ -39,7 +39,7 @@ { "id": "http:\/\/www.example.org", "definition": { - "type": "http:\/\/id.tincanapi.com\/activitytype\/site", + "type": "http:\/\/id.tincanapi.com\/activitytype\/lms", "name": { "en": "test_name" } diff --git a/tests/mod_forum/user_report_viewed/existing_report_viewed/statements.json b/tests/mod_forum/user_report_viewed/existing_report_viewed/statements.json index 712d9ba6eb8202a5a94195204ffeec8df0b5e5f3..53dd25207efb70f90c16cdb140974fd28c5853ba 100644 --- a/tests/mod_forum/user_report_viewed/existing_report_viewed/statements.json +++ b/tests/mod_forum/user_report_viewed/existing_report_viewed/statements.json @@ -43,7 +43,7 @@ { "id": "http:\/\/www.example.org", "definition": { - "type": "http:\/\/id.tincanapi.com\/activitytype\/site", + "type": "http:\/\/id.tincanapi.com\/activitytype\/lms", "name": { "en": "test_name" } diff --git a/tests/mod_quiz/attempt_reviewed/existing_attempt_reviewed/statements.json b/tests/mod_quiz/attempt_reviewed/existing_attempt_reviewed/statements.json index 2348dcc8ab37e61ed9b290aacb4c5b8c9ff658d8..bfb0634839d8f5aaffc5f37b23169c3043f8fdef 100644 --- a/tests/mod_quiz/attempt_reviewed/existing_attempt_reviewed/statements.json +++ b/tests/mod_quiz/attempt_reviewed/existing_attempt_reviewed/statements.json @@ -46,7 +46,7 @@ { "id": "http:\/\/www.example.org", "definition": { - "type": "http:\/\/id.tincanapi.com\/activitytype\/site", + "type": "http:\/\/id.tincanapi.com\/activitytype\/lms", "name": { "en": "test_name" } diff --git a/tests/mod_quiz/attempt_started/existing_attempt_started/statements.json b/tests/mod_quiz/attempt_started/existing_attempt_started/statements.json index 3ff202180e1b529245a2c00755630ae7406cd916..b426a71f9cffb5088cf28f0b228cd88945255aa3 100644 --- a/tests/mod_quiz/attempt_started/existing_attempt_started/statements.json +++ b/tests/mod_quiz/attempt_started/existing_attempt_started/statements.json @@ -50,7 +50,7 @@ { "id": "http:\/\/www.example.org", "definition": { - "type": "http:\/\/id.tincanapi.com\/activitytype\/site", + "type": "http:\/\/id.tincanapi.com\/activitytype\/lms", "name": { "en": "test_name" } diff --git a/tests/mod_quiz/attempt_submitted/existing_attempt_submitted/statements.json b/tests/mod_quiz/attempt_submitted/existing_attempt_submitted/statements.json index 4078b5b594a9d6c087343003f9f773285af17716..2dcfc406853b3c76a2352ba0fa89cf359d8615d1 100644 --- a/tests/mod_quiz/attempt_submitted/existing_attempt_submitted/statements.json +++ b/tests/mod_quiz/attempt_submitted/existing_attempt_submitted/statements.json @@ -61,7 +61,7 @@ { "id": "http:\/\/www.example.org", "definition": { - "type": "http:\/\/id.tincanapi.com\/activitytype\/site", + "type": "http:\/\/id.tincanapi.com\/activitytype\/lms", "name": { "en": "test_name" } diff --git a/tests/mod_scorm/sco_launched/existing_sco_launched/statements.json b/tests/mod_scorm/sco_launched/existing_sco_launched/statements.json index de617c1f7831cbf9aa4effbefd1cd9f7d4372353..2fc9c02442d30f06ab84b06753e53e904aec4390 100644 --- a/tests/mod_scorm/sco_launched/existing_sco_launched/statements.json +++ b/tests/mod_scorm/sco_launched/existing_sco_launched/statements.json @@ -39,7 +39,7 @@ { "id": "http:\/\/www.example.org", "definition": { - "type": "http:\/\/id.tincanapi.com\/activitytype\/site", + "type": "http:\/\/id.tincanapi.com\/activitytype\/lms", "name": { "en": "test_name" } diff --git a/tests/mod_scorm/scoreraw_submitted/existing_scoreraw_submitted/statements.json b/tests/mod_scorm/scoreraw_submitted/existing_scoreraw_submitted/statements.json index d31f3bd5d438ac69f7fc0b096e2f88048eeaddfc..6c4cb7287f65cd4489e54665959b640fb3447fdd 100644 --- a/tests/mod_scorm/scoreraw_submitted/existing_scoreraw_submitted/statements.json +++ b/tests/mod_scorm/scoreraw_submitted/existing_scoreraw_submitted/statements.json @@ -47,7 +47,7 @@ { "id": "http:\/\/www.example.org", "definition": { - "type": "http:\/\/id.tincanapi.com\/activitytype\/site", + "type": "http:\/\/id.tincanapi.com\/activitytype\/lms", "name": { "en": "test_name" } diff --git a/tests/mod_scorm/status_submitted/existing_status_submitted/statements.json b/tests/mod_scorm/status_submitted/existing_status_submitted/statements.json index 22eddff872781850a7ffa822652f7f427a946f93..913144157441f64669c19a5116003069e65ee0f9 100644 --- a/tests/mod_scorm/status_submitted/existing_status_submitted/statements.json +++ b/tests/mod_scorm/status_submitted/existing_status_submitted/statements.json @@ -39,7 +39,7 @@ { "id": "http:\/\/www.example.org", "definition": { - "type": "http:\/\/id.tincanapi.com\/activitytype\/site", + "type": "http:\/\/id.tincanapi.com\/activitytype\/lms", "name": { "en": "test_name" }