Coder Social home page Coder Social logo

judge-turtle's People

Contributors

btws2 avatar dependabot[bot] avatar inteon avatar lgtm-migrator avatar

Watchers

 avatar  avatar

Forkers

lgtm-migrator

judge-turtle's Issues

Images are not shown in output

When submitting solutions for the Turtle judge, I can't seem to get the images to work:

image

Tested in both Firefox and Chrome.

(Not entirely sure if this is a turtle judge issue or a Dodona issue, but I'll move the issue to the correct repo if necessary)

Visual feedback

Some ideas for visual feedback:

  • Bounding box of region of interest with different pixels
  • Three viewing modes (with toggle for switching) for comparing submission and solution:
    • Side by side (default)
    • On top of each other with 50% transparency with CSS (and bounding box)
    • Diff of two images (with Pixelmatch or PIL)

Docs:

Script to convert solution.py to svg image for exercise description

Python script for teacher which converts turtle solution to image.

Teachers need a png image for the exercise description. This script could be in their GitHub repository with Dodona exercises in a preparation folder. Running the script locally would generate the image in the media folder based on the solution.py.

  • Automatic filename based on folder/exercise name
  • Option to change canvas size
  • svglib? Support for svg's is sufficient, so no png's needed.
  • Also write svg image (with option for transparant or white background)

Similar to donkirkby/svg-turtle#4 and based on https://github.ugent.be/brewille/oef_turtle/blob/master/centered_rectangle/preparation/conv2png.py

Feedback ignoring background

This feature request tries to make the feedback more meaningful. 2209/2500 pixels correct doesn't say that much, but 88% is already better.

Background pixels are correct by default, so count them separately (see below). E.g. square with a black border and transparant inside. A blank canvas is already 90%+ correct. If the number of black pixels is counted, this results in 0% correct.

  • Absolute and percentage difference of total pixels, e.g. 950/1000 (95%) pixels correct (current situation, but add percentage)
  • Absolute and percentage difference of mismatched (non-background) pixels, e.g. 900/1000 (90%) foreground pixels correct
  • User specifies background color in config.json (default if not mentioned is transparant). e.g. "background-color": "white"

Docs:

Use https://pypi.org/project/colour/ or the color map in svg_turtle to convert between colour formats.

Edit: This is what I meant. The score isn't 90%+, but a more realistic score, 20% similarity.
image

`ValueError: images do not match`

import turtle

center = (0, 0)
side = 50

turtle.fillcolor("blue")
x_pt, y_pt = center

x_pt -= side / 2
y_pt += side / 2

turtle.up()
turtle.goto(x_pt, y_pt)
turtle.down()

turtle.begin_fill()
for _ in range(4):
    turtle.forward(side)
    turtle.right(90)
turtle.end_fill()

turtle.home()
turtle.dot(5)


turtle.done()
Standard Error:
Traceback (most recent call last):
  File "/mnt/_n9h4GBuCwjJb87ulQw3cg/judge/turtle_judge.py", line 74, in <module>
    correct_pixels, total_pixels = diff_images(png_submission, png_solution)
  File "/mnt/_n9h4GBuCwjJb87ulQw3cg/judge/judge/runtime.py", line 61, in diff_images
    diff = ImageChops.difference(image1, image2)
  File "/usr/local/lib/python3.10/site-packages/PIL/ImageChops.py", line 102, in difference
    return image1._new(image1.im.chop_difference(image2.im))
ValueError: images do not match

Load custom background images

Load custom backgrounds in turtle canvas with bgpic.

Edit: This feature request is to make "connect-the-dots"-exercises possible. This would be ideal to learn about the coordinate system and get some visual help. E.g.
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.