Working on assignments with GitHub and Gradescope

We’ll use GitHub + Gradescope to access and submit assignments. Here’s how it works:

  1. Get the assignment materials from GitHub classroom.
  2. Clone the repository to any machine you are using.
  3. Work on the assignment, pushing back to GitHub.
  4. Submit the assignment on Gradescope.

Here is a diagram of the process:

Workflow for assignments

The rest of this document contains a more detailed version of these instructions.

Get the assignment materials from GitHub classroom.

Each assignment will provide a link to GitHub classroom. Click the link.

The first assignment will be an individual assignment. All other assignments will be optional pair-programming assignments (you can do them on your own or with a partner). To accept an individual assignment, click the “Accept this assignment” button.

For all other assignments, you will need to create a team before you can start.

  • If you are working by yourself, use your GitHub id as your team name.
  • If you are working with a partner, create a team name that contains both of your GitHub ids. Create a team based on your GitHub ids

The assignment files will be copied as a private repository that you (and your partner) and the course staff have access to.

We will call this version, that lives on your GitHub account the GitHub fork.

If you are working with a partner, the person who did not create the team and accept the assignment should now click the GitHub classroom link, find the newly created team, and click the Join button. Join your partner's team

Clone your repository to your own machine(s)

Once your repository has been created, you should clone the code to any machines (e.g., knuth where you want to work):

  1. Click on the link for the repository. Click on the link for the repository
  2. Click the Clone or download button and copy the URL. Copy the repository URL
  3. On the cloning machine (e.g., your own machine or knuth), in a directory that will contain your assignment, run:
      git clone <fork-url>
    

    where <fork-url> is the URL for the repository. We’ll call this directory the local clone.

Work on the assignment, pushing back to GitHub.

Committing

While you’re working on the assignment, be sure to commit often.

This command will commit your changes to the local clone:

  git commit -m 'an informative log message' 

Important note: When you run git commit, it’s good practice to use the -m flag to include a commit message, as in this example. Commit messages should be short but informative (i.e., more than just “committing” or “stuff”), describing what is new about this commit, relative to the previous one (e.g., “Finishing part 1” or “Fixing bug in function foo”). In addition to being standard industry practice, good commit messages may help you in CS 131. Although we won’t grade commit messages, we will occasionally read them. Messages can rarely hurt you (unless they’re extremely unprofessional), but may help you, e.g., if something goes wrong with your submission and you need help fixing it or possibly asking for leniency during the submission process.

Adding files

If you add a new file, you’ll need to add it to the repository:

  git add <new file>

Pushing back to GitHub

Eventually, you’ll need to push the changes from your local clone to your fork on GitHub:

  git push

If you’re working in a pair, you should always push; it’s how your teammate gets access to the updates.

Submit the assignment on Gradescope.

You will submit your assignments via Gradescope. The Gradescope autograder (if applicable) will run your code through a set of scripts that will execute a number of test cases and record the scores. To submit your assignment, complete the following steps:

  1. Access the course’s Gradescope site, select the appropriate assignment, and then choose GitHub as the submission method.

  2. The first time you submit your repository, you will need to authorize Gradescope to access your git repository. Select the appropriate repository and branch.

  3. If this is a pair-programming submission, you will need to associate all team members with the submission. After you upload your files, click “Add Group Member” and add your partner to the submission. Add your team member to your Gradescope submission

  4. You can submit multiple times before the deadline. Your last submission will determine your grade.

  5. Once assignments are completely graded, you will be able to see your grade and assignment feedback on Gradescope. Grades will also be synched with Sakai.