Skip to content

This repository contains the Python scripts used for grading in the GCIS-123/124 class at RIT.

License

Notifications You must be signed in to change notification settings

NeonixRIT/GradingScripts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GradingScripts

Welcome to the GradingScripts, home of all the scripts needed to grade the class GCIS-123/124!

Here is a brief guide for how to use the grading scripts for GCIS-123/124. In this quick guide, I’ll be going over how to use these scripts, each of there purposes, and how to use them for the first time. If you’re not a CA for GCIS-123/124, please stop reading. Or don’t. Not like this will be a very entertaining read.

image

Prerequisites

  • Python 3.10 or newer
  • Git 2.30.0 or newer

NOTE: Required Python modules are installed at script start.

  • versionmanager.py: Check remote repo for updated release
  • PyGithub: Library to interact with GitHub API

Before we get started with other things, let’s make sure you have installed what you need to actually run the scripts.

If you don't have Python installed already, lets get that installed. Head to https://www.python.org/downloads/ and download the latest version, make sure to check the Add Python 3.X to PATH button if you're on Windows.

How to get Github O-Auth token

Now that you have the package installed you can now run the scripts, huzzah! But wait, what’s this information you need? It doesn’t just work? Blasphemy!

Well, that’s what we’re going over next, what you should have access to for grading. We have 2 scripts, each of which does the same thing but can be run differently. Included is also a ./data folder. This folder contains config.json which will be created after running the script for the first time and is used for storing information that should be consistent across the semester, primarily your Github Authentication token and the Github Organization name.

You’re probably thinking, “What’s a Github Authentication token?”. Basically it’s a token generated by Github that can be used to login to your Github account through the scripts. Needless to say, if you plan on using these scripts, you need to make a token. So let’s go over that now.

Steps Guiding Images
Log into your Github account
Go to the upper right-hand corner of the screen, click on the icon with your profile picture, and then on the settings. image
Click on the “Developer Settings” button at the bottom left. image
Click on the “Personal access tokens” button. image
Click on the “Generate new token” icon in the top right of the screen (you may be prompted to log in again upon clicking this). image
Add a Note so you know what the token is being used for. You can set it to never expire or add a custom expiration date (NOTE: every time the token expires you will need to update it in tmp/config.txt). Make sure to give it the “repo” and “read:packages” permissions. image
Scroll to the bottom and click the “Generate token” button. image
Copy this new token and put it somewhere safe (or put it into the script directly). NOTE: This will be stored in a file called config.txt in the tmp in the same location as the scripts. image

Some extra information about these tokens, you won’t be able to see them again after you get out of the page, so paste it in another file, or to where the script prompts you. The script will store it so you only have to do this once. However, if you delete the token on Github, the token will be rejected and you’ll need to delete or edit the config.txt file in order to be able to use them again. The script will give you an error if you use an invalid token.

Get Organization Name

The next thing you’ll need to do is get the organization name from Github. This is relatively easy compared to making a personal access token. Once you’re added to the organization, you should be able to access it on the left of the Github homepage.

image

In order to ensure you spell it right, it’s recommended you click on the organization and copy the organization name from the link at the top of your browser, and then enter it into the script when prompted.

image

Get Class Roster

Finally we will be getting a classroom roster csv file from Github Classroom in order to make grading easier. This will allow the script to change github usernames to peoples actually names. The script will also only clone the entries in the csv file. This is option of couse but is highly recommended so that you don't have to clone every repo from the organization every time.

Steps Guiding Images
Go to https://classroom.github.com/classrooms and login if needed
Go to your classroom/organization for the semester image
At the top click on the Students tab image
Then under classroom roster, click download image
Then click Download without group names image

And Tada! You now have a CSV file containing all the students for your classroom. I recommend opening the CSV file to delete the entries of students you will not be grading. I also recommend placing the classroom roster file into the ./data/csvs folder.

After you enter all the information, the script will clone all the repositories and put them all into the folder specified. Inside will be a folder named after the assignment name and the date/time specified. image

One last thing to note, first time running the script might need to be done with admin privileges. So, start it in an admin powershell/cmd/whatever window. This is to properly install the pip packages required for the script to work.

Congratulations! You’ve either read or skimmed through my entire guide. May your grading be easy and enjoyable thanks to these scripts!

TODO

  • Add direct auth with github?
  • Add bulk clone option to run multiple clones from options a csv/json file
  • sqlite?
  • improve usage of context
  • Add tests for student repo with no commits
  • Add test for timezone fix
  • Add test for data folder extraction
  • Add tests for update functions
  • Add tests for version class
  • Add tests for AtomicCounter class

About

This repository contains the Python scripts used for grading in the GCIS-123/124 class at RIT.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%