Select Git revision
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
autolab_example.py 2.07 KiB
import os
from unitgrade_private.autolab.autolab import format_autolab_json, docker_build_image
from unitgrade_private.autolab.autolab import deploy_assignment
"""
Semantic score formatting. See.
https://docs.autolabproject.com/lab/https://docs.autolabproject.com/features/formatted-feedback/
{
"_presentation": "semantic",
"stages": ["Build","Test","Timing"],
"Test": {
"Add Things": {
"passed": true
},
"Return Values": {
"passed": false,
"hint": "You need to return 1"
}
},
"Build": {
"compile": {
"passed": true
},
"link": {
"passed": true
}
},
"Timing": {
"Stage 1 (ms)": 10,
"Stage 2 (ms)": 20
}
}
{"scores": {"Correctness": 20, "TA/Design/Readability": 40}}
"""
if __name__ == "__main__":
wdir = os.getcwd()
args = [('example_simplest', 'cs101', 'report1_grade.py', 'report1_grade.py'),
('example_framework', 'cs102', 'report2_grade.py', 'report2_grade.py'),
('example_docker', 'cs103', 'report3_complete_grade.py', 'report3_grade.py'),
]
from unitgrade_private import load_token
# data, _ = load_token("../example_framework/instructor/cs102/Report2_handin_18_of_18.token")
data, _ = load_token("../example_framework/students/cs102/Report2_handin_3_of_16.token")
format_autolab_json(data, indent=2)
# import sys
# sys.exit()
for bdir, name, instructor, student in args:
instructor_base = f"{wdir}/../{bdir}/instructor"
student_base = f"{wdir}/../{bdir}/students"
output_tar = deploy_assignment(name, INSTRUCTOR_BASE=instructor_base, INSTRUCTOR_GRADE_FILE=f"{instructor_base}/{name}/{instructor}",
STUDENT_BASE=student_base, STUDENT_GRADE_FILE=f"{student_base}/{name}/{student}",
output_tar=None,
autograde_image='tango_python_tue')
print(output_tar)
docker_build_image() # Make sure docker grading image is up-to-date.
docker_build_image() # Make sure docker grading image is up-to-date.