For a few years now we’ve been teaching our Geo-Python course (Introduction to Python for geology/geography students) using GitHub Classroom for the assignments. We create starter assignments with the assignment described in the
README.md file for each repo (+ some starter code) and have the students accept and return the assignments using GitHub Classroom. This fall we’re planning to move to teaching the course using Jupyter Notebooks (and Jupyter Lab), in place of learning Python programming from the IPython console + Spyder IDE. We’re also hoping to move to autograding for parts of the assignments to save some time. Is anyone here able to comment on the pros/cons of using GitHub Classroom with Jupyter Notebooks versus nbgrader? It seems that nbgrader replicates some of the functionality of GitHub Classroom (sharing and collecting assignments) in addition to the autograding stuff. I really like GitHub Classroom for managing assignments, but I don’t foresee continuing to use it if we’re not able to do some of the autograding.
And sorry if this is a question that has an obvious solution. If so, I’ve not found it, and unfortunately also not yet had time to play with nbgrader.
I have looked at using continuous integration for autograding, but haven’t gotten anything off the ground yet. Definitely interested.
We have used travis-ci.com to provide automatic feedback before the assignment is due. The main program for each assignment is a series of tests of the student code. Initially, all the tests will fail as there will be no student code. As they write more code, more of these tests will pass. The code to get the initial tests to pass is relatively easy. The idea is to encourage students to work on their assignments by immediately showing them the results of their work.
The above workflow is easy to set up. Just link the github classroom organization to travis-ci.com, and include a .travis.yml file along with the main program as part of the starter code for the github Classroom assignment.
The final assignment grading (after the due date) is not on travis-ci.com. It is faster to just clone all student repositories from the organization into my local PC and run the tests again for all students (a little different from the tests given to students to make sure that their code is not designed for only those tests). This also makes it easy for us to see the students’ source code and not rely entirely on the results of running their code. I have a script that I run to do this (downloading code from github, running every student’s code, and producing a text file with the results). I can share this script - it was put together with code we found on this forum.
I’d love that script. I have some of my own, but they… aren’t great.
Hello. I am new to GitHub, and as a teacher using Python and JAVA, I plan to set up GH Education this summer, to utilize in the fall semester. This assignment organization is exactly what i was envisioning…would you mind sharing your script with me as well? as well as your set-up for using travis-ci.com for initial feedback?
Thanks for the replies @sfogarty and @apanangadan. The CI option is an interesting one, and one of the things we’re hoping to be able to do with autograding is provide exactly the feedback you mention as the students are working on the assignments. The appeal of nbgrader in one sense is that it is integrated with the Jupyter Notebooks we would use for the assignments and it is easy to configure tests that should be passed within the exercise notebook. That said, if you don’t mind sharing the scripts I certainly could play around a bit and see what can be done.
Anyone else using Jupyter Notebooks?
I will clean up the auto-grading code a bit and write some documentation (a couple of days).
Note that just providing feedback automatically does not need any code at all:
- Create an organization on github, request that it be made educational (free private repos for students).
- Sign in to travis-ci.com, add the github organization, and either pay for a subscription or request travis-ci for a free build subscription for the organization (https://education.travis-ci.com/).
- Design the starter code for the programming assignment with tests built-in such that running it outputs the feedback
- Add a .travis.yml file to the starter code with the commands to build and run the code in each repo. A sample is attached:
travis.yml.pdf (5.8 KB)
- Create a Github Classroom assignment with the starter code and distribute the link to students
The scripts to do the auto-grading are here:
The readme also includes a link to a sample assignment and the document we distribute to students with the assignment instructions.
Thanks for following up @apanangadan!
Thank you for sharing this code!