This repository contains tools for managing courses at UC Davis. Most of these tools arose from teaching the STA 141A-B-C series, and are written in R or Python.
This script provides four subprograms to help manage student git repos:
clone
: Clone multiple repos from a base URL.prepare
: Createfeedback.ipynb
in every repo, based on the Jupyter notebook submitted by the student.grade
: Extract scores fromfeedback.ipynb
in every repo.commit
: Add and commit a user-specified file in every repo.push
: Push toorigin master
in every repo.
The script requires Python >= 3.7 and these external packages:
Name | Tested Version | Conda Install Command |
---|---|---|
pandas | 0.24.0 | |
nbformat | 4.4.0 | conda install -c anaconda nbformat |
pygit2 | 0.27.4 | conda install -c conda-forge pygit2 |
pytz | 2018.7 | conda install -c anaconda pytz |
If you don't use Anaconda, these packages can also be installed with pip
.
Once you've installed the required packages, use git clone
to clone this
repo.
To use this tool to grade an assignment, the basic process is:
-
Clone the assignments with
python ucdtool.py clone DEST NAME
. TheDEST
argument is the directory to clone the assignments into; it will be created if it doesn't exist already. TheNAME
argument is the name of the assignment on GitHub, for example "assignment-1". The name must match exactly. -
Generate a
feedback.ipynb
file in every repo withpython ucdtool.py prepare PATH DUE
. ThePATH
argument is the directory that contains the assignment repos. TheDUE
argument is a due date inMM.DD hh:mm
format. The due date is only used to print out the names of students that submitted late. -
Grade each
feedback.ipynb
, adding feedback directly in the notebook. Usuallyfeedback.ipynb
will have grading cells marked in red. However, if the student deleted parts of the original assignment notebook, these will not show up and you'll have to create grading cells manually. -
When all of the notebooks are graded, use
python ucdtool.py commit PATH FILE MESSAGE
to add and commit the graded notebooks. ThePATH
argument is the directory that contains the assignment repos. TheFILE
argument is the name of the file to add and commit, usuallyfeedback.ipynb
. TheMESSAGE
argument is the commit message. -
Finally, push with
python ucdtool.py push PATH
. ThePATH
argument is the directory that contains the assignment repos. Be careful: unlike steps 1-4, there is no "undo" for this step and students can immediately see the pushed commits.
This script can merge rosters from GitHub Classroom and UC Davis Photorosters.