public function getCategoriesAverageScore(Collection $categories, string $locale, array $applicantIds = []): array 	{ 		$dataProvider = new DataProvider(new DatabaseRawDataFetcher); 		$categories_with_avg_score = [];  		foreach ($categories as $category) { 			$categoryBasedAnswers = $dataProvider->fetchGeneralReportAnswers($category->questions->pluck('id')->all(), $applicantIds);  			$totalAnswers = 0; 			$totalAnswersMaxPossible = 0;  			foreach ($categoryBasedAnswers as $answer) { 				$totalAnswersMaxPossible += $answer->answer_value_count; 				$totalAnswers += ($answer->answer_value_count * (int) $answer->value); 			}  			$totalCategoriesAverage = $totalAnswersMaxPossible == 0 ? 0 : round($totalAnswers / ($totalAnswersMaxPossible * 4), 3); 			$totalCategoriesAverageTurnedIntoScale4 = round(4 * $totalCategoriesAverage, 3);  			array_push($categories_with_avg_score, [ 				'name' => $category->getTranslation('name', $locale), 				'score' => $totalCategoriesAverageTurnedIntoScale4, 				'code' => $category->code, 				'image_url' => $category->storage()->getFirstFile('image')?->getUrl(), 			]); 		}  		return $categories_with_avg_score; 	}