NuSurvey.Web.Controllers.SurveyResponseController.GetCountActiveCategoriesWithScore C# (CSharp) Method

GetCountActiveCategoriesWithScore() private method

private GetCountActiveCategoriesWithScore ( Survey survey ) : int
survey Survey
return int
        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;
        }