Due to COVID-19, the kids had to do online learning for a couple of months. Unfortunately, they were constantly tempted to play games or watch YouTube during class time. Sometimes they became so immersed that they missed lessons, or forget to complete assigned tasks.
I tried various solutions, such as parental control software, or lock down the router. None of them worked for me. There were just too many things to configure. Furthermore, some potential avenues for distraction (eg. YouTube) might sometimes be necessary for schoolwork (eg. YouTube being used for information or research by the teacher).
The solution I eventually settled upon turned out to be quite simple. I hacked together an AutoIt script that logs details about the active window (title and executable) to a Google form periodically. By looking at the logs from time-to-time, it gives me a pretty good picture of what they have been doing on their computers, and have a chat with them when things get out-of-hand.
To use the script, first open up this Google Form. Then click on the dot-menu at the top-right hand corner and select "Make a copy...". Give it any name you want (eg. "PC Logger") and click "Done". This will save the new copy to your Google Drive, and open the form in a new browser tab.
Now, click "Send" at the top-right corner, then click on the "Link" icon:
Click "Copy" to copy the URL and open it up in another browser tab. This is the actual form that allows the submission of new information, and we are going to obtain some details from it so that the AutoIt script can use them to submit new information.
You should also have the AutoIt script pclogger.au3 opened in a text editor (yes, even Notepad).
View the source code of the form (usually right-click on webpage and select "View page source"). Then look for (Ctrl-F):
- "<form action=". Then copy everything within the double-quotes (should be in the form "https://docs.google.com/forms/u/.../formResponse" and paste it into the script, assigned to $FormResponseUrl.
- "data-params=", followed by ""Username",null,0,[[<number>". Copy the "<number>" into the script, assigned to $FormUsername.
- "data-params=", followed by ""Executable",null,0,[[<number>". Copy the "<number>" into the script, assigned to $FormExecutable.
- "data-params=", followed by ""Title",null,0,[[<number>". Copy the "<number>" into the script, assigned to $FormWinTitle.