Reworked test view page
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user