Package com.spertus.jacquard.common
Class Autograder
java.lang.Object
com.spertus.jacquard.common.Autograder
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
Modifier and TypeClassDescriptionstatic class
A singleton class for building the Autograder. -
Field Summary
Modifier and TypeFieldDescriptionfinal int
The Java level of student code.final long
The number of milliseconds tests should run before timing out.final Visibility
The visibility level ofGrader
results. -
Method Summary
Modifier and TypeMethodDescriptionstatic Autograder
Gets the singleton Autograder instance.static void
init()
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.
-
Field Details
-
javaLevel
public final int javaLevelThe Java level of student code. -
timeoutMillis
public final long timeoutMillisThe number of milliseconds tests should run before timing out. -
visibility
The visibility level ofGrader
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
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).
-