• This repository has been archived on 06/Feb/2018
  • Stars
    star
    187
  • Rank 206,464 (Top 5 %)
  • Language
    Ruby
  • License
    MIT License
  • Created about 11 years ago
  • Updated about 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Command line tool to help teachers use GitHub in their classrooms

Notice: We have released a web based tool for teachers. teachers_pet will remain availble, but we recommend teachers use Classroom for GitHub instead.

teachers_pet Build Status Gem Version

WARNING: This documentation may contain unreleased changes. See rubydoc.info/gems/teachers_pet for the version of this README corresponding to the latest release.

Command line tool to help teachers use GitHub in their classrooms.

Philosophy

Each class is an 'organization' on GitHub. This allows the instructors (GitHub organization Owners) to create, push, pull, and administer all repositories. This achieves two goals:

  • Instructors can push code starter code to all students
  • Instructors can easily browse/pull student code at any time during the assignment to assist in questions, check on progress

Each student is given a team in the organization. The team name is the same as the student's GitHub username.

Installation

Install Ruby 1.9.3+, then run

gem install teachers_pet

If you've used this tool before, get the newest version using

gem update teachers_pet

To use the latest-and-greatest code from this repository, see the instructions in CONTRIBUTING.md.

Typical workflow

...when using the sandboxing method with private repositories:

Basic setup

  1. Create an organization (you will be an owner by default). The organization should reflect the name of your course. See the classroom guide for more info.

  2. Have each student/instructor create GitHub accounts.

  3. Create a students file (you can use an alternate filename and specify with the --students option if you like)

    • Individual assignments: one username per line
    • Group assignments: one team per line in the format teamName username username username
  4. Add the GitHub username of all instructors to an Owners.csv file (one per line)

  5. Run the following:

    teachers_pet create_student_teams ...
    teachers_pet add_to_team --members Owners.csv ...

Assignments

teachers_pet create_repos ...
teachers_pet push_files ...
# Multiple times:
teachers_pet open_issue ...

# Then, after the assignment is due,
teachers_pet clone_repos ...

Authentication

The scripts will ask for your GitHub password in order to run. If you have two factor authentication (2FA) enabled, create a personal access token (replace github.com with your host for GitHub Enterprise):

https://github.com/settings/tokens/new?description=teachers_pet&scopes=repo%2Cpublic_repo%2Cwrite%3Aorg%2Crepo%3Astatus%2Cread%3Aorg%2Cuser%2Cadmin%3Aorg

Once created, specify the token using the --token option, or if you add the TEACHERS_PET_GITHUB_TOKEN environment variable to your .bash_profile (or equivalent – example below), it will be picked up by teachers_pet.

# replace YOUR_TOKEN_HERE below
echo "\n\nexport TEACHERS_PET_GITHUB_TOKEN=YOUR_TOKEN_HERE" >> ~/.bash_profile
source ~/.bash_profile

Actions

To learn the options for each action, run

teachers_pet help
# or
teachers_pet help COMMAND

Giving others access

You may need to give other people access to various repositories using teams – the add_to_team command can help do this in bulk.

Creating assignments

When using the sandboxing setup, you will need to create the repositories for the students. For each assignment, use the create_repos action to create a repository for each student. The repositories are technically created per team, but if you use create_student_teams first, then there will be one team per student.

Forks

If you need to grab the list of users who have forked a particular repository – e.g. to use with another command – you can run the forks command, and the results will be written to a file.

Collaborator access

Give collaborator access to everyone who has forked your repository using add_collaborators. Mostly useful for GitHub demonstrations, where usernames can quickly be collected via forks, and then the students can be quickly given access to a repository.

Pushing starter files

When creating repositories for students, you will often want to include boilerplate files. After running create_repos, create a canonical copy of the starter files (e.g. .gitignore, Makefiles, etc.) in a repository. From the local clone of the repository, use the push_files action to place that code in the repositories for each student. This works by creating a Git remote for each student repository, and doing a git push to each one.

Opening issues

After running create_repos, instructors can open issues in student repos as a way to list requirements of the assignment, goals, or instructions for patching, using the open_issue command.

Clone repositories for grading

When grading, use the clone_repos command to clone all the repositories in the organization that match the username-repository naming scheme that is generated when create_repos is run.

Merge all open pull requests

When running a GitHub workshop, it's nice to be able to merge a bunch of pull requests on a particular repository all at once. merge_pull_requests will handle this for you.

Related projects

More Repositories

1

GitHubGraduation-2022

Join the GitHub Graduation Yearbook and "walk the stage" on June 11.
1,446
star
2

GitHubGraduation-2021

Join the GitHub Graduation Yearbook and "walk the stage" on June 5.
JavaScript
1,375
star
3

classroom

GitHub Classroom automates repository creation and access control, making it easy for teachers to distribute starter code and collect assignments on GitHub.
Ruby
1,339
star
4

graduation

$ git remote <graduation> yearbook
JavaScript
747
star
5

codespaces-project-template-js

Codespaces template for creating and deploying your own React portfolio
JavaScript
603
star
6

primer-explore-github

406
star
7

teachers

Join the discussion in the GitHub Education Community:
182
star
8

codespaces-project-template-py

Codespaces template for building a Python project
HTML
157
star
9

codespaces-project-template-dotnet

Codespaces template for building a .NET project
HTML
132
star
10

launchpad-profile-readme

128
star
11

classroom-assistant

Clone student repositories in bulk
JavaScript
116
star
12

Octernships

GitHub Octernships program connects students with industry partners in paid professional experiences and mentorship on open source and software development projects.
115
star
13

memebot_discord

Launch your very own Discord bot to welcome your users and share a meme.
Dockerfile
114
star
14

github-starter-course

93
star
15

github-university-2020

86
star
16

Student-Developer-Pack-Current-Partners-FAQ

This repo gives you an overview of the Student Developer Pack, the current partners in the pack and answers to frequently asked questions about the pack.
84
star
17

codespaces-teaching-template-py

Codespaces template for teaching Python
Jupyter Notebook
83
star
18

autograding

GitHub Education Auto-grading and Feedback for GitHub Classroom
TypeScript
59
star
19

autograding-example-python

GitHub Classroom autograding example repo with Python and Pytest
Python
45
star
20

PR-TalentLandMX

Participa para ganar swag especial dentro de Talend Land 2023
42
star
21

PR-Pao-de-Queijo-Request

HTML
41
star
22

codespaces-teaching-js-template

Codespaces template for teaching JavaScript
JavaScript
38
star
23

guide

GitHub guide for teachers
Ruby
34
star
24

autograding-example-java

GitHub Classroom autograding example repo with Java, Gradle, and JUnit
Java
26
star
25

PR-Patches-Campus-Party

PR-Patches-Campus-Party
HTML
24
star
26

Classroom-Report-2020

Design, analysis, findings and raw data from the 2020 GitHub Education Classroom Report
20
star
27

Classroom-Report-2018

Design, analysis, findings and raw data from the 2018 GitHub Education Classroom Report
20
star
28

primer-copilot

17
star
29

hackconviii

The conference for hacker community leaders: https://hackcon.mlh.io/. Here you can find everything related to the GitHub Scavenger Hunt.
16
star
30

codespaces-teaching-template-dotnet

Codespaces template for teaching .NET
HTML
14
star
31

Series-Intro-to-GitHub-Flow

12
star
32

autograding-example-c

GitHub Classroom autograding example repo with C and bash tests
Shell
12
star
33

autograding-example-cpp

GitHub Classroom autograding example repo with C++ and Catch.
C++
12
star
34

autograding-grading-reporter

Renders Autograding output and syncs results to classroom
JavaScript
11
star
35

autograding-example-node

GitHub Classroom autograding example repo with Node and Jest.
JavaScript
10
star
36

Classroom-Report-2019

Design, analysis, findings and raw data from the 2019 GitHub Education Classroom Report
10
star
37

Global-Campus-Experiences

This is a guide to Global Campus Experiences and how learners can approach incorporating them into your learning journey.
7
star
38

edu-resource-guide

Resources for GitHub and GitHub Education products and services.
5
star
39

autograding-command-grader

JavaScript
3
star
40

autograding-io-grader

JavaScript
2
star
41

example-classroom-template

Ruby
1
star