Penn State University taking attendance using beacons

Göran KrampeBlogs, Case Studies

penn
Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+

Blog article by David Fusco, professor at Penn State University, College of IST (Information Sciences and Technology)

In order for me to be able to assign attendance grades for a course that I teach, I need my students to sign in to our LMS (Learning Management System), navigate to the course, select the ‘Resources’ tab, get the randomly generated code for today’s class that’s been written on the board up front, then enter it in the box provided. Me, as the professor, earlier in the day, had to log in to the same LMS, navigate to the course, same ‘Resources’ tab, and then copy down (or remember – not likely) the alpha generated code to be used later.

It’s either that or I get my student assistant to do it for me. Either way, taking attendance is a fairly tedious process. In other classes, where professors don’t use the university-supplied LMS, their student assistants are taking attendance via a hardcopy roster. At least the hardcopy roster version, for the most part, ensured that people where there. In my version, there’s nothing from stopping a friend from texting the code for the day to his buddy who is sleeping back in his dorm.

As a professor at Penn State University in the College of IST (Information Sciences and Technology), I’m constantly trying to keep on top of all things tech. My tech background is in networking, so gravitating towards IoT was a natural fit for me. Last fall, I created an executive-style enterprise architecture program for Cisco Systems and we talked a great deal about IoT and Fog Computing. It definitely peaked my interest and I felt I needed to learn more. I kind of knew what beacons were, at least in the RFID realm. There are plenty of other articles that explain the difference between the new beacon world. I highly suggest you become educated on the primary differences between these two topics:

  1. iBeacon vs Eddystone
  2. iOS vs Android implementations of the Physical Web

What I wanted to do

Back to my problem. Taking attendance should not be this hard. I thought – there HAS to be a way to be able to know if a student is in my room or not, identify who they are, and then record their attendance automatically. A quick bit of background on another tech solution I used – an LRS (Learning Record Store). In short, it’s a system that tracks small, micro-activities performed by a person (or M2M). It stores ‘I DID THIS’. Or, in my case, I attended IST 420 (on a given date).

A quick summary of what I wanted to do:

  • Turn my Mac into a beacon (because I was too cheap to buy a real beacon – I know, I know, they are only like $10, but even more importantly, I didn’t want to wait for it to arrive)
  • Each class, turn on the beacon (I take my Mac to every class with me)
  • Have the student have an app on their phone (I had a backup plan for those that didn’t have one, for those of you who feel this is unfair to them)
  • That app would see the beacon and then automatically register their attendance in the LRS. On first launch, it would have the student enter their email address and then remember it for subsequent uses.

What really happened

I read a LOT about beacons, the tech behind it, and drew out a picture of what this would look like. I also built a server on my home network (VM LAMP stack – I used Turnkey LAMP); I wanted to have a web server as an intermediate processor, this proved to be very useful later.

Turnkey LAMP

And I bought MacBeacon from Radius Networks.

MacBeacon

NOTE: It only emulates iBeacon; As of this writing, I still haven’t found a good Eddystone emulator. If there is one, I didn’t find it or was too lazy to write one.

User Interface

I then dug into the app side – I was convinced that making an app was the only way to go for this. I’ll circle back around later and compare to Eddystone, which opened my mind to another way.
I spent quite a bit of time with this. Went down the path of looking at Xcode and educating myself on what it takes to build an app, and I looked at the Ionic framework. Quite frankly, I didn’t want to learn another language and honestly, Xcode seemed to be a pain, at least for the simple thing I wanted to do. I already knew HTML and Javascript. I wondered if there’s a way to create a mobile app using the tools, languages, frameworks I already understood. Of course there is!

Again, there are lots of other articles explaining how to do this. Below is the ionic interface, I ended up just coding it by hand in an HTML editor. Not that this is bad, I just wanted to do too many custom JS functions and didn’t need the front-end design part.

Ionic

Evothings

Then, during my Google searches of this, I came across Evothings and the workbench solution. Wow – what an awesome product that’s going to save me TONS of time.

I copied the iBeacon Scan example provided and I was on my way.

Evothings Workbench

I added my LRS libraries and my send code, well, they aren’t mine, they are from the Tin Can API folks. I had been using them for another project and wanted to include them here. A natural fit.

Tin Can

After this, I modified app.js and my logic to basically continually scan for beacons and then take action once my iBeacon signal was detected. Did I say how much time Evothings Workbench saved me for testing?

A side note, I had one very important piece – I wanted to remember the user after the first time. window.localStorage.getItem helped in that area. I also used (cheated) the beacon.major and beacon.minor to help me fake the app into being able to see it as an individual class. Nothing fancy, but it worked.

Get current date and convert beacon.major to a course:

JavaScript code

Build specific course by date being stored – I only wanted to take attendance one per day per course per student:

JavaScript code

See if it’s the first time running the app or if the cache has been cleared:

JavaScript code

See if the record for the day has already been cut; if not, send the LRS statement:

JavaScript code

After a bit of tinkering and polishing off my JavaScript knowledge, my app was working perfectly. Now I just need to get it to the students.

Deploying the app

Needess to say, I fell into a hole. The hole that is called ‘getting your app into the iTunes store’. Man, what a long and cumbersome process. I’ll save the certificates, Phonegap, and all things iTunes for another blog post. Let’s just say, that didn’t take me where I wanted to be. Not that this process won’t work for those of you looking to publish a polished app – this just wasn’t for me. Too cumbersome. For the record, the service that Phonegap is offering is pretty awesome, so many thanks to them for that.

Phonegap

  • What if I wanted to update the app?
  • What if I wanted students to be able to write their own app and share them – QUICKLY?
  • And what about Android? I hadn’t even gotten to that point yet.

So, I asked Peter Svensson, from Evothings, who had been extremely helpful during my journey. He suggested I take to the Evothings Gitter discussions. Which I did.

Evothings Gitter

The folks there were quick and very helpful. They turned me on to the Evothings viewer app. I had been looking for a quick way to distribute my app. This wasn’t perfect, but it was very, very close. I could have students install this and then change my code on the back end all I wanted. By this time, I moved my code to my production server, on the public Internet. What I did was give them an intermediate HTML launch page that then redirected them locally to an EVO:// app, through the viewer.

Evothings Viewer
Share App
Launch
HTML source
MacBeacon
Open in App
Recorded

It worked!

Recorded

Well, mostly. For some reason, some Android phones weren’t detecting my beacon, but for everyone else, it worked perfectly and their attendance was recorded into my LRS. All students had to do was:

  1. Install the viewer app
  2. Open the URL in their browser – http://drdavefusco.com/attendance/launch.html and then click on the launch link.

That would then redirect them to the local Evothings app via the EVO: protocol. The fine folks at Evothings can tell you how that works. I just know it does.

What’s next

  • Change the intermediate launch page to autoredirect (like 3 seconds) instead of having an A HREF link; this would save the student from having to click
  • Figure out why some Android phones aren’t seeing the beacon
  • See how I can export my LRS activities into my LMS so that part isn’t manual. There’s some info about Canvas and xAPI, but I haven’t dug into it yet. And it’s not likely the university is going to allow me into the code for our LMS.
  • See how this might work with an Eddystone URL and not have an app at all. That’s for another post.

Hint: I now have it working exactly the same way, using a Radius Networks’ Eddystone beacon, Chrome, and the same backend logic. Just a different approach. If you want to read more on that, here’s a good article from Radius networks. In a nutshell, it’s the same process except I moved the logic to one HTML file hosted on my web site that is broadcast via the Eddystone beacon and its Eddystone URL. Students can get to this via the instructions included in the Radius Networks article. The Android side is a bit different, but like I said, that’s for another post.