Python Turtle graphics is a popular way for introducing programming to kids. This judge aims to provide feedback for these students during the learning experience and evaluations. How similar is the submission of the student to the solution of the teacher?
This Dodona course contains some sample exercises that were used in developing the Python Turtle judge:
There are a number of sample exercises on Dodona's sample exercises repository to demonstrate the use of the judge:
config.json
print()
statements and time.sleep()
are ignored.solution.py
to svg image for exercise description.dirconfig.json
config.json
(example with default settings)evaluation
settings in config.json
Add your solution file (solution.py
) the evaluation
folder. You can define a different name for the solution in the config.json
file. Absolute
necessary files are marked with ▶
in the tree structure below.
+-- README.md # Optional: Describes the repository
+-- dirconfig.json # Shared config for all exercises in subdirs
+-- 📂public # Optional: Contains files that belong to the course or series
| +-- my_turtle.png # Optional: An image to reuse throughout the course
+-- 📂turtle-exercises # We could group exercises in a folder
| +-- 📂rectangle # Folder name for the exercise
| | +-- config.json # ▶ Configuration of the exercise (explained later)
| | +-- 📂evaluation # -- 🔽️ ADD YOUR SOLUTION HERE 🔽 --
| | | +-- solution.py # ▶ The Python Turtle model solution file
| | +-- 📂solution # Optional: This will be visible in Dodona for teachers
| | | +-- solution.py # Optional: The Python Turtle model solution file
| | +-- 📂description #
| | +-- description.nl.md # ▶ The description in Dutch
| | +-- description.en.md # Optional: The description in English
| | +-- 📂media # Optional folder
| | | +-- rectangle.svg # Optional: An image used in the description
| | +-- 📂boilerplate # Optional folder
| | +-- boilerplate # Optional: loaded automatically in submission text area
| :
:
dirconfig.json
{
"type": "exercise",
"programming_language": "python",
"access": "public",
"evaluation": {
"handler": "turtle",
"time_limit": 10,
"memory_limit": 50000000
},
"labels": [
"turtle"
],
"author": "Firstname Lastname <firstname_lastname@ugent.be>",
"contact": "firstname_lastname@ugent.be"
}
config.json
(example with default settings){
"description": {
"names": {
"nl": "Mijn eerste Python Turtle oefening",
"en": "My first Python Turtle exercise"
}
},
"type": "exercise",
"programming_language": "turtle",
"access": "public",
"labels": [
"turtle"
],
"evaluation": {
"handler": "turtle",
"canvas_width": 400,
"canvas_height": 250
}
}
evaluation
settings in config.json
If these settings are not defined, the default value is chosen.
Evaluation setting | Description | Possible values | Default |
---|---|---|---|
solution_file |
Relative path to solution file | path | ./solution.py |
canvas_width |
Width of canvas in pixels | int | 400 |
canvas_height |
Height of canvas in pixels | int | 250 |
The svg images for each exercise can be made with a Python script. Place the script at the root of your folder with exercises.
# TODO, see https://github.com/BTWS2/judge-turtle/issues/16
![image_name](./media/image_name.svg){:height="50%" width="50%"}{: style="border-style: inset"}
<img src="https://github.com/dodona-edu/judge-turtle/raw/main/media/image_name.svg" alt="image_name" height="50%" width="50%" style="border-style: inset">
Development funded by the Faculty of Engineering and Architecture of Ghent University