Esempio n. 1
0
        // Token: 0x060000B3 RID: 179 RVA: 0x000119C4 File Offset: 0x0000FBC4
        protected List <ExamQuestion> GetQuestionList(ExamResultTopic resultinfo)
        {
            SqlParam            sqlParam = DbHelper.MakeAndWhere("id", WhereType.In, resultinfo.questionlist);
            List <ExamQuestion> list     = DbHelper.ExecuteList <ExamQuestion>(new SqlParam[]
            {
                sqlParam
            });

            int[]               array  = FPUtils.SplitInt(resultinfo.questionlist);
            string[]            array2 = FPUtils.SplitString(resultinfo.answerlist, "§", array.Length);
            string[]            array3 = FPUtils.SplitString(resultinfo.scorelist, "|", array.Length);
            string[]            array4 = FPUtils.SplitString(resultinfo.optionlist, "|", array.Length);
            List <ExamQuestion> list2  = new List <ExamQuestion>();
            int num = 0;

            foreach (int num2 in array)
            {
                foreach (ExamQuestion examQuestion in list)
                {
                    if (examQuestion.id == num2)
                    {
                        examQuestion.useranswer = array2[num];
                        examQuestion.userscore  = (double)FPUtils.StrToFloat(array3[num]);
                        examQuestion.optionlist = array4[num];
                        if (examQuestion.type == 1 || examQuestion.type == 2)
                        {
                            examQuestion.answer = this.OptionAnswer(examQuestion.optionlist, examQuestion.answer);
                        }
                        list2.Add(examQuestion);
                    }
                }
                num++;
            }
            return(list2);
        }
Esempio n. 2
0
        // Token: 0x06000096 RID: 150 RVA: 0x0000E908 File Offset: 0x0000CB08
        protected List <ExamQuestion> GetQuestionList(ExamResultTopic resultinfo)
        {
            SqlParam            sqlParam = DbHelper.MakeAndWhere("id", WhereType.In, resultinfo.questionlist);
            List <ExamQuestion> list     = DbHelper.ExecuteList <ExamQuestion>(new SqlParam[]
            {
                sqlParam
            });

            int[]               array  = FPUtils.SplitInt(resultinfo.questionlist);
            string[]            array2 = FPUtils.SplitString(resultinfo.answerlist, "§", array.Length);
            string[]            array3 = FPUtils.SplitString(resultinfo.scorelist, "|", array.Length);
            string[]            array4 = FPUtils.SplitString(resultinfo.optionlist, "|", array.Length);
            List <ExamQuestion> list2  = new List <ExamQuestion>();

            SqlParam[] sqlparams = new SqlParam[]
            {
                DbHelper.MakeAndWhere("qid", WhereType.In, resultinfo.questionlist),
                DbHelper.MakeAndWhere("uid", this.userid)
            };
            List <ExamNote> list3 = DbHelper.ExecuteList <ExamNote>(sqlparams);
            int             num   = 0;

            foreach (int num2 in array)
            {
                foreach (ExamQuestion examQuestion in list)
                {
                    if (examQuestion.id == num2)
                    {
                        examQuestion.useranswer = array2[num];
                        examQuestion.userscore  = (double)FPUtils.StrToFloat(array3[num]);
                        examQuestion.optionlist = array4[num];
                        if (examQuestion.type == 1 || examQuestion.type == 2)
                        {
                            examQuestion.answer = this.OptionAnswer(examQuestion.optionlist, examQuestion.answer);
                        }
                        foreach (ExamNote examNote in list3)
                        {
                            if (examNote.qid == examQuestion.id)
                            {
                                examQuestion.note = examNote.note;
                            }
                        }
                        if (this.examloglist.ContainsKey(examQuestion.sortid))
                        {
                            ExamLogInfo examLogInfo = this.examloglist[examQuestion.sortid];
                            if (FPUtils.InArray(examQuestion.id, examLogInfo.favlist))
                            {
                                examQuestion.isfav = 1;
                            }
                        }
                        list2.Add(examQuestion);
                    }
                }
                num++;
            }
            return(list2);
        }
Esempio n. 3
0
 // Token: 0x060000C2 RID: 194 RVA: 0x000130BC File Offset: 0x000112BC
 protected override void View()
 {
     this.examresult = DbHelper.ExecuteModel <ExamResult>(this.resultid);
     if (this.examresult.id == 0)
     {
         this.ShowErr("该考生的试卷不存在或已被删除。");
     }
     else if (this.examresult.status == 0)
     {
         this.ShowErr("对不起,该考试尚未完成。");
     }
     else
     {
         this.examresult.passmark = this.examresult.passmark * this.examresult.total / 100.0;
         string commandText = string.Format("SELECT MAX([score]) AS [maxscore] FROM [{0}Exam_ExamResult] WHERE [examid]={1} AND [status]>0", DbConfigs.Prefix, this.examresult.examid);
         this.maxscore = Math.Round((double)FPUtils.StrToFloat(DbHelper.ExecuteScalar(commandText).ToString(), 0f), 1);
         commandText   = string.Format("SELECT AVG([score]) AS [avgscore] FROM [{0}Exam_ExamResult] WHERE [examid]={1} AND [status]>0", DbConfigs.Prefix, this.examresult.examid);
         this.avgscore = Math.Round((double)FPUtils.StrToFloat(DbHelper.ExecuteScalar(commandText).ToString(), 0f));
         SqlParam[] sqlparams = new SqlParam[]
         {
             DbHelper.MakeAndWhere("examid", this.examresult.examid),
             DbHelper.MakeAndWhere("status", WhereType.GreaterThan, 0)
         };
         this.testers = DbHelper.ExecuteCount <ExamResult>(sqlparams);
         commandText  = string.Format("SELECT COUNT(*) FROM [{0}Exam_ExamResult] WHERE [examid]={1} AND [score]>{2} AND [status]>0", DbConfigs.Prefix, this.examresult.examid, this.examresult.score);
         if (this.examresult.score > 0.0)
         {
             this.display = FPUtils.StrToInt(DbHelper.ExecuteScalar(commandText).ToString(), 0) + 1;
         }
         SqlParam     sqlParam = DbHelper.MakeAndWhere("resultid", this.resultid);
         OrderByParam orderby  = DbHelper.MakeOrderBy("display", OrderBy.ASC);
         this.examtopiclist = DbHelper.ExecuteList <ExamResultTopic>(orderby, new SqlParam[]
         {
             sqlParam
         });
         int num  = Convert.ToInt32(this.examresult.total) / 5;
         int num2 = num / 2;
         if (num % 2 != 0)
         {
             num2++;
         }
         for (int i = 1; i < 10; i++)
         {
             if (i % 2 == 0)
             {
                 this.bcklist.Add(i / 2 * num);
             }
             else
             {
                 this.bcklist.Add(i * num2);
             }
         }
     }
 }
Esempio n. 4
0
 // Token: 0x060000B2 RID: 178 RVA: 0x000117F4 File Offset: 0x0000F9F4
 protected override void View()
 {
     if (!this.isperm)
     {
         this.ShowErr("对不起,您没有权限阅卷。");
     }
     else
     {
         this.examresult = DbHelper.ExecuteModel <ExamResult>(this.resultid);
         if (this.examresult.id == 0)
         {
             this.ShowErr("该考生的试卷不存在或已被删除。");
         }
         else
         {
             this.examloglist = ExamBll.GetExamLogList(this.examresult.channelid, this.userid);
             string commandText = string.Format("SELECT MAX([score]) AS [maxscore] FROM [{0}Exam_ExamResult] WHERE [id]={1}", DbConfigs.Prefix, this.resultid);
             this.maxscore = Math.Round((double)FPUtils.StrToFloat(DbHelper.ExecuteScalar(commandText).ToString(), 0f), 1);
             if (this.maxscore > this.examresult.total)
             {
                 this.maxscore = this.examresult.total;
             }
             commandText   = string.Format("SELECT AVG([score]) AS [avgscore] FROM [{0}Exam_ExamResult] WHERE [id]={1}", DbConfigs.Prefix, this.resultid);
             this.avgscore = Math.Round((double)FPUtils.StrToFloat(DbHelper.ExecuteScalar(commandText).ToString(), 0f), 1);
             SqlParam sqlParam = DbHelper.MakeAndWhere("examid", this.examresult.examid);
             this.testers = DbHelper.ExecuteCount <ExamResult>(new SqlParam[]
             {
                 sqlParam
             });
             commandText = string.Format("SELECT COUNT(*) FROM [{0}Exam_ExamResult] WHERE [examid]={1} AND [score]>{2}", DbConfigs.Prefix, this.examresult.examid, this.examresult.score);
             if (this.examresult.score > 0.0)
             {
                 this.display = FPUtils.StrToInt(DbHelper.ExecuteScalar(commandText).ToString(), 0) + 1;
             }
             this.examtopicresultlist = ExamBll.GetExamResultTopicList(this.resultid);
         }
     }
 }