- pick only best results fixed

This commit is contained in:
Wiesner András 2024-10-01 16:33:11 +02:00
parent 5011bd956b
commit 77cf3f267a

View File

@ -462,15 +462,15 @@ class TestMgr
foreach ($tests as $test) {
$nickname = $test["nickname"];
if (!in_array($nickname, $best_test_ids)) {
$best_tests[$nickname] = $test["_id"];
$best_test_ids[$nickname] = $test["_id"];
}
}
// just keep values, drop the keys (nicknames)
$best_tests = array_values($best_tests);
$best_test_ids = array_values($best_test_ids);
// remove non-best results
$test_data_array = array_filter($test_data_array, fn($test) => in_array($test["_id"], $best_tests));
$test_data_array = array_filter($test_data_array, fn($test) => in_array($test["_id"], $best_test_ids));
// renumber results
$test_data_array = array_values($test_data_array);