xAPI-vle / moodle-logstore_xapi

A Moodle plugin to send xAPI statements to an LRS using events in the Moodle logstore.
GNU General Public License v3.0
76 stars 84 forks source link

"Identify users by id" setting does not work, flawed test #733

Closed gavbaa closed 2 years ago

gavbaa commented 4 years ago

Description Enabling the "Identify users by id" setting does not send the username in the xAPI statement.

Version Release 4.6.0, which appears to be current master.

Steps to reproduce the bug

  1. Go to Site Administration -> Plugins -> Logging -> Logstore xAPI
  2. Tick the box named “Identify users by id”.
  3. View a course activity.
  4. The statements sent to the LRS have an actor of: "actor": { "name": "Admin User", "account": { "homePage": "https://lms.com", "name": "2" } }

Expected behaviour The statements sent to the LRS have an actor of: "actor": { "name": "Admin User", "account": { "homePage": "https://lms.com", "name": "admin" } }

Actual behaviour "actor": { "name": "Admin User", "account": { "homePage": "https://lms.com", "name": "2" } }

Server information

Client information

Additional information Changing the test on https://github.com/xAPI-vle/moodle-logstore_xapi/blob/master/src/transformer/utils/get_user.php#L32 from

if (array_key_exists('send_username', $config) && $config['send_username'] === true) {

to

if (array_key_exists('send_username', $config) && $config['send_username'] == true) {

appears to resolve the issue.

davidpesce commented 2 years ago

This was resolved in #745 and will be merged into main repository soon.