示例#1
0
        public ActionResult ShowCurriculumStatistic(int[] selectCurriculumId)
        {
            ViewData["selectGroupName"] = LmsService.FindService<IUserService>().GetGroup((int)HttpContext.Session["SelectedGroupId"]).Name;
            IEnumerable<User> users = LmsService.FindService<IUserService>().GetUsersByGroup(LmsService.FindService<IUserService>().GetGroup((int)HttpContext.Session["SelectedGroupId"]));
            AllSpecializedResults allSpecRes = new AllSpecializedResults();
            SpecializedResultProxy srp = new SpecializedResultProxy();
            allSpecRes = srp.GetResults(users, selectCurriculumId, LmsService);

            return View(allSpecRes);
        }
        public AllSpecializedResults GetResults(IEnumerable <User> users, int[] selectedCurriculumIds, ILmsService lmsServiceParam)
        {
            this.lmsService = lmsServiceParam;
            var asr = new AllSpecializedResults
            {
                Users = users.ToList(),
                // SelectedDisciplineIds = selectedCurriculumIds,
                Curriculums =
                    this.lmsService.FindService <ICurriculumService>().GetCurriculums(
                        curr => selectedCurriculumIds.Contains(curr.Id))
            };


            foreach (var usr in asr.Users)
            {
                var specializedResult = new SpecializedResult
                {
                    Curriculums = asr.Curriculums
                };

                foreach (var curriculum in specializedResult.Curriculums)
                {
                    var disciplineResult = new DisciplineResult
                    {
                        CurriculumChapterTopics =
                            this.lmsService.FindService <ICurriculumService>().GetCurriculumChapterTopicsByCurriculumId(curriculum.Id)
                    };

                    #region TopicResult

                    foreach (var curriculumChapterTopic in disciplineResult.CurriculumChapterTopics)
                    {
                        var topicResult = new TopicResult(usr, curriculumChapterTopic)
                        {
                            AttemptResults =
                                this.lmsService.FindService <ITestingService>().GetResults(
                                    usr, curriculumChapterTopic)
                        };
                        topicResult.Res = topicResult.GetTopicResultScore(lmsServiceParam);
                        disciplineResult.TopicResults.Add(topicResult);
                    }

                    #endregion

                    disciplineResult.CalculateSumAndMax(usr, curriculum);
                    specializedResult.DisciplineResults.Add(disciplineResult);
                }
                specializedResult.CalculateSpecializedResult(usr);
                asr.SpecializedResults.Add(specializedResult);
            }
            return(asr);
        }
示例#3
0
        public AllSpecializedResults GetResults(IEnumerable<User> users, int[] selectedCurriculumIds, ILmsService lmsServiceParam)
        {
            this.lmsService = lmsServiceParam;
            var asr = new AllSpecializedResults
                {
                    Users = users.ToList(),
                    // SelectedDisciplineIds = selectedCurriculumIds,
                    Curriculums =
                        this.lmsService.FindService<ICurriculumService>().GetCurriculums(
                            curr => selectedCurriculumIds.Contains(curr.Id))
                };


            foreach (var usr in asr.Users)
            {
                var specializedResult = new SpecializedResult
                    {
                        Curriculums = asr.Curriculums
                    };

                foreach (var curriculum in specializedResult.Curriculums)
                {
                    var disciplineResult = new DisciplineResult
                        {
                            CurriculumChapterTopics =
                                this.lmsService.FindService<ICurriculumService>().GetCurriculumChapterTopicsByCurriculumId(curriculum.Id)
                        };

                    #region TopicResult

                    foreach (var curriculumChapterTopic in disciplineResult.CurriculumChapterTopics)
                    {
                        var topicResult = new TopicResult(usr, curriculumChapterTopic)
                            {
                                AttemptResults =
                                    this.lmsService.FindService<ITestingService>().GetResults(
                                        usr, curriculumChapterTopic)
                            };
                        topicResult.Res = topicResult.GetTopicResultScore(lmsServiceParam);
                        disciplineResult.TopicResults.Add(topicResult);
                    }

                    #endregion

                    disciplineResult.CalculateSumAndMax(usr, curriculum);
                    specializedResult.DisciplineResults.Add(disciplineResult);
                }
                specializedResult.CalculateSpecializedResult(usr);
                asr.SpecializedResults.Add(specializedResult);
            }
            return asr;
        }
示例#4
0
        public AllSpecializedResults GetResults(IEnumerable <User> users, int[] selectCurriculumIds, ILmsService ILMS)
        {
            _LmsService = ILMS;
            AllSpecializedResults asr = new AllSpecializedResults();
            SpecializedResult     specializedResult;
            CurriculumResult      curRes;
            ThemeResult           themeResult;


            asr.Users = users.ToList();
            asr.SelectCurriculumIds = selectCurriculumIds;
            asr.Curriculums         = _LmsService.FindService <ICurriculumService>().GetCurriculums(selectCurriculumIds);

            IEnumerable <int> ieIds = selectCurriculumIds;

            foreach (User usr in asr.Users)
            {
                specializedResult             = new SpecializedResult();
                specializedResult.Curriculums = _LmsService.FindService <ICurriculumService>().GetCurriculums(ieIds);
                foreach (Curriculum curr in specializedResult.Curriculums)
                {
                    curRes        = new CurriculumResult();
                    curRes.Themes = _LmsService.FindService <ICurriculumService>().GetThemesByCurriculumId(curr.Id);

                    #region ThemeResult

                    foreach (Theme theme in curRes.Themes)
                    {
                        themeResult = new ThemeResult(usr, theme);
                        themeResult.AttemptResults = _LmsService.FindService <ITestingService>().GetResults(usr, theme);
                        themeResult.Res            = themeResult.GetThemeResultScore();
                        curRes.ThemeResult.Add(themeResult);
                    }

                    #endregion

                    curRes.CalculateSumAndMax(usr, curr);
                    specializedResult.CurriculumResult.Add(curRes);
                }
                specializedResult.CalculateSpecializedResult(usr);
                asr.SpecializedResult.Add(specializedResult);
            }
            return(asr);
        }
        public AllSpecializedResults GetResults(IEnumerable <User> users, int[] selectDisciplineIds, ILmsService ILMS)
        {
            _LmsService = ILMS;
            AllSpecializedResults asr = new AllSpecializedResults();
            SpecializedResult     specializedResult;
            DisciplineResult      curRes;
            TopicResult           topicResult;


            asr.Users = users.ToList();
            asr.SelectDisciplineIds = selectDisciplineIds;
            asr.Disciplines         = _LmsService.FindService <ICurriculumService>().GetDisciplines(selectDisciplineIds);

            IEnumerable <int> ieIds = selectDisciplineIds;

            foreach (User usr in asr.Users)
            {
                specializedResult             = new SpecializedResult();
                specializedResult.Disciplines = _LmsService.FindService <ICurriculumService>().GetDisciplines(ieIds);
                foreach (Discipline curr in specializedResult.Disciplines)
                {
                    curRes        = new DisciplineResult();
                    curRes.Topics = _LmsService.FindService <ICurriculumService>().GetTopicsByDisciplineId(curr.Id);

                    #region TopicResult

                    foreach (Topic topic in curRes.Topics)
                    {
                        topicResult = new TopicResult(usr, topic);
                        topicResult.AttemptResults = _LmsService.FindService <ITestingService>().GetResults(usr, topic);
                        topicResult.Res            = topicResult.GetTopicResultScore();
                        curRes.TopicResult.Add(topicResult);
                    }

                    #endregion

                    curRes.CalculateSumAndMax(usr, curr);
                    specializedResult.DisciplineResult.Add(curRes);
                }
                specializedResult.CalculateSpecializedResult(usr);
                asr.SpecializedResult.Add(specializedResult);
            }
            return(asr);
        }
示例#6
0
        public AllSpecializedResults GetResults(IEnumerable<User> users, int[] selectCurriculumIds, ILmsService ILMS)
        {
            _LmsService = ILMS;
            AllSpecializedResults asr = new AllSpecializedResults();
            SpecializedResult specializedResult;
            CurriculumResult curRes;
            ThemeResult themeResult;

            
            asr.Users = users.ToList();
            asr.SelectCurriculumIds = selectCurriculumIds;
            asr.Curriculums = _LmsService.FindService<ICurriculumService>().GetCurriculums(selectCurriculumIds);

            IEnumerable<int> ieIds = selectCurriculumIds;
            foreach (User usr in asr.Users)
            {
                specializedResult = new SpecializedResult();
                specializedResult.Curriculums = _LmsService.FindService<ICurriculumService>().GetCurriculums(ieIds);
                foreach (Curriculum curr in specializedResult.Curriculums)
                {
                    curRes = new CurriculumResult();
                    curRes.Themes = _LmsService.FindService<ICurriculumService>().GetThemesByCurriculumId(curr.Id);
                    
                    #region ThemeResult

                    foreach (Theme theme in curRes.Themes)
                    {
                        themeResult = new ThemeResult(usr, theme);
                        themeResult.AttemptResults = _LmsService.FindService<ITestingService>().GetResults(usr, theme);
                        themeResult.Res = themeResult.GetThemeResultScore();
                        curRes.ThemeResult.Add(themeResult);
                    }

                    #endregion

                    curRes.CalculateSumAndMax(usr, curr);
                    specializedResult.CurriculumResult.Add(curRes);
                }
                specializedResult.CalculateSpecializedResult(usr);
                asr.SpecializedResult.Add(specializedResult);
            }
            return asr;
        }
示例#7
0
        public AllSpecializedResults GetResults(IEnumerable<User> users, int[] selectDisciplineIds, ILmsService ILMS)
        {
            _LmsService = ILMS;
            AllSpecializedResults asr = new AllSpecializedResults();
            SpecializedResult specializedResult;
            DisciplineResult curRes;
            TopicResult topicResult;

            
            asr.Users = users.ToList();
            asr.SelectDisciplineIds = selectDisciplineIds;
            asr.Disciplines = _LmsService.FindService<ICurriculumService>().GetDisciplines(selectDisciplineIds);

            IEnumerable<int> ieIds = selectDisciplineIds;
            foreach (User usr in asr.Users)
            {
                specializedResult = new SpecializedResult();
                specializedResult.Disciplines = _LmsService.FindService<ICurriculumService>().GetDisciplines(ieIds);
                foreach (Discipline curr in specializedResult.Disciplines)
                {
                    curRes = new DisciplineResult();
                    curRes.Topics = _LmsService.FindService<ICurriculumService>().GetTopicsByDisciplineId(curr.Id);
                    
                    #region TopicResult

                    foreach (Topic topic in curRes.Topics)
                    {
                        topicResult = new TopicResult(usr, topic);
                        topicResult.AttemptResults = _LmsService.FindService<ITestingService>().GetResults(usr, topic);
                        topicResult.Res = topicResult.GetTopicResultScore();
                        curRes.TopicResult.Add(topicResult);
                    }

                    #endregion

                    curRes.CalculateSumAndMax(usr, curr);
                    specializedResult.DisciplineResult.Add(curRes);
                }
                specializedResult.CalculateSpecializedResult(usr);
                asr.SpecializedResult.Add(specializedResult);
            }
            return asr;
        }