- A GitHub organization linked to GitHub Classroom
- The organization upgraded to GitHub Team (free for educators)
You will create:
- A leaderboard repo (public) — receives scores and displays the leaderboard
- A template repo (can be private) — contains only
MyString.javafor students to modify - A GitHub Classroom assignment — uses the template and runs the autograder
- Navigate to the GitHub Global Campus dashboard.
- Click Upgrade to GitHub Team.
- Click Upgrade next to your organization's name. (If you don't see the organization, that means it's already upgraded.)
-
Create a new public repo (e.g.,
java-hash-ex-leaderboard) on GitHub within your organization. Do not add any files yet. -
From your local
java-hash-exercisedirectory, run:./make_leaderboard_repo.sh <org> <leaderboard-repo>
For example:
./make_leaderboard_repo.sh java-hash-ex-org java-hash-ex-leaderboard
-
Push the generated
leaderboard-repo/contents to your GitHub repo. -
Enable GitHub Pages:
- Go to the repo's Settings.
- Click Pages in the left sidebar.
- Under Source, select
Deploy from a branch. - Under Branch, select
mainand/docs. - Click Save.
- On GitHub, click your profile picture → Settings.
- In the left sidebar, click Developer settings.
- Expand Personal access tokens → click Fine-grained tokens
- Click Generate new token and fill in:
- Token name:
Hash Contest Leaderboard - Description: you can leave this blank
- Expiration: end of semester or day after the activity
- Resource owner: your organization
- Repository access: Only select repositories → select your leaderboard repo
- Permissions: Contents
- Token name:
- After closing the permissions dialog, set the Contents permissions to
Read and write. - Click Generate token.
- Copy the token, which you will need in the next step.
From your local java-hash-exercise directory, run:
./make_github_autograder.sh <org> <leaderboard-repo> <token>For example:
./make_github_autograder.sh java-hash-ex-org java-hash-ex-leaderboard ghp_xxxxxxxxxxxxThis creates student-autograder.yml in the current directory.
- Create a new private repo (e.g.,
hash-contest-template) on GitHub within your organization. - Add the file
MyString.java(fromsrc/main/java/MyString.java). Here is the simplest way to do so:- On the new repo page, click on the link uploading a new file.
- Drag in
MyString.java(fromsrc/main/java/MyString.java).
- Go to the repo's Settings.
- Chek the box for
Template repository.
- Go to GitHub Classroom.
- Select your classroom.
- Click Create your first assignment or New assignment.
- Choose Create a blank assignment.
- Fill in assignment details (name, deadline, etc.).
- Under Starter code and environment, select your template repo.
- Under Grading and feedback:
- In the Add autograding tests section, select Custom YAML.
- Paste the contents of
student-autograder.yml. - Click the button Convert to workflow file.
- Scroll to the bottom of the page and click Create assignment.
- Accept the assignment.
- Modify
MyString.javaby changing the pseudonym and implementinghashCode(). - Add, commit, and push the changes.
- Check the Actions tab on GitHub for the results (which may take a minute).
- Verify the leaderboard updates at
https://<org>.github.io/<leaderboard-repo>/.
- Student pushes
MyString.javato their private repo - GitHub Classroom runs the autograder, which:
- Downloads evaluation code from the leaderboard repo
- Compiles and runs the student's implementation
- Shows results in the Actions tab
- Triggers the leaderboard repo to update
- The leaderboard repo updates
leaderboard.json - Students view rankings at the GitHub Pages URL
| Script | Creates |
|---|---|
make_leaderboard_repo.sh |
leaderboard-repo/ directory with all leaderboard files |
make_student_autograder.sh |
student-autograder.yml to paste into GitHub Classroom |
