Пример #1
0
        /// <summary>
        ///     Executes the completeness.
        /// </summary>
        /// <typeparam name="TAssessment">The type of the assessment.</typeparam>
        /// <param name="completenessCategory">The completeness category.</param>
        /// <param name="assessment">The assessment.</param>
        /// <param name="ruleSet">The rule set.</param>
        /// <returns></returns>
        public CompletenessResults ExecuteCompleteness <TAssessment> (string completenessCategory, TAssessment assessment, string ruleSet)
        {
            var ruleCollection = _completenessRuleCollectionFactory.GetCompletenessRuleCollection <TAssessment> (completenessCategory);
            var ruleEngine     = _ruleEngineFactory.CreateRuleEngine(assessment, ruleCollection);

            return(ExecuteCompleteness(ruleEngine, completenessCategory, assessment, ruleSet));
        }
        public CompletenessResults CalculateCompleteness <TAssessment>(string completenessCategory, TAssessment assessment, IContainItemDefinitions itemDefinitionContainer) where TAssessment : AssessmentInstance
        {
            var completenessResults = CalculateCompleteness(assessment, itemDefinitionContainer, completenessCategory);
            //todo: to better use completenessCategory
            var ruleCollection         = _completenessRuleCollectionFactory.GetCompletenessRuleCollection <TAssessment>(assessment.AssessmentName);
            var ruleEngine             = _ruleEngineFactory.CreateRuleEngine(assessment, ruleCollection);
            var skippedQuestionResults = ruleEngine.ExecuteRuleSet(assessment, "CompletenessRuleSet");

            completenessResults.UpdateTotal(completenessResults.Total - skippedQuestionResults.RuleViolations.Count());

            return(completenessResults);
        }