Esempio n. 1
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. 2
0
        // Token: 0x060000BE RID: 190 RVA: 0x00012D18 File Offset: 0x00010F18
        protected string GetChildSort(int channelid, int parentid, int level)
        {
            SqlParam[] sqlparams = new SqlParam[]
            {
                DbHelper.MakeAndWhere("parentid", parentid),
                DbHelper.MakeAndWhere("channelid", channelid),
                DbHelper.MakeAndWhere("appid", WhereType.In, this.sortappidlist),
                DbHelper.MakeAndWhere("hidden", 0)
            };
            OrderByParam    orderby       = DbHelper.MakeOrderBy("display", OrderBy.ASC);
            List <SortInfo> list          = DbHelper.ExecuteList <SortInfo>(orderby, sqlparams);
            StringBuilder   stringBuilder = new StringBuilder();

            foreach (SortInfo sortInfo in list)
            {
                ExamLogInfo examLogInfo;
                if (this.userexamlog.ContainsKey(sortInfo.id))
                {
                    examLogInfo = this.userexamlog[sortInfo.id];
                }
                else
                {
                    examLogInfo        = new ExamLogInfo();
                    examLogInfo.sortid = sortInfo.id;
                }
                stringBuilder.AppendFormat("<tr class=\"keypoint keypoint-level-{0} child_row_{1}\">\r\n", level, sortInfo.parentid);
                if (sortInfo.subcounts > 0)
                {
                    stringBuilder.AppendFormat("<td class=\"name-col\"><span class=\"text toggle-expand\"><span  id=\"row_{1}\" class=\"sprite sprite-expand sprite-expand\"></span>{0}</span></td>\r\n", sortInfo.name, sortInfo.id);
                }
                else
                {
                    stringBuilder.AppendFormat("<td class=\"name-col\"><span class=\"text\"><span class=\"sprite sprite-expand sprite-noexpand\"></span>{0}</span></td>\r\n", sortInfo.name);
                }
                stringBuilder.AppendFormat("<td class=\"count-col\">{0}道/{1}道</td>\r\n", examLogInfo.answers, sortInfo.posts);
                stringBuilder.AppendFormat("<td class=\"count-col\">{0}道</td>\r\n", examLogInfo.answers - examLogInfo.wrongs);
                if (examLogInfo.answers > 0)
                {
                    stringBuilder.AppendFormat("<td class=\"capacity-col\"><span class=\"progressBar\">{0}%</span></td>\r\n", examLogInfo.accuracy);
                }
                else
                {
                    stringBuilder.AppendFormat("<td class=\"capacity-col\"><span class=\"progressBar\">{0}%</span></td>\r\n", 0);
                }
                stringBuilder.Append("</tr>\r\n");
                if (sortInfo.subcounts > 0)
                {
                    stringBuilder.Append(this.GetChildSort(channelid, sortInfo.id, level + 1));
                }
            }
            return(stringBuilder.ToString());
        }
Esempio n. 3
0
        // Token: 0x060000C0 RID: 192 RVA: 0x00012FBC File Offset: 0x000111BC
        private ExamLogInfo GetExamLogInfo(string sqlstring)
        {
            IDataReader dataReader  = DbHelper.ExecuteReader(CommandType.Text, sqlstring);
            ExamLogInfo examLogInfo = new ExamLogInfo();

            if (dataReader.Read())
            {
                examLogInfo.answers = FPUtils.StrToInt(dataReader["answers"]);
                examLogInfo.wrongs  = FPUtils.StrToInt(dataReader["wrongs"]);
            }
            dataReader.Close();
            return(examLogInfo);
        }
Esempio n. 4
0
 // Token: 0x060000CE RID: 206 RVA: 0x0001462C File Offset: 0x0001282C
 protected override void View()
 {
     this.channelinfo = ChannelBll.GetChannelInfo("exam_question");
     if (this.channelinfo.id == 0)
     {
         this.ShowErr("对不起,目前系统尚未创建题目库频道。");
     }
     else
     {
         string commandText = string.Format("SELECT SUM([curfavs]) AS [total] FROM [{0}Exam_ExamLogInfo] WHERE [channelid]={1} AND [uid]={2}", DbConfigs.Prefix, this.channelinfo.id, this.userid);
         this.total       = FPUtils.StrToInt(DbHelper.ExecuteScalar(commandText));
         this.userexamlog = ExamBll.GetExamLogList(this.channelinfo.id, this.userid);
         List <SortAppInfo> sortAppList = SortBll.GetSortAppList("exam_");
         foreach (SortAppInfo sortAppInfo in sortAppList)
         {
             if (this.sortappidlist != "")
             {
                 this.sortappidlist += ",";
             }
             this.sortappidlist += sortAppInfo.id;
         }
         SqlParam[] sqlparams = new SqlParam[]
         {
             DbHelper.MakeAndWhere("parentid", 0),
             DbHelper.MakeAndWhere("channelid", this.channelinfo.id),
             DbHelper.MakeAndWhere("appid", WhereType.In, this.sortappidlist),
             DbHelper.MakeAndWhere("hidden", 0)
         };
         OrderByParam    orderby = DbHelper.MakeOrderBy("display", OrderBy.ASC);
         List <SortInfo> list    = DbHelper.ExecuteList <SortInfo>(orderby, sqlparams);
         foreach (SortInfo sortInfo in list)
         {
             ExamLogInfo examLogInfo;
             if (this.userexamlog.ContainsKey(sortInfo.id))
             {
                 examLogInfo = this.userexamlog[sortInfo.id];
             }
             else
             {
                 examLogInfo = new ExamLogInfo();
             }
             examLogInfo.sortid    = sortInfo.id;
             examLogInfo.sortname  = sortInfo.name;
             examLogInfo.questions = sortInfo.posts;
             examLogInfo.subcounts = sortInfo.subcounts;
             this.examloglist.Add(examLogInfo);
         }
     }
 }
Esempio n. 5
0
 // Token: 0x060000BD RID: 189 RVA: 0x00012850 File Offset: 0x00010A50
 protected override void View()
 {
     this.channelinfo = ChannelBll.GetChannelInfo("exam_question");
     if (this.channelinfo.id == 0)
     {
         this.ShowErr("对不起,目前系统尚未创建题目库频道。");
     }
     else
     {
         string sqlstring = string.Format("SELECT COUNT([uid]) FROM (SELECT DISTINCT [uid] FROM [{0}Exam_ExamResult] WHERE [channelid]={1} AND [status]>0) AS TA", DbConfigs.Prefix, this.channelinfo.id);
         this.examusers   = this.GetScalarTotal(sqlstring);
         sqlstring        = string.Format("SELECT AVG([score]) FROM [{0}Exam_ExamResult] WHERE [channelid]={1} AND [uid]={2} AND [status]>0", DbConfigs.Prefix, this.channelinfo.id, this.userid);
         this.avg_my      = this.GetScalarTotal(sqlstring);
         sqlstring        = string.Format("SELECT AVG([score]) FROM [{0}Exam_ExamResult] WHERE [channelid]={1} AND [status]>0", DbConfigs.Prefix, this.channelinfo.id);
         this.avg_total   = this.GetScalarTotal(sqlstring);
         sqlstring        = string.Format("SELECT COUNT(*) FROM (SELECT [uid],AVG([score]) AS [scoreavg] FROM [{0}Exam_ExamResult] WHERE [channelid]={1} AND [status]>0 GROUP BY [uid]) AS TA WHERE [scoreavg]>{2}", DbConfigs.Prefix, this.channelinfo.id, this.avg_my);
         this.avg_display = FPUtils.StrToInt(this.GetScalarTotal(sqlstring)) + 1;
         sqlstring        = string.Format("SELECT SUM([answers]) AS [answers],SUM([wrongs]) AS [wrongs] FROM [{0}Exam_ExamLogInfo] WHERE [channelid]={1}", DbConfigs.Prefix, this.channelinfo.id);
         ExamLogInfo examLogInfo = this.GetExamLogInfo(sqlstring);
         this.accuracy_total   = examLogInfo.accuracy;
         sqlstring             = string.Format("SELECT SUM([answers]) AS [answers],SUM([wrongs]) AS [wrongs] FROM [{0}Exam_ExamLogInfo] WHERE [channelid]={1} AND [uid]={2}", DbConfigs.Prefix, this.channelinfo.id, this.userid);
         examLogInfo           = this.GetExamLogInfo(sqlstring);
         this.accuracy_my      = examLogInfo.accuracy;
         sqlstring             = string.Format("SELECT COUNT(*) FROM (SELECT [uid],SUM(wrongs) AS [wrongs] FROM [{0}Exam_ExamLogInfo] WHERE [channelid]={1} GROUP BY [uid]) AS TA WHERE [wrongs]<{2}", DbConfigs.Prefix, this.channelinfo.id, examLogInfo.wrongs);
         this.accuracy_display = FPUtils.StrToInt(this.GetScalarTotal(sqlstring)) + 1;
         SqlParam[] sqlparams = new SqlParam[]
         {
             DbHelper.MakeAndWhere("channelid", this.channelinfo.id),
             DbHelper.MakeAndWhere("status", WhereType.GreaterThan, 0),
             DbHelper.MakeAndWhere("uid", this.userid)
         };
         List <ExamResult> list = DbHelper.ExecuteList <ExamResult>(OrderBy.ASC, sqlparams);
         int num = 1;
         foreach (ExamResult examResult in list)
         {
             if (this.examresult != "")
             {
                 this.examresult += ",";
             }
             this.examresult += string.Format("['', {0}]", examResult.score);
             num++;
         }
         this.userexamlog = ExamBll.GetExamLogList(this.channelinfo.id, this.userid);
         List <SortAppInfo> sortAppList = SortBll.GetSortAppList("exam_");
         foreach (SortAppInfo sortAppInfo in sortAppList)
         {
             if (this.sortappidlist != "")
             {
                 this.sortappidlist += ",";
             }
             this.sortappidlist += sortAppInfo.id;
         }
         SqlParam[] sqlparams2 = new SqlParam[]
         {
             DbHelper.MakeAndWhere("parentid", 0),
             DbHelper.MakeAndWhere("channelid", this.channelinfo.id),
             DbHelper.MakeAndWhere("appid", WhereType.In, this.sortappidlist),
             DbHelper.MakeAndWhere("hidden", 0)
         };
         OrderByParam    orderby = DbHelper.MakeOrderBy("display", OrderBy.ASC);
         List <SortInfo> list2   = DbHelper.ExecuteList <SortInfo>(orderby, sqlparams2);
         foreach (SortInfo sortInfo in list2)
         {
             if (this.userexamlog.ContainsKey(sortInfo.id))
             {
                 examLogInfo = this.userexamlog[sortInfo.id];
             }
             else
             {
                 examLogInfo = new ExamLogInfo();
             }
             examLogInfo.sortid    = sortInfo.id;
             examLogInfo.sortname  = sortInfo.name;
             examLogInfo.questions = sortInfo.posts;
             examLogInfo.subcounts = sortInfo.subcounts;
             this.examloglist.Add(examLogInfo);
         }
     }
 }
Esempio n. 6
0
        // Token: 0x060000D6 RID: 214 RVA: 0x00015284 File Offset: 0x00013484
        protected override void View()
        {
            ExamQuestion examQuestion = DbHelper.ExecuteModel <ExamQuestion>(this.qid);

            if (examQuestion.id == 0)
            {
                this.ShowErrMsg("对不起,该题目不存在或已被删除。");
            }
            SortInfo sortInfo = SortBll.GetSortInfo(examQuestion.sortid);

            if (sortInfo.id == 0)
            {
                this.ShowErrMsg("对不起,该题目题库不存在或已被删除。");
            }
            foreach (int num in FPUtils.SplitInt(sortInfo.parentlist))
            {
                if (num != 0)
                {
                    ExamLogInfo examLogInfo = ExamBll.GetExamLogInfo(this.userid, num);
                    if (examLogInfo.sortid == 0)
                    {
                        examLogInfo.sortid    = examQuestion.sortid;
                        examLogInfo.channelid = examQuestion.channelid;
                        examLogInfo.uid       = this.userid;
                        examLogInfo.notes     = 1;
                        examLogInfo.notelist  = this.qid.ToString();
                        if (num == sortInfo.id)
                        {
                            examLogInfo.curnotes = 1;
                        }
                        DbHelper.ExecuteInsert <ExamLogInfo>(examLogInfo);
                    }
                    else
                    {
                        if (!FPUtils.InArray(this.qid, examLogInfo.notelist))
                        {
                            examLogInfo.notes++;
                            ExamLogInfo examLogInfo2 = examLogInfo;
                            examLogInfo2.notelist += ((examLogInfo.notelist == "") ? this.qid.ToString() : ("," + this.qid.ToString()));
                            if (num != sortInfo.id)
                            {
                                examLogInfo.curnotes++;
                            }
                        }
                        DbHelper.ExecuteUpdate <ExamLogInfo>(examLogInfo);
                    }
                }
            }
            SqlParam[] sqlparams = new SqlParam[]
            {
                DbHelper.MakeAndWhere("qid", this.qid),
                DbHelper.MakeAndWhere("uid", this.userid)
            };
            ExamNote examNote = DbHelper.ExecuteModel <ExamNote>(sqlparams);

            examNote.uid  = this.userid;
            examNote.qid  = this.qid;
            examNote.note = this.note;
            if (examNote.id > 0)
            {
                DbHelper.ExecuteUpdate <ExamNote>(examNote);
            }
            else
            {
                DbHelper.ExecuteInsert <ExamNote>(examNote);
            }
            Hashtable hashtable = new Hashtable();

            hashtable["error"]   = 0;
            hashtable["message"] = "";
            base.Response.AddHeader("Content-Type", "text/html; charset=UTF-8");
            base.Response.Write(JsonMapper.ToJson(hashtable));
            base.Response.End();
        }
Esempio n. 7
0
        // Token: 0x060000CF RID: 207 RVA: 0x000148B4 File Offset: 0x00012AB4
        protected string GetChildSort(int channelid, int parentid, int level)
        {
            SqlParam[] sqlparams = new SqlParam[]
            {
                DbHelper.MakeAndWhere("parentid", parentid),
                DbHelper.MakeAndWhere("channelid", channelid),
                DbHelper.MakeAndWhere("appid", WhereType.In, this.sortappidlist),
                DbHelper.MakeAndWhere("hidden", 0)
            };
            OrderByParam    orderby       = DbHelper.MakeOrderBy("display", OrderBy.ASC);
            List <SortInfo> list          = DbHelper.ExecuteList <SortInfo>(orderby, sqlparams);
            StringBuilder   stringBuilder = new StringBuilder();

            foreach (SortInfo sortInfo in list)
            {
                ExamLogInfo examLogInfo;
                if (this.userexamlog.ContainsKey(sortInfo.id))
                {
                    examLogInfo = this.userexamlog[sortInfo.id];
                }
                else
                {
                    examLogInfo        = new ExamLogInfo();
                    examLogInfo.sortid = sortInfo.id;
                }
                stringBuilder.AppendFormat("<tr class=\"keypoint keypoint-level-{0} child_row_{1}\">\r\n", level, sortInfo.parentid);
                if (sortInfo.subcounts > 0)
                {
                    if (examLogInfo.favs > 0)
                    {
                        stringBuilder.AppendFormat("<td class=\"name-col\"><span class=\"text toggle-expand\"><span id=\"row_{0}\" class=\"sprite sprite-expand i-20\"></span>\r\n", sortInfo.id);
                        stringBuilder.AppendFormat("<a href=\"questionview.aspx?sortid={0}&action=fav\" target=\"_blank\" class=\"btn btn-link link-button\">{1}(共{2}道收藏)</a>\r\n", sortInfo.id, sortInfo.name, examLogInfo.favs);
                        stringBuilder.AppendFormat("</span></td>\r\n", new object[0]);
                    }
                    else
                    {
                        stringBuilder.AppendFormat("<td class=\"name-col\"><span class=\"text toggle-expand\"><span id=\"row_{1}\" class=\"sprite sprite-expand i-20\"></span>{0}(共{2}道收藏)</span></td>\r\n", sortInfo.name, sortInfo.id, examLogInfo.favs);
                    }
                }
                else if (examLogInfo.favs > 0)
                {
                    stringBuilder.AppendFormat("<td class=\"name-col\"><span class=\"text\"><span class=\"sprite sprite-expand-holder i-20\"></span>\r\n", new object[0]);
                    stringBuilder.AppendFormat("<a href=\"questionview.aspx?sortid={0}&action=fav\" target=\"_blank\" class=\"btn btn-link link-button\">{1}(共{2}道收藏)</a>\r\n", sortInfo.id, sortInfo.name, examLogInfo.favs);
                    stringBuilder.AppendFormat("</span></td>\r\n", new object[0]);
                }
                else
                {
                    stringBuilder.AppendFormat("<td class=\"name-col\"><span class=\"text\"><span class=\"sprite sprite-expand-holder i-20\"></span>{0}(共{1}道收藏)</span></td>\r\n", sortInfo.name, examLogInfo.favs);
                }
                stringBuilder.AppendFormat("<td class=\"button-col\">", new object[0]);
                if (examLogInfo.favs > 0)
                {
                    stringBuilder.AppendFormat("<a href=\"questionview.aspx?sortid={0}&action=fav\" target=\"_blank\" class=\"btn btn-link link-button\"><span class=\"btn-inner\">查看题目</span></a>", sortInfo.id);
                }
                else
                {
                    stringBuilder.AppendFormat("<span class=\"btn-inner\">查看题目</span>", new object[0]);
                }
                stringBuilder.Append("</td></tr>\r\n");
                if (sortInfo.subcounts > 0)
                {
                    stringBuilder.Append(this.GetChildSort(channelid, sortInfo.id, level + 1));
                }
            }
            return(stringBuilder.ToString());
        }
Esempio n. 8
0
        // Token: 0x060000CB RID: 203 RVA: 0x0001420C File Offset: 0x0001240C
        protected override void View()
        {
            ExamQuestion examQuestion = DbHelper.ExecuteModel <ExamQuestion>(this.qid);

            if (examQuestion.id == 0)
            {
                this.ShowErrMsg("对不起,该题目不存在或已被删除。");
            }
            SortInfo sortInfo = SortBll.GetSortInfo(examQuestion.sortid);

            if (this.option == 1)
            {
                foreach (int num in FPUtils.SplitInt(sortInfo.parentlist))
                {
                    if (num != 0)
                    {
                        ExamLogInfo examLogInfo = ExamBll.GetExamLogInfo(this.userid, num);
                        if (examLogInfo.sortid == 0)
                        {
                            examLogInfo.sortid    = examQuestion.sortid;
                            examLogInfo.channelid = examQuestion.channelid;
                            examLogInfo.uid       = this.userid;
                            examLogInfo.favs      = 1;
                            if (num == sortInfo.id)
                            {
                                examLogInfo.curfavs = 1;
                            }
                            examLogInfo.favlist = this.qid.ToString();
                            DbHelper.ExecuteInsert <ExamLogInfo>(examLogInfo);
                        }
                        else
                        {
                            examLogInfo.favs++;
                            if (num == sortInfo.id)
                            {
                                examLogInfo.curfavs++;
                            }
                            ExamLogInfo examLogInfo2 = examLogInfo;
                            examLogInfo2.favlist += ((examLogInfo.favlist == "") ? this.qid.ToString() : ("," + this.qid.ToString()));
                            DbHelper.ExecuteUpdate <ExamLogInfo>(examLogInfo);
                        }
                    }
                }
            }
            else if (this.option == -1)
            {
                foreach (int num in FPUtils.SplitInt(sortInfo.parentlist))
                {
                    if (num != 0)
                    {
                        ExamLogInfo examLogInfo = ExamBll.GetExamLogInfo(this.userid, num);
                        if (examLogInfo.sortid != 0)
                        {
                            if (FPUtils.InArray(this.qid, examLogInfo.favlist))
                            {
                                examLogInfo.favs--;
                                if (num == sortInfo.id)
                                {
                                    examLogInfo.curfavs--;
                                }
                                string text = "";
                                foreach (int num2 in FPUtils.SplitInt(examLogInfo.favlist))
                                {
                                    if (num2 != this.qid)
                                    {
                                        text += ((text == "") ? num2.ToString() : ("," + num2.ToString()));
                                    }
                                }
                                examLogInfo.favlist = text;
                                DbHelper.ExecuteUpdate <ExamLogInfo>(examLogInfo);
                            }
                        }
                    }
                }
            }
            Hashtable hashtable = new Hashtable();

            hashtable["error"]   = 0;
            hashtable["message"] = "";
            hashtable["action"]  = this.option;
            base.Response.AddHeader("Content-Type", "text/html; charset=UTF-8");
            base.Response.Write(JsonMapper.ToJson(hashtable));
            base.Response.End();
        }
Esempio n. 9
0
 // Token: 0x060000D9 RID: 217 RVA: 0x000155E0 File Offset: 0x000137E0
 protected override void View()
 {
     this.examconfig = ExamConifgs.GetExamConfig();
     this.sortinfo   = SortBll.GetSortInfo(this.sortid);
     if (this.sortinfo.id == 0)
     {
         this.ShowErr("对不起,该题库不存在或已被删除。");
     }
     else
     {
         SqlParam[] sqlparams = new SqlParam[]
         {
             DbHelper.MakeAndWhere("sortid", this.sortid),
             DbHelper.MakeAndWhere("uid", this.userid)
         };
         this.examloginfo = DbHelper.ExecuteModel <ExamLogInfo>(sqlparams);
         if (this.examloginfo.sortid != 0)
         {
             this.channelid             = this.examloginfo.channelid;
             this.examloginfo.questions = this.sortinfo.posts;
             this.examloglist           = ExamBll.GetExamLogList(this.channelid, this.userid);
             string text = "";
             if (this.action == "wrong")
             {
                 this.pagenav = string.Concat(new object[]
                 {
                     "错题(",
                     this.sortinfo.name,
                     ")共",
                     this.examloginfo.wrongs,
                     "道题目"
                 });
                 text = this.examloginfo.wronglist;
             }
             else if (this.action == "note")
             {
                 this.pagenav = string.Concat(new object[]
                 {
                     "笔记(",
                     this.sortinfo.name,
                     ")共",
                     this.examloginfo.notes,
                     "道题目"
                 });
                 text = this.examloginfo.notelist;
             }
             else if (this.action == "fav")
             {
                 this.pagenav = string.Concat(new object[]
                 {
                     "收藏(",
                     this.sortinfo.name,
                     ")共",
                     this.examloginfo.favs,
                     "道题目"
                 });
                 text = this.examloginfo.favlist;
             }
             if (text != "")
             {
                 SqlParam     sqlParam = DbHelper.MakeAndWhere("id", WhereType.In, text);
                 OrderByParam orderby  = DbHelper.MakeOrderBy("type", OrderBy.ASC);
                 this.questionlist = DbHelper.ExecuteList <ExamQuestion>(orderby, new SqlParam[]
                 {
                     sqlParam
                 });
                 SqlParam[] sqlparams2 = new SqlParam[]
                 {
                     DbHelper.MakeAndWhere("qid", WhereType.In, text),
                     DbHelper.MakeAndWhere("uid", this.userid)
                 };
                 List <ExamNote> list = DbHelper.ExecuteList <ExamNote>(sqlparams2);
                 for (int i = 0; i < this.questionlist.Count; i++)
                 {
                     if (FPUtils.InArray(this.questionlist[i].id, this.examloginfo.favlist))
                     {
                         this.questionlist[i].isfav = 1;
                     }
                     foreach (ExamNote examNote in list)
                     {
                         if (examNote.qid == this.questionlist[i].id)
                         {
                             this.questionlist[i].note = examNote.note;
                         }
                     }
                     if (this.examloglist.ContainsKey(this.questionlist[i].sortid))
                     {
                         ExamLogInfo examLogInfo = this.examloglist[this.questionlist[i].sortid];
                         if (FPUtils.InArray(this.questionlist[i].id, examLogInfo.qidlist))
                         {
                             int[]    array  = FPUtils.SplitInt(examLogInfo.qidlist);
                             string[] array2 = FPUtils.SplitString(examLogInfo.optionlist, "|", array.Length);
                             string[] array3 = FPUtils.SplitString(examLogInfo.answerlist, "§", array.Length);
                             for (int j = 0; j < array.Length; j++)
                             {
                                 if (array[j] == this.questionlist[i].id)
                                 {
                                     this.questionlist[i].useranswer = array3[j];
                                     this.questionlist[i].optionlist = array2[j];
                                     this.questionlist[i].answer     = this.OptionAnswer(array2[j], this.questionlist[i].answer);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Esempio n. 10
0
 // Token: 0x06000024 RID: 36 RVA: 0x0000349C File Offset: 0x0000169C
 public static void UpdateExamLog(SortInfo sortinfo, int uid, ExamQuestion question, bool iswrong)
 {
     foreach (int num in FPUtils.SplitInt(sortinfo.parentlist))
     {
         if (num != 0)
         {
             ExamLogInfo examLogInfo = ExamBll.GetExamLogInfo(uid, num);
             if (examLogInfo.sortid == 0)
             {
                 examLogInfo.sortid    = num;
                 examLogInfo.uid       = uid;
                 examLogInfo.channelid = sortinfo.channelid;
                 examLogInfo.answers   = 1;
                 examLogInfo.wrongs    = (iswrong ? 1 : 0);
                 if (num == sortinfo.id)
                 {
                     examLogInfo.curwrongs = (iswrong ? 1 : 0);
                 }
                 examLogInfo.qidlist    = question.id.ToString();
                 examLogInfo.optionlist = question.optionlist;
                 examLogInfo.answerlist = question.useranswer;
                 examLogInfo.scorelist  = (iswrong ? "0" : "1");
                 examLogInfo.wronglist  = (iswrong ? question.id.ToString() : "");
                 DbHelper.ExecuteInsert <ExamLogInfo>(examLogInfo);
             }
             else
             {
                 if (FPUtils.InArray(question.id, examLogInfo.qidlist))
                 {
                     int[]    array2 = FPUtils.SplitInt(examLogInfo.qidlist);
                     string[] array3 = FPUtils.SplitString(examLogInfo.optionlist, "|", array2.Length);
                     int[]    array4 = FPUtils.SplitInt(examLogInfo.scorelist, ",", array2.Length);
                     string[] array5 = FPUtils.SplitString(examLogInfo.answerlist, "§", array2.Length);
                     string   text   = "";
                     string   text2  = "";
                     string   text3  = "";
                     for (int j = 0; j < array2.Length; j++)
                     {
                         if (array2[j] == question.id)
                         {
                             if (array4[j] == 1 && iswrong)
                             {
                                 array4[j] = 0;
                                 array5[j] = question.useranswer;
                                 array3[j] = question.optionlist;
                                 examLogInfo.wrongs++;
                                 if (num == sortinfo.id)
                                 {
                                     examLogInfo.curwrongs++;
                                 }
                                 if (examLogInfo.wronglist != "")
                                 {
                                     ExamLogInfo examLogInfo2 = examLogInfo;
                                     examLogInfo2.wronglist += ",";
                                 }
                                 ExamLogInfo examLogInfo3 = examLogInfo;
                                 examLogInfo3.wronglist += question.id;
                             }
                             else if (array4[j] == 0 && !iswrong)
                             {
                                 array4[j] = 1;
                                 array5[j] = question.useranswer;
                                 array3[j] = question.optionlist;
                                 examLogInfo.wrongs--;
                                 if (num == sortinfo.id)
                                 {
                                     examLogInfo.curwrongs--;
                                 }
                                 string text4 = "";
                                 foreach (int num2 in FPUtils.SplitInt(examLogInfo.wronglist))
                                 {
                                     if (num2 != question.id)
                                     {
                                         if (text4 != "")
                                         {
                                             text4 += ",";
                                         }
                                         text4 += num2;
                                     }
                                 }
                                 examLogInfo.wronglist = text4;
                             }
                         }
                         if (text != "")
                         {
                             text += ",";
                         }
                         text += array4[j];
                         if (text2 != "")
                         {
                             text2 += "§";
                         }
                         text2 += array5[j];
                         if (text3 != "")
                         {
                             text3 += "|";
                         }
                         text3 += array3[j];
                     }
                     examLogInfo.scorelist  = text;
                     examLogInfo.answerlist = text2;
                     examLogInfo.optionlist = text3;
                 }
                 else
                 {
                     examLogInfo.answers++;
                     examLogInfo.wrongs += (iswrong ? 1 : 0);
                     if (num == sortinfo.id)
                     {
                         examLogInfo.curwrongs += (iswrong ? 1 : 0);
                     }
                     ExamLogInfo examLogInfo4 = examLogInfo;
                     examLogInfo4.qidlist += ((examLogInfo.qidlist == "") ? question.id.ToString() : ("," + question.id.ToString()));
                     if (iswrong)
                     {
                         ExamLogInfo examLogInfo5 = examLogInfo;
                         examLogInfo5.scorelist += ((examLogInfo.scorelist == "") ? "0" : ",0");
                         ExamLogInfo examLogInfo6 = examLogInfo;
                         examLogInfo6.wronglist += ((examLogInfo.wronglist == "") ? question.id.ToString() : ("," + question.id.ToString()));
                     }
                     else
                     {
                         ExamLogInfo examLogInfo7 = examLogInfo;
                         examLogInfo7.scorelist += ((examLogInfo.scorelist == "") ? "1" : ",1");
                     }
                     ExamLogInfo examLogInfo8 = examLogInfo;
                     examLogInfo8.answerlist += ((examLogInfo.answerlist == "") ? question.useranswer : ("§" + question.useranswer));
                     ExamLogInfo examLogInfo9 = examLogInfo;
                     examLogInfo9.optionlist += ((examLogInfo.optionlist == "") ? question.optionlist : ("|" + question.optionlist));
                 }
                 DbHelper.ExecuteUpdate <ExamLogInfo>(examLogInfo);
             }
         }
     }
 }