Class Autograder

java.lang.Object
com.spertus.jacquard.common.Autograder

public final class Autograder extends Object
A singleton class containing configuration information. The client must initialize the Autograder before calling other Jacquard code. This can be done throw Autograder.Builder or init().
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    A singleton class for building the Autograder.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
    The Java level of student code.
    final long
    The number of milliseconds tests should run before timing out.
    The visibility level of Grader results.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Autograder
    Gets the singleton Autograder instance.
    static void
    Initializes the autograder with all default values.
    static void
    Resets and reinitializes the Autograder.
    static boolean
    Checks whether the Autograder has been initialized.
    static void
    Resets Autograder initialization so multiple tests can run independently.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • javaLevel

      public final int javaLevel
      The Java level of student code.
    • timeoutMillis

      public final long timeoutMillis
      The number of milliseconds tests should run before timing out.
    • visibility

      public final Visibility visibility
      The visibility level of Grader results.
  • Method Details

    • init

      public static void init()
      Initializes the autograder with all default values. If customized values are desired, Autograder.Builder should be used instead.
      Throws:
      ClientException - if the Autograder is initialized more than once
    • getInstance

      public static Autograder getInstance()
      Gets the singleton Autograder instance.
      Returns:
      the singleton Autograder instance
      Throws:
      ClientException - if the Autograder has not been initialized
    • isInitialized

      public static boolean isInitialized()
      Checks whether the Autograder has been initialized.
      Returns:
      whether the autograder has been initialized
    • resetForTest

      public static void resetForTest()
      Resets Autograder initialization so multiple tests can run independently.
    • initForTest

      public static void initForTest()
      Resets and reinitializes the Autograder. This is a convenience method to make testing more convenient. Timeout is set to 0 (no timeout).