Beispiel #1
0
        protected override void Statistics()
        {
            if (ThirdCounter < 2)
            {
                return;
            }

            if (!IsArbitration)
            {
                //    IsAllow = OnlineHelper.GetMinThreshold(TeacherChecks.Select(s => s.Score).ToArray()) > Threshold;
                Boolean flag = false;

                foreach (var readyCheckAnswer in ReadyCheckAnswers)
                {
                    Double f =
                        OnlineHelper.GetMinThreshold(
                            TeacherChecks.Select(s => s.Score[readyCheckAnswer.QuestionInfo.QuestionId.ToString()]).ToArray());

                    flag = flag || f >
                           readyCheckAnswer.QuestionInfo.Threshold;

                    if (flag)
                    {
                        break;
                    }
                }

                IsAllow = flag;

                if (IsAllow)
                {
                    EnoughCount = EnoughCount + 1;

                    if (ThirdCounter == 3)
                    {
                        IsArbitration = true;

                        IsAllow = false;
                    }

                    return;
                }
            }

            IsAllFinish = true;

            ReadyCheckAnswers.ForEach(s =>
            {
                s.FinalScore = TeacherChecks.Capacity == TeacherChecks.Count ? TeacherChecks.Last().Score[s.AnswerId] : OnlineHelper.GetMiddleScore(TeacherChecks.Select(a => a.Score[s.QuestionInfo.QuestionId.ToString()]).ToArray());
            });
            //FinalScore = TeacherChecks.Capacity == TeacherChecks.Count
            //    ? TeacherChecks.Last().Score
            //    : OnlineHelper.GetMiddleScore(TeacherChecks.Select(s => s.Score).ToArray());
        }
Beispiel #2
0
        protected override void Statistics()
        {
            if (ThirdCounter < 2)
            {
                return;
            }

            if (ThirdCounter == 2)
            {
                Boolean flag = false;

                foreach (var readyCheckAnswer in ReadyCheckAnswers)
                {
                    Boolean a = (OnlineHelper.GetMinThreshold(
                                     TeacherChecks.Select(s => s.Score[readyCheckAnswer.QuestionInfo.QuestionId.ToString()]).ToArray()) >
                                 readyCheckAnswer.QuestionInfo.Threshold);
                    flag = flag || a;

                    if (flag)
                    {
                        break;;
                    }
                }

                IsAllow = flag;

                //    IsAllow = OnlineHelper.GetMinThreshold(TeacherChecks.Select(s => s.Score).ToArray()) > Threshold;

                if (IsAllow)
                {
                    EnoughCount = EnoughCount + 1;

                    return;
                }
            }


            IsAllFinish = true;

            ReadyCheckAnswers.ForEach(s =>
            {
                s.FinalScore = OnlineHelper.GetMiddleScore(TeacherChecks.Select(a => a.Score[s.QuestionInfo.QuestionId.ToString()]).ToArray());
            });
            //FinalScore = OnlineHelper.GetMiddleScore(TeacherChecks.Select(s => s.Score).ToArray());
        }