Beispiel #1
0
        public static void MarkNotIncludedPages(IList <TblPages> usedPages)
        {
            foreach (var page in usedPages)
            {
                if (page.PageTypeRef == (int?)FX_PAGETYPE.Practice)
                {
                    var questions = StudentRecordFinder.GetQuestionsForPage(page);

                    foreach (var q in questions)
                    {
                        var ua = new TblUserAnswers
                        {
                            QuestionRef      = q.ID,
                            Date             = DateTime.Now,
                            UserRef          = ((CustomUser)Membership.GetUser()).ID,
                            UserAnswer       = string.Empty,
                            IsCompiledAnswer = false,
                            AnswerTypeRef    = FxAnswerType.NotIncludedAnswer.ID
                        };

                        ServerModel.DB.Insert(ua);
                    }
                }
            }
        }
Beispiel #2
0
        private static void AddAnswersFromPageToReCompilationList(TblPages page, IList <TblUsers> users, List <TblUserAnswers> answersForReCompilation)
        {
            var questions = StudentRecordFinder.GetQuestionsForPage(page);

            foreach (var u in users)
            {
                foreach (var q in questions)
                {
                    TblUserAnswers lstUserAnswer = GetLastUserAnswerForCompiledQuestion(q, u);

                    AddAnswerToReCompilationList(lstUserAnswer, answersForReCompilation);
                }
            }
        }
Beispiel #3
0
        public static bool IsContainCompiledQuestions(TblPages page)
        {
            var questions = StudentRecordFinder.GetQuestionsForPage(page);

            foreach (var question in questions)
            {
                if (question.IsCompiled)
                {
                    return(true);
                }
            }

            return(false);
        }
    private void BuildStatistic(int pageId, int userId)
    {
        var page      = ServerModel.DB.Load <TblPages>(pageId);
        var questions = StudentRecordFinder.GetQuestionsForPage(pageId);

        foreach (var question in questions)
        {
            if (question.IsCompiled)
            {
                _headerLabel.Text = string.Format("Compilation Details For Question From Page:{0}", page.PageName);
                var cqr = (CompiledQuestionResult)LoadControl("../Controls/CompiledQuestionResult.ascx");
                cqr.BuildCompiledQuestionsResult(question, userId);
                _placeHolder.Controls.Add(cqr);
            }
        }
    }
Beispiel #5
0
        public void Calc()
        {
            var questions = StudentRecordFinder.GetQuestionsForPage(_page.ID);

            foreach (var q in questions)
            {
                var status = (new UserResultForQuestion(_userId, q, _date)).Calc();

                if (status == ResultStatus.NotIncluded)
                {
                    SetNotIncluded();
                    return;
                }

                if (status == ResultStatus.Enqueued)
                {
                    SetEnqueued();
                    return;
                }

                if (status == ResultStatus.Empty)
                {
                    SetEmpty();
                    return;
                }

                if (status == ResultStatus.Pass)
                {
                    _userRank += (int)q.Rank;
                }
            }

            if (_userRank >= _pageRank)
            {
                _status = ResultStatus.Pass;
            }
            else
            {
                _status = ResultStatus.Fail;
            }
        }