Affects Version/s: 3.9
Fix Version/s: 3.9
All new classes and methods are covered by PHPUnitTests:
- Run PHPUnitTests suite: vendor/bin/phpunit --testsuite core_xapi_testsuite
Pull from Repository:
Pull Master Branch:
Pull Master Diff URL:
A basic xAPI LRS support is needed In order to get statements from H5P content.
This first issue will cover the following needs:
- Have a "lib/xAPI" library for the main LRS access point
- A generic Moodle webservice layer which wraps a xAPI statement processing
- xAPI handler base classes which every plugin can extend to use xAPI on their code
- xAPI statement class to generate xAPI statements with all related classes for handling actors (user, group), objects and verbs (the rest of xAPI properties would be compatible but validations will be responsibility of every plugin for now).
- PHPUnit test
- Null privacy provider
The web service for processing a xAPI statement will delegate part of the process to specific plugins like the future mod_h5p.
The web service receive a frankenstyle component responsible to handle part of the statement and a xAPI statement structure.
xAPI Statement generic processing method will:
- xAPI checks the statement structure, if any check fails, it returns an error. That means:
- Check that only supported xAPI attributes are used
- Check all users and groups are created in the LMS
- xAPI checks if the component has a xAPI handling class implementation. Otherwise it returns an error.
- For every statement:
- xAPI asks again the plugin to you convert into a standard event. In case the plugin could not convert some statement into an event, this statement will be marked as “rejected” and xAPI continue to the next statement.
- xAPI handler will trigger all the generated events
- Once all statements are processed:
- If ALL statements are marked as “not processed” it returns an error.
- If some statement could be processed, returns an array containing “true” if the statement is processed and “false" otherwise.