AccelerationConsortium / ac-microcourses

Microcourses hosted by the Acceleration Consortium for self-driving lab topics.
https://ac-microcourses.readthedocs.io/
MIT License
24 stars 3 forks source link

Fix autograding to divide points #120

Open sgbaird opened 3 hours ago

sgbaird commented 3 hours ago

Existing example from https://github.com/ACC-Robotics/1-pumps-and-pipettes/blob/main/.github/classroom/autograding.json

{
    "tests": [
      {
        "name": "Run pytest",
        "setup": "pip install -r requirements.txt",
        "run": "pytest",
        "input": "",
        "output": "",
        "comparison": "included",
        "timeout": 10,
        "points": 100
      }
    ]
  }

Use pytest file_name.py::function_name syntax to assign partial points (and make sure points add up to the total for the assignment, 10 points in most cases).

sgbaird commented 3 hours ago

This is the new yaml syntax, which we should try to switch to: https://github.com/ACC-Robotics/0.2-intro-github-classroom/blob/main/.github/workflows/classroom.yml

E.g.,

name: Autograding Tests
'on':
- push
- repository_dispatch
permissions:
  checks: write
  actions: read
  contents: read
jobs:
  run-autograding-tests:
    runs-on: ubuntu-latest
    if: github.actor != 'github-classroom[bot]'
    steps:
    - name: Checkout code
      uses: actions/checkout@v4
    - name: Hello world test
      id: hello-world-test
      uses: classroom-resources/autograding-python-grader@v1
      with:
        timeout: 5
        max-score: 5
        setup-command: sudo -H pip3 install pytest
    - name: Autograding Reporter
      uses: classroom-resources/autograding-grading-reporter@v1
      env:
        HELLO-WORLD-TEST_RESULTS: "${{steps.hello-world-test.outputs.result}}"
      with:
        runners: hello-world-test
sgbaird commented 3 hours ago

https://docs.github.com/en/education/manage-coursework-with-github-classroom/teach-with-github-classroom/use-autograding