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
75 stars 85 forks source link

user_report_viewed event course id is sometimes 0, but this causes error #525

Closed garemoko closed 5 years ago

garemoko commented 5 years ago

Description The user_report_viewed event is triggered when somebody views a report of a particular user's forum usage. This report can look at site wide forum usage rather than for a single course, in which case there is no particular related course. As a result the Moodle event can have a course id of 0, if the user was looking at a report of all forum activity for all courses.

The generates an error when we try to get course information because course 0 does not exist.

To fix:

  1. Update tests data to have the event include a course id of 0.
  2. Delete https://github.com/xAPI-vle/moodle-logstore_xapi/blob/master/src/transformer/events/mod_forum/user_report_viewed.php#L26 and https://github.com/xAPI-vle/moodle-logstore_xapi/blob/master/src/transformer/events/mod_forum/user_report_viewed.php#L49
  3. Update tests expected result.

I'll try and get a PR in tomorrow.

Version 4.2.4

HT2Bot commented 5 years ago

:tada: This issue has been resolved in version 4.2.5 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: