/// <summary> /// Get kpi group collection for genarate report. /// </summary> /// <param name="templateId">The evaluation template identity.</param> /// <param name="weigthingKey">The weigthing key for maximun max score.</param> /// <param name="summary">The summary detail evaluation.</param> /// <returns></returns> private IEnumerable <VendorEvaluationRequestItemModel> GetKpiGroupCollection(EvaluationTemplate templateInfo, string weigthingKey, SummaryEvaluationViewModel summary) { var criteriaInfo = _unitOfWork.GetRepository <Criteria>().GetCache(x => x.Id == templateInfo.CriteriaId).FirstOrDefault(); var criteriaGroups = _unitOfWork.GetRepository <CriteriaGroup>().GetCache(x => x.CriteriaId == criteriaInfo.Id); var kpiGroups = _unitOfWork.GetRepository <KpiGroup>().GetCache(); return(this.InitialVendorEvaluationRequestItemModel(kpiGroups, criteriaGroups, weigthingKey, summary)); }
public Evaluation(string description, EvaluationTemplate evaluationTemplate, Student student, DateTime evaluationDate, Course course, ICollection<EvaluationItem> evaluationItems, string generalComment, Guid bundleId, Class createdForClass) { Description = description; EvaluationTemplate = evaluationTemplate; Student = student; EvaluationDate = evaluationDate; Course = course; EvaluationItems = evaluationItems; GeneralComment = generalComment; BundleId = bundleId; CreatedForClass = createdForClass; EditAbleState = new EditableState(); }
public void AddQuestion(string questionContent, string position, int competenceId) { EvaluationTemplate evaluationTemplate = this.EvaluationTemplate.GetEvaluationTemplateByPosition(position); Position positionObj = this.PositionRepository.GetPositionByName(position); ICollection <EvaluationTemplate> evalTemplate = new List <EvaluationTemplate>(); evalTemplate.Add(evaluationTemplate); questionContent = questionContent.Trim().ToString(); var random = new Random(); int testId = random.Next(0, 5000) + random.Next(0, 5000); this.QuestionRepository.Add(new Question { Id = testId, Content = questionContent, CompetenceId = competenceId, EvaluationTemplates = evalTemplate, PositionId = positionObj.Id }); }
public void DeleteEvaluationTemplate(int templateId) { EvaluationTemplate evalTemplate = this.EvaluationTemplateRepository.GetFirstOrDefault(templateId); this.EvaluationTemplateRepository.Delete(evalTemplate); }
/// <summary> /// Get Grade from total score. /// </summary> /// <param name="totalScore">The total score evaluation.</param> /// <param name="gradeList">The grade item collection.</param> /// <param name="evaluationTemplate">The evaluation template.</param> /// <returns></returns> private string GetGradeName(int totalScore, IEnumerable <GradeItem> gradeList, EvaluationTemplate evaluationTemplate) { string result = string.Empty; var grades = gradeList.Where(x => x.GradeId == evaluationTemplate.GradeId); return(grades.FirstOrDefault(x => x.StartPoint <= totalScore && x.EndPoint >= totalScore)?.GradeNameTh); }
public void AddNewEvaluations( string description, Class klas, EvaluationTemplate evaluationTemplate, DateTime evaluationDate, Course course) { Guid bundleId = Guid.NewGuid(); foreach (var student in klas.Students) { List<EvaluationItem> evaluationItems = new List<EvaluationItem>(); foreach (var subsection in evaluationTemplate.EvaluationSubSections) { foreach (Goal goal in subsection.Goals) { evaluationItems.Add(new EvaluationItem(goal, subsection)); } } AddEvaluation(new Evaluation(description, evaluationTemplate, student, evaluationDate, course, evaluationItems, "", bundleId,klas)); } }
//public void AddStudypPlan(StudyPlan studyPlan) //{ // StudyPlans.Add(studyPlan); //} public void AddEvaluationTemplate(EvaluationTemplate evaluationTemplate) { EvaluationTemplates.Add(evaluationTemplate); }