Attendance from QR Code using Microsoft Forms
When I teach smaller courses, I take attendance through a small writing assignment or sign-in sheet. When I taught my first large course, this method did not work. The sign-in sheet would frequently not reach certain students and students reported being "worried" about signing in.
When polling students about how they would like attendance to be taken, students expressed a variety of opinions but the two primary concerns were:
- They wanted it to be simple
- They didn't want to download a separate application.
I followed up with students who did not want to use a separate, attendance application. Their primary complaint is that there are too many tools used in education, complaining that in addition to their LMS (CANVAS), there is GradeScope, TopHat, etc., each of these requiring separate accounts or sign-in processes. In addition, to these concerns (valid or invalid), my own concern with having students download a third-party application pertained to privacy and data-protection.
Solution
Here is my solution. First, I create several Excel sheets using the following simple script.
import os
from openpyxl import Workbook
def create_attendance_files(dates, directory='.'):
os.makedirs(directory, exist_ok=True)
for date in dates:
filepath = os.path.join(directory, f"Attend_{date}.xlsx")
if os.path.exists(filepath):
print(f"Skipped (exists): {filepath}")
continue
wb = Workbook()
wb.save(filepath)
print(f"Created: {filepath}")
if __name__ == "__main__":
dates = ["10_8_25", "10_15_25", "10_17_25"]
create_attendance_files(dates, directory='.')
Next, I import all of these into my Microsoft Account (OneDrive).
Third, I add a Form to each one of these Excel sheets, by opening the sheet, clicking Insert, and then New Form.
Fourth, I open the Form and typically add a question or post an announcement of some sort.
Fifth, I click Collect responses and select the option for the QR Code, download the image of the QR Code.
Sixth, I display the QR code on the screen before class begins, students scan the QR code, and when they do it records the following:
- Start time: time when they first scanned the QR code.
- Completion time: time when they completed the form.
- Email Address
- Student's name
After class, I download the Excel sheet linked to the Form, then using my Course Roster import the Attendance sheet and the Roster sheet to an application I wrote in Python (using NiceGUI) that checks whether a student (1) attended class or (2) was late.
The application will flag students not in attendance or late in red. In addition, it provides some percentages about the number of students who missed class.
Future Improvements
Some ideas for future improvements include:
- Email Absent Students: Adding a feature that will allow for emailing all of the students who missed class. What tends to happen when a student misses class is that they will email me asking what happened during that class. Things would be simpler if I could email all absent students with this information.
- Make executable.
- Write documentation.
- Database: I considered adding a database but since attendance data is likely to be uploaded to an LMS (CANVAS), this feature seems unncessary.