My guides to using GitHub Classroom for teachers and students


(Jacob Fiksel) #1

Hi all,

I’ve been working this summer to setup GitHub Classroom for our optional computational lab associated with our large undergrad intro to statistics course. While the course has not started yet, we’ve been testing features of GitHub Classroom, which has allowed me to put together guides for both teachers and students.

On the teacher side, I’ve listed recommended steps for getting your GitHub Classroom/organization setup, how to send out assignments, and how to grade assignments. These are solely based on my experience so far, and I would love additional feedback to be included in these guides, especially for grading workflows.

On the student side, I have steps for downloading Git (both Windows and Mac–I assume that if a student is using Linux, they probably can figure out how to download Git), and how to pull, edit, commit, and push assignments to GitHub Classroom. I specifically do not go into branching or any intermediate/advanced Git features, as we want to use Git as an educational tool, and not have it be the focus of our class.

Here are the links to the guides:


I’m sure that similar material has been posted here, but I just wanted to pitch in what I have so far. Looking forward to feedback.

Jacob


(Manuel Schmalstieg) #2

Hi Jacob,

Thanks a lot for sharing this guides!

Your how-to about Grading assignments is highly valuable, as I’m still looking at optimizing that part of my workflow.

regards,
Manuel


(Konzy) #3

Jacob, thank you for including my script in your tutorial as well as the pull request. I’m glad you found it useful enough to contribute and share.


(Vanessa) #4

@jfiksel this is awesome. Cool if I share it on Twitter from the Education account?


(Jacob Fiksel) #5

@mozzadrella of course, no problem–glad you like it!


New Instructor
(Dr. N[0]) #6

Thanks so much for capturing and sharing your workflows. I’m wondering about the starter code. It seems that creating a classroom and populating it with starter code from another repo brings all the previous commits. Have you found that to be true? Do you mind your students seeing all that? (Personally, I’m going to create a “scratch” repo each semester, copy my master starter code there and then create the assignment using that scratch repo to initially populate the student’s assignment repos.)

Again, great job and thanks! --Greg


(Jacob Fiksel) #7

I’m glad you liked the guide, @gregnordstrom! Yes, I believe it does bring the previous commits. I actually haven’t thought too much about this, but my current position is that I think it’s actually a good thing for the students to see what a commit history looks like (as long as you practice what you preach with commits, which is not always the case for me :slight_smile:) I also don’t think that students in an intro class will even notice the previous commits, especially when we’re trying to not have Git be the focus of the class.

If this is something you’re worried about, what I’ve seen suggested is to fork the starter code repo from the master organization into your class organization, and then squash the commits. You can then use this forked repo as the starter code. I’ve actually never squashed my commit history before, but it looks like there are quite a few guides floating around online. I’m also sure someone in this community can give you some advice on this.

Hope this was helpful!
Jacob


(Dan Wallach) #8

In my class, students build new features every week. In the subsequent week, they get my “reference” solution and build more from there. This led me to a complex set of branches, starting from “master” and then forking each week from there. So weekN is master, but with some things deleted. weekN-1 is weekN with a few more things deleted. And so on down to the week1 branch which has very little there.

(And yes, when I want to make a small change to the master, I have to rebase all the branches. Uggh.)

Given this structure, what I’m doing to create the “release” branches for the students is roughly:

  • Clone a fresh copy of the repo from GitHub
  • git checkout weekN
  • rm -rf .git
  • git init . ; git add . ; git commit -m ‘weekN ready to go’

And then I create a repo at GitHub and push this new repo, now completely free of my commit history.


(Dan Wallach) #9

My student instructions look a lot like yours, except for IntelliJ IDEA rather than for RStudio. IntelliJ has specific support for GitHub in it, including GitHub’s token-based login thing. While they’re working, I’m mostly just telling them “thou shalt commit and push, simultaneously”, since this will be for most of them their very first exposure to Git. Gotta start simple.

Travis-CI is going to be fun as well. So far as I can tell, you have to manually enable Travis-CI on each and every student repo, which you can’t do until the student accepts the GitHub Classroom link. This basically means that I’ll have to take a swing at it every night to pick up stragglers. For the most part, though, I’m seeing Travis-CI as a feature for the graders more than for the students. If I get this right, for most students, the graders will never leave their web browser. They’ll visit a student repo, click to the commits, verify the green checkmark from Travis-CI, and then they just need to browser the code to make sure the students didn’t do something dumb, like disable all the unit tests we provide them.

For the students, themselves, I’m basically telling them to run gradle check locally, which then runs CheckStyle, ErrorProne, and their unit tests. In later weeks, it will also run JaCoCo for code coverage requirements. The only reason a student might need to visit GitHub.com is if they’re paranoid that their code didn’t get pushed.

Sadly, Travis-CI only offers one simultaneous build for freebie accounts like the one they’ve offered me. They’ve done some performance tuning, but it still seems to take about a minute of CPU time for a given repo to be checked out and the tests to run. If all 160 of my students do a push within five minutes of the final deadline, it will be 3+ hours before all the tests have finished.

On the one hand, this is bothersome due to the lack of instant feedback. On the other hand, it tells students that there’s a benefit to running locally. It’s the same tests running in either place.


(Readoc) #10

Just wanted to say thanks to @jfiksel for sharing this. Ran into a bit of an issue I’m working through on the

mass-clone

“fatal: Cannot change to ‘pull’: No such file or directory”

Anyone else run into this one? Everything connects (via SSH) and goes through the process fine.

Thanks in advance.


(Readoc) #11

So I wanted to reply with a solution in case anyone else runs into this. Turns out it was an authentication error stopping everything.

I have 2FA set up on my account. In order to get the script to work, I needed to switch to https and authenticate with a generated GitHub access token.

It’s working wonderfully!


(Jacob Fiksel) #12

Sorry for the late response @readoc, glad that it’s working for you! And thanks for your comment, I’m sure that more people in the future will have this problem. If you feel that there should be another script in the mass_clone repo that accommodates 2FA, feel free to make a pull request.


(Jacob Fiksel) #13

Hi all–if you have already cloned the mass_clone directory, there have been some important updates in the repository that can be found here: https://github.com/jfiksel/mass_clone . Please pull in these changes, otherwise you may have problems once your classroom organization has over 100 total repositories.


(Readoc) #14

Not to worry @jfiksel. It’s been working well. If I make changes, I’ll make sure to do a pull request.


(小克) #15

I also wrote an article, but it was written in Chinese.


(Ryan James) #16

I think I’m having the same problem. I’ve never done ssh with github before and I’m not sure how to get this to authenticate properly. Do you know where I can find more documentation to set this up?


(Readoc) #17

I ended up not using SSH.

Instead, I used https with a GitHub access token that I generated.

https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/


(Bill Foote - http://jovial.com/) #18

Hi @jfiksel, just wanted to say thanks for writing this guide. Just yesterday, I found out that there’s a thing called “github classroom.” I learned that shortly after I found out that the place I’m about to start teaching uses github classroom. Anyhoo, I can tell already that your guide is going to save me a ton of time getting this set up.


(Jacob Fiksel) #19

@wffoote I’m glad these guides were helpful! I’m hoping to improve the student guides based off feedback from my class last semester. Please let me know if there is anything for the teaching guides that is unclear or should be explained in more depth.