private int GetCountActiveCategoriesWithScore(Survey survey)
{
var count = 0;
foreach (var category in survey.Categories.Where(a => !a.DoNotUseForCalculations && a.IsActive && a.IsCurrentVersion))
{
var totalMax = Repository.OfType<CategoryTotalMaxScore>().GetNullableById(category.Id);
if (totalMax == null) //No Questions most likely
{
continue;
}
count++;
if (count > 3)
{
break;
}
}
return count;
}