Esempio n. 1
0
        public List <SingleScoreInfo> GetSingleScoreList(Guid ClassIDNum, Guid PaperIDNum)
        {
            List <SingleScoreInfo> SingleScoreInfoList = new List <SingleScoreInfo>();
            List <CEDTS_User>      userlist            = _user.SelectUserByClassID(ClassIDNum);
            CEDTS_Paper            paper = _paper.GetPaperByID(PaperIDNum);
            double totalscore            = paper.Score.Value;

            foreach (var user in userlist)
            {
                SingleScoreInfo eachsinglescore = new SingleScoreInfo();
                eachsinglescore.UserID     = user.UserID;
                eachsinglescore.StudNum    = user.StudentNumber;
                eachsinglescore.StudName   = user.UserNickname;
                eachsinglescore.TotalScore = totalscore;
                CEDTS_Test test = _paper.GetTestByPaperID(SinglePaperID, user.UserID);
                if (test == null || test.IsFinished == false)
                {
                    eachsinglescore.Done    = false;
                    eachsinglescore.Score   = 0;
                    eachsinglescore.Percent = 0;
                }
                else
                {
                    eachsinglescore.Done    = true;
                    eachsinglescore.Score   = test.TotalScore.Value;
                    eachsinglescore.Percent = test.TotalScore.Value / totalscore * 100;
                }
                SingleScoreInfoList.Add(eachsinglescore);
            }
            return(SingleScoreInfoList);
        }
Esempio n. 2
0
        public ActionResult MultipleExercise()
        {
            int                   UserID        = _user.SelectUserByAccout(User.Identity.Name).UserID;
            List <Guid?>          paclist       = _paper.SelectPaperByPeriod(BeginTime, EndTime, UserID, ClassID);
            List <SelectListItem> PaperNameList = new List <SelectListItem>();

            foreach (var pac in paclist)
            {
                CEDTS_Paper paper = _paper.GetPaperByID(Guid.Parse(pac.ToString()));
                PaperNameList.Add(new SelectListItem {
                    Text = paper.Title, Value = paper.PaperID.ToString()
                });
            }
            ViewData["PaperNameList"] = PaperNameList;
            return(View(PaperNameList));
        }
Esempio n. 3
0
        public ActionResult UserScore(int UserID)
        {
            List <CEDTS_Test> usertest = _paper.SelectTestByPeriod(BeginTime, EndTime, UserID);
            StatisticsScore   Ss       = new StatisticsScore();

            Ss.Score    = new List <double>();
            Ss.TypeName = new List <string>();
            foreach (var s in usertest)
            {
                CEDTS_Paper paper = _paper.SelectPaper(s.PaperID);
                if (paper.State != 9 && paper.State != 10)
                {
                    Ss.Score.Add(s.TotalScore.Value / paper.Score.Value * 100);
                    Ss.TypeName.Add(paper.Title);
                }
            }
            return(Json(Ss));
        }
Esempio n. 4
0
        public ActionResult SingleExercisePaper()
        {
            ClassName = _user.GetClassbyID(ClassID).ClassName;
            CEDTS_Paper paper = _paper.GetPaperByID(SinglePaperID);

            ViewData["TaskName"]  = paper.Title;
            ViewData["ClassName"] = ClassName;
            List <CEDTS_User> StudList = _user.SelectUserByClassID(ClassID);

            if (StudList.Count == 0)
            {
                ViewData["Empty"] = "Empty";
            }
            else
            {
                ViewData["Empty"] = "";
            }
            return(View());
        }
Esempio n. 5
0
        public ActionResult AssignedExercise(int?id)
        {
            List <ScoreInfo> scorelist = new List <ScoreInfo>();
            int               UserID   = _user.SelectUserByAccout(User.Identity.Name).UserID;
            List <Guid?>      paclist  = _paper.SelectPaperByPeriod(BeginTime, EndTime, UserID, ClassID);
            List <CEDTS_User> userlist = _user.SelectUserByClassID(ClassID);

            foreach (var user in userlist)
            {
                ScoreInfo eachscore = new ScoreInfo();
                eachscore.UserID    = user.UserID;
                eachscore.StudNum   = user.StudentNumber;
                eachscore.StudName  = user.UserNickname;
                eachscore.TestNames = new List <string>();
                eachscore.TestScore = new List <double>();
                List <CEDTS_Test> usertest = _paper.SelectTestByPeriod(BeginTime, EndTime, user.UserID);
                foreach (var pac in paclist)
                {
                    CEDTS_Paper paper = _paper.GetPaperByID(Guid.Parse(pac.ToString()));
                    eachscore.TestNames.Add(paper.Title);
                    CEDTS_Test test = _paper.GetTestByPaperID(Guid.Parse(pac.ToString()), user.UserID);
                    if (test != null && test.IsFinished == true)
                    {
                        eachscore.TestScore.Add(double.Parse(test.TotalScore.ToString()) / double.Parse(paper.Score.ToString()) * 100);
                    }
                    else
                    {
                        eachscore.TestScore.Add(0);
                    }
                }
                double totalscore = 0.0;
                foreach (var score in eachscore.TestScore)
                {
                    totalscore += score;
                }
                eachscore.AveScore = totalscore / eachscore.TestScore.Count;
                scorelist.Add(eachscore);
            }
            ViewData["StartDate"] = BeginTime;
            ViewData["EndDate"]   = EndTime;
            ViewData["ClassName"] = ClassName;
            return(View(_paper.ScoreInfoPaged(id, scorelist)));
        }
Esempio n. 6
0
        public ActionResult SingleTest(int id)
        {
            CEDTS_Paper paper = _paper.GetPaperByID(SinglePaperID);

            ViewData["UserID"]     = id;
            ViewData["PaperID"]    = SinglePaperID;
            ViewData["PaperName"]  = paper.Title;
            ViewData["PaperState"] = paper.State;
            CEDTS_Test test = _paper.GetTestByPaperID(SinglePaperID, id);

            if (test == null || test.IsFinished == false)
            {
                ViewData["TestID"] = "";
            }
            else
            {
                ViewData["TestID"] = test.TestID;
            }
            return(View());
        }
Esempio n. 7
0
        public ActionResult AllExercise(int?id)
        {
            List <ScoreInfo> scorelist = new List <ScoreInfo>();
            int               UserID   = _user.SelectUserByAccout(User.Identity.Name).UserID;
            List <Guid?>      paclist  = _paper.SelectPaperByPeriod(BeginTime, EndTime, UserID, ClassID);
            List <CEDTS_User> userlist = _user.SelectUserByClassID(ClassID);

            foreach (var user in userlist)
            {
                ScoreInfo eachscore = new ScoreInfo();
                eachscore.UserID    = user.UserID;
                eachscore.StudNum   = user.StudentNumber;
                eachscore.StudName  = user.UserNickname;
                eachscore.TestNames = new List <string>();
                eachscore.TestScore = new List <double>();
                List <CEDTS_Test> usertest = _paper.SelectTestByPeriod(BeginTime, EndTime, user.UserID);
                foreach (var pac in paclist)
                {
                    CEDTS_Paper paper = _paper.GetPaperByID(Guid.Parse(pac.ToString()));
                    eachscore.TestNames.Add(paper.Title);
                    CEDTS_Test test = _paper.GetTestByPaperID(Guid.Parse(pac.ToString()), user.UserID);
                    if (test != null && test.IsFinished == true)
                    {
                        eachscore.TestScore.Add(double.Parse(test.TotalScore.ToString()) / double.Parse(paper.Score.ToString()) * 100);
                    }
                    else
                    {
                        eachscore.TestScore.Add(0);
                    }
                }

                int    donenum    = 0;
                double userscore  = 0.0;
                double totalscore = 0.0;
                foreach (var test in usertest)
                {
                    if (!paclist.Contains(test.PaperID))
                    {
                        List <CEDTS_PaperAssessment> assessment = _paper.SelectPaperAssessmentItem(test.PaperID);
                        foreach (var ass in assessment)
                        {
                            donenum += _paper.SelectQNByAssessmentID(Guid.Parse(ass.AssessmentItemID.ToString()));
                        }
                        userscore  += double.Parse(test.TotalScore.ToString());
                        totalscore += double.Parse(_paper.SelectPaper(test.PaperID).Score.ToString());
                    }
                }
                eachscore.DoneNum = donenum;
                if (totalscore == 0)
                {
                    eachscore.DoneScore = 0.0;
                }
                else
                {
                    eachscore.DoneScore = userscore / totalscore * 100;
                }
                double avescore = 0.0;
                foreach (var score in eachscore.TestScore)
                {
                    avescore += score;
                }
                eachscore.AveScore = (avescore + eachscore.DoneScore) / (eachscore.TestScore.Count + 1);
                scorelist.Add(eachscore);
            }
            ViewData["StartDate"] = BeginTime;
            ViewData["EndDate"]   = EndTime;
            ViewData["ClassName"] = ClassName;
            return(View(_paper.ScoreInfoPaged(id, scorelist)));
        }
Esempio n. 8
0
        public ActionResult SingleExerciseScore()
        {
            List <SingleScoreInfo> SingleScoreInfoList  = GetSingleScoreList(ClassID, SinglePaperID);
            SingleStatistics       SingleStatisticsInfo = new SingleStatistics();

            ClassName = _user.GetClassbyID(ClassID).ClassName;
            CEDTS_Paper paper = _paper.GetPaperByID(SinglePaperID);

            ViewData["TaskName"]  = paper.Title;
            ViewData["ClassName"] = ClassName;
            if (SingleScoreInfoList.Count == 0)
            {
                ViewData["Empty"] = "Empty";
            }
            else
            {
                ViewData["Empty"] = "";
                bool doneflag = false;
                foreach (var singlescore in SingleScoreInfoList)
                {
                    if (singlescore.Done)
                    {
                        doneflag = true;
                        break;
                    }
                }
                if (doneflag)
                {
                    int    donum          = 0;
                    int    undonum        = SingleScoreInfoList.Count;
                    double totalstudscore = 0.0;
                    double highscore      = double.MinValue;
                    double lowscore       = double.MaxValue;
                    string highname       = "";
                    string lowname        = "";
                    foreach (var singlescore in SingleScoreInfoList)
                    {
                        if (singlescore.Done)
                        {
                            donum++;
                            undonum--;
                            totalstudscore += singlescore.Score;
                            if (singlescore.Score <= lowscore)
                            {
                                if (singlescore.Score == lowscore)
                                {
                                    lowname = lowname + "、" + singlescore.StudName;
                                }
                                else
                                {
                                    lowscore = singlescore.Score;
                                    lowname  = singlescore.StudName;
                                }
                            }
                            if (singlescore.Score >= highscore)
                            {
                                if (singlescore.Score == highscore)
                                {
                                    highname = highname + "、" + singlescore.StudName;
                                }
                                else
                                {
                                    highscore = singlescore.Score;
                                    highname  = singlescore.StudName;
                                }
                            }
                        }
                    }
                    SingleStatisticsInfo.AveScore        = totalstudscore / donum;
                    SingleStatisticsInfo.AvePercent      = SingleStatisticsInfo.AveScore / paper.Score.Value * 100;
                    SingleStatisticsInfo.DoNum           = donum;
                    SingleStatisticsInfo.UndoNum         = undonum;
                    SingleStatisticsInfo.HighestScore    = highscore;
                    SingleStatisticsInfo.HighestStudName = highname;
                    SingleStatisticsInfo.LowestScore     = lowscore;
                    SingleStatisticsInfo.LowestStudName  = lowname;
                    double temp = 0.0;
                    foreach (var singlescore in SingleScoreInfoList)
                    {
                        if (singlescore.Done)
                        {
                            temp += Math.Pow((singlescore.Score - SingleStatisticsInfo.AveScore), 2);
                        }
                    }
                    SingleStatisticsInfo.Variance          = temp / donum;
                    SingleStatisticsInfo.StandardDeviation = Math.Sqrt(SingleStatisticsInfo.Variance);
                }
                else
                {
                    SingleStatisticsInfo.DoNum   = 0;
                    SingleStatisticsInfo.UndoNum = SingleScoreInfoList.Count;
                }
            }
            return(View(SingleStatisticsInfo));
        }
        public ActionResult Remark(Guid PaperID, Guid TestID, int type)
        {
            PaperTotal pt = new PaperTotal();
            List <SkimmingScanningPartCompletion> sspcList = new List <SkimmingScanningPartCompletion>(); //临时存储快速阅读题型
            List <Listen> slpoList = new List <Listen>();                                                 //临时存储短对话听力题型
            List <Listen> llpoList = new List <Listen>();                                                 //临时存储长对话听力题型
            List <Listen> rlpoList = new List <Listen>();                                                 //临时存储听力理解题型
            List <Listen> lpcList  = new List <Listen>();                                                 //临时存储复合型听力题型
            List <ReadingPartCompletion> rpcList = new List <ReadingPartCompletion>();                    //临时存储阅读理解选词填空题型
            List <ReadingPartOption>     rpoList = new List <ReadingPartOption>();                        //临时存储阅读理解选择题型
            List <ClozePart>             cpList  = new List <ClozePart>();                                //临时存储完型填空题型

            List <CEDTS_PaperAssessment> paList = _paper.SelectPaperAssessmentItem(PaperID);
            CEDTS_Paper paper = _paper.SelectPaper(PaperID);

            List <CEDTS_TestAnswer> taList = _test.GetTestAnswer(TestID);

            foreach (var pa in paList)
            {
                Guid ItemID      = Guid.Parse(pa.AssessmentItemID.ToString());//试题ID
                var  relQuestion = taList.Where(p => p.AssessmentItemID == ItemID).Select(p => p.QuestionID).ToList();

                #region 快速阅读理解赋值
                if (pa.ItemTypeID == 1)
                {
                    var tempListQuestion = new List <CEDTS_Question>();
                    SkimmingScanningPartCompletion sspc = new SkimmingScanningPartCompletion();
                    CEDTS_AssessmentItem           ai   = _paper.SelectAssessmentItem(ItemID);
                    CEDTS_ItemType        it            = _paper.SelectItemType((int)ai.ItemTypeID);
                    List <CEDTS_Question> questionList  = _paper.SelectQuestion(ItemID);
                    ItemBassInfo          info          = new ItemBassInfo();
                    info.UserAnswer        = new List <string>();
                    info.QuestionID        = new List <Guid>();
                    info.AnswerValue       = new List <string>();
                    info.DifficultQuestion = new List <double>();
                    info.Knowledge         = new List <string>();
                    info.KnowledgeID       = new List <string>();
                    info.Problem           = new List <string>();
                    info.ScoreQuestion     = new List <double>();
                    info.TimeQuestion      = new List <double>();
                    info.Tip     = new List <string>();
                    sspc.Choices = new List <string>();

                    sspc.Content       = ai.Original;
                    info.QuestionCount = (int)ai.QuestionCount;
                    info.Score         = (double)ai.Score;
                    info.ReplyTime     = (int)ai.Duration;
                    info.ItemID        = (Guid)ai.AssessmentItemID;
                    info.Count         = (int)ai.Count;
                    info.Diffcult      = (double)ai.Difficult;
                    info.ItemType      = it.ItemTypeID.ToString();
                    info.ItemType_CN   = it.TypeName_CN;
                    info.PartType      = it.PartTypeID.ToString();
                    int TermNum = 0;

                    foreach (var question in questionList)
                    {
                        if (!relQuestion.Contains(question.QuestionID))
                        {
                            continue;
                        }
                        info.QuestionID.Add(question.QuestionID);
                        info.UserAnswer.Add(taList.Where(p => p.QuestionID == question.QuestionID).Select(p => p.UserAnswer).FirstOrDefault());
                        info.ScoreQuestion.Add((double)question.Score);
                        info.TimeQuestion.Add((int)question.Duration);
                        info.DifficultQuestion.Add((double)question.Difficult);
                        info.Problem.Add(question.QuestionContent);
                        info.AnswerValue.Add(question.Answer);
                        info.Tip.Add(question.Analyze);
                        if (question.ChooseA != "")
                        {
                            sspc.Choices.Add(question.ChooseA);
                            sspc.Choices.Add(question.ChooseB);
                            sspc.Choices.Add(question.ChooseC);
                            sspc.Choices.Add(question.ChooseD);
                        }
                        else
                        {
                            TermNum++;
                        }

                        tempListQuestion.Add(question);
                    }
                    info.QuestionCount = tempListQuestion.Count;
                    sspc.TermNum       = TermNum;
                    sspc.ChoiceNum     = info.QuestionCount - TermNum;
                    sspc.Info          = info;
                    sspcList.Add(sspc);
                }
                #endregion

                #region 短对话听力赋值
                if (pa.ItemTypeID == 2)
                {
                    var    tempListQuestion            = new List <CEDTS_Question>();
                    Listen listen                      = new Listen();
                    CEDTS_AssessmentItem  ai           = _paper.SelectAssessmentItem(ItemID);
                    CEDTS_ItemType        it           = _paper.SelectItemType((int)ai.ItemTypeID);
                    List <CEDTS_Question> questionList = _paper.SelectQuestion(ItemID);
                    ItemBassInfo          info         = new ItemBassInfo();
                    info.UserAnswer        = new List <string>();
                    info.QuestionID        = new List <Guid>();
                    info.AnswerValue       = new List <string>();
                    info.DifficultQuestion = new List <double>();
                    info.Knowledge         = new List <string>();
                    info.KnowledgeID       = new List <string>();
                    info.Problem           = new List <string>();
                    info.ScoreQuestion     = new List <double>();
                    info.TimeQuestion      = new List <double>();
                    info.Tip             = new List <string>();
                    info.questionSound   = new List <string>();
                    info.timeInterval    = new List <int>();
                    info.QustionInterval = ai.Interval.ToString();
                    listen.Choices       = new List <string>();

                    listen.Script      = ai.Original;
                    info.QuestionCount = (int)ai.QuestionCount;
                    info.Score         = (double)ai.Score;
                    info.ReplyTime     = (int)ai.Duration;
                    info.ItemID        = (Guid)ai.AssessmentItemID;
                    info.Count         = (int)ai.Count;
                    info.Diffcult      = (double)ai.Difficult;
                    info.ItemType      = it.ItemTypeID.ToString();
                    info.ItemType_CN   = it.TypeName_CN;
                    info.PartType      = it.PartTypeID.ToString();
                    foreach (var question in questionList)
                    {
                        if (!relQuestion.Contains(question.QuestionID))
                        {
                            continue;
                        }
                        info.QuestionID.Add(question.QuestionID);
                        info.UserAnswer.Add(taList.Where(p => p.QuestionID == question.QuestionID).Select(p => p.UserAnswer).FirstOrDefault());
                        info.ScoreQuestion.Add((double)question.Score);
                        info.TimeQuestion.Add((int)question.Duration);
                        info.DifficultQuestion.Add((double)question.Difficult);
                        info.Problem.Add(question.QuestionContent);
                        info.AnswerValue.Add(question.Answer);
                        info.Tip.Add(question.Analyze);
                        listen.Choices.Add(question.ChooseA);
                        listen.Choices.Add(question.ChooseB);
                        listen.Choices.Add(question.ChooseC);
                        listen.Choices.Add(question.ChooseD);

                        tempListQuestion.Add(question);
                    }
                    info.QuestionCount = tempListQuestion.Count;
                    listen.Info        = info;
                    slpoList.Add(listen);
                }
                #endregion

                #region 长对话听力赋值
                if (pa.ItemTypeID == 3)
                {
                    var    tempListQuestion            = new List <CEDTS_Question>();
                    Listen listen                      = new Listen();
                    CEDTS_AssessmentItem  ai           = _paper.SelectAssessmentItem(ItemID);
                    CEDTS_ItemType        it           = _paper.SelectItemType((int)ai.ItemTypeID);
                    List <CEDTS_Question> questionList = _paper.SelectQuestion(ItemID);
                    ItemBassInfo          info         = new ItemBassInfo();
                    info.UserAnswer        = new List <string>();
                    info.QuestionID        = new List <Guid>();
                    info.AnswerValue       = new List <string>();
                    info.DifficultQuestion = new List <double>();
                    info.Knowledge         = new List <string>();
                    info.KnowledgeID       = new List <string>();
                    info.Problem           = new List <string>();
                    info.ScoreQuestion     = new List <double>();
                    info.TimeQuestion      = new List <double>();
                    info.Tip             = new List <string>();
                    info.QustionInterval = ai.Interval.ToString();
                    info.timeInterval    = new List <int>();
                    info.questionSound   = new List <string>();
                    listen.Choices       = new List <string>();

                    listen.Script      = ai.Original;
                    info.QuestionCount = (int)ai.QuestionCount;
                    info.Score         = (double)ai.Score;
                    info.ReplyTime     = (int)ai.Duration;
                    info.ItemID        = (Guid)ai.AssessmentItemID;
                    info.Count         = (int)ai.Count;
                    info.Diffcult      = (double)ai.Difficult;
                    info.ItemType      = it.ItemTypeID.ToString();
                    info.ItemType_CN   = it.TypeName_CN;
                    info.PartType      = it.PartTypeID.ToString();
                    foreach (var question in questionList)
                    {
                        if (!relQuestion.Contains(question.QuestionID))
                        {
                            continue;
                        }
                        info.QuestionID.Add(question.QuestionID);
                        info.UserAnswer.Add(taList.Where(p => p.QuestionID == question.QuestionID).Select(p => p.UserAnswer).FirstOrDefault());
                        info.questionSound.Add(question.Sound);
                        info.timeInterval.Add(question.Interval.Value);
                        info.ScoreQuestion.Add((double)question.Score);
                        info.TimeQuestion.Add((int)question.Duration);
                        info.DifficultQuestion.Add((double)question.Difficult);
                        info.Problem.Add(question.QuestionContent);
                        info.AnswerValue.Add(question.Answer);
                        info.Tip.Add(question.Analyze);
                        listen.Choices.Add(question.ChooseA);
                        listen.Choices.Add(question.ChooseB);
                        listen.Choices.Add(question.ChooseC);
                        listen.Choices.Add(question.ChooseD);

                        tempListQuestion.Add(question);
                    }
                    info.QuestionCount = tempListQuestion.Count;
                    listen.Info        = info;
                    llpoList.Add(listen);
                }
                #endregion

                #region 短文理解听力赋值
                if (pa.ItemTypeID == 4)
                {
                    var    tempListQuestion            = new List <CEDTS_Question>();
                    Listen listen                      = new Listen();
                    CEDTS_AssessmentItem  ai           = _paper.SelectAssessmentItem(ItemID);
                    CEDTS_ItemType        it           = _paper.SelectItemType((int)ai.ItemTypeID);
                    List <CEDTS_Question> questionList = _paper.SelectQuestion(ItemID);
                    ItemBassInfo          info         = new ItemBassInfo();
                    info.UserAnswer        = new List <string>();
                    info.QuestionID        = new List <Guid>();
                    info.AnswerValue       = new List <string>();
                    info.DifficultQuestion = new List <double>();
                    info.Knowledge         = new List <string>();
                    info.KnowledgeID       = new List <string>();
                    info.Problem           = new List <string>();
                    info.ScoreQuestion     = new List <double>();
                    info.TimeQuestion      = new List <double>();
                    info.Tip             = new List <string>();
                    info.QustionInterval = ai.Interval.ToString();
                    info.questionSound   = new List <string>();
                    info.timeInterval    = new List <int>();
                    listen.Choices       = new List <string>();

                    listen.Script      = ai.Original;
                    info.QuestionCount = (int)ai.QuestionCount;
                    info.Score         = (double)ai.Score;
                    info.ReplyTime     = (int)ai.Duration;
                    info.ItemID        = (Guid)ai.AssessmentItemID;
                    info.Count         = (int)ai.Count;
                    info.Diffcult      = (double)ai.Difficult;
                    info.ItemType      = it.ItemTypeID.ToString();
                    info.ItemType_CN   = it.TypeName_CN;
                    info.PartType      = it.PartTypeID.ToString();
                    foreach (var question in questionList)
                    {
                        if (!relQuestion.Contains(question.QuestionID))
                        {
                            continue;
                        }
                        info.QuestionID.Add(question.QuestionID);
                        info.UserAnswer.Add(taList.Where(p => p.QuestionID == question.QuestionID).Select(p => p.UserAnswer).FirstOrDefault());
                        info.questionSound.Add(question.Sound);
                        info.timeInterval.Add(question.Interval.Value);
                        info.ScoreQuestion.Add((double)question.Score);
                        info.TimeQuestion.Add((int)question.Duration);
                        info.DifficultQuestion.Add((double)question.Difficult);
                        info.Problem.Add(question.QuestionContent);
                        info.AnswerValue.Add(question.Answer);
                        info.Tip.Add(question.Analyze);
                        listen.Choices.Add(question.ChooseA);
                        listen.Choices.Add(question.ChooseB);
                        listen.Choices.Add(question.ChooseC);
                        listen.Choices.Add(question.ChooseD);

                        tempListQuestion.Add(question);
                    }
                    info.QuestionCount = tempListQuestion.Count;
                    listen.Info        = info;
                    rlpoList.Add(listen);
                }
                #endregion

                #region  合型听力赋值
                if (pa.ItemTypeID == 5)
                {
                    var    tempListQuestion            = new List <CEDTS_Question>();
                    Listen listen                      = new Listen();
                    CEDTS_AssessmentItem  ai           = _paper.SelectAssessmentItem(ItemID);
                    CEDTS_ItemType        it           = _paper.SelectItemType((int)ai.ItemTypeID);
                    List <CEDTS_Question> questionList = _paper.SelectQuestion(ItemID);
                    ItemBassInfo          info         = new ItemBassInfo();
                    info.UserAnswer        = new List <string>();
                    info.QuestionID        = new List <Guid>();
                    info.AnswerValue       = new List <string>();
                    info.DifficultQuestion = new List <double>();
                    info.Knowledge         = new List <string>();
                    info.KnowledgeID       = new List <string>();
                    info.Problem           = new List <string>();
                    info.ScoreQuestion     = new List <double>();
                    info.TimeQuestion      = new List <double>();
                    info.Tip             = new List <string>();
                    info.questionSound   = new List <string>();
                    info.timeInterval    = new List <int>();
                    info.QustionInterval = ai.Interval.ToString();
                    listen.Choices       = new List <string>();

                    listen.Script      = ai.Original;
                    info.QuestionCount = (int)ai.QuestionCount;
                    info.Score         = (double)ai.Score;
                    info.ReplyTime     = (int)ai.Duration;
                    info.ItemID        = (Guid)ai.AssessmentItemID;
                    info.Count         = (int)ai.Count;
                    info.Diffcult      = (double)ai.Difficult;
                    info.ItemType      = it.ItemTypeID.ToString();
                    info.ItemType_CN   = it.TypeName_CN;
                    info.PartType      = it.PartTypeID.ToString();
                    foreach (var question in questionList)
                    {
                        if (!relQuestion.Contains(question.QuestionID))
                        {
                            string script = "(_" + question.Order + "_)";
                            listen.Script = listen.Script.Replace(script, "(_<span style='color:Red'>" + question.Answer + "</span>_)");
                            continue;
                        }
                        info.QuestionID.Add(question.QuestionID);
                        info.UserAnswer.Add(taList.Where(p => p.QuestionID == question.QuestionID).Select(p => p.UserAnswer).FirstOrDefault());
                        info.ScoreQuestion.Add((double)question.Score);
                        info.TimeQuestion.Add((int)question.Duration);
                        info.DifficultQuestion.Add((double)question.Difficult);
                        info.Problem.Add(question.QuestionContent);
                        info.AnswerValue.Add(question.Answer);
                        info.Tip.Add(question.Analyze);

                        tempListQuestion.Add(question);
                    }
                    info.QuestionCount = tempListQuestion.Count;
                    listen.Info        = info;
                    lpcList.Add(listen);
                }
                #endregion

                #region 阅读理解选词填空赋值
                if (pa.ItemTypeID == 6)
                {
                    var tempListQuestion               = new List <CEDTS_Question>();
                    ReadingPartCompletion rpc          = new ReadingPartCompletion();
                    CEDTS_AssessmentItem  ai           = _paper.SelectAssessmentItem(ItemID);
                    CEDTS_ItemType        it           = _paper.SelectItemType((int)ai.ItemTypeID);
                    List <CEDTS_Question> questionList = _paper.SelectQuestion(ItemID);
                    CEDTS_Expansion       es           = _paper.SelectExpansion(ItemID);
                    ItemBassInfo          info         = new ItemBassInfo();
                    info.UserAnswer        = new List <string>();
                    info.QuestionID        = new List <Guid>();
                    info.AnswerValue       = new List <string>();
                    info.DifficultQuestion = new List <double>();
                    info.Knowledge         = new List <string>();
                    info.KnowledgeID       = new List <string>();
                    info.Problem           = new List <string>();
                    info.ScoreQuestion     = new List <double>();
                    info.TimeQuestion      = new List <double>();
                    info.Tip = new List <string>();

                    rpc.Content        = ai.Original;
                    info.QuestionCount = (int)ai.QuestionCount;
                    info.Score         = (double)ai.Score;
                    info.ReplyTime     = (int)ai.Duration;
                    info.ItemID        = (Guid)ai.AssessmentItemID;
                    info.Count         = (int)ai.Count;
                    info.Diffcult      = (double)ai.Difficult;
                    info.ItemType      = it.ItemTypeID.ToString();
                    info.ItemType_CN   = it.TypeName_CN;
                    info.PartType      = it.PartTypeID.ToString();
                    foreach (var question in questionList)
                    {
                        if (!relQuestion.Contains(question.QuestionID))
                        {
                            string Content = "(_" + question.Order + "_)";
                            rpc.Content = rpc.Content.Replace(Content, "(_<span style='color:Red'>" + question.Answer + "</span>_)");
                            continue;
                        }
                        info.QuestionID.Add(question.QuestionID);
                        info.UserAnswer.Add(taList.Where(p => p.QuestionID == question.QuestionID).Select(p => p.UserAnswer).FirstOrDefault());
                        info.ScoreQuestion.Add((double)question.Score);
                        info.TimeQuestion.Add((int)question.Duration);
                        info.DifficultQuestion.Add((double)question.Difficult);
                        info.Problem.Add(question.QuestionContent);
                        info.AnswerValue.Add(question.Answer);
                        info.Tip.Add(question.Analyze);

                        tempListQuestion.Add(question);
                    }
                    rpc.WordList = new List <string>();
                    rpc.WordList.Add(es.ChoiceA);
                    rpc.WordList.Add(es.ChoiceB);
                    rpc.WordList.Add(es.ChoiceC);
                    rpc.WordList.Add(es.ChoiceD);
                    rpc.WordList.Add(es.ChoiceE);
                    rpc.WordList.Add(es.ChoiceF);
                    rpc.WordList.Add(es.ChoiceG);
                    rpc.WordList.Add(es.ChoiceH);
                    rpc.WordList.Add(es.ChoiceI);
                    rpc.WordList.Add(es.ChoiceJ);
                    rpc.WordList.Add(es.ChoiceH);
                    rpc.WordList.Add(es.ChoiceK);
                    rpc.WordList.Add(es.ChoiceL);
                    rpc.WordList.Add(es.ChoiceN);
                    rpc.WordList.Add(es.ChoiceM);
                    rpc.WordList.Add(es.ChoiceO);
                    info.QuestionCount = tempListQuestion.Count;
                    rpc.Info           = info;
                    rpcList.Add(rpc);
                }

                #endregion

                #region 阅读理解选择题型赋值
                if (pa.ItemTypeID == 7)
                {
                    var tempListQuestion               = new List <CEDTS_Question>();
                    ReadingPartOption     rpo          = new ReadingPartOption();
                    CEDTS_AssessmentItem  ai           = _paper.SelectAssessmentItem(ItemID);
                    CEDTS_ItemType        it           = _paper.SelectItemType((int)ai.ItemTypeID);
                    List <CEDTS_Question> questionList = _paper.SelectQuestion(ItemID);
                    ItemBassInfo          info         = new ItemBassInfo();
                    info.UserAnswer        = new List <string>();
                    info.QuestionID        = new List <Guid>();
                    info.AnswerValue       = new List <string>();
                    info.DifficultQuestion = new List <double>();
                    info.Knowledge         = new List <string>();
                    info.KnowledgeID       = new List <string>();
                    info.Problem           = new List <string>();
                    info.ScoreQuestion     = new List <double>();
                    info.TimeQuestion      = new List <double>();
                    info.Tip           = new List <string>();
                    rpo.Choices        = new List <string>();
                    rpo.Content        = ai.Original;
                    info.QuestionCount = (int)ai.QuestionCount;
                    info.Score         = (double)ai.Score;
                    info.ReplyTime     = (int)ai.Duration;
                    info.ItemID        = (Guid)ai.AssessmentItemID;
                    info.Count         = (int)ai.Count;
                    info.Diffcult      = (double)ai.Difficult;
                    info.ItemType      = it.ItemTypeID.ToString();
                    info.ItemType_CN   = it.TypeName_CN;
                    info.PartType      = it.PartTypeID.ToString();
                    foreach (var question in questionList)
                    {
                        if (!relQuestion.Contains(question.QuestionID))
                        {
                            continue;
                        }
                        info.QuestionID.Add(question.QuestionID);
                        info.UserAnswer.Add(taList.Where(p => p.QuestionID == question.QuestionID).Select(p => p.UserAnswer).FirstOrDefault());
                        info.ScoreQuestion.Add((double)question.Score);
                        info.TimeQuestion.Add((int)question.Duration);
                        info.DifficultQuestion.Add((double)question.Difficult);
                        info.Problem.Add(question.QuestionContent);
                        info.AnswerValue.Add(question.Answer);
                        info.Tip.Add(question.Analyze);
                        rpo.Choices.Add(question.ChooseA);
                        rpo.Choices.Add(question.ChooseB);
                        rpo.Choices.Add(question.ChooseC);
                        rpo.Choices.Add(question.ChooseD);

                        tempListQuestion.Add(question);
                    }
                    info.QuestionCount = tempListQuestion.Count;
                    rpo.Info           = info;
                    rpoList.Add(rpo);
                }
                #endregion

                #region 完型填空赋值
                if (pa.ItemTypeID == 8)
                {
                    var                   tempListQuestion = new List <CEDTS_Question>();
                    ClozePart             cp           = new ClozePart();
                    CEDTS_AssessmentItem  ai           = _paper.SelectAssessmentItem(ItemID);
                    CEDTS_ItemType        it           = _paper.SelectItemType((int)ai.ItemTypeID);
                    List <CEDTS_Question> questionList = _paper.SelectQuestion(ItemID);
                    ItemBassInfo          info         = new ItemBassInfo();
                    info.UserAnswer        = new List <string>();
                    info.QuestionID        = new List <Guid>();
                    info.AnswerValue       = new List <string>();
                    info.DifficultQuestion = new List <double>();
                    info.Knowledge         = new List <string>();
                    info.KnowledgeID       = new List <string>();
                    info.Problem           = new List <string>();
                    info.ScoreQuestion     = new List <double>();
                    info.TimeQuestion      = new List <double>();
                    info.Tip   = new List <string>();
                    cp.Choices = new List <string>();

                    cp.Content         = ai.Original;
                    info.QuestionCount = (int)ai.QuestionCount;
                    info.Score         = (double)ai.Score;
                    info.ReplyTime     = (int)ai.Duration;
                    info.ItemID        = (Guid)ai.AssessmentItemID;
                    info.Count         = (int)ai.Count;
                    info.Diffcult      = (double)ai.Difficult;
                    info.ItemType      = it.ItemTypeID.ToString();
                    info.ItemType_CN   = it.TypeName_CN;
                    info.PartType      = it.PartTypeID.ToString();
                    foreach (var question in questionList)
                    {
                        if (!relQuestion.Contains(question.QuestionID))
                        {
                            string Content = "(_" + question.Order + "_)";
                            string value   = string.Empty;
                            switch (question.Answer)
                            {
                            case "A": value = question.ChooseA; break;

                            case "B": value = question.ChooseB; break;

                            case "C": value = question.ChooseC; break;

                            case "D": value = question.ChooseD; break;

                            default: break;
                            }
                            cp.Content = cp.Content.Replace(Content, "(_<span style='color:Red'>" + value + "</span>_)");
                            continue;
                        }
                        info.QuestionID.Add(question.QuestionID);
                        info.UserAnswer.Add(taList.Where(p => p.QuestionID == question.QuestionID).Select(p => p.UserAnswer).FirstOrDefault());
                        info.ScoreQuestion.Add((double)question.Score);
                        info.TimeQuestion.Add((int)question.Duration);
                        info.DifficultQuestion.Add((double)question.Difficult);
                        info.Problem.Add(question.QuestionContent);
                        info.AnswerValue.Add(question.Answer);
                        info.Tip.Add(question.Analyze);
                        cp.Choices.Add(question.ChooseA);
                        cp.Choices.Add(question.ChooseB);
                        cp.Choices.Add(question.ChooseC);
                        cp.Choices.Add(question.ChooseD);

                        tempListQuestion.Add(question);
                    }
                    info.QuestionCount = tempListQuestion.Count;
                    cp.Info            = info;
                    cpList.Add(cp);
                }
                #endregion
            }
            pt.PaperID          = paper.PaperID;
            pt.UserID           = paper.UserID.Value;
            pt.UpdateUserID     = paper.UpdateUserID.Value;
            pt.Title            = paper.Title;
            pt.Type             = paper.Type;
            pt.Duration         = paper.Duration.Value;
            pt.Difficult        = paper.Difficult.Value;
            pt.Score            = paper.Score.Value;
            pt.Description      = paper.Description;
            pt.CreateTime       = paper.CreateTime.Value;
            pt.PaperContent     = paper.PaperContent;
            pt.SspcList         = sspcList;
            pt.SlpoList         = slpoList;
            pt.LlpoList         = llpoList;
            pt.LpcList          = lpcList;
            pt.RlpoList         = rlpoList;
            pt.RpcList          = rpcList;
            pt.RpoList          = rpoList;
            pt.CpList           = cpList;
            this.TempData["pt"] = pt;
            ViewData["testID"]  = TestID.ToString();
            TempData["content"] = _test.GetTest(TestID).Remark;
            return(View());
        }