Reworked test view page

This commit is contained in:
Gregory Ballantine
2024-06-03 11:28:24 -04:00
parent 0fde8c082e
commit 0510c80c34
2 changed files with 41 additions and 32 deletions

View File

@ -24,4 +24,22 @@ class Test extends Model {
return $this->belongsTo(Component::class);
}
public function benchmarkResults() {
$data = [];
foreach ($this->benchmarks as $i, $b) {
$benchmarkResults = $this->results()->where('benchmark_id', $b->id)->get();
$data[$i] = [
'name' => $b->name,
'scoring' => $b->scoring,
'count' => count($benchmarkResults),
'average' => 0,
'minimum' => 0,
'maximum' => 0,
]
}
return $data;
}
}