Challenge
Base class for an individual programming challenge.
A challenge corresponds to a single source file containing a function and its test invocations. When loaded, the source code is parsed to extract the function body (shown to the user), the invocations (used as test cases), and the correct answers (computed by evaluating the code via a JSR-223 script engine).
Challenges are created within a ChallengeGroup via the challenge("name") { } DSL block or automatically through includeFiles / includeFilesWithType patterns.
This is a sealed class with language-specific subclasses: JavaChallenge, KotlinChallenge, and PythonChallenge.
Inheritors
Properties
the parent group containing this challenge
the challenge identifier, typically matching the source file name
Optional URL or identifier for the equivalent CodingBat problem.
The list of correct answers for each invocation, computed by evaluating the challenge source code.
Optional Markdown description displayed above the challenge. Can also be set via @desc comments in the source.
whether this challenge can be replaced by a later definition with the same name
Functions
Retrieves or computes the FunctionInfo for this challenge. Results are cached when running in production or test mode. Source code is fetched from the configured repo (local or remote).