Exemple #1
0
        // Token: 0x0600008F RID: 143 RVA: 0x0000E224 File Offset: 0x0000C424
        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.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.optionlist = array3[num];
                        list2.Add(examQuestion);
                    }
                }
                num++;
            }
            return(list2);
        }
Exemple #2
0
        // Token: 0x06000088 RID: 136 RVA: 0x0000BCCC File Offset: 0x00009ECC
        protected override void View()
        {
            SqlParam     sqlParam = DbHelper.MakeAndWhere("parentid", 0);
            OrderByParam orderby  = DbHelper.MakeOrderBy("display", OrderBy.ASC);

            this.menulist = DbHelper.ExecuteList <MenuInfo>(orderby, new SqlParam[]
            {
                sqlParam
            });
            if (this.Session["FP_ADMIN_TOPMENU"] != null)
            {
                this.topmenuid = FPUtils.StrToInt(this.Session["FP_ADMIN_TOPMENU"].ToString(), 0);
            }
            if (this.topmenuid == 0)
            {
                if (this.roleid == 1)
                {
                    this.topmenuid = 1;
                }
                else if (this.role.menus != "")
                {
                    this.topmenuid = FPUtils.SplitInt(this.role.menus)[0];
                }
            }
        }
Exemple #3
0
 // Token: 0x0600008E RID: 142 RVA: 0x0000C0C8 File Offset: 0x0000A2C8
 protected override void View()
 {
     if (this.ispost)
     {
         string @string = FPRequest.GetString("chkid");
         foreach (int id in FPUtils.SplitInt(@string))
         {
             CreditInfo creditInfo = DbHelper.ExecuteModel <CreditInfo>(id);
             if (DbHelper.ExecuteDelete <CreditInfo>(id) > 0)
             {
                 string sqlstring = string.Format("UPDATE [{0}WMS_UserInfo] SET [credits]=[credits]+{1} WHERE [id]={2}", DbConfigs.Prefix, creditInfo.credits * -1, creditInfo.uid);
                 DbHelper.ExecuteSql(sqlstring);
             }
         }
     }
     if (this.uid > 0)
     {
         SqlParam sqlParam = DbHelper.MakeAndWhere("uid", this.uid);
         this.creditlist = DbHelper.ExecuteList <CreditInfo>(this.pager, new SqlParam[]
         {
             sqlParam
         });
     }
     else
     {
         this.creditlist = DbHelper.ExecuteList <CreditInfo>(this.pager);
     }
     this.iuser = UserBll.GetUserInfo(this.uid);
     base.SaveRightURL();
 }
Exemple #4
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);
        }
        // Token: 0x06000049 RID: 73 RVA: 0x00007D4C File Offset: 0x00005F4C
        protected override void View()
        {
            ExamTopic examTopic = DbHelper.ExecuteModel <ExamTopic>(this.tid);

            if (!FPUtils.InArray(this.qid, examTopic.questionlist) && this.tid > 0 && this.qid > 0 && this.option == 1)
            {
                if (examTopic.curquestions >= examTopic.questions - examTopic.randoms)
                {
                    this.ShowErrMsg("该大题题目数已满,不能再添加题目");
                    return;
                }
                examTopic.questionlist = ((examTopic.questionlist == "") ? this.qid.ToString() : (examTopic.questionlist + "," + this.qid));
                examTopic.curquestions = FPUtils.SplitInt(examTopic.questionlist).Length;
                SqlParam[] sqlparams = new SqlParam[]
                {
                    DbHelper.MakeSet("questionlist", examTopic.questionlist),
                    DbHelper.MakeSet("curquestions", examTopic.curquestions),
                    DbHelper.MakeAndWhere("id", this.tid)
                };
                DbHelper.ExecuteUpdate <ExamTopic>(sqlparams);
            }
            if (this.tid > 0 && this.qid > 0 && this.option == -1)
            {
                string text = "";
                foreach (int num in FPUtils.SplitInt(examTopic.questionlist))
                {
                    if (this.qid != num && num != 0)
                    {
                        if (text != "")
                        {
                            text += ",";
                        }
                        text += num;
                    }
                }
                examTopic.questionlist = text;
                examTopic.curquestions = FPUtils.SplitInt(examTopic.questionlist).Length;
                SqlParam[] sqlparams = new SqlParam[]
                {
                    DbHelper.MakeSet("questionlist", examTopic.questionlist),
                    DbHelper.MakeSet("curquestions", examTopic.curquestions),
                    DbHelper.MakeAndWhere("id", this.tid)
                };
                DbHelper.ExecuteUpdate <ExamTopic>(sqlparams);
            }
            Hashtable hashtable = new Hashtable();

            hashtable["error"]        = 0;
            hashtable["curquestions"] = examTopic.curquestions;
            hashtable["questionlist"] = examTopic.questionlist;
            hashtable["action"]       = this.option;
            base.Response.AddHeader("Content-Type", "text/html; charset=UTF-8");
            base.Response.Write(JsonMapper.ToJson(hashtable));
            base.Response.End();
        }
Exemple #6
0
        // Token: 0x06000033 RID: 51 RVA: 0x00004124 File Offset: 0x00002324
        public static string GetTopicQuestion(int channelid, ExamTopic examtopic)
        {
            string text = examtopic.questionlist;
            string type;

            if (examtopic.type == -1)
            {
                type = "1,2";
            }
            else
            {
                type = examtopic.type.ToString();
            }
            if (examtopic.curquestions < examtopic.questions)
            {
                if (examtopic.randoms > 0)
                {
                    int[] array  = FPUtils.SplitInt(examtopic.randomsort);
                    int[] array2 = FPUtils.SplitInt(examtopic.randomcount, ",", array.Length);
                    for (int i = 0; i < array.Length; i++)
                    {
                        if (array2[i] > 0)
                        {
                            string questionRandom = QuestionBll.GetQuestionRandom(channelid, array2[i], type, array[i], text);
                            if (questionRandom != "")
                            {
                                text += ((text == "") ? questionRandom : ("," + questionRandom));
                            }
                        }
                    }
                    if (examtopic.questions - examtopic.curquestions - examtopic.randoms > 0)
                    {
                        string questionRandom = QuestionBll.GetQuestionRandom(channelid, examtopic.questions - examtopic.curquestions - examtopic.randoms - 1, type, "", text);
                        if (questionRandom != "")
                        {
                            text += ((text == "") ? questionRandom : ("," + questionRandom));
                        }
                    }
                }
                else
                {
                    int    count          = examtopic.questions - examtopic.curquestions;
                    string questionRandom = QuestionBll.GetQuestionRandom(channelid, count, type, "", text);
                    if (questionRandom != "")
                    {
                        text += ((text == "") ? questionRandom : ("," + questionRandom));
                    }
                }
            }
            return(text);
        }
Exemple #7
0
        // Token: 0x0600001E RID: 30 RVA: 0x00002C3C File Offset: 0x00000E3C
        protected string GetSortNav(SortInfo sortinfo, string url)
        {
            string text = "";

            if (url.IndexOf("?") > 0)
            {
                url += "&";
            }
            else
            {
                url += "?";
            }
            url = this.rawpath + "/" + url;
            SqlParam        sqlParam = DbHelper.MakeAndWhere("id", WhereType.In, sortinfo.parentlist);
            List <SortInfo> list     = DbHelper.ExecuteList <SortInfo>(new SqlParam[]
            {
                sqlParam
            });

            foreach (int num in FPUtils.SplitInt(sortinfo.parentlist))
            {
                if (num != 0)
                {
                    foreach (SortInfo sortInfo in list)
                    {
                        if (sortInfo.id == num)
                        {
                            if (text != "")
                            {
                                text += "|";
                            }
                            object obj = text;
                            text = string.Concat(new object[]
                            {
                                obj,
                                sortInfo.name,
                                ",",
                                url,
                                "channelid=",
                                sortInfo.channelid,
                                "&sortid=",
                                sortInfo.id
                            });
                        }
                    }
                }
            }
            return(text);
        }
Exemple #8
0
 // Token: 0x0600004C RID: 76 RVA: 0x0000689C File Offset: 0x00004A9C
 protected override void View()
 {
     if (this.sysconfig.admintitle == "")
     {
         this.pagetitle = this.siteconfig.sitetitle;
     }
     else
     {
         this.pagetitle = this.sysconfig.admintitle;
     }
     if (this.Session["FP_ADMIN_LEFTMENU"] != null)
     {
         this.lefturl = this.Session["FP_ADMIN_LEFTMENU"].ToString();
     }
     if (string.IsNullOrEmpty(this.lefturl))
     {
         if (this.role.menus != "" && this.roleid != 1)
         {
             MenuInfo menuInfo = DbHelper.ExecuteModel <MenuInfo>(FPUtils.SplitInt(this.role.menus)[0]);
             this.lefturl = menuInfo.lefturl;
             if (this.lefturl != "")
             {
                 if (this.lefturl.IndexOf("?") > 0)
                 {
                     this.lefturl = this.lefturl + "&topmenuid=" + menuInfo.id;
                 }
                 else
                 {
                     this.lefturl = this.lefturl + "?topmenuid=" + menuInfo.id;
                 }
             }
         }
         if (this.lefturl == "")
         {
             this.lefturl = "sysmenu.aspx?parentid=1";
         }
     }
     if (this.Session["FP_ADMIN_RIGHTMENU"] != null)
     {
         this.righturl = this.Session["FP_ADMIN_RIGHTMENU"].ToString();
     }
     if (string.IsNullOrEmpty(this.righturl))
     {
         this.righturl = this.role.desktopurl;
     }
 }
Exemple #9
0
 // Token: 0x060000AC RID: 172 RVA: 0x0000DBA8 File Offset: 0x0000BDA8
 protected override void View()
 {
     if (this.ispost)
     {
         if (this.action == "delete")
         {
             foreach (int num in FPUtils.SplitInt(FPRequest.GetString("chkdel")))
             {
                 if (num > 5)
                 {
                     DbHelper.ExecuteDelete <RoleInfo>(num);
                 }
             }
         }
     }
     this.rolelist = DbHelper.ExecuteList <RoleInfo>(OrderBy.ASC);
     base.SaveRightURL();
 }
Exemple #10
0
        // Token: 0x0600006C RID: 108 RVA: 0x0000B3BC File Offset: 0x000095BC
        protected override void View()
        {
            SqlParam        sqlParam = DbHelper.MakeAndWhere("id", WhereType.In, this.examuser);
            List <UserInfo> list     = DbHelper.ExecuteList <UserInfo>(new SqlParam[]
            {
                sqlParam
            });
            string text  = "";
            string text2 = "";

            foreach (int num in FPUtils.SplitInt(this.examuser))
            {
                foreach (UserInfo userInfo in list)
                {
                    if (num == userInfo.id && !FPUtils.InArray(num, text2))
                    {
                        if (text != "")
                        {
                            text += ",";
                        }
                        if (userInfo.realname != "")
                        {
                            text += userInfo.realname;
                        }
                        else
                        {
                            text += userInfo.username;
                        }
                        if (text2 != "")
                        {
                            text2 += ",";
                        }
                        text2 += num;
                    }
                }
            }
            Hashtable hashtable = new Hashtable();

            hashtable["error"] = 0;
            hashtable["uname"] = text;
            base.Response.AddHeader("Content-Type", "text/html; charset=UTF-8");
            base.Response.Write(JsonMapper.ToJson(hashtable));
            base.Response.End();
        }
Exemple #11
0
        // Token: 0x06000099 RID: 153 RVA: 0x0000ED58 File Offset: 0x0000CF58
        private string OptionAnswer(string optionlist, string answer)
        {
            string[] array  = FPUtils.SplitString("A,B,C,D,E,F");
            int[]    array2 = FPUtils.SplitInt(optionlist);
            string   text   = "";

            for (int i = 0; i < array2.Length; i++)
            {
                if (FPUtils.InArray(array[array2[i]], answer))
                {
                    if (text != "")
                    {
                        text += ",";
                    }
                    text += array[i];
                }
            }
            return(text);
        }
Exemple #12
0
        // Token: 0x06000098 RID: 152 RVA: 0x0000EC64 File Offset: 0x0000CE64
        protected string Option(string[] opstr, int ascount, string optionlist)
        {
            string[] array  = FPUtils.SplitString("A,B,C,D,E,F");
            int[]    array2 = FPUtils.SplitInt(optionlist, ",", ascount);
            string   text   = "";

            if (ascount > opstr.Length)
            {
                ascount = opstr.Length;
            }
            for (int i = 0; i < ascount; i++)
            {
                if (optionlist != "")
                {
                    string text2 = text;
                    text = string.Concat(new string[]
                    {
                        text2,
                        array[i],
                        ".",
                        opstr[array2[i]],
                        "<br/>"
                    });
                }
                else
                {
                    string text2 = text;
                    text = string.Concat(new string[]
                    {
                        text2,
                        array[i],
                        ".",
                        opstr[i],
                        "<br/>"
                    });
                }
            }
            return(text);
        }
Exemple #13
0
        // Token: 0x06000062 RID: 98 RVA: 0x0000A734 File Offset: 0x00008934
        protected List <ExamQuestion> GetQuestionList(string questionids)
        {
            SqlParam            sqlParam = DbHelper.MakeAndWhere("id", WhereType.In, questionids);
            List <ExamQuestion> list     = DbHelper.ExecuteList <ExamQuestion>(new SqlParam[]
            {
                sqlParam
            });
            List <ExamQuestion> list2 = new List <ExamQuestion>();

            foreach (int num in FPUtils.SplitInt(questionids))
            {
                foreach (ExamQuestion examQuestion in list)
                {
                    if (examQuestion.id == num)
                    {
                        examQuestion.optionlist = this.OptionInt(examQuestion.ascount, this.examinfo.optiondisplay);
                        list2.Add(examQuestion);
                    }
                }
            }
            return(list2);
        }
Exemple #14
0
 // Token: 0x0600009F RID: 159 RVA: 0x0000F068 File Offset: 0x0000D268
 protected override void View()
 {
     this.channelinfo = ChannelBll.GetChannelInfo(this.channelid);
     if (this.channelinfo.id == 0)
     {
         this.ShowErr("考试频道不存在或已被删除。");
     }
     else
     {
         this.sortlist = SortBll.GetSortList(this.channelid, 0);
         List <SqlParam> list = new List <SqlParam>();
         list.Add(DbHelper.MakeAndWhere("status", 1));
         if (this.channelid > 0)
         {
             list.Add(DbHelper.MakeAndWhere("channelid", this.channelid));
         }
         if (this.sortid > 0)
         {
             string childSorts = SortBll.GetChildSorts(this.sortid);
             list.Add(DbHelper.MakeAndWhere("sortid", WhereType.In, childSorts));
         }
         if (FPUtils.IsNumericArray(this.typeid))
         {
             StringBuilder stringBuilder = new StringBuilder();
             foreach (int num in FPUtils.SplitInt(this.typeid))
             {
                 if (!string.IsNullOrEmpty(stringBuilder.ToString()))
                 {
                     stringBuilder.Append(" OR ");
                 }
                 stringBuilder.AppendFormat("(','+[typelist]+',') LIKE '%,{0},%'", num);
             }
             list.Add(DbHelper.MakeAndWhere("(" + stringBuilder.ToString() + ")", WhereType.Custom, ""));
         }
         list.Add(DbHelper.MakeAndWhere(string.Format("(([examroles]='' AND [examdeparts]='' AND [examuser]='') OR (','+[examroles]+',') LIKE '%,{0},%' OR (','+[examdeparts]+',') LIKE '%,{1},%' OR (','+[examuser]+',') LIKE '%,{2},%')", this.roleid, this.departid, this.userid), WhereType.Custom, ""));
         this._examlist = DbHelper.ExecuteList <ExamInfo>(this.pager, list.ToArray());
         this.pagenav   = this.channelinfo.name;
     }
 }
Exemple #15
0
        // Token: 0x0600003E RID: 62 RVA: 0x00005E4C File Offset: 0x0000404C
        protected override void View()
        {
            if (this.ispost)
            {
                if (this.action == "delete")
                {
                    SqlParam[] sqlparams = new SqlParam[]
                    {
                        DbHelper.MakeAndWhere("system", WhereType.NotEqual, 1),
                        DbHelper.MakeAndWhere("id", WhereType.In, FPRequest.GetString("chkdel"))
                    };
                    DbHelper.ExecuteDelete <MenuInfo>(sqlparams);
                }
                else if (this.action == "desk")
                {
                    int[] array = FPUtils.SplitInt(FPRequest.GetString("chkdel"));
                    foreach (int id in array)
                    {
                        MenuInfo menuInfo = DbHelper.ExecuteModel <MenuInfo>(id);
                        DbHelper.ExecuteInsert <DesktopInfo>(new DesktopInfo
                        {
                            name     = menuInfo.name,
                            lefturl  = menuInfo.lefturl,
                            righturl = menuInfo.righturl
                        });
                    }
                }
                base.Response.Redirect("sysmenumanage.aspx");
            }
            SqlParam     sqlParam = DbHelper.MakeAndWhere("parentid", 0);
            OrderByParam orderby  = DbHelper.MakeOrderBy("display", OrderBy.ASC);

            this.menulist = DbHelper.ExecuteList <MenuInfo>(orderby, new SqlParam[]
            {
                sqlParam
            });
            base.SaveRightURL();
        }
Exemple #16
0
        // Token: 0x06000064 RID: 100 RVA: 0x0000A848 File Offset: 0x00008A48
        protected string Option(AsposeWordApp wd, string[] opstr, int ascount, string optionlist)
        {
            string[] array  = FPUtils.SplitString("A,B,C,D,E,F");
            int[]    array2 = FPUtils.SplitInt(optionlist, ",", ascount);
            string   result = "";

            if (ascount > opstr.Length)
            {
                ascount = opstr.Length;
            }
            for (int i = 0; i < ascount; i++)
            {
                if (optionlist != "")
                {
                    wd.Writeln(array[i] + "." + opstr[array2[i]], 12.0, false, "left");
                }
                else
                {
                    wd.Writeln(array[i] + "." + opstr[i], 12.0, false, "left");
                }
            }
            return(result);
        }
Exemple #17
0
        // Token: 0x06000082 RID: 130 RVA: 0x0000D130 File Offset: 0x0000B330
        protected override void View()
        {
            if (this.ispost)
            {
                int   @int  = FPRequest.GetInt("uid");
                int[] array = FPUtils.SplitInt(this.examuser);
                this.examuser = "";
                foreach (int num in array)
                {
                    if (num != @int)
                    {
                        if (this.examuser != "")
                        {
                            this.examuser += ",";
                        }
                        this.examuser += num;
                    }
                }
                base.Response.Redirect(string.Concat(new string[]
                {
                    this.pagename,
                    "?examuser="******"&keyword=",
                    this.keyword
                }));
            }
            List <SqlParam> list = new List <SqlParam>();

            list.Add(DbHelper.MakeAndWhere("id", WhereType.In, this.examuser));
            if (this.keyword != "")
            {
                list.Add(DbHelper.MakeAndWhere("username", WhereType.Like, this.keyword));
                list.Add(DbHelper.MakeOrWhere("realname", WhereType.Like, this.keyword));
            }
            this.userlist = DbHelper.ExecuteList <UserInfo>(list.ToArray());
        }
Exemple #18
0
        // Token: 0x06000034 RID: 52 RVA: 0x00004328 File Offset: 0x00002528
        public static List <ExamQuestion> GetQuestionList(string qidlist)
        {
            SqlParam            sqlParam = DbHelper.MakeAndWhere("id", WhereType.In, qidlist);
            List <ExamQuestion> list     = DbHelper.ExecuteList <ExamQuestion>(new SqlParam[]
            {
                sqlParam
            });

            int[] array = FPUtils.SplitInt(qidlist);
            List <ExamQuestion> list2 = new List <ExamQuestion>();

            foreach (int num in array)
            {
                if (num != 0)
                {
                    bool flag = false;
                    foreach (ExamQuestion examQuestion in list)
                    {
                        if (examQuestion.id == num)
                        {
                            list2.Add(examQuestion);
                            flag = true;
                            break;
                        }
                    }
                    if (!flag)
                    {
                        list2.Add(new ExamQuestion
                        {
                            id = num
                        });
                    }
                }
            }
            return(list2);
        }
Exemple #19
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);
             }
         }
     }
 }
        // Token: 0x06000052 RID: 82 RVA: 0x00008B8C File Offset: 0x00006D8C
        protected override void View()
        {
            this.examtopic   = DbHelper.ExecuteModel <ExamTopic>(this.examtopicid);
            this.examinfo    = DbHelper.ExecuteModel <ExamInfo>(this.examtopic.examid);
            this.sortinfo    = SortBll.GetSortInfo(this.examinfo.sortid);
            this.channelinfo = ChannelBll.GetChannelInfo("exam_question");
            this.channelid   = this.channelinfo.id;
            this.sortlist    = SortBll.GetSortList(this.channelid, 0);
            if (this.ispost)
            {
                string          text     = "";
                string          text2    = "";
                SqlParam        sqlParam = DbHelper.MakeAndWhere("channelid", this.channelid);
                List <SortInfo> list     = DbHelper.ExecuteList <SortInfo>(new SqlParam[]
                {
                    sqlParam
                });
                int num = 0;
                foreach (SortInfo sortInfo in list)
                {
                    int @int = FPRequest.GetInt("randomcount_" + sortInfo.id);
                    if (@int > 0)
                    {
                        if (text != "")
                        {
                            text += ",";
                        }
                        text += sortInfo.id;
                        if (text2 != "")
                        {
                            text2 += ",";
                        }
                        text2 += @int;
                        num   += @int;
                    }
                }
                if (num > this.examtopic.questions - this.examtopic.curquestions)
                {
                    this.ShowErr("设定的随机题数不能大于总随机题数。");
                    return;
                }
                if (this.action == "save")
                {
                    SqlParam[] sqlparams = new SqlParam[]
                    {
                        DbHelper.MakeSet("randomsort", text),
                        DbHelper.MakeSet("randomcount", text2),
                        DbHelper.MakeSet("randoms", num),
                        DbHelper.MakeAndWhere("id", this.examtopicid)
                    };
                    DbHelper.ExecuteUpdate <ExamTopic>(sqlparams);
                    base.AddMsg("随机题设置保存成功!");
                    this.examtopic.randomsort  = text;
                    this.examtopic.randomcount = text2;
                    this.link = string.Concat(new object[]
                    {
                        "examtopicrandom.aspx?examtopicid=",
                        this.examtopicid,
                        "&paper=",
                        this.paper
                    });
                }
                else if (this.action == "create")
                {
                    string text3  = this.examtopic.questionlist;
                    int[]  array  = FPUtils.SplitInt(text);
                    int[]  array2 = FPUtils.SplitInt(text2, ",", array.Length);
                    for (int i = 0; i < array.Length; i++)
                    {
                        if (array2[i] > 0)
                        {
                            string questionRandom = QuestionBll.GetQuestionRandom(this.channelid, array2[i], this.examtopic.type.ToString(), array[i], text3);
                            if (questionRandom != "")
                            {
                                text3 += ((text3 == "") ? questionRandom : ("," + questionRandom));
                            }
                        }
                    }
                    this.examtopic.questionlist = text3;
                    this.examtopic.curquestions = FPUtils.SplitInt(this.examtopic.questionlist).Length;
                    SqlParam[] sqlparams = new SqlParam[]
                    {
                        DbHelper.MakeSet("questionlist", this.examtopic.questionlist),
                        DbHelper.MakeSet("curquestions", this.examtopic.curquestions),
                        DbHelper.MakeSet("randomsort", ""),
                        DbHelper.MakeSet("randomcount", ""),
                        DbHelper.MakeSet("randoms", 0),
                        DbHelper.MakeAndWhere("id", this.examtopicid)
                    };
                    DbHelper.ExecuteUpdate <ExamTopic>(sqlparams);
                    base.AddMsg("生成随机题目成功!");
                    this.link = string.Concat(new object[]
                    {
                        "examtopicmanage.aspx?examid=",
                        this.examtopic.examid,
                        "&paper=",
                        this.paper,
                        "&examtopicid=",
                        this.examtopicid
                    });
                }
            }
            int[] array3 = FPUtils.SplitInt(this.examtopic.randomsort);
            int[] array4 = FPUtils.SplitInt(this.examtopic.randomcount, ",", array3.Length);
            for (int i = 0; i < array3.Length; i++)
            {
                this.randomlist.Add(array3[i], array4[i]);
            }
            SqlParam sqlParam2 = DbHelper.MakeAndWhere("id", WhereType.In, this.examtopic.questionlist);

            this.questionlist = DbHelper.ExecuteList <ExamQuestion>(new SqlParam[]
            {
                sqlParam2
            });
            foreach (ExamQuestion examQuestion in this.questionlist)
            {
                if (this.curlist.ContainsKey(examQuestion.sortid))
                {
                    this.curlist[examQuestion.sortid] = this.curlist[examQuestion.sortid] + 1;
                }
                else
                {
                    this.curlist.Add(examQuestion.sortid, 1);
                }
            }
            base.SaveRightURL();
        }
 // Token: 0x0600004C RID: 76 RVA: 0x000080D4 File Offset: 0x000062D4
 protected override void View()
 {
     this.examconfig = ExamConifgs.GetExamConfig();
     this.examinfo   = DbHelper.ExecuteModel <ExamInfo>(this.examid);
     if (this.examinfo.id == 0)
     {
         this.ShowErr("对不起,该试卷不存在或已被删除。");
     }
     else
     {
         this.sortid   = this.examinfo.sortid;
         this.sortinfo = SortBll.GetSortInfo(this.sortid);
         if (this.ispost)
         {
             string    @string   = FPRequest.GetString("action");
             int       @int      = FPRequest.GetInt("examtopicid");
             int       int2      = FPRequest.GetInt("tid");
             ExamTopic examTopic = DbHelper.ExecuteModel <ExamTopic>(@int);
             if (@string == "delete")
             {
                 DbHelper.ExecuteDelete <ExamTopic>(@int);
                 if (this.paper == 1)
                 {
                     StringBuilder stringBuilder = new StringBuilder();
                     stringBuilder.AppendFormat("UPDATE [{0}Exam_ExamInfo] SET [total]=[total]-{1},[questions]=[questions]-{2} WHERE [id]={3}", new object[]
                     {
                         DbConfigs.Prefix,
                         examTopic.perscore * (double)examTopic.questions,
                         examTopic.questions,
                         this.examid
                     });
                     DbHelper.ExecuteSql(stringBuilder.ToString());
                 }
             }
             else if (@string == "addpaper")
             {
                 if (this.examinfo.papers == 4)
                 {
                     this.ShowErr("对不起,一场考试最多只能添加4份试卷。");
                     return;
                 }
                 string text = string.Format("UPDATE [{0}Exam_ExamInfo] SET [papers]=[papers]+1 WHERE [id]={1}", DbConfigs.Prefix, this.examid);
                 DbHelper.ExecuteSql(text);
                 this.paper = this.examinfo.papers + 1;
             }
             else if (@string == "delpaper")
             {
                 if (this.examinfo.papers == 1)
                 {
                     this.ShowErr("对不起,一场考试必须有一份试卷。");
                     return;
                 }
                 StringBuilder stringBuilder = new StringBuilder();
                 stringBuilder.AppendFormat("UPDATE [{0}Exam_ExamInfo] SET [papers]=[papers]-1 WHERE [id]={1}", DbConfigs.Prefix, this.examid);
                 stringBuilder.AppendFormat("DELETE FROM [{0}Exam_ExamTopic] WHERE [examid]={1} AND [paper]={2}", DbConfigs.Prefix, this.examid, this.paper);
                 stringBuilder.AppendFormat("UPDATE [{0}Exam_ExamTopic] SET [paper]=[paper]-1 WHERE [examid]={1} AND [paper]>{2}", DbConfigs.Prefix, this.examid, this.paper);
                 DbHelper.ExecuteSql(stringBuilder.ToString());
                 this.examinfo.papers = this.examinfo.papers - 1;
                 if (this.paper > this.examinfo.papers)
                 {
                     this.paper = this.examinfo.papers;
                 }
                 List <ExamTopic> examTopicList = ExamBll.GetExamTopicList(this.examid, 1);
                 double           num           = 0.0;
                 int num2 = 0;
                 foreach (ExamTopic examTopic2 in examTopicList)
                 {
                     num  += examTopic2.perscore * (double)examTopic2.questions;
                     num2 += examTopic2.questions;
                 }
                 string sqlstring = string.Format("UPDATE [{0}Exam_ExamInfo] SET [questions]={1},[total]={2} WHERE [id]={3}", new object[]
                 {
                     DbConfigs.Prefix,
                     num2,
                     num,
                     this.examid
                 });
                 DbHelper.ExecuteSql(sqlstring);
             }
             else if (@string == "saveas")
             {
                 if (this.examinfo.papers == 4)
                 {
                     this.ShowErr("对不起,一场考试最多只能添加4份试卷。");
                     return;
                 }
                 string text = string.Format("UPDATE [{0}Exam_ExamInfo] SET [papers]=[papers]+1 WHERE [id]={1}", DbConfigs.Prefix, this.examid);
                 DbHelper.ExecuteSql(text);
                 this.examtopiclist   = ExamBll.GetExamTopicList(this.examid, this.paper);
                 this.examinfo.papers = this.examinfo.papers + 1;
                 for (int i = 0; i < this.examtopiclist.Count; i++)
                 {
                     this.examtopiclist[i].paper = this.examinfo.papers;
                     DbHelper.ExecuteInsert <ExamTopic>(this.examtopiclist[i]);
                 }
             }
             else if (@string == "deletetopic")
             {
                 string text2 = "";
                 foreach (int num3 in FPUtils.SplitInt(examTopic.questionlist))
                 {
                     if (int2 != num3 && num3 > 0)
                     {
                         if (text2 != "")
                         {
                             text2 += ",";
                         }
                         text2 += num3;
                     }
                 }
                 examTopic.questionlist = text2;
                 if (examTopic.questionlist.Length > 0)
                 {
                     examTopic.curquestions = FPUtils.SplitInt(examTopic.questionlist).Length;
                 }
                 else
                 {
                     examTopic.curquestions = 0;
                 }
                 SqlParam[] sqlparams = new SqlParam[]
                 {
                     DbHelper.MakeSet("questionlist", examTopic.questionlist),
                     DbHelper.MakeSet("curquestions", examTopic.curquestions),
                     DbHelper.MakeAndWhere("id", @int)
                 };
                 DbHelper.ExecuteUpdate <ExamTopic>(sqlparams);
             }
             else if (@string == "display")
             {
                 this.examtopiclist = ExamBll.GetExamTopicList(this.examid, this.paper);
                 string text = "";
                 foreach (ExamTopic examTopic3 in this.examtopiclist)
                 {
                     DataTable dataTable = new DataTable();
                     dataTable.Columns.Add("display", typeof(int));
                     dataTable.Columns.Add("qid", typeof(int));
                     foreach (int num4 in FPUtils.SplitInt(examTopic3.questionlist))
                     {
                         DataRow dataRow = dataTable.NewRow();
                         dataRow["display"] = FPRequest.GetInt("display_" + num4);
                         dataRow["qid"]     = num4;
                         dataTable.Rows.Add(dataRow);
                     }
                     string text3 = "";
                     foreach (DataRow dataRow2 in dataTable.Select("1=1", "display asc"))
                     {
                         if (text3 != "")
                         {
                             text3 += ",";
                         }
                         text3 += dataRow2["qid"].ToString();
                     }
                     if (text != "")
                     {
                         text += "|";
                     }
                     text += string.Format("UPDATE [{0}Exam_ExamTopic] SET [questionlist]='{1}' WHERE [id]={2}", DbConfigs.Prefix, text3, examTopic3.id);
                 }
                 DbHelper.ExecuteSql(text);
             }
             base.Response.Redirect(this.pagename + string.Format("?examid={0}&paper={1}&examtopicid={2}", this.examid, this.paper, @int));
         }
         this.examtopiclist = ExamBll.GetExamTopicList(this.examid, this.paper);
         SqlParam[] sqlparams2 = new SqlParam[]
         {
             DbHelper.MakeAndWhere("examid", this.examid),
             DbHelper.MakeAndWhere("paper", this.paper)
         };
         this.examinfo.questions = FPUtils.StrToInt(DbHelper.ExecuteSum <ExamTopic>("questions", sqlparams2));
         base.SaveRightURL();
     }
 }
Exemple #22
0
 // Token: 0x06000069 RID: 105 RVA: 0x0000AB4C File Offset: 0x00008D4C
 protected override void View()
 {
     this.examconfig = ExamConifgs.GetExamConfig();
     if (this.id > 0)
     {
         this.questioninfo = DbHelper.ExecuteModel <ExamQuestion>(this.id);
         this.sortid       = this.questioninfo.sortid;
         this.type         = this.questioninfo.type;
         this.ascount      = this.questioninfo.ascount;
         if (this.type == 1 || this.type == 2 || this.type == 3)
         {
             this.questioninfo.answer = this.questioninfo.answer.ToLower();
         }
     }
     this.sortinfo = SortBll.GetSortInfo(this.sortid);
     if (this.examid > 0 && this.examtopicid > 0)
     {
         this.reurl = string.Concat(new object[]
         {
             "examtopicmanage.aspx?examid=",
             this.examid,
             "&examtopicid=",
             this.examtopicid
         });
     }
     if (this.examid > 0)
     {
         this.reurl = "examtopicmanage.aspx?examid=" + this.examid;
     }
     else if (this.examtopicid > 0)
     {
         this.reurl = "examtopicselect.aspx?examtopicid=" + this.examtopicid;
     }
     else
     {
         this.reurl = string.Concat(new object[]
         {
             "questionmanage.aspx?sortid=",
             this.sortid,
             "&type=",
             this.backtype
         });
     }
     if (this.ispost)
     {
         this.questioninfo.upperflg = 0;
         this.questioninfo.orderflg = 0;
         this.questioninfo.status   = 0;
         this.questioninfo.isclear  = 0;
         this.questioninfo          = FPRequest.GetModel <ExamQuestion>(this.questioninfo);
         if (this.questioninfo.isclear == 1)
         {
             this.questioninfo.title = questionadd.GetTextFromHTML(this.questioninfo.title);
         }
         this.questioninfo.channelid = this.sortinfo.channelid;
         if (this.questioninfo.type == 1 || this.questioninfo.type == 2)
         {
             this.questioninfo.ascount = FPRequest.GetInt("ascount" + this.questioninfo.type);
             this.questioninfo.content = "";
             for (int i = 0; i < this.questioninfo.ascount; i++)
             {
                 if (this.questioninfo.content != "")
                 {
                     ExamQuestion examQuestion = this.questioninfo;
                     examQuestion.content += "§";
                 }
                 if (this.questioninfo.isclear == 1)
                 {
                     ExamQuestion examQuestion2 = this.questioninfo;
                     examQuestion2.content += questionadd.GetTextFromHTML(FPRequest.GetString(string.Concat(new object[]
                     {
                         "option",
                         this.questioninfo.type,
                         "_",
                         i.ToString()
                     })));
                 }
                 else
                 {
                     ExamQuestion examQuestion3 = this.questioninfo;
                     examQuestion3.content += FPRequest.GetString(string.Concat(new object[]
                     {
                         "option",
                         this.questioninfo.type,
                         "_",
                         i.ToString()
                     }));
                 }
             }
         }
         else if (this.questioninfo.type == 3)
         {
             this.questioninfo.ascount = 2;
             this.questioninfo.content = "";
         }
         else if (this.questioninfo.type == 4)
         {
             this.questioninfo.ascount = FPUtils.SplitString(this.questioninfo.answer).Length;
             this.questioninfo.content = "";
         }
         else if (this.questioninfo.type == 5)
         {
             this.questioninfo.ascount = FPUtils.SplitString(this.questioninfo.answerkey).Length;
             this.questioninfo.content = "";
         }
         this.questioninfo.answer = FPRequest.GetString("answer" + this.questioninfo.type);
         if (this.questioninfo.id > 0)
         {
             DbHelper.ExecuteUpdate <ExamQuestion>(this.questioninfo);
             base.AddMsg("更新试题成功!");
         }
         else
         {
             this.questioninfo.uid = this.userid;
             this.questioninfo.id  = DbHelper.ExecuteInsert <ExamQuestion>(this.questioninfo);
             SortBll.UpdateSortPosts(this.questioninfo.sortid, 1);
             if (this.examid > 0)
             {
                 ExamTopic examTopic = DbHelper.ExecuteModel <ExamTopic>(this.examtopicid);
                 if (examTopic.curquestions >= examTopic.questions)
                 {
                     this.ShowErr("该大题题目数已满,不能再添加");
                     return;
                 }
                 examTopic.questionlist = ((examTopic.questionlist == "") ? this.questioninfo.id.ToString() : (examTopic.questionlist + "," + this.questioninfo.id));
                 examTopic.curquestions = FPUtils.SplitInt(examTopic.questionlist).Length;
                 SqlParam[] sqlparams = new SqlParam[]
                 {
                     DbHelper.MakeSet("questionlist", examTopic.questionlist),
                     DbHelper.MakeSet("curquestions", examTopic.curquestions),
                     DbHelper.MakeAndWhere("id", this.examtopicid)
                 };
                 DbHelper.ExecuteUpdate <ExamTopic>(sqlparams);
             }
             base.AddMsg("添加试题成功!");
         }
         if (this.action == "continue")
         {
             this.link = string.Format("questionadd.aspx?sortid={0}&examid={1}&examtopicid={2}&type={3}", new object[]
             {
                 this.sortid,
                 this.examid,
                 this.examtopicid,
                 this.backtype
             });
         }
         else
         {
             this.link = this.reurl;
         }
         if (File.Exists(FPUtils.GetMapPath(string.Concat(new object[]
         {
             this.webpath,
             "cache/qtxt_",
             this.id,
             ".jpg"
         }))))
         {
             File.Delete(FPUtils.GetMapPath(string.Concat(new object[]
             {
                 this.webpath,
                 "cache/qtxt_",
                 this.id,
                 ".jpg"
             })));
         }
     }
     base.SaveRightURL();
 }
Exemple #23
0
        // Token: 0x060000B8 RID: 184 RVA: 0x00011E2C File Offset: 0x0001002C
        protected override void View()
        {
            if (this.ispost)
            {
                if (!this.isperm)
                {
                    this.ShowErrMsg("对不起,您没有权限阅卷。");
                    return;
                }
                this.examresult = ExamBll.GetExamResult(this.resultid);
                if (this.examresult.id == 0)
                {
                    this.ShowErrMsg("对不起,该考试不存在或已被删除。");
                    return;
                }
                int status = this.examresult.status;
                this.examresult.status = 2;
                this.examresult.exnote = FPRequest.GetString("exnote");
                if (DbHelper.ExecuteUpdate <ExamResult>(this.examresult) <= 0)
                {
                    this.ShowErrMsg("保存出现错误。");
                    return;
                }
                List <ExamResultTopic> examResultTopicList = ExamBll.GetExamResultTopicList(this.resultid);
                int    num   = 0;
                double score = this.examresult.score;
                this.examresult.score  = 0.0;
                this.examresult.score1 = 0.0;
                this.examresult.score2 = 0.0;
                this.examresult.wrongs = 0;
                foreach (ExamResultTopic examResultTopic in examResultTopicList)
                {
                    if (examResultTopic.questions == 0)
                    {
                        num++;
                    }
                    else
                    {
                        int[]    array  = FPUtils.SplitInt(examResultTopic.questionlist);
                        string[] array2 = FPUtils.SplitString(examResultTopic.answerlist, "§", array.Length);
                        string[] array3 = FPUtils.SplitString(examResultTopic.scorelist, "|", array.Length);
                        examResultTopicList[num].scorelist   = "";
                        examResultTopicList[num].correctlist = "";
                        examResultTopicList[num].score       = 0.0;
                        int num2 = 0;
                        foreach (ExamQuestion examQuestion in QuestionBll.GetQuestionList(examResultTopic.questionlist))
                        {
                            string a = array2[num2];
                            if (examResultTopicList[num].scorelist != "")
                            {
                                ExamResultTopic examResultTopic2 = examResultTopicList[num];
                                examResultTopic2.scorelist += "|";
                            }
                            double num3 = 0.0;
                            if (examQuestion.type == 1 || examQuestion.type == 2)
                            {
                                num3 = (double)FPRequest.GetFloat("score_" + examQuestion.id);
                                this.examresult.score1 += num3;
                            }
                            else if (examQuestion.type == 3)
                            {
                                num3 = (double)FPRequest.GetFloat("score_" + examQuestion.id);
                                this.examresult.score1 += num3;
                            }
                            else if (examQuestion.type == 4)
                            {
                                num3 = (double)FPRequest.GetFloat("score_" + examQuestion.id);
                                this.examresult.score1 += num3;
                            }
                            else if (examQuestion.type == 5)
                            {
                                num3 = (double)FPRequest.GetFloat("score_" + examQuestion.id);
                                this.examresult.score2 += num3;
                            }
                            else if (examQuestion.type == 6)
                            {
                                num3 = (double)FPRequest.GetFloat("score_" + examQuestion.id);
                                this.examresult.score2 += num3;
                            }
                            this.examresult.score          += num3;
                            examResultTopicList[num].score += num3;
                            ExamResultTopic examResultTopic3 = examResultTopicList[num];
                            examResultTopic3.scorelist += num3.ToString();
                            if (examResultTopicList[num].correctlist != "")
                            {
                                ExamResultTopic examResultTopic4 = examResultTopicList[num];
                                examResultTopic4.correctlist += "|";
                            }
                            bool iswrong = false;
                            if (num3 >= examResultTopic.perscore * 0.6)
                            {
                                ExamResultTopic examResultTopic5 = examResultTopicList[num];
                                examResultTopic5.correctlist += "1";
                            }
                            else
                            {
                                ExamResultTopic examResultTopic6 = examResultTopicList[num];
                                examResultTopic6.correctlist += "0";
                                examResultTopicList[num].wrongs++;
                                this.examresult.wrongs++;
                                if (a == "")
                                {
                                    this.examresult.unanswer++;
                                }
                                iswrong = true;
                            }
                            SortInfo sortInfo = SortBll.GetSortInfo(examQuestion.sortid);
                            ExamBll.UpdateExamLog(sortInfo, this.examresult.uid, examQuestion, iswrong);
                            num2++;
                        }
                        DbHelper.ExecuteUpdate <ExamResultTopic>(examResultTopicList[num]);
                        num++;
                    }
                }
                ExpInfo       examExpByScore = ExamBll.GetExamExpByScore(this.examresult.score, this.examresult.examid);
                StringBuilder stringBuilder  = new StringBuilder();
                if (status == 0)
                {
                    stringBuilder.AppendFormat("UPDATE [{0}Exam_ExamResult] SET [score1]={1},[score2]={2},[score]={3},[wrongs]={4},[exp]={5} WHERE [id]={6}|", new object[]
                    {
                        DbConfigs.Prefix,
                        this.examresult.score1,
                        this.examresult.score2,
                        this.examresult.score,
                        this.examresult.wrongs,
                        examExpByScore.exp,
                        this.examresult.id
                    });
                    stringBuilder.AppendFormat("UPDATE [{0}Exam_ExamInfo] SET [exams]=[exams]+1,[score]=[score]+{1} WHERE [id]={2}", DbConfigs.Prefix, this.examresult.score, this.examresult.examid);
                }
                else
                {
                    stringBuilder.AppendFormat("UPDATE [{0}Exam_ExamResult] SET [score1]={1},[score2]={2},[score]={3},[exp]={4} WHERE [id]={5}|", new object[]
                    {
                        DbConfigs.Prefix,
                        this.examresult.score1,
                        this.examresult.score2,
                        this.examresult.score,
                        examExpByScore.exp,
                        this.examresult.id
                    });
                    stringBuilder.AppendFormat("UPDATE [{0}Exam_ExamInfo] SET [score]=[score]-{1} WHERE [id]={2}|", DbConfigs.Prefix, score, this.examresult.examid);
                    stringBuilder.AppendFormat("UPDATE [{0}Exam_ExamInfo] SET [score]=[score]+{1} WHERE [id]={2}", DbConfigs.Prefix, this.examresult.score, this.examresult.examid);
                    stringBuilder.AppendFormat("UPDATE [{0}WMS_UserInfo] SET [exp]=[exp]-{1} WHERE [id]={2}", DbConfigs.Prefix, this.examresult.exp, this.examresult.uid);
                }
                this.msg = DbHelper.ExecuteSql(stringBuilder.ToString());
                UserBll.UpdateUserExp(this.examresult.uid, examExpByScore.exp);
                if (this.msg != "")
                {
                    this.ShowErrMsg(this.msg);
                    return;
                }
            }
            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();
        }
Exemple #24
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();
        }
Exemple #25
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();
        }
Exemple #26
0
 // Token: 0x06000084 RID: 132 RVA: 0x0000D2E8 File Offset: 0x0000B4E8
 protected override void View()
 {
     if (this.ispost)
     {
         if (!this.isfile)
         {
             this.ShowErr("请选择要导入的本地Excel表文件");
         }
         else
         {
             string mapPath  = FPUtils.GetMapPath(this.webpath + "cache");
             string fileName = Path.GetFileName(FPRequest.Files["uploadfile"].FileName);
             string a        = Path.GetExtension(fileName).ToLower();
             if (a != ".xls")
             {
                 this.ShowErr("该文件不是Excel表文件类型");
             }
             else
             {
                 if (!Directory.Exists(mapPath))
                 {
                     Directory.CreateDirectory(mapPath);
                 }
                 if (File.Exists(mapPath + "\\" + fileName))
                 {
                     File.Delete(mapPath + "\\" + fileName);
                 }
                 FPRequest.Files["uploadfile"].SaveAs(mapPath + "\\" + fileName);
                 DataTable excelTable = FPExcel.GetExcelTable(mapPath + "\\" + fileName);
                 string    text       = "";
                 string    text2      = "";
                 string    text3      = "";
                 if (excelTable.Rows.Count > 0)
                 {
                     int num = excelTable.Rows.Count - 1;
                     for (int i = 0; i < num; i++)
                     {
                         DataRow dataRow = excelTable.Rows[num - i];
                         string  text4   = dataRow.ItemArray[0].ToString().Trim();
                         if (!(text4 == ""))
                         {
                             SqlParam sqlParam = DbHelper.MakeAndWhere("username", text4);
                             UserInfo userInfo = DbHelper.ExecuteModel <UserInfo>(new SqlParam[]
                             {
                                 sqlParam
                             });
                             if (userInfo.id == 0)
                             {
                                 userInfo.username = text4;
                                 userInfo.realname = dataRow.ItemArray[1].ToString().Trim();
                                 userInfo.password = FPUtils.MD5(dataRow.ItemArray[2].ToString().Trim());
                                 userInfo.roleid   = this.GetRoleId(dataRow.ItemArray[3].ToString().Trim());
                                 userInfo.departid = this.GetDepartId(dataRow.ItemArray[4].ToString().Trim());
                                 userInfo.nickname = dataRow.ItemArray[5].ToString().Trim();
                                 userInfo.id       = DbHelper.ExecuteInsert <UserInfo>(userInfo);
                             }
                             else
                             {
                                 if (!string.IsNullOrEmpty(dataRow.ItemArray[1].ToString().Trim()))
                                 {
                                     userInfo.realname = dataRow.ItemArray[1].ToString().Trim();
                                 }
                                 if (!string.IsNullOrEmpty(dataRow.ItemArray[2].ToString().Trim()))
                                 {
                                     userInfo.password = FPUtils.MD5(dataRow.ItemArray[2].ToString().Trim());
                                 }
                                 if (!string.IsNullOrEmpty(dataRow.ItemArray[3].ToString().Trim()))
                                 {
                                     userInfo.roleid = this.GetRoleId(dataRow.ItemArray[3].ToString().Trim());
                                 }
                                 if (!string.IsNullOrEmpty(dataRow.ItemArray[4].ToString().Trim()))
                                 {
                                     userInfo.departid = this.GetDepartId(dataRow.ItemArray[4].ToString().Trim());
                                 }
                                 if (!string.IsNullOrEmpty(dataRow.ItemArray[5].ToString().Trim()))
                                 {
                                     userInfo.nickname = dataRow.ItemArray[5].ToString().Trim();
                                 }
                                 DbHelper.ExecuteUpdate <UserInfo>(userInfo);
                             }
                             if (text != "")
                             {
                                 text += ",";
                             }
                             text += userInfo.id;
                         }
                     }
                     if (File.Exists(mapPath + "\\" + fileName))
                     {
                         File.Delete(mapPath + "\\" + fileName);
                     }
                     if (text != "")
                     {
                         if (this.examuser != "")
                         {
                             this.examuser += ",";
                         }
                         this.examuser += text;
                     }
                     SqlParam        sqlParam2 = DbHelper.MakeAndWhere("id", WhereType.In, this.examuser);
                     List <UserInfo> list      = DbHelper.ExecuteList <UserInfo>(new SqlParam[]
                     {
                         sqlParam2
                     });
                     foreach (int num2 in FPUtils.SplitInt(this.examuser))
                     {
                         foreach (UserInfo userInfo2 in list)
                         {
                             if (num2 == userInfo2.id && !FPUtils.InArray(num2, text3))
                             {
                                 if (text2 != "")
                                 {
                                     text2 += ",";
                                 }
                                 if (userInfo2.realname != "")
                                 {
                                     text2 += userInfo2.realname;
                                 }
                                 else
                                 {
                                     text2 += userInfo2.username;
                                 }
                                 if (text3 != "")
                                 {
                                     text3 += ",";
                                 }
                                 text3 += num2;
                             }
                         }
                     }
                 }
                 Hashtable hashtable = new Hashtable();
                 hashtable["uname"]    = text2;
                 hashtable["examuser"] = text3;
                 base.Response.AddHeader("Content-Type", "text/html; charset=UTF-8");
                 base.Response.Write(JsonMapper.ToJson(hashtable));
                 base.Response.End();
             }
         }
     }
 }
Exemple #27
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);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }