This project started, as many do, with a time intensive task. My school's Student Information System, Infinite Campus, provides tools for creating ad-hoc groups of students. One way of making these groups is through the use of an ad-hoc filter. This allows a user to generate a list of students created by filtering records retrieved from the back end. Another method of making groups is through the use of a selection filter. This method involves looking up a student in a list of all students, then clicking an arrow to move the student to the list of selected students to the right. In a school with thousands of students, such a task can be both menial and time-consuming. Thus, I believed it to be an excellent candidate for automation.
This project is one in two parts. First, it started as a Python script that I used for my own personal data tasks. Then, its need for others in my district became apparent, so I worked to convert it to a Google Chrome Extension, published in the Chrome Web Store.
The Python Era
I first approached this task with the idea of creating a Python script using Selenium to automatically select students from the list by manipulating the webpage's DOM. The selection filter creation screen offers a list of students with the students' student numbers displayed in parentheses. The script originally loaded student numbers from a CSV file into a list, then iterated through the options, checking to see if the option's student number was in the list.
In retrospect, this should have been implemented using a Python set rather than a Python list. With a list lookup's time complexity of O(n), this algorithm has a complexity of O(n^2). Moving to a set, whose lookup time complexity is O(1), would have resulted in a time complexity of O(n).
Nonetheless, I set up several staff members with the script on their computer, but I was unhappy with the implementation. Firstly, it was cumbersome to run and required some degree of expertise to use. I decided to use GitHub for version control and to provide a method to deploy patches and enhancements to users. This required training for these users in how to navigate Git Bash. While this mainly involved running git pull periodically, it was intimidating for users and was not fool proof. I also ran into the problem of Chrome updates breaking the Chromedriver on a fairly consistent basis. This required me to download the new Chromedriver to the repo, push to GitHub, and tell users to pull changes to their local machines. I decided that integrating the script directly into Chrome through a Chrome Extension might be the way to go.
The Google Chrome Era
https://github.com/eidech/icselectionfilterpopulatorchromeext
Moving to a Google Chrome Extension involved changing entirely the technologies involved. While the Python script relied on the use of an external executable Selenium driver run by Python, a Google Chrome Extension uses native JavaScript running in the browser to manipulate the DOM. The Chrome Extension has, thus far, fixed all of the problems of the Python script. The Chrome Web Store automatically pushes updates to users. Installation of the extension is a matter of clicking "install" and running the extension is a matter of clicking an icon. Planned development includes support of XLSX files in addition to CSV as well as visual enhancements.
Have a question about this project? Interested in contributing? Feel free to email at christopher.eide@gmail.com!