Working on assignments with GitHub and Gradescope

Big thanks to Ben Wiedermann at HMC for inspiring the following.

Authors
Affiliations

Pomona College

original content by Ben Wiedermann

Harvey Mudd College

Working on assignments with GitHub and Gradescope

In Math 154, we will use GitHub + Gradescope to access and submit assignments. Here is the basic structure of how it will work:

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

The following diagram lays out the process, and the rest of the document provides a more detailed set of instructions.

Flowchart demonstrating that assignments are recieved from Git, processed on your computer (iteratively with GitHub), and submitted to Gradescope.

Flowchart of assignment process.

Installing R + RStudio + Git

Most importantly, please become familiar with Happy Git and GitHub with R. Happy Git with R is an incredibly user friendly resource which includes help for almost every single thing that might happen when getting started.

  1. The first step is to install R + RStudio + Git on your machine. (If you are planning to use Pomona’s RStudio server, R + RStudio + Git are all three already installed for you.)

  2. Create an account on GitHub (if you already have one, use it!).

  3. Introduce everyone: R + RStudio (should happen automatically); yourself to GitHub (see https://happygitwithr.com/); RStudio + GitHub (see https://happygitwithr.com/).

  4. Follow the rest of the steps that Jenny Bryan spells out in Happy Git and GitHub with R. Most likely, you only need to work through step 12. Step 15 is detailed below after you have gotten the assignment from GitHub.

Screen shot of the Happy Git with R webpage.

The more you read Happy Git with R, the better your life will be.

See the fantastic posit::conf talk by Meghan Harris, “Please Let Me Merge Before I Start Crying”: And Other Things I’ve Said at The Git Terminal.

Get the assignment materials from GitHub

Each assignment will be provided within a separate GitHub repository. You will get to the specific repository via the course organization.

Screen shot of GitHub showing what the course organization will look like for a given student.

The course organization which lists all of the assignment repositories. Click on the repository associated with the specific week’s HW assignment.

The assignment files will be copied as a private repository that you (and your partner(s), if applicable) and the course TAs have access to. Notice that all of the repos are tagged “private.”

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

Clone the assignment (or project) repository on to your own computer(s)

Once your repository has been created, you should clone the code to whatever computer you are working on. Just like a Google Doc, you can work on the files from different machines at different times. Unlike a Google Doc, you’ll have to make sure to open the repo (clone or pull if you’ve already cloned) and save the repo (commit + push) more deliberately.

  1. From the course organization, lick on the link for the correct repository.

  2. Click the green Code button and copy the URL.

Screen shot of GitHub showing the location of the repo URL.

Copy the HTTPS URL, and use it to create a new project in RStudio.
  1. On the cloning machine (e.g., your own compute or the RStudio server), create a new R project with the URL copied from above. Follow the steps at https://happygitwithr.com/new-github-first.html (section 15.2 New RStudio Project via git clone).

Work on the assignment, push back to GitHub

All of the GitHub interaction will take place through the RStudio IDE. The two important steps for getting the assignment back to GitHub are:

pull

If you are working with a colleague or on different machines it is so incredibly important to get in the habit of immediately clicking on pull when you start your work. (If you are working alone on a single machine pull won’t hurt! You’ll just be told that your files are already up to date.)

Screen shot of how to pull using the Rstudio IDE.

Always pull before you start. pull-work-render-commit-push

Render your work

Don’t forget to put your name on the assignment. Also, make sure that you Render to pdf. Render early and often. The more often you Render, the fewer headaches you will have.

Screen shot of how to Render using the RStudio IDE.

Always pull before you start. pull-work-render-commit-push

commit your work

You don’t need to commit every file, but you do need to commit files that are integral to the analysis (always commit .qmd, .pdf, data files, images that created the pdf, etc.).

Screen shot of how to commit using the RStudio IDE.

pull-work-render-commit-push

push your work to GitHub

It is good practice to use meaningful commit messages to help your future self figure out your past work.

Screen shot of how to push using the RStudio IDE.

pull-work-render-commit-push

check your work on GitHub

To make sure that the work went through, always check your GitHub repo online to confirm any changes you made.

Screen shot of checking GitHub changes online.

Check that your changes are correct.

Submit the assignment on Gradescope

You will submit your assignments via Gradescope on Canvas.

Connecting your GitHub account to Gradescope

The first time you go to submit an assignment on Gradescope, you will be asked to connect to GitHub. Here are the steps to follow to make that connection:

  1. Access Gradescope from Canvas: From Canvas, click on Gradescope in the Course Navigation menu. You will be asked to authorize the Gradescope integration.

  2. Navigate to Gradescope.com: In a new tab (same browser), navigate to https://www.gradescope.com/. Gradescope should recognize your student user account from the Canvas integration.

  3. Go to Gradescope Account Settings: Click on Account (bottom left of the screen) and then Edit Account.

Screen shot of Gradescope account changes.

Change your Gradescope account settings.

This will take you to your Account Settings in Gradescope. Here, you’ll have the option to verify your Pomona email address and set up a password.

  1. Link Your GitHub Account to Gradescope: Scroll to the bottom of the page to the Link External Account menu. Click on Link a GitHub account.

Screen shot of how to link GitHub to Gradescope.

Linking GitHub to Gradescope.

You’ll be prompted to authorize GitHub and connect it to Gradescope. In the drop-down menu under Repositories, be sure to select “Public and private” to enable full access.

Screen shot of authorizing Gradescope to talk to GitHub.

Authorizing Gradescope to talk to GitHub.

When prompted, log in to your GitHub account to complete the process (I don’t know if you need your PAT or your “Go(ubs!” password, try both!).

After your accounts have been linked, you’ll see a message that says “Successfully authenticated with GitHub.”

Screen shot of successful integration between GitHub and Gradescope.

Successful integration of GitHub and Gradescope
  1. Return to Canvas & Verify the Connection

Now, you can return to Canvas and navigate back to Gradescope. If you are returning to your previous tab, you may need to refresh the page to make sure your account settings are updated.

Click on your programming assignment in Gradescope. Verify that the GitHub connection is working, and that you can see a list of your GitHub files in the drop-down menu when you are submitting an assignment.

Screen shot of submitting HW from GitHub to Gradescope.

Submitting HW from GitHub to Gradescope.

Submitting assignments after having connected to GitHub

To submit your assignment, complete the following steps:

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

  2. Select the appropriate GitHub repository. The branch will always be “main”.

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

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