Working on Red Panda and Learning Locker. Previously Elgg. I enjoy trying to solve problems with technology.

A nifty way to orderBy in Laravel while ignoring null values

Tuesday 05 July 2016

I was working on a Laravel project today that required orderBy 'asc' on a field that could contain null values. The issue when trying to get the data in 'asc' order was the null values would always be first: "null,null,null,4,5,6".

Here is one solution when using Laravel Eloquent.

DB::raw( "ISNULL(due_date), due_date" ) )

This will maintain the orderBy 'asc' while placing any record with a null value at the end.

Objective::with('user')->orderBy( DB::raw( "ISNULL(due_date), due_date" ) )->paginate(15);

Learning Locker wins MongoDB’s Open Source Innovation Award 2016

Wednesday 29 June 2016

Yesterday Learning Locker was announced as the winner of MongoDB’s Open Source Innovation award 2016. Last year’s winner was Facebook so we’re in good company.

Learning Locker is a Learning Record Store (LRS). It’s open source, generating revenue, and growing from strength to strength. This award is testament to all those involved both within HT2 and the wider open source community.

When I was hired by HT2 to help develop something new and innovative, the initial idea was not to build an LRS but a personal learning tool that would allow students to take control of their learning data. We quickly realized that first there had to be a standard way for institutions to collect and store data so we pivoted and built an open source LRS; turns out that was a good decision!

On a personal note, my current focus has shifted to a new HT2 product called Red Panda, a personal learning app that uses data stored in Learning Locker to recommend and guide individuals through personalized learning pathways. This new product works together with Learning Locker and Curatr (as well as other LMSs such as Moodle) to offer organizations a complete learning ecosystem that is personalized, social and driven by data.

Read more about the award over on Learning Locker’s blog.

Modern Command Line Part Two: Rise of the bots

Thursday 04 February 2016

Following on from my post  - Modern Command Lines -  talking about slash commands and Red Panda (a new CPD platform I work on), this post covers our work on bots.

Along with slash commands, we have introduced a native helper bot and hooks for external services, in our case Learning Locker, to provide a bot for users.

There are two things you do with these bots:

  1. Ask a question and get a reply.
  2. Issue a command and the bot goes off and does it.

Some background

Towards the end of last year, I spent a fair bit of time reading up on bots, command lines and conversational interfaces. The service that really piqued my interest was Slack; they have done a great job providing ways to integrate with the service from full blown apps through webhooks to slash commands and bots. They also brought the command line and text commands to a new audience who may not have used this approach before.

Given recent hype there will be people who are rightly wary; if the approach doesn’t gain traction outside of more technically minded users and products, then it will remain an option for power users only.

However, I think conversational interfaces stand a chance of wider adoption. Once you start using the command line it becomes natural, you just chat. Messaging apps are everywhere so the interface is familiar. No need to hunt around a UI trying to find what you need: just chat and get stuff done.

A key advantage from the product side is being able to provide users with a consistent interface when conversing with external applications. I like the idea that services can disseminate their information through a simple, well defined, familiar interface instead of trying to hook into the menu and navigation structure of any given application. And for users, they don’t need to care, they just chat.

RedPanda and Pepper

Our initial experiment centers around a helper bot, Pepper, who is available to help users with a few tasks. These can be triggered via slash commands or through written messages:

  • When is my next task due?
  • Get me the popular #php resources this week?
  • @llbot Show me my latest test scores? (One for the Learning Locker bot)
  • What were my check in stats last week?
  • When is @bbetts next available to give a tutorial?
  • How do I change my notification settings?

We are also introducing a mechanism that generates shortcuts for the commands users regularly run so they don’t need to keep asking. This helps build up a level of personalisation and automation based on a user’s popular actions.

For example, if you login and always run the same command to access the latest learning resources, you could be prompted:

Pepper: I’ve notice you regularly access your latest resource, would you like me to do this for you upon login?

Replying ‘yes’ sets up a shortcut command that would automatically go and fetch the latest resources for the user when they login.

In the case of Learning Locker (LL), a user might like a weekly summary of their learning data. So, they would invite the LL Bot into the conversation and ask it to sort this out.

  • User: "@llbot Can you send me a weekly summary of my learning data every Friday?"
  • LLBot: "Done".

The bot has picked this up and is off to work building, curating and setting up the summary for delivery each week, on Friday.

These are trivial examples but hopefully illustrate the point if you’re not familiar with this concept.

I should point out that this is optional and not required to use RedPanda. For now it is aimed at those users who like to experiment.

Learning Locker, data and intelligent bots

The integration with Learning Locker is an exciting angle providing the opportunity to explore a new learning landscape powered by learning data, assisted by intelligent bots. I think this could open up new, innovative, application opportunities.

Using Learning Locker’s powerful event driven "if this, then that" functionality and having a customizable bot that helps users make use of their learning data in a friendly, simple, chat like interface, could be pretty neat. The bot might do things like help identify areas needing improvement, suggest resources and construct learning paths all underpinned by data.

A Personal Assistant

At the moment the focus is on building this functionality into RedPanda, however, working on this project has got me thinking about abstracting it out into a standalone, open, service. Something simple that lets people create and customise their own helper bot — an assistant — to aid in daily work, learning and training.

But, first things first, let’s see how it goes with RedPanda. At this stage we’re just experimenting and there is so much to learn. Will it work out as well as I imagine in my head? I’m not sure but it's going to be fun trying.

If you would like to follow RedPanda development, check out our Twitter account @redpandaapp, or, if learning analytics are more your thing, check out @learning_locker.

Further reading

The growing LRS market

Tuesday 02 February 2016

The Learning Record Store (LRS) market is growing. It’s still early days but there are positive signs that this space is going to expand over the next 12 - 18 months.

Why do I think this?

  1. The enquires and customers we are gaining at HT2
  2. Popularity of the xAPI camps
  3. Investment arriving

Enquiries and Customers

Learning Locker had a great 2015 providing LRS services for clients such as Nike, Villeroy and Boch, Xerox, City and Guilds as well as securing a prestigious contract to help power part of Jisc’s Learning Analytics Architecture; this is a groundbreaking project handling a serious amount of data and is real validation of xAPI, LRSs and learning analytics. You can read more about what Learning Locker is up to, including a move from php to nodejs, in Ben’s post.


Two LRS solutions, Watershed and Yet Analytics, recently attracted investment. Last week Watershed announced a $3 million dollar raise and shortly after winning the Data Visionary award at Techcrunch Disrupt, Yet Analytics also attracted investment.

I realise the amount of money is small when you look at established tech markets, however, in a fledgling space, I think it’s a real signal of intent; great news for the eco-system around xAPI and LRSs.

Getting started

If you are interested in using an LRS then you have three choices; choose an LMS that has LRS capabilities, try out one of the main LRS platforms Watershed, Learning Locker, Yet Analytics and Saltbox or build your own (not something I would recommend unless you have the technical skills and time to invest).

Today's reading

Saturday 30 January 2016

Don't underestimate institutional knowledge

This post talks about the strength of institutional knowledge within organizations and the challenge it presents when building new products to tackle the same market.

"Once a product reaches the level of ubiquity that it has with its customer base, institutional knowledge becomes its core competitive asset."

It is a good point; you might have identified a need that should be addressed, a way to make something better but in the end is fixing it and offering a new solution really going to be enough to entice a switch to your offering? In some cases it could be, but often it's not enough.

Other reading

Modern Command Lines

Monday 25 January 2016

Many of the tools I use daily, such as Sublime, Laravel and Slack, have great command line options.

Laravel has artisan commands which make it quick and easy to manage many aspects of your application.

Slack brings the command line to a non-developer environment through Slash Commands. Slash Commands are basically shortcuts to various actions available on the platform. Want to toggle your away status? Just type /away and there is no need to hunt around the UI for that option.

Due to my positive experience using these tools, I am adding the concept of slash commands to RedPanda, a CPD tool I am building with HT2. At first it will be simple commands to help navigate the platform and toggle a few values; if that works, we'll look to expand the functionality.

I'm curious to find out if this helps usability and if people use it. A lot of work goes into user interfaces yet it can still be tricky to find how to change your password or update your notification settings. What if you could type /profile toggle:privacy private and that command turned your profile's privacy setting to private. Or, if you need help at any point in the application, just type /help and you're served up help docs specific to your location in the app.

Like Slack, users will not need to remember commands, they will just type / and the availability list will appear.

I'm not sure how well this approach will work in our context but it's going to be fun experimenting. Once we test it out on RedPanda, I will report back with some findings.

Today's reading

Saturday 23 January 2016

Anywhere but medium - Anywhere and medium

Dave Winer (creator of RSS) argues that folks should blog anywhere but Medium, and Medium responses. I can see both sides of the argument, control over your content is ideal but an audience is compelling and, ultimately, building an audience is easier within existing networks.

Uber financials and growth

Investors feel this spend is worth it because it will eventually make money; sure it will as everyone else will be put out of business.

I'm not saying that this isn't an effective strategy for a company but don't mistake it for a "clever" or "innovative" strategy, it is simple - if you have more money than everyone else, chances are, you win: nothing clever in that.

I was a supporter of Uber as I disliked the monopoly and behaviour of the main taxi firms here in Toronto, however, if Uber crushes everyone then we are no better off and in fact could be in a worse position; with no choice and ultimately that is not a good thing.

xAPI update: no more TinCan, an interview and a conference

Thursday 26 February 2015

So far this year it feels like the movement around xAPI has stepped up a notch. Previously, it was something a lot of people had heard of (mostly as TinCan) but not necessarily explored in much depth. This is changing and people are getting excited about the potential xAPI brings to their learning technology stack.

No more TinCan

One of the little annoyances about xAPI was the use of two names - there is a reason for this - therefore it is great to see a move towards calling it what it is: the experience API (xAPI for short). 

An interview with Aaron Silvers

Aaron is a key member of the xAPI community - this interview is definitely worth checking out: xAPI, LRS – The Interview.

A new LRS

As use of xAPI grows, so will the number of products and services available to help harness the resulting data - enter Yet Analytics. Previously called An Estuary (I hope I have that right), Yet Analytics emerged toward the end of 2014 with a mission to "build the core data infrastructure for connected learning and training". They are building an LRS which is due on the market soon.

xAPI Camp

If you are interested in xAPI, what it is, who is using it, problems it is solving, then I recommend atending the xAPI Camp on March 24th in Orlando Florida. It looks like a great event with knowledgeable speakers.

Learning Locker v1.3.4

v1.3.4 of Learning Locker was release today, for full release notes head over to github.

Personal Locker

Work is continuing on a personal version of Learning Locker. We are keen to explore ways to empower learners to harness their data through an open source personal learning profile (PLP) powered by xAPI. We should have more news on this experiment towards the end of March.

Laravel Packages

Monday 12 January 2015

I currently use Laravel, the best php framework I have worked with, on a couple of projects including: Learning Locker and Reach. Here are a few of the Laravel packages and libraries that I use.

  • Intervention: this package handles all my image manipulation needs. It is powerful, has plenty of available options and is both mature and stable.
  • PHP Guzzle: Guzzle is a well known HTTP client and framework. I find this library saves time when working with various web services. It is well documented and highly recommended.
  • OAuth Wrapper for Laravel: nearly all the projects I work on require some kind of OAuth implementation, mostly as a client but increasing acting as a server as well (Library listed below). This Laravel package is a wrapper around the PHPoAuthLib library providing both OAuth 1 and 2 support, with a large number of services available out of the box.
  • Eloquent Sluggable: this simple package does a good job generating slugs for your Eloquent models. While creating a simple slug is not challenging, this package has a lot of nice features that just make life easier including making sure slugs are unique, gracefully update, respect reserved values as well as handy functions like model look-up based on the slug.
  • Laravel Mongo: if you are wanting to use MongoDB with Laravel then I recommend this package. It does an excellent job of mapping Laravel’s core API to Mongo specific queries. This means you can use the powerful Laravel Eloquent ORM as is, which is great. This package is used on the Learning Locker project.
  • OAuth 2.0 server for Laravel: this package is a Laravel wrapper around the excellent League of Extraordinary Packages standards compliant OAuth 2.0 server library. I am just getting going with this but so far it feels solid and is well written.