GraderRegistry class

Maps a grader name (as it appears in JSONL/JSON files) to a factory that can construct an actual Grader from a config map.

Usage:

final reg = GraderRegistry();
reg.register('answer_correctness',
  (cfg) => AnswerCorrectnessGrader(expected: cfg['expected'] as num));

Constructors

GraderRegistry()

Properties

hashCode int
The hash code for this object.
no setterinherited
registeredNames Iterable<String>
Returns all registered names. Order is insertion order.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(String name, Map<String, dynamic> config) Grader
Build a grader by name using config. Throws if name is not registered.
contains(String name) bool
Returns true if name has a registered factory.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
register(String name, GraderFactoryFunction factory) → void
Register a factory for name. Overwrites any prior registration of the same name.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited