Refactor aggregate score to a constructor

This commit is contained in:
2024-05-17 22:52:13 +02:00
parent 577351eda5
commit 49a36904dc
3 changed files with 12 additions and 2 deletions

View File

@@ -40,6 +40,15 @@ namespace platform {
}
compute_accuracy_value();
}
static Score Scores::create_aggregate(json& data, std::string key)
{
auto scores = Scores(result[key][0]);
for (int i = 1; i < result[key].size(); i++) {
auto score = Scores(result[key][i]);
scores.aggregate(score);
}
return scores;
}
void Scores::compute_accuracy_value()
{
accuracy_value = 0;