validate method
Validates the suite at construction time: ids unique, reference solutions present if required. Returns the list of problems (empty if valid).
Implementation
List<String> validate() {
final problems = <String>[];
final seen = <String>{};
for (final t in tasks) {
if (!seen.add(t.id)) {
problems.add('duplicate task id "${t.id}"');
}
if (t.graders.isEmpty) {
problems.add('task "${t.id}" has no graders');
}
if (requireReferenceSolution && t.referenceSolution == null) {
problems.add('task "${t.id}" missing referenceSolution');
}
if (t.trialsPerRun <= 0) {
problems.add('task "${t.id}" has trialsPerRun <= 0');
}
}
return problems;
}