Substitution-Requests
System for handling CSE 102 staff sub requests.
The ULAs only ever interact with the Google form (https://docs.google.com/forms/d/e/1FAIpQLSfJzXo9-nKoIsOveLWelCe8Y47yryD3jPGPoYIxo8lhsZESeQ/viewform?usp=sf_link)
This system downloads all of the forms, appends any new ones it hasn't seen yet (measured by timestamps) to its database, and pops up a GUI for selecting instructors' responses to each request.
The system also provides graphical interfaces for various common forms of information retreival and for implementing manual changes.
The system can also automatically send emails to the relevant person(s).
The limitation of this system is that it doesn't run "in the background" it must be run on an instructor's PC and have the results pulled and pushed to/from Git each time.
Installing and configuring for the first time
Install the libraries in your Python environment:
pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
pip install --upgrade pandas
pip install --upgrade pysimplegui
Versions that are proven to work (newer versions probably work, older versions maybe work)
- python 3.9.13
- pysimplegui 4.60.4
- pandas: 1.4.4
- google-api-python-client 2.100.0
- google-auth-httplib2 0.1.1
- google-auth-oauthlib 0.5.2
Install and configure Git
Be sure to use the right version (32 vs 64 bit, Windows vs Linux, etc.) you can find your version of Windows by typing “about” in the start bar
When installing Git, there are many settings, if you don’t know what it does, just keep the default option.
Run Git bash and within run this command:
git config --global core.autocrlf false
Close Git bash and open Git Gui
Click “Clone Existing Repository” and paste https://git.egr.msu.edu/CSE102/Substitution-Requests.git into the “Source Location” box.
The “Target Directory” box is the path to the folder you want to store your local copy in. The folder must NOT already exist.
(E.g. “C:\Users\USERNAME\Substitution-Requests” will create the Substitution Requests folder and put all the files inside it.)
Open the Repo in GitGui (this might happen automatically after cloning). Click “Tools” and “Add”
Put “Pull” in the name box and “git pull origin master” (no quotes) in the command box and click “Add”
Authenticate your machine with Google
Run the code for the first time (or since 7 days have elapsed since this step was last performed on this computer)
It will take you to a login page, you MUST log in as cse102msu@gmail.com (password is python_1107)
This login has mandatory 2-factor authentication (b/c of Google policy on API access)
So if this is the first time or if you've reset your browser cookies it will call the office phone in EGR 1107 to give you the code
Once logged in, just click continue on each increasingly dire warning page until it says “The authentication flow has completed. You may close this window”
Daily workflow:
Ensure that nobody else is currently working on these files or sitting on unpushed changes
(This prevents merge conflicts and the need to redo work)
Open Git Gui and click "Tools" and "Pull" (or whatever you named the pull command during configuration explained above)
(This updates your local copy to the repo's version)
run "driver.py" in your Python environment and when done, click "OK" to close and save changes
(If you get an interpreter error that says "Token has been expired or revoked", delete the "token.json" file and rerun the program. You will have to redo the Google authentication steps above.)
In Git Gui type a commit message and then click "Rescan", "Stage Changed", "Commit", and "Push" in that order.
Click "Push" in the dialog box that comes up, then close the confirmation dialog.
(This updates the repo with your local changes)
Start of semester workflow
There are tools to partially automate some of this process, but they may need to be modified to match the structure of the data provided. Some manual entry will also be necessary.
-
classDates.txt (input file, filled out by hand, match format of previous semester's)
-
sections.txt (input file, copy-pasted from hiring spreadsheet, may need to tweak the data to match format of previous semester's)
-
helproomHour1 (input file, filled out by hand, match format of previous semester's)
-
helproomHour2 (input file, filled out by hand, match format of previous semester's)
-
sectionCSVHelper.py (script to generate databases based on input files, run by reset.py)
-
reset.py (script to run sectionCSVHelper and clear the appropriate files/data, run by user)
reset.py is sufficient to fully reset the status back to the beginning of the current semester. New staffing/scheduling will require modifying the input files.