Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions grading/judge-parameterizable-course/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# DOCKER-VERSION 1.1.0

#inherit from the java container
ARG VERSION=latest
FROM ingi/inginious-c-base:${VERSION}
LABEL org.inginious.grading.name="test-judge"
LABEL org.inginious.variable.isInExamMode='{"value": "False", "description": "A boolean indicating if the judge is in exam mode"}'
LABEL org.inginious.variable.signature='{"value": "def foo()", "description": "The signature should be: def nameFunction(param1, param2, ...)" }'
COPY run /course/run
COPY template.py /course/template.py
18 changes: 18 additions & 0 deletions grading/judge-parameterizable-course/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

parsetemplate /task/tests.py
parsetemplate --output /task/student/code.py /course/template.py
output=$(python3 /task/tests.py 2> stderr.log)

if [ "$(tail -n 1 stderr.log)" = "" ]; then
feedback-result success
feedback-msg -em "Your code is saved for future grading"
elif [ "$(tail -n 1 stderr.log)" != "OK" ]; then
error=$(grep "self" stderr.log | cut -d ',' -f3- | cut -d '"' -f2)
feedback-result failed
feedback-msg -em "$error"
exit 1
else
feedback-result success
feedback-msg -em "Your code is correct"
fi
2 changes: 2 additions & 0 deletions grading/judge-parameterizable-course/template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@@$signature@@:
@ @thecode@@