Table of Contents
Script to automatically partition the grading of a Gradescope assignment. Can output the partition to a txt file, a json file, or to a google sheet.
Python 3+ Required
Go to the assignment page on Gradescope, then click Review Grades -> Download Grades (Located at the bottom of the page) ->Download CSV
-
Clone the repo
git clone https://github.com/RyanHowell15/Grading-Partition.git
OR Copy all .py files into a directory
-
If you do not have settings.json configured, run
python3 main.py setup
and view the documentation on how to configure settings.json.
-
Once settings.json is setup, run
python3 main.py "filepath_to_csv"
for example
python3 main.py ./Assignment_7_Scores.csv
After this, a new file called partition.txt (or partition.json depending on the setting) will be created in the same directory. That file will contain the partition. If you are using Google Sheets, a spreadsheet will be created instead of a partition file.
settings.json is a file located in the directory of the .py files that holds most information, such as instructor names, how many hours each instructor works or should dedicate to grading, and how the partition should be outputted.
Dictionary of instructor names to how many hours they work. For example:
"instructors":{
"BOB SMITH": 20,
"SARAH":10
}
Note that grading amount is relative, so if we changed Bob to 10 and Sarah to 5 it would result in the same amount of grading.
Also, if the instructor's name matches how it appears in Gradescope, their submissions will be ignored and not partitioned to any instructor.
How the partition should be outputted. Possible values for this field are:
- "txt" Output partition into a readable text file.
- "json" Output partition into a json file.
- "googlesheets" Create a spreadsheet for the partition. Please refer to the documentation on creating a spreadsheet before using.
This field is only required if the "output" field is set to "googlesheets"
Specifies the url of the google sheet to create the partition on.
There is optional functionality to output the partition onto a google sheet. Run this command to install the required libraries.
pip3 install gspread oauth2client
If you do not have client_key.json setup, you will need to set it up prior to these instructions.
Inside client_key.json, there is a "service_email" field. Copy the email, and share the google sheet you wish to use to this email. Make sure it has editor permissions.
Copy the url of the google sheet you wish to use into a "sheetUrl" field in settings.json. For example:
"instructors":{
"BOB SMITH": 20,
"SARAH":10
},
"output":"googlesheets",
"sheetUrl":"https://docs.google.com/spreadsheets/d/boguslink"
After running the script, a new worksheet called "New Assignment" will be created with the partition. NOTE: Before running the script again, you must either rename or delete this worksheet.
This is a file required in the same directory as the .py files if you wish to use the google sheets functionality. There is some Google API setup required, you only have to do this once.
- Visit https://console.developers.google.com/
- Create a new Project
- Once the project is created, click on "Enable API's and Services". Search for the Google Sheets API and the Google Drive API and enable both. If you need to get back to the API menu after enabling one of them, click on the "API's and Services" menu here:
- Create a new credential from the Credentials menu. I recommend the "help me choose" option.
- When you get to the Service Account menu, enter whatever you want for the Part 1-Service Account Details then just skip the optional parts 2 and 3
- Click on the email of the created Service Account, then go to the keys menu -> add key -> create new key -> JSON to download a key.
- Rename this file to "client_key.json" and move it into the directory of the .py files. Note, you should not have this file publicly accessible.
Ryan Howell - [email protected]
Project Link: https://github.com/RyanHowell15/Grading-Partition