Class ImportRequiredGrader
java.lang.Object
com.spertus.jacquard.common.Grader
com.spertus.jacquard.syntaxgrader.SyntaxGrader
com.spertus.jacquard.syntaxgrader.SyntaxCheckGrader
com.spertus.jacquard.syntaxgrader.ImportRequiredGrader
Checks whether required imports appear in a submission. This is
one of several graders checking imports.
-
Field Summary
Fields inherited from class com.spertus.jacquard.syntaxgrader.SyntaxCheckGrader
adapter, maxScorePerInstance
-
Constructor Summary
ConstructorDescriptionImportRequiredGrader
(double pointsPerImport, List<String> requiredImports) Creates an import checker with the default name that awards points per required import that is found.ImportRequiredGrader
(String name, double pointsPerImport, List<String> requiredImports) Creates an import checker that awards points per required import that is found. -
Method Summary
Modifier and TypeMethodDescriptionvoid
finalizeResults
(List<Result> results) Adds any results that cannot be computed until all visits are complete.void
Performs any setup before a call toSyntaxCheckGrader.grade(CompilationUnit)
.Methods inherited from class com.spertus.jacquard.syntaxgrader.SyntaxCheckGrader
grade, makeFailingResult, makeSuccessResult
Methods inherited from class com.spertus.jacquard.syntaxgrader.SyntaxGrader
getCallableSingleTarget
Methods inherited from class com.spertus.jacquard.common.Grader
getCallableMultiTarget, grade, grade, gradeAll, makeExceptionResult, makeExceptionResultList, makeFailureResult, makeFailureResultList, makePartialCreditResult, makeSuccessResult, makeSuccessResultList
-
Constructor Details
-
ImportRequiredGrader
Creates an import checker that awards points per required import that is found. Required imports may end with asterisks but must not end with semicolons. For example, legal values include "java.util.*" and "java.io.IOException".- Parameters:
name
- the name of this checkerpointsPerImport
- the number of points per required importrequiredImports
- required imports- Throws:
ClientException
- if requiredImports is empty or has malformed entries
-
ImportRequiredGrader
Creates an import checker with the default name that awards points per required import that is found. Required imports may end with asterisks but must not end with semicolons. For example, legal values include "java.util.*" and "java.io.IOException".- Parameters:
pointsPerImport
- the number of points per required importrequiredImports
- required imports- Throws:
ClientException
- if requiredImports is empty or has malformed entries
-
-
Method Details
-
initialize
public void initialize()Description copied from class:SyntaxCheckGrader
Performs any setup before a call toSyntaxCheckGrader.grade(CompilationUnit)
.- Overrides:
initialize
in classSyntaxCheckGrader
-
finalizeResults
Description copied from class:SyntaxCheckGrader
Adds any results that cannot be computed until all visits are complete.- Overrides:
finalizeResults
in classSyntaxCheckGrader
- Parameters:
results
- the list of results, which may be mutated by this call
-