Class DrawingAutograder


  • public class DrawingAutograder
    extends Autograder
    Example child class of the Autograder. Has an additional test for comparing the output of using the StdDraw Library.
    See Also:
    Autograder
    • Constructor Detail

      • DrawingAutograder

        public DrawingAutograder()
        The constructor of a drawing Autograder.
    • Method Detail

      • drawingDiffTest

        public void drawingDiffTest​(java.lang.String p,
                                    boolean size,
                                    boolean order,
                                    java.lang.String inFile)
        Test to check whether the students code draws all expected shapes. WARNING: A students code may be 100% correct and still not pass this test. This test only checks the lists of shapes and their colors. If a student uses a non-standard color (they calculate the RGB values themself) or use non-standard shapes (creating shapes using the polygon instead of the built in version) they may get the same output but fail the tests. The param size is to know whether to test where size matters (true if you want to compare size) and order is to know whether the order of the drawing matterss (this might be important to check layering)
        Parameters:
        p - the name of the students program to run
        size - boolean false for size agnostic true for size dependent comparison
        order - boolean false for order agnostic true for order dependent
        inFile - the stdinput to be passed to the main method of the code
      • drawingDiffTest

        public void drawingDiffTest​(java.lang.String p,
                                    java.util.ArrayList<shapes.DummyShape> exp,
                                    boolean size,
                                    boolean order,
                                    java.lang.String inFile)
        Test to check whether the students code draws all expected shapes. WARNING: A students code may be 100% correct and still not pass this test. This test only checks the lists of shapes and their colors. If a student uses a non-standard color (they calculate the RGB values themself) or use non-standard shapes (creating shapes using the polygon instead of the built in version) they may get the same output but fail the tests. The param size is to know whether to test where size matters (true if you want to compare size) and order is to know whether the order of the drawing matterss (this might be important to check layering)
        Parameters:
        p - the name of the students program to run
        exp - a lists containing all the expected shapes that the program should make
        size - boolean false for size agnostic true for size dependent comparison
        order - boolean false for order agnostic true for order dependent
        inFile - the stdinput to be passed to the main method of the code
      • drawingContainsTest

        public void drawingContainsTest​(java.lang.String p,
                                        shapes.DummyShape exp,
                                        java.lang.String inFile)
        Test to check whether the students code draws an expected shape.
        Parameters:
        p - the name of the students program to run
        exp - the shape the students code must contain
        inFile - the std input to be passed to the main method of the code
      • drawingShapeCountTest

        public void drawingShapeCountTest​(java.lang.String p,
                                          int expCount,
                                          java.lang.String inFile)
        Test to check whether the students code draws at least an expected number of shapes. This could be a useful test as each shape can only be one color so there is a minimum number of shapes in order to possibly draw the whole image and if it is less than that amount then the submission must be missing part of the drawing.
        Parameters:
        p - the name of the students program to run
        expCount - the number of shapes expected to have been drawn
        inFile - the std input to be passed to the main method of the code
      • drawingSizeTest

        public void drawingSizeTest​(java.lang.String p,
                                    int expWidth,
                                    int expHeight,
                                    java.lang.String inFile)
        Test to check whether the students code sets the stddraw canvas to the expected size.
        Parameters:
        p - the name of the students program to run
        expWidth - the desired width of the drawing canvas
        expHeight - the desired height of the drawing canvas
        inFile - the std input to be passed to the main method of the code