grading-harness merge requestshttps://gitlab.cs.washington.edu/cse340/grading-harness/-/merge_requests2022-01-04T14:20:42-08:00https://gitlab.cs.washington.edu/cse340/grading-harness/-/merge_requests/2Add diff tool to screenshots.py2022-01-04T14:20:42-08:00Henry HeinoAdd diff tool to screenshots.pyAdds a diff tool to the student and grader views for the HTML generated
by `screenshots.py`.
## How Tolerance Works
Suppose `p1` and `p2` represent the actual and expected values of some pixel (respectively).
Then, defining `Δr = p1.r ...Adds a diff tool to the student and grader views for the HTML generated
by `screenshots.py`.
## How Tolerance Works
Suppose `p1` and `p2` represent the actual and expected values of some pixel (respectively).
Then, defining `Δr = p1.r - p2.r, Δg = p1.g - p2.g, Δb = p1.g - p2.g, Δa = p1.a - p2.a`, if `Δr² + Δg² + Δb² + Δa² ≥ tolerance`, then the two pixels are considered different.
## Adjusting Tolerance
Tolerance can be adjusted through the HTML page's URL. For example, if viewing `file:///tmp/mozilla_selenite0/Screenshots-3-2.html`, navigate to `file:///tmp/mozilla_selenite0/Screenshots-3-2.html?tolerance=256` for a version with `tolerance=256`.
## Screenshots
![Fullscreen window: three columns for each test, logs number of different pixels](/uploads/6baab9bcc6c5619e05b7912f6751dac2/Screenshot_from_2022-01-04_10-34-26.png)
![Small window: Columns are thinner](/uploads/a4d80cb1ef6980d1b1d161116f907fe3/Screenshot_from_2022-01-03_23-11-13.png)
## To-do
☑ Test locally
☑ Test with Ed
## Example Diffs (somewhat buggy solution)
* [Example diffs with a solution that incorrectly calculates the bounding box of a circle.](/uploads/fcfb6176e4f888f000d5b4cec1bd72f6/Screenshots-3.html) (default tolerance = 64)Jasper Palmerjpalmer4@uw.eduJasper Palmerjpalmer4@uw.eduhttps://gitlab.cs.washington.edu/cse340/grading-harness/-/merge_requests/1Use GitGrade Item Specific Tags to parse testRegex2020-03-02T19:06:07-08:00Jeremy Zhangjkzhang@cs.washington.eduUse GitGrade Item Specific Tags to parse testRegexcriteria.xml is no longer required to apply automatic points using the Grading Commands systemcriteria.xml is no longer required to apply automatic points using the Grading Commands systemAdam Towersajtowers@cs.washington.eduAdam Towersajtowers@cs.washington.edu