If you’ve read Ben’s previous blog post, you’ll know that we’ve been working hard to improve our conformance. You’ll be happy to know that we’re now in the process of testing our issue/conformance branch on Github and making a new release. We’ve also reported the issues that we had with the xAPI test suite on Github and those are now being resolved.

Whilst we were improving our conformance, we decided to refactor our statement validator. The refactoring process has:

  1. Fixed a small bug in Learning Locker
  2. Improved code reuse and maintainability
  3. Allowed us to publish our validation without Learning Locker via Packagist
  4. Improved our validation messages

Our new validation has been tested against the xAPI test suite, all of the examples given by the specification, and our own test suite. Whilst the first two benefits are great, the last two are more interesting to the community.

Our new Statement Factory suite allows you to validate your xAPI statements outside of Learning Locker – you can even validate pre-constructed JSON statements. Activity Providers looking to generate xAPI statements will find this a useful debugging tool to iron out any problems with a statement’s structure prior to deploying to an LRS.

Our validation messages have been sprinkled with awesomeness this festive season. Our new messages are intuitive and more traceable than ever before. With every message we provide you with three pieces of information:

  1. What Learning Locker actually received
  2. What Learning Locker expected to receive
  3. Where the problem is

Here are a few (slightly contrived) examples:

  1. “`Agen` (LockerXApiElement) is not a valid `objectType` in `LockerXApiAuthority`. Acceptable types are `[“Agent”,”Group”]` in `statement.authority`”
  2. “Unknown properties [“name”,”mbox”,”objectType”] from `LockerXApiElement` in `statement.authority`”
  3. “`+100` should be a valid `LockerXApiLanguage` in `statement.verb.display`”
  4. “`mailt:[email protected]` should be a valid `LockerXApiMailto` in `statement.actor.mbox`”

Next Steps

As I previously said, we’re now in the process of testing and making a new release (in the next week or two) from the issue/conformance branch (this will be merged into develop soon). We’d be grateful for your feedback as always via Github, the Google Group, and Gitter.