Giter Club home page Giter Club logo

gradingscripts's Introduction

GradingScripts

Welcome to the GradingScripts, home of all the scripts needed to grade the class SWEN-123!

     Here is a brief guide for how to use the grading scripts for CSEC/SWEN-123. 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 CSEC/SWEN-123, please stop reading. Or don’t. Not like this will be a very entertaining read.

     Before we get started with other things, let’s make sure you have installed what you need to actually run the scripts. In order to make life easier, we’re going to first start out with a tool called pip. If you installed Python, pip should already be on your computer, but in case it isn’t, go to this link and follow the instructions: https://pip.pypa.io/en/stable/installing/. It’s ok. I’ll wait for you to get back.

     By now you should have pip (yay!). That means you’re on your way to being able to run the scripts at all! Now the next step is really easy. Now that you have pip, you just need to use it to install 3 packages that the scripts require. Those commands are as follows:

pip install gitpython

pip install PyGithub

pip install pygithub3

     Now that you have all the packages 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 3 main scripts, each of which also includes a .bat file that can be used to run the script. There’s one file not listed here, called temp.txt. This text file will be created upon using any of these scripts 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.
Click on the “Developer Settings” button at the bottom left.
Click on the “Personal access tokens” button.
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).
Add a Note so you know what the token is being used for and give it the “repo” and “read:packages” permissions.
Scroll to the bottom and click the “Generate token” button.
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 temp.txt in the same location as the scripts.

     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 temp.txt file in order to be able to use them again. You’ll probably crash the script if you try to use an invalid token, haven’t tried it personally.

     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.

     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.

Now let’s run through using each script beyond the first 2 prompts.

     This is a typical first running of the cloneRepositories script. You put in your Github auth token and the organization name first. Beyond that, you need to enter the assignment name. This can be found on the left-hand side of the organization.

     Next, you enter the day that it’s due in the proper format (‘yyyy-mm-dd’, ex: 2020-08-18). After that the time that the assignment is due (so it only gets the commits before that time) in 24 hour format (ex: ‘23:59’ for 11:59pm).

     After you enter all the information, the script will clone all the repositories and put them all into a folder in the same area as the scripts, and if it’s your first time running the script, the temp.txt file will show up as well.

The next script we’ll be going over is the addFiles script.

Some important notes

  1. The folder with the files to be added should be in the SAME DIRECTORY as the scripts.
  2. The script uses the initial directory and then uses the path you give it, so keep that in mind as well.
  3. For the sake of not pushing our luck, don’t put any double quotes (“) in the commit message.
  4. There is no take-backsies that I’m aware of, so make sure you aren’t giving the students any solutions.

Those 4 things aside, just give the script what it wants and it’ll add files to the students’ repositories!

     The final script you need to worry about (well the final one that I wrote), is linesBetweenCommits. This script is used to calculate the average number of lines added between commits. So if someone adds 1000 one commit and 1 the next, it’ll average out to 500.5. This script is meant to be used to make grading this portion of assignments a bit “easier” (possible it makes it possible).

     This one’s real easy, put in the assignment name (as it shows up in the folders, which is the same as it does in Github). However, you must have already cloned the assignments for this one to work.

     See those fancy little folders at the top, those are the assignments. So for the first one, you’d put “assignment-01”, but without the quotes. Once the script has been run, there will be a file in the folder with all the students’ usernames (ie aaa1234) and they’re average lines inserted per commit.

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.