One of the recently released plugins in the Moodle plugins database is the Logstore xAPI which allows you to emits events from the Moodle Logstore as xAPI statements.
Moodle Logstore is a log of activities in Moodle. When you view a course, complete a quiz, or grade a student a log of that activity is recorded in the Logstore. The plugin uses these logs to produce xAPI statements and then sends (emits) them to an LRS that you can configure. Read More