How does the Github Classroom get the results from the autograder? #77361
-
Hi everyone,I am trying to create a custom autograder action for a complex series of tests and to give better feedback. But looking at the official autograder code (https://github.com/education/autograding) I can't see where the points are stored/send somewhere that Github classroom can access. The only output I see from the autograder is to the run check, but that is an unstructured string? Anyone know how this works? How does Github classroom get the grade? A suggestion...(optional)more help with creating custom actions |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
I don't know if this will work, or even if it is ok to do, but I am going to tag @markpatterson27 here (contributor to autograding action), maybe they will know the answer? |
Beta Was this translation helpful? Give feedback.
-
As an alternative to creating a custom autograder, you could create scripts that do the grading and feedback for you, and just use autograding to call those scripts. See https://github.com/SERC-COM299/CookieDB-KV1-CREATE-and-INSERT/blob/6bb50fa2e734cd9798da8806811ffc016c11ee20/.github/classroom/autograding.json#L44-L51 for an example of grading if the student has used the correct data type for an attribute in a SQL database (along with providing them feedback as a comment in the 'Feedback' PR). |
Beta Was this translation helpful? Give feedback.
-
This method works fine for the Classroom updates as needed. I hoped to use this as a workaround by combining with the official Autograding. Since currently my Classroom does not update grades labels :/ Here is my code to debug and pass the grades to the Classroom by this custom action. Unfortunately, this workaround does not work. name: GitHub Classroom Workflow
on: [push]
jobs:
build:
permissions: write-all
name: Autograding
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Auto
id: auto
uses: education/autograding@v1
- name: Out
id: out
env:
GRADES: ${{join(steps.auto.outputs.*, '\n')}}
run: |
echo "Auto print $GRADES"
points=$(echo "$GRADES" | awk -F'/' '{print $1}')
echo 'points<<EOF' >> $GITHUB_OUTPUT
echo $points >> $GITHUB_OUTPUT
echo EOF >> $GITHUB_OUTPUT
totalpoints=$(echo "$GRADES" | awk -F'/' '{print $2}')
echo 'totalpoints<<EOF' >> $GITHUB_OUTPUT
echo $totalpoints >> $GITHUB_OUTPUT
echo EOF >> $GITHUB_OUTPUT
- name: Get points
env:
POINTS: ${{ steps.out.outputs.points }}
TOTAL: ${{ steps.out.outputs.totalpoints }}
run: echo "Grades $POINTS / $TOTAL"
- name: mark
id: mark
env:
POINTS: ${{ steps.out.outputs.points }}
TOTAL: ${{ steps.out.outputs.totalpoints }}
# run: echo "points=7" >> "$GITHUB_OUTPUT" ; echo "total-points=9" >> "$GITHUB_OUTPUT"
uses: markpatterson27/autograding@dev-points-input-release
with:
points: ${{ steps.out.outputs.points }}
available-points: ${{ steps.out.outputs.totalpoints }}
# points: 8
# available-points: 15 |
Beta Was this translation helpful? Give feedback.
I think you've answered your own question. Autograding uses check suite to report the grading score to GH classroom. (Specifically, this call: https://octokit.github.io/rest.js/v18#checks-update)
There's an issue with an actions/github-script that pulls the relevant code: github-education-resources/autograding#52 I haven't checked , but change the
text
string to the value you want (including the 'Points ' prefix in the formatPoints {points}/{total-points}
). Presumably GH classroom parses the string on the other end. Pretty sure the points have to be integers.I have thought about putting that code into a separate action or proposing a
points
input on the autograding action, for cases whe…