One of the things missing on my ‘take a photo’ extension to the quiz has been the report at the end. I spent a little time building a report that would pull the photos along with the quiz results. Below is an image showing one result.

The users profile photo is pulled along with the two photos taken while doing the quiz. The first photo is taken before the user can start the quiz. The second photo is taken before the user can submit their attempt.


Report showing the photos


Popup of selected phot

Clicking on a photo will popup a modal window with the full size image. I use a simple bootstrap carousel to navigate between the photos. Overlayed on each thumbnail is a time stamp of when the photo was taken.Great, so we can compare the photo taken to their profile photo… not really.

What I really wanted was to analyze the photo that was taken and see how close it matched the users profile photo. Basically do face recognition.

I had played around with this about two years ago. While working for The Training Room Online I helped build an elearning game using Unity 3D. It was a first-person game using your standard mouse and keyboard to control movement. Once the game was built I started worked on using the movement of your face to control the movement of the character. Sadly my laptop was stolen before I could ever complete the code.

Anyway, back to the present and using face recognition in the quiz. I figured that if I could make it work in a quiz, why not use it to log into the site. The animation below shows me logging into my Moodle site using face recognition.

Very briefly

  • I fire the webcam up and take a photo
  • save the blob to the server as a file
  • call the file and analyze it
  • based on the match, I retrieve the name of the person
  • then using the persons name check if they are registered on the site
  • if they are I log them in
  • if not, I show the traditional login page

Besides all the other bits and pieces, I also had to create a new login form to hold the camera canvas, as well as build a new authentication method.

All in all it’s been a busy 24 hours… time for more coffee.