? PET Academy Cookbook
1. Organisation erstellen
- Gehe zu: https://github.com/organizations/new
- Organisation Name:
pet-academy-test - Plan: Free
- Keine Mitglieder hinzufügen
- Fertig!
2. GitHub Classroom erstellen
- Besuche: https://classroom.github.com
- Klick auf “New classroom”
- Name: z. B.
Pet Academy Test - Spring 2025 - Introduction to Privacy Tech - Organisation:
pet-academy-test - LMS: “I don't use an LMS”, dann einfach auf “Continue” klicken ???TBD TUWel Integration - Moodle
3. Assignment erstellen
- Im Classroom: “New assignment”
- Name:
Hello Python - Assignment type: Individual assignment
- Starter code: leer lassen (Template-Repo kommt erst)
- Repository visibility: Public
- Student admin access: ❌ deaktivieren
- Feedback pull requests: ✅ aktivieren
- Autograding tests: ? später (wir verwenden GitHub Actions)
4. Template-Repository vorbereiten
Name: hello-python-template
Ort: In der Organisation pet-academy-test (oder später transferieren)
hello.py
def hallo(name):
return f"Hallo, {name}!"
if __name__ == "__main__":
print(hallo("PET Academy"))
test_hello.py
from hello import hallo
def test_hallo():
assert hallo("Alice") == "Hallo, Alice!"
assert hallo("Bob") == "Hallo, Bob!"
print("✅ Alle Tests bestanden.")
if __name__ == "__main__":
test_hallo()
.github/workflows/tests.yml
name: Python Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- run: pip install pytest
- run: pytest
README.md
# Hello Python – PET Academy Assignment
Welcome to your first assignment at the **PET Academy**!
## Task
Implement the function `hallo(name)` in `hello.py`.
### Example
```python
>>> hallo("Alice")
'Hallo, Alice!'
Run the tests
python test_hello.py
Autograding
Tests run automatically using GitHub Actions.
Tips
- Stick to the function signature
- Return a string
- Don’t break the tests ;)
Einstellungen:
- Template-Repo aktivieren in den Settings
- In die Organisation
pet-academy-testverschieben (falls es im persönlichen Account war)
5. Template eintragen & Assignment synchronisieren
- Gehe zur Aufgabe → Edit assignment
- Trage das Template ein:
pet-academy-test/hello-python-template - Speichern
- “Sync assignment” erscheint, sobald mind. 1 Studi beigetreten ist eventuell geht es auch automagisch
- Klick → erzeugt Pull Requests in Studi-Repos mit dem Starter-Code
6. Studis einladen
- Im Assignment → Copy invitation link
- An Studis mailen
- Studis klicken → erhalten automatisch ihr Repo mit Starter-Code
7. Autograding: Was triggert GitHub Actions?
| Aktion | Startet Autograding |
|---|---|
Commit auf main |
Ja |
| PR mergen (Sync) | Ja |
| Datei im Web ändern | Ja |
| Nur Repo beitreten | Nein |
Wenn nichts läuft: Mini-Änderung machen (z. B. Leerzeichen) und committen.
8. Neue Studis später?
Wenn neue Studis beitreten nachdem das Template verknüpft wurde:
- Sie bekommen direkt den aktuellen Starter-Code
- Kein „Sync assignment“ nötig
Wenn man das Template später ändert:
- Dann „Sync assignment“ erneut → PR mit den Änderungen wird erstellt