Example #1
0
        /// <summary>
        /// 返回数据
        /// </summary>
        /// <param name="row"></param>
        /// <returns></returns>
        public TestSettingInfo GetModel(SqlDataReader dr)
        {
            TestSettingInfo Model = new TestSettingInfo();

            if (dr.Read())
            {
                Model.Id                 = dr.GetInt32(0);
                Model.CourseId           = int.Parse(dr["CourseId"].ToString());
                Model.PaperScore         = dr.GetInt32(2);
                Model.TestQuestionsCount = dr.GetInt32(3);
                Model.TestTimeLength     = dr.GetInt32(4);
                //Model.TestStartTime = dr[6].ToString();
                //Model.TestEndTime = dr[7].ToString();
                if (dr["TestStartTime"] == DBNull.Value)
                {
                    Model.TestStartTime = null;
                }
                else
                {
                    Model.TestStartTime = Convert.ToDateTime(dr["TestStartTime"]);
                }
                if (dr["TestEndTime"] == DBNull.Value)
                {
                    Model.TestEndTime = null;
                }
                else
                {
                    Model.TestEndTime = Convert.ToDateTime(dr["TestEndTime"]);
                }
                Model.LowScore     = dr.GetInt32(5);
                Model.CompanyId    = dr.GetInt32(8);
                Model.TestInterval = dr.GetInt32(9);
            }
            return(Model);
        }
Example #2
0
 public void PrepareModel(SqlDataReader dr, List <TestSettingInfo> List)
 {
     while (dr.Read())
     {
         TestSettingInfo Model = new TestSettingInfo();
         {
             Model.Id                 = dr.GetInt32(0);
             Model.CourseId           = int.Parse(dr["CourseId"].ToString());
             Model.PaperScore         = dr.GetInt32(2);
             Model.TestQuestionsCount = dr.GetInt32(3);
             Model.TestTimeLength     = dr.GetInt32(4);
             if (dr["TestStartTime"] == DBNull.Value)
             {
                 Model.TestStartTime = null;
             }
             else
             {
                 Model.TestStartTime = Convert.ToDateTime(dr["TestStartTime"]);
             }
             if (dr["TestEndTime"] == DBNull.Value)
             {
                 Model.TestEndTime = null;
             }
             else
             {
                 Model.TestEndTime = Convert.ToDateTime(dr["TestEndTime"]);
             }
             Model.LowScore     = dr.GetInt32(7);
             Model.CompanyId    = dr.GetInt32(8);
             Model.TestInterval = dr.GetInt32(9);
         }
         List.Add(Model);
     }
 }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            base.ClearCache();
            int             productID   = RequestHelper.GetQueryString <int>("ProductID");
            decimal         score       = RequestHelper.GetQueryString <decimal>("Scorse");
            TestSettingInfo testSetting = TestSettingBLL.ReadTestSetting(base.UserCompanyID, productID);

            StringBuilder textOut = new StringBuilder();
            //textOut.AppendLine("<div class=\"exam\">本次考试总分:" + testSetting.PaperScore + "分,你的得分是:<span class=\"active\">" + score + "</span>分</div>");
            string tempOut = string.Empty;

            if (score >= 60 && score < testSetting.LowScore)
            {
                tempOut = "<font color=\"#000\">好可惜哦,通过线是 " + testSetting.LowScore.ToString() + " 分,就差一点点了!<br> 复习后可以再试一下的哟~~</font>";
            }
            else if (score >= testSetting.LowScore)
            {
                tempOut = "<font color=\"#000\">恭喜你通过了~,你太厉害了!</font>";
            }
            else
            {
                tempOut = "<font color=\"#000\">成绩不太理想喔!通过线是 " + testSetting.LowScore.ToString() + " 分。<br> 努力一下,学习后来征服它~~</font>";
            }
            textOut.Append("<div id=\"emptyTip\" class=\"pt40\"><p style=\"color:#a6a6a6; line-height:30px; font-weight:bold; font-size:14px;\"><span style='font-size:50px; color:red; font-family:黑体;'>" + score.ToString() + "</span>分<br/>" + tempOut + "</p>\r\n");

            textOut.Append("<br />返回 <a href=\"CourseCenter.aspx?Action=PostCourse\" class=\"green\">我的岗位课程</a></div>");
            textOut.Append("<div style=\"margin:50px auto;\"><table style=\"width:200px; margin:0px auto;\"><tr><td style=\"padding-right:10px; text-align:right;\">上海加禾汽修服务<br>上海孟特管理咨询</td><td style=\" border-left:1px solid #CCC; text-align: left; padding-left:10px;\">联合<br>出品</td></tr></table></div>");
            paperContent.InnerHtml = textOut.ToString();
        }
Example #4
0
        public void UpdateTestSetting(TestSettingInfo Model)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("Update [" + ShopMssqlHelper.TablePrefix + "TestSetting] set [CourseId]=@courseId,[PaperScore]=@paperScore,[TestQuestionsCount]=@testQuestionsCount,[TestTimeLength]=@testTimeLength,[LowScore]=@lowScore,[TestStartTime]=@testStartTime,[TestEndTime]=@testEndTime,[CompanyId]=@companyId,[TestInterval]=@testInterval where [Id]=@id");
            SqlParameter[] par = (SqlParameter[])this.ValueParas(Model);
            DbSQLHelper.ExecuteSql(sql.ToString(), par);
        }
Example #5
0
        protected void BindSystemTestSetting()
        {
            TestSettingInfo systemTestSetting = TestSettingBLL.ReadSystemTestSetting();

            PaperScorseTips.Text    = PaperScore.HintInfo = "留空总分则为" + systemTestSetting.PaperScore + "分";
            TestTimeLengthTips.Text = TestTimeLength.HintInfo = "留空考试时长则为" + systemTestSetting.TestTimeLength + "分钟";
            QuestionsNumTips.Text   = QuestionsNum.HintInfo = "留空则为" + systemTestSetting.TestQuestionsCount + "道试题";
            LowScoreTips.Text       = LowScore.HintInfo = "留空则及格线为" + systemTestSetting.LowScore + "分";
            TestIntervalTips.Text   = TestInterval.HintInfo = "两次考试相隔的小时数,留空为" + systemTestSetting.TestInterval + "小时。";
        }
Example #6
0
        protected string GetSpecialTestTime(int companyID, int courseID)
        {
            StringBuilder   resultHtml  = new StringBuilder();
            TestSettingInfo testSetting = TestSettingBLL.ReadCompanyTestSetting(int.Parse(Eval("CompanyID").ToString()), int.Parse(Eval("ID").ToString()));

            if (testSetting != null)
            {
                resultHtml.AppendLine("<br>");
                resultHtml.AppendLine("<span style=\"margin-left:10px;\">" + testSetting.TestStartTime + "—" + testSetting.TestEndTime + "</span>");
            }
            return(resultHtml.ToString());
        }
Example #7
0
        protected void BindTestSetting(ProductInfo product)
        {
            TestSettingInfo systemTestSetting = TestSettingBLL.ReadCompanyTestSetting(product.CompanyID, product.ID);

            if (systemTestSetting != null)
            {
                TestStartTime.Text  = systemTestSetting.TestStartTime.ToString().Replace('/', '-');
                TestEndTime.Text    = systemTestSetting.TestEndTime.ToString().Replace('/', '-');
                PaperScore.Text     = systemTestSetting.PaperScore.ToString();
                TestTimeLength.Text = systemTestSetting.TestTimeLength.ToString();
                QuestionsNum.Text   = systemTestSetting.TestQuestionsCount.ToString();
                LowScore.Text       = systemTestSetting.LowScore.ToString();
                TestInterval.Text   = systemTestSetting.TestInterval.ToString();
            }
        }
Example #8
0
        public static void UpdateTestSetting(int companyID, int productID, TestSettingInfo testSetting)
        {
            //删除已有记录
            TestSettingInfo currentTestSetting = TestSettingBLL.ReadCompanyTestSetting(companyID, productID);

            if (currentTestSetting != null)
            {
                DeleteTestSetting(currentTestSetting.Id);
            }

            if (testSetting.PaperScore > 0 || testSetting.TestTimeLength > 0 || testSetting.TestQuestionsCount > 0 || testSetting.LowScore > 0 || testSetting.TestStartTime.HasValue || testSetting.TestEndTime.HasValue)
            {
                //取得公司通用考试设置
                TestSettingInfo systemTestSetting = ReadTestSetting(companyID);
                testSetting.CompanyId = companyID;
                testSetting.CourseId  = productID;

                //内容不合法的,都重置公司默认设置
                if (testSetting.PaperScore <= 0)
                {
                    testSetting.PaperScore = systemTestSetting.PaperScore;
                }
                if (testSetting.TestTimeLength <= 0)
                {
                    testSetting.TestTimeLength = systemTestSetting.TestTimeLength;
                }
                if (testSetting.TestQuestionsCount <= 0)
                {
                    testSetting.TestQuestionsCount = systemTestSetting.TestQuestionsCount;
                }
                if (testSetting.LowScore <= 0)
                {
                    testSetting.LowScore = systemTestSetting.LowScore;
                }
                if (testSetting.TestInterval <= 0)
                {
                    testSetting.TestInterval = systemTestSetting.TestInterval;
                }

                //下面两项任一项为空,都采用公司默认设置
                if (testSetting.TestStartTime == null || testSetting.TestEndTime == null)
                {
                    testSetting.TestStartTime = systemTestSetting.TestStartTime;
                    testSetting.TestEndTime   = systemTestSetting.TestEndTime;
                }
                AddTestSetting(testSetting);
            }
        }
Example #9
0
 /// <summary>
 /// 该数据访问对象的属性值装载到数据库更新参数数组
 /// </summary>
 /// <remarks></remarks>
 protected IDbDataParameter[] ValueParas(TestSettingInfo Model)
 {
     SqlParameter[] par =
     {
         new SqlParameter("@id",                 SqlDbType.Int),
         new SqlParameter("@courseId",           SqlDbType.Int),
         new SqlParameter("@paperScore",         SqlDbType.Int),
         new SqlParameter("@testQuestionsCount", SqlDbType.Int),
         new SqlParameter("@testTimeLength",     SqlDbType.Int),
         new SqlParameter("@lowScore",           SqlDbType.Int),
         new SqlParameter("@testStartTime",      SqlDbType.DateTime),
         new SqlParameter("@testEndTime",        SqlDbType.DateTime),
         new SqlParameter("@companyId",          SqlDbType.Int),
         new SqlParameter("@testInterval",       SqlDbType.Int)
     };
     par[0].Value = Model.Id;
     par[1].Value = Model.CourseId;
     par[2].Value = Model.PaperScore;
     par[3].Value = Model.TestQuestionsCount;
     par[4].Value = Model.TestTimeLength;
     par[5].Value = Model.LowScore;
     if (Model.TestStartTime.HasValue)
     {
         par[6].Value = Model.TestStartTime;
     }
     else
     {
         par[6].Value = DBNull.Value;
     }
     if (Model.TestEndTime.HasValue)
     {
         par[7].Value = Model.TestEndTime;
     }
     else
     {
         par[7].Value = DBNull.Value;
     }
     par[8].Value = Model.CompanyId;
     par[9].Value = Model.TestInterval;
     return(par);
 }
Example #10
0
        public List <TestSettingInfo> ReadList(TestSettingInfo Model)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("select * from [" + ShopMssqlHelper.TablePrefix + "TestSetting] ");
            List <TestSettingInfo> TempList       = new List <TestSettingInfo>();
            MssqlCondition         mssqlCondition = new MssqlCondition();

            this.PrepareCondition(mssqlCondition, Model);

            if (mssqlCondition.ToString() != string.Empty)
            {
                sql.Append("where " + mssqlCondition.ToString());
                sql.Append(" Order by [Id] desc");
                using (SqlDataReader reader = DbSQLHelper.ExecuteReader(sql.ToString()))
                {
                    this.PrepareModel(reader, TempList);
                }
            }

            return(TempList);
        }
Example #11
0
        /// <summary>
        /// 返回考试设置信息
        /// </summary>
        /// <param name="companyId">公司级别从低到高,以","分隔</param>
        /// <param name="courseId"></param>
        /// <returns></returns>
        public static TestSettingInfo ReadTestSetting(string companyId, int courseId)
        {
            TestSettingInfo testSetting = null;

            string[] sonCompanyID = companyId.Split(',');
            for (int i = 0; i < sonCompanyID.Length; i++)
            {
                //1、第一调取companyId公司设置的courseId课程的考试设定
                if (courseId != 0)
                {
                    testSetting = ReadCompanyTestSetting(int.Parse(sonCompanyID[i]), courseId);
                    if (testSetting != null)
                    {
                        break;
                    }
                }
                //2、第二调取companyId公司设置的考试设定
                if (testSetting == null)
                {
                    testSetting = ReadCompanyTestSetting(int.Parse(sonCompanyID[i]), 0);
                    if (testSetting != null)
                    {
                        break;
                    }
                }
            }
            //3、第三调取系统设置的courseId课程的考试设定
            if (testSetting == null && courseId != 0)
            {
                testSetting = ReadSystemTestSetting(courseId);
            }
            //4、第四调取系统设置的考试设定
            if (testSetting == null)
            {
                testSetting = ReadSystemTestSetting();
            }
            return(testSetting);
        }
Example #12
0
        private string RecordTest()
        {
            int    productID  = RequestHelper.GetForm <int>("CateID");
            int    userID     = base.UserID;
            int    companyID  = base.UserCompanyID;
            string answerList = RequestHelper.GetForm <string>("Answer");

            //重新提交答案
            if (!string.IsNullOrEmpty(answerList))
            {
                //Dictionary<int, string> answerDic = new Dictionary<int, string>();
                JArray answerDic = (JArray)JsonConvert.DeserializeObject(answerList);
                foreach (JToken item in answerDic)
                {
                    if (!string.IsNullOrEmpty(item.Value <string>("Answer")))
                    {
                        AnswerSet(productID, item.Value <int>("StyleID"), item.Value <int>("ID"), item.Value <string>("Answer"));
                    }
                }
            }

            TestSettingInfo testSetting = TestSettingBLL.ReadTestSetting(companyID, productID);
            decimal         score       = Convert.ToDecimal(TestPaperBLL.CalcTestResult(companyID, userID, productID).Scorse);

            //判断是否通过各岗位
            if (score >= testSetting.LowScore)
            {
                PostPassBLL.CheckPostPass(userID, productID);

                //孟特销售工具应用与说明 课程处理
                //if (productID == 5368)
                //    TestSettingBLL.SpecialTestHandle(userID, int.Parse(CookiesHelper.ReadCookieValue("UserStudyPostId")));
            }

            string ReturnResult = "{\"Success\":\"true\",\"Url\":\"TestPaperShow.aspx?Action=TestPaperResult&ProductID=" + productID.ToString() + "&Scorse=" + score.ToString() + "\"}";

            return(ReturnResult);
        }
Example #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            base.ClearCache();

            int companyID = base.UserCompanyID;
            int userID    = base.UserID;

            filePath = TestPaperBLL.ReadTestPaperPath(userID, productID);

            if (!IsPostBack)
            {
                if (productID < 0)
                {
                    ScriptHelper.Alert("选择课程后,进行考试!");
                    Response.End();
                }
                TestSettingInfo testSetting = TestSettingBLL.ReadTestSetting(companyID, productID);
                ProductInfo     product     = ProductBLL.ReadProduct(productID);

                RenZhengCateInfo renZhengProduct = RenZhengCateBLL.ReadTestCateByID(product.ID);
                if (renZhengProduct != null)
                {
                    PostApprover postApprover = new PostApprover(PostPassBLL.ReadPostPassList(new PostPassInfo()
                    {
                        UserId = userID, IsRZ = 1
                    }));
                    if (!postApprover.IsTest(renZhengProduct.PostId))
                    {
                        Response.Write("<script>alert('请先完成 " + PostBLL.ReadPost(postApprover.NextPostID).PostName + " 的岗位综合认证!');history.go(-1);</script>");
                        Response.End();
                    }
                }

                if (testSetting.TestStartTime != null && testSetting.TestEndTime != null)
                {
                    if (testSetting.TestStartTime > DateTime.Now || testSetting.TestEndTime < DateTime.Now)
                    {
                        Response.Write("<script>alert('不在 该门课程 设定的考试时间内!');history.go(-1);</script>");
                        Response.End();
                    }
                }
                TestPaperInfo PaperModel = new TestPaperInfo();
                PaperModel.CateIdCondition = productID.ToString();
                PaperModel.UserIdCondition = userID.ToString();
                List <TestPaperInfo> PaperList = TestPaperBLL.NewReadList(PaperModel);
                if (PaperList.Count > 0)
                {
                    foreach (TestPaperInfo Item in PaperList)
                    {
                        if (Item.IsPass == 1)// && Item.CateId != 5368//孟特销售工具应用与说明 需要多次考试
                        {
                            Response.Write("<script>alert('您已通过,请选择其它课程!');</script>");
                            Response.End();
                        }
                        if ((DateTime.Now - Item.TestDate).TotalHours < testSetting.TestInterval)
                        {
                            if (testSetting.TestStartTime != null || testSetting.TestEndTime != null)
                            {
                                Response.Write("<script>alert('您已经参加过考试,暂不能重考!');window.close();</script>");
                            }
                            else
                            {
                                Response.Write("<script>alert('考完" + testSetting.TestInterval + "小时后才能重考,请选择其它课程!');history.go(-1);</script>");
                            }
                            Response.End();
                        }
                    }
                }

                if ((File.Exists(filePath) && (DateTime.Now - File.GetLastWriteTime(filePath)).TotalHours < testSetting.TestInterval))//TempPaperInfo != null && (DateTime.Now - TempPaperInfo.TestDate).TotalHours < 72
                {
                    bool      HaveTest = false;
                    XmlHelper XmlDoc1  = new XmlHelper(filePath);
                    for (int StyleId = 1; StyleId <= 3; StyleId++)
                    {
                        string NodeName = "TestPaper";
                        if (StyleId == 1)
                        {
                            NodeName = NodeName + "/Single";
                        }
                        else if (StyleId == 2)
                        {
                            NodeName = NodeName + "/Multi";
                        }
                        else if (StyleId == 3)
                        {
                            NodeName = NodeName + "/PanDuan";
                        }
                        //判断题型库里是否有考题
                        XmlNode Node = XmlDoc1.ReadNode(NodeName);
                        if (Node != null && Node.HasChildNodes)
                        {
                            XmlNodeList NodeList = XmlDoc1.ReadChildNodes(NodeName);
                            //遍历节点
                            foreach (XmlNode node in NodeList)
                            {
                                if (!string.IsNullOrEmpty(node.ChildNodes[6].InnerText))
                                {
                                    HaveTest = true;
                                }
                            }
                        }
                    }
                    if (HaveTest)
                    {
                        AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("TestPaperRecord"), ShopLanguage.ReadLanguage("TestPaper"), productID);
                        TestPaperInfo testpaper = TestPaperBLL.CalcTestResult(companyID, userID, productID);
                        if (testpaper.IsPass == 1)
                        {
                            PostPassBLL.CheckPostPass(UserID, productID);

                            //孟特销售工具应用与说明 课程处理
                            //if (productID == 5368)
                            //    TestSettingBLL.SpecialTestHandle(userID, int.Parse(CookiesHelper.ReadCookieValue("UserStudyPostId")));
                        }
                        ResponseHelper.Write("<script>alert('您上次未完成交卷,此时系统自动为您补交!得分:" + testpaper.Scorse + "分。');window.location.href='CourseCenter.aspx';</script>");
                        Response.End();
                    }
                }


                TestName.Text = product.Name;
                endTimer      = testSetting.TestTimeLength * 60;

                QuestionBLL.ReadQuestionXmlList(productID, product.Accessory, companyID, userID);

                AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("StartTest"), ShopLanguage.ReadLanguage("TestCate"), productID);
                AdminLogBLL.AddAdminLog(Request.Browser.Browser + "|" + Request.Browser.Version, productID);
            }
        }
Example #14
0
        protected override void PageLoad()
        {
            int    companyID = base.UserCompanyID;
            int    userID    = base.UserID;
            string filePath  = TestPaperBLL.ReadTestPaperPath(userID, productID);

            base.PageLoad();
            base.ClearCache();
            base.Title = "考试中心";
            if (productID == int.MinValue)
            {
                ScriptHelper.Alert("请在“课程列表”中选择课程后,进行考试!");
            }
            TestSettingInfo testSetting = TestSettingBLL.ReadTestSetting(companyID, productID);
            ProductInfo     product     = ProductBLL.ReadProduct(productID);

            //if (!CompanyBLL.IsTest)
            //{
            //    Response.Write("<script>alert('该公司不允许考试,请联系管理员!');var DG = frameElement.lhgDG;DG.cancel();</script>");
            //    Response.End();
            //}
            RenZhengCateInfo renZhengProduct = RenZhengCateBLL.ReadTestCateByID(product.ID);

            if (renZhengProduct != null)
            {
                PostApprover postApprover = new PostApprover(PostPassBLL.ReadPostPassList(new PostPassInfo()
                {
                    UserId = userID, IsRZ = 1
                }));
                if (!postApprover.IsTest(renZhengProduct.PostId))
                {
                    Response.Write("<script>alert('请先完成 " + PostBLL.ReadPost(postApprover.NextPostID).PostName + " 的岗位综合认证!');window.close();</script>");
                    Response.End();
                }
            }
            if (testSetting.TestStartTime.HasValue && testSetting.TestEndTime.HasValue)
            {
                //if (product.ClassID != 4387)
                //{
                //    if (Convert.ToDateTime(testSetting.TestStartTime) > DateTime.Now || Convert.ToDateTime(testSetting.TestEndTime) < DateTime.Now)
                //    {
                //        Response.Write("<script>alert('不在 该门课程 设定的考试时间内!');var DG = frameElement.lhgDG;DG.cancel();</script>");
                //        Response.End();
                //    }
                //}
                //else
                //{
                if (testSetting.TestStartTime > DateTime.Now || testSetting.TestEndTime < DateTime.Now) //&& Convert.ToDateTime(testSetting.TestStartTime).Minute <= DateTime.Now.Minute && Convert.ToDateTime(testSetting.TestEndTime).Minute >= DateTime.Now.Minute
                {
                    Response.Write("<script>alert('不在 该门课程 设定的考试时间内!');window.close();</script>");
                    Response.End();
                }
                //}
            }

            TestPaperInfo PaperModel = new TestPaperInfo();

            PaperModel.CateIdCondition = productID.ToString();
            PaperModel.UserIdCondition = userID.ToString();
            List <TestPaperInfo> PaperList = TestPaperBLL.NewReadList(PaperModel);

            if (PaperList.Count > 0)
            {
                foreach (TestPaperInfo Item in PaperList)
                {
                    if (Item.IsPass == 1)// && Item.CateId != 5368孟特销售工具应用与说明 需要多次考试
                    {
                        Response.Write("<script>alert('您已通过,请选择其它课程!');</script>");
                        Response.End();
                    }
                    if ((DateTime.Now - Item.TestDate).TotalHours < testSetting.TestInterval)
                    {
                        if (testSetting.TestStartTime.HasValue || testSetting.TestEndTime.HasValue)
                        {
                            Response.Write("<script>alert('您已经参加过考试,暂不能重考!');window.close();</script>");
                        }
                        else
                        {
                            Response.Write("<script>alert('考完" + testSetting.TestInterval + "小时后才能重考,请选择其它课程!');window.close();</script>");
                        }
                        Response.End();
                    }
                }
            }

            if ((File.Exists(filePath) && (DateTime.Now - File.GetLastWriteTime(filePath)).TotalHours < testSetting.TestInterval))//TempPaperInfo != null && (DateTime.Now - TempPaperInfo.TestDate).TotalHours < 72
            {
                bool      HaveTest = false;
                XmlHelper XmlDoc1  = new XmlHelper(filePath);
                for (int StyleId = 1; StyleId <= 3; StyleId++)
                {
                    string NodeName = "TestPaper";
                    if (StyleId == 1)
                    {
                        NodeName = NodeName + "/Single";
                    }
                    else if (StyleId == 2)
                    {
                        NodeName = NodeName + "/Multi";
                    }
                    else if (StyleId == 3)
                    {
                        NodeName = NodeName + "/PanDuan";
                    }
                    //判断题型库里是否有考题
                    XmlNode Node = XmlDoc1.ReadNode(NodeName);
                    if (Node != null && Node.HasChildNodes)
                    {
                        XmlNodeList NodeList = XmlDoc1.ReadChildNodes(NodeName);
                        //遍历节点
                        foreach (XmlNode node in NodeList)
                        {
                            if (!string.IsNullOrEmpty(node.ChildNodes[6].InnerText))
                            {
                                HaveTest = true;
                            }
                        }
                    }
                }
                if (HaveTest)
                {
                    AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("TestPaperRecord"), ShopLanguage.ReadLanguage("TestPaper"), productID);
                    TestPaperInfo testpaper = TestPaperBLL.CalcTestResult(companyID, userID, productID);
                    if (testpaper.IsPass == 1)
                    {
                        PostPassBLL.CheckPostPass(UserID, productID);

                        //孟特销售工具应用与说明 课程处理
                        //if (productID == 5368)
                        //    TestSettingBLL.SpecialTestHandle(userID, int.Parse(CookiesHelper.ReadCookieValue("UserStudyPostId")));
                    }
                    ResponseHelper.Write("<script>alert('您上次未完成交卷,此时系统自动为您补交!得分:" + testpaper.Scorse + "分。');window.close();</script>");
                    Response.End();
                }
            }

            //开启防止多次开启同一课程考试
            //TestSettingBLL.TestBegin(userID, productID);

            paperName = product.Name;
            testTime  = (testSetting.TestTimeLength * 60).ToString();

            QuestionBLL.ReadQuestionXmlList(productID, product.Accessory, companyID, userID);
            XmlHelper XmlDoc = new XmlHelper(filePath);


            paperInfoHtml.AppendLine("<p>考试时长:" + testSetting.TestTimeLength.ToString() + " 分钟</p>");
            paperInfoHtml.AppendLine("<p>试卷总分:" + testSetting.PaperScore.ToString() + " 分</p>");
            paperInfoHtml.AppendLine("<p>试题数量:共 " + XmlDoc.ReadAttribute("TestPaper", "QuestionNum") + " 道。其中 ");
            string TempNum = XmlDoc.ReadAttribute("TestPaper", "SingleNum");

            if (int.Parse(TempNum) > 0)
            {
                paperInfoHtml.Append("单项选择题:" + TempNum + " 道;");
            }
            TempNum = XmlDoc.ReadAttribute("TestPaper", "MultiNum");
            if (int.Parse(TempNum) > 0)
            {
                paperInfoHtml.Append("多项选择题:" + TempNum + " 道;");
            }
            TempNum = XmlDoc.ReadAttribute("TestPaper", "PanDunNum");
            if (int.Parse(TempNum) > 0)
            {
                paperInfoHtml.Append("判断题:" + TempNum + " 道;");
            }
            paperInfoHtml.Append("</p>");

            int NoteCount = XmlDoc.ReadChildNodes("TestPaper/Single").Count;

            if (NoteCount > 0)
            {
                questionStyleHtml.AppendLine("<li data-id=\"1\"><a href=\"javascript:void(0);\">" + EnumHelper.ReadEnumChineseName <QuestionType>(1) + "</a></li>");
                questionIndexHtml.AppendLine("<ul data-style=\"1\" class=\"clearfix\" id=\"radio\">");
                for (int i = 1; i <= NoteCount; i++)
                {
                    questionIndexHtml.AppendLine("<li><a href=\"javascript:void(0);\">" + (i) + "</a></li>");
                }
                questionIndexHtml.AppendLine("</ul>");
            }

            NoteCount = XmlDoc.ReadChildNodes("TestPaper/Multi").Count;
            if (NoteCount > 0)
            {
                questionStyleHtml.AppendLine("<li data-id=\"2\"><a href=\"javascript:void(0);\">" + EnumHelper.ReadEnumChineseName <QuestionType>(2) + "</a></li>");
                questionIndexHtml.AppendLine("<ul data-style=\"2\" class=\"clearfix\" id=\"checkbox\">");
                for (int i = 1; i <= NoteCount; i++)
                {
                    questionIndexHtml.AppendLine("<li><a href=\"javascript:void(0);\">" + (i) + "</a></li>");
                }
                questionIndexHtml.AppendLine("</ul>");
            }

            NoteCount = XmlDoc.ReadChildNodes("TestPaper/PanDuan").Count;
            if (NoteCount > 0)
            {
                questionStyleHtml.AppendLine("<li data-id=\"3\"><a href=\"javascript:void(0);\">" + EnumHelper.ReadEnumChineseName <QuestionType>(3) + "</a></li>");
                questionIndexHtml.AppendLine("<ul data-style=\"3\" class=\"clearfix\" id=\"judge\">");
                for (int i = 1; i <= NoteCount; i++)
                {
                    questionIndexHtml.AppendLine("<li><a href=\"javascript:void(0);\">" + (i) + "</a></li>");
                }
                questionIndexHtml.AppendLine("</ul>");
            }

            UserLogBLL.AddUserLog(ShopLanguage.ReadLanguage("StartTest"), ShopLanguage.ReadLanguage("TestPaper"), paperName);
            UserLogBLL.AddUserLog(Request.Browser.Browser + "|" + Request.Browser.Version, productID);
        }
Example #15
0
        //public static TestSettingInfo ReadTestSys(int Id)
        //{
        //    if (HttpContext.Current.Session["TestSysInfo"] == null || ((TestSettingInfo)HttpContext.Current.Session["TestSysInfo"]).CompanyId != Id)
        //    {
        //        TestSettingInfo Model = dal.ReadTestSys(Id);
        //        if (Model == null)
        //        {
        //            Model = dal.ReadTestSys(0);
        //            Model.CompanyId = Id;
        //        }
        //        HttpContext.Current.Session["TestSysInfo"] = Model;
        //    }
        //    return (TestSettingInfo)HttpContext.Current.Session["TestSysInfo"];
        //}

        /// <summary>
        /// 添加考试设定(如果已有记录则更新记录)
        /// </summary>
        /// <param name="Model"></param>
        /// <returns></returns>
        public static int AddTestSetting(TestSettingInfo Model)
        {
            Model.Id = dal.AddTestSetting(Model);
            CacheHelper.Remove(cacheKey);
            return(Model.Id);
        }
Example #16
0
        /// <summary>
        /// 计算考试成绩
        /// </summary>
        /// <returns></returns>
        public static TestPaperInfo CalcTestResult(int companyID, int userID, int productID)
        {
            TestPaperInfo       PaperModel  = new TestPaperInfo();
            string              filePath    = ReadTestPaperPath(userID, productID);
            TestPaperReportInfo testPaper   = ReadTheLatestPaper(userID, productID);
            TestSettingInfo     testSetting = TestSettingBLL.ReadTestSetting(companyID, productID);

            if (File.Exists(filePath) && (testPaper.TestDate == DateTime.MinValue || (DateTime.Now - testPaper.TestDate).TotalHours >= testSetting.TestInterval))
            {
                XmlHelper XmlDoc = new XmlHelper(filePath);

                int QuestionNum = int.Parse(XmlDoc.ReadAttribute("TestPaper", "QuestionNum"));

                decimal Scorse   = 0; //试卷得分
                int     RightNum = 0; //正确的题目数量

                //从xml里读取答案,进行校卷
                string QuestionList   = string.Empty;
                string UserAnswerList = string.Empty;
                for (int StyleId = 1; StyleId <= 3; StyleId++)
                {
                    string NodeName = GetTestPaperStyleNodeName(StyleId);
                    //判断题型库里是否有考题
                    XmlNode Node = XmlDoc.ReadNode(NodeName);
                    if (Node != null && Node.HasChildNodes)
                    {
                        XmlNodeList NodeList = XmlDoc.ReadChildNodes(NodeName);
                        //遍历节点
                        foreach (XmlNode node in NodeList)
                        {
                            QuestionList   = QuestionList + "," + node.ChildNodes[9].InnerText;
                            UserAnswerList = UserAnswerList + "," + node.ChildNodes[6].InnerText;
                            if (node.ChildNodes[6].InnerText.ToLower() == node.ChildNodes[5].InnerText.ToLower())
                            {
                                RightNum = RightNum + 1;
                            }
                        }
                    }
                }

                //UserInfo user = UserBLL.ReadUser(userID);
                //TestSettingInfo testSetting = TestSettingBLL.ReadTestSetting(companyID, productID);
                if (QuestionNum == 0)
                {
                    Scorse = 0;
                }
                else
                {
                    Scorse = Convert.ToDecimal(Math.Round((decimal.Parse(testSetting.PaperScore.ToString()) * RightNum / QuestionNum), 1));//这样计算的总分更准备
                }
                if (QuestionList != string.Empty && QuestionList.StartsWith(","))
                {
                    QuestionList   = QuestionList.Substring(1);
                    UserAnswerList = UserAnswerList.Substring(1);
                }

                PaperModel.CateId     = productID;
                PaperModel.PaperName  = ProductBLL.ReadProduct(productID).Name;
                PaperModel.CompanyId  = companyID;
                PaperModel.UserId     = userID;
                PaperModel.QuestionId = QuestionList;
                PaperModel.Answer     = UserAnswerList;
                PaperModel.Scorse     = Scorse;
                if (Scorse >= testSetting.LowScore)
                {
                    PaperModel.Point  = 2;
                    PaperModel.IsPass = 1;
                }
                else
                {
                    PaperModel.IsPass = 0;
                }

                UserLogBLL.AddUserLog(ShopLanguage.ReadLanguage("ApplyTest"), ShopLanguage.ReadLanguage("TestPaper"), ProductBLL.ReadProduct(productID).Name);
                TestPaperBLL.AddPaper(PaperModel);
                File.SetLastWriteTime(filePath, DateTime.Now);
            }
            if ((testPaper.TestDate > DateTime.MinValue && (DateTime.Now - testPaper.TestDate).TotalHours < testSetting.TestInterval))
            {
                PaperModel.Scorse = testPaper.Score;
            }

            //解除本课程的考试限制
            //TestSettingBLL.TestEnd(userID, productID);

            return(PaperModel);
        }
Example #17
0
 public static void UpdateTestSetting(TestSettingInfo Model)
 {
     dal.UpdateTestSetting(Model);
     CacheHelper.Remove(cacheKey);
 }
Example #18
0
 public void PrepareCondition(MssqlCondition mssqlCondition, TestSettingInfo Model)
 {
     mssqlCondition.Add("[CompanyId]", Model.CompanyId, ConditionType.Equal);
 }
Example #19
0
        /// <summary>
        /// 根据productId读取符合条件随机抽取指定数量的考题创建xml文档
        /// </summary>
        /// <param name="productId"></param>
        /// <param name="CourseId">题库ID</param>
        /// <param name="companyId">用户的公司ID</param>
        public static void ReadQuestionXmlList(int productId, string CourseId, int companyId, int userId)
        {
            TestSettingInfo TestSettingModel = TestSettingBLL.ReadTestSetting(companyId, productId);
            QuestionInfo    Model            = new QuestionInfo();

            Model.QuestionNum = " Top " + TestSettingModel.TestQuestionsCount.ToString() + " * ";
            Model.IdCondition = CourseId;
            Model.Condition   = CompanyBLL.SystemCompanyId.ToString();//默认情况下都读取系统考题
            Model.Field       = "CompanyId";
            List <QuestionInfo> TempQuestionList = ReadList(Model);

            //写入xml文件
            XmlHelper xmldoc = new XmlHelper();

            xmldoc.InsertNode("TestPaper");
            xmldoc.InsertElement("TestPaper", "CateId", productId.ToString());
            xmldoc.InsertNode("TestPaper", "Single", "");
            xmldoc.InsertNode("TestPaper", "Multi", "");
            xmldoc.InsertNode("TestPaper", "PanDuan", "");
            int QuestionIndex = 0;
            int SingleNum     = 0;
            int MultiNum      = 0;
            int PanDuanNum    = 0;

            foreach (QuestionInfo Item in TempQuestionList)
            {
                string NodeName = "TestPaper";
                QuestionIndex = QuestionIndex + 1;
                if (Item.Style == "1")
                {
                    SingleNum = SingleNum + 1;
                    NodeName  = NodeName + "/Single/QuestionInfo" + SingleNum.ToString();
                    xmldoc.InsertElement("TestPaper/Single", "QuestionInfo" + SingleNum.ToString(), "id", Item.QuestionId.ToString(), "");
                }
                else if (Item.Style == "2")
                {
                    MultiNum = MultiNum + 1;
                    NodeName = NodeName + "/Multi/QuestionInfo" + MultiNum.ToString();
                    xmldoc.InsertElement("TestPaper/Multi", "QuestionInfo" + MultiNum.ToString(), "id", Item.QuestionId.ToString(), "");
                }
                else if (Item.Style == "3")
                {
                    PanDuanNum = PanDuanNum + 1;
                    NodeName   = NodeName + "/PanDuan/QuestionInfo" + PanDuanNum.ToString();
                    xmldoc.InsertElement("TestPaper/PanDuan", "QuestionInfo" + PanDuanNum.ToString(), "id", Item.QuestionId.ToString(), "");
                }
                xmldoc.InsertNode(NodeName, "Question", Item.Question);//.Replace("~","")

                //单项选择题四个选项随机排序
                string answer = Item.Answer.ToUpper();
                if (Item.Style == "1")
                {
                    string[,] optionArrray = new string[4, 2] {
                        { "A", Item.A }, { "B", Item.B }, { "C", Item.C }, { "D", Item.D }
                    };

                    optionArrray = RandomHelper.GetRandomOptionArray <string>(optionArrray, ref answer);
                    for (int i = 0; i <= optionArrray.GetUpperBound(0); i++)
                    {
                        xmldoc.InsertNode(NodeName, optionArrray[i, 0], optionArrray[i, 1]);
                    }
                }
                else
                {
                    xmldoc.InsertNode(NodeName, "A", Item.A);
                    xmldoc.InsertNode(NodeName, "B", Item.B);
                    xmldoc.InsertNode(NodeName, "C", Item.C);
                    xmldoc.InsertNode(NodeName, "D", Item.D);
                }
                xmldoc.InsertNode(NodeName, "Answer", answer);
                xmldoc.InsertNode(NodeName, "CustomerAnswer", "");
                xmldoc.InsertNode(NodeName, "Style", Item.Style);
                xmldoc.InsertNode(NodeName, "CompanyId", Item.CompanyId.ToString());
                xmldoc.InsertNode(NodeName, "QuestionId", Item.QuestionId.ToString());
            }
            xmldoc.InsertElement("TestPaper", "QuestionNum", QuestionIndex.ToString());
            xmldoc.InsertElement("TestPaper", "SingleNum", SingleNum.ToString());
            xmldoc.InsertElement("TestPaper", "MultiNum", MultiNum.ToString());
            xmldoc.InsertElement("TestPaper", "PanDunNum", PanDuanNum.ToString());

            //保存创建好的XML文档
            if (Directory.Exists(ServerHelper.MapPath("~/xml")) == false)//如果不存在就创建file文件夹
            {
                Directory.CreateDirectory(ServerHelper.MapPath("~/xml"));
            }
            xmldoc.Save(ServerHelper.MapPath("~/xml/") + userId.ToString() + "_" + productId.ToString() + ".xml");
        }
Example #20
0
 public int AddTestSetting(TestSettingInfo Model)
 {
     SqlParameter[] pt = (SqlParameter[])this.ValueParas(Model);
     return(Convert.ToInt32(ShopMssqlHelper.ExecuteScalar(ShopMssqlHelper.TablePrefix + "AddTestSetting", pt)));
 }
Example #21
0
        protected void HanderTestSetting(ProductInfo product)
        {
            try
            {
                string paperScore         = PaperScore.Text.Trim();
                string testTimeLength     = TestTimeLength.Text.Trim();
                string testQuestionsCount = QuestionsNum.Text.Trim();
                string lowScore           = LowScore.Text.Trim();
                string testStartTime      = TestStartTime.Text.Trim();
                string testEndTime        = TestEndTime.Text.Trim();
                string testInterval       = TestInterval.Text.Trim();

                TestSettingInfo testSetting = new TestSettingInfo();
                if (!string.IsNullOrEmpty(paperScore))
                {
                    testSetting.PaperScore = Convert.ToInt32(paperScore);
                }
                if (!string.IsNullOrEmpty(testTimeLength))
                {
                    testSetting.TestTimeLength = Convert.ToInt32(testTimeLength);
                }
                if (!string.IsNullOrEmpty(testQuestionsCount))
                {
                    testSetting.TestQuestionsCount = Convert.ToInt32(testQuestionsCount);
                }
                if (!string.IsNullOrEmpty(lowScore))
                {
                    testSetting.LowScore = Convert.ToInt32(lowScore);
                }
                if (!string.IsNullOrEmpty(testStartTime) && !string.IsNullOrEmpty(testEndTime))
                {
                    testSetting.TestStartTime = Convert.ToDateTime(testStartTime);
                    testSetting.TestEndTime   = Convert.ToDateTime(testEndTime);
                }
                if (!string.IsNullOrEmpty(testInterval))
                {
                    testSetting.TestInterval = Convert.ToInt32(testInterval);
                }
                TestSettingBLL.UpdateTestSetting(product.CompanyID, product.ID, testSetting);
            }
            catch (Exception ex)
            {
                ScriptHelper.Alert("考试时间设置出现异常!");
            }

            //TestSettingInfo systemTestSetting = TestSettingBLL.ReadCompanyTestSetting(product.CompanyID, product.ID);
            //if (!string.IsNullOrEmpty(paperScore) || !string.IsNullOrEmpty(testTimeLength) || !string.IsNullOrEmpty(testQuestionsCount) || !string.IsNullOrEmpty(testQuestionsCount) || !string.IsNullOrEmpty(lowScore) || !string.IsNullOrEmpty(testStartTime) || !string.IsNullOrEmpty(testEndTime))
            //{
            //    if (systemTestSetting == null)
            //    {
            //        systemTestSetting = TestSettingBLL.ReadTestSetting(product.CompanyID);
            //        systemTestSetting.CompanyId = product.CompanyID;
            //        systemTestSetting.CourseId = product.ID;
            //    }
            //    if (!string.IsNullOrEmpty(paperScore)) systemTestSetting.PaperScore = Convert.ToInt32(paperScore);
            //    if (!string.IsNullOrEmpty(testTimeLength)) systemTestSetting.TestTimeLength = Convert.ToInt32(testTimeLength);
            //    if (!string.IsNullOrEmpty(testQuestionsCount)) systemTestSetting.TestQuestionsCount = Convert.ToInt32(testQuestionsCount);
            //    if (!string.IsNullOrEmpty(lowScore)) systemTestSetting.LowScore = Convert.ToInt32(lowScore);
            //    //下面两项同时为空或同时不为空时可以修改
            //    if ((!string.IsNullOrEmpty(testStartTime) && !string.IsNullOrEmpty(testEndTime)) || (string.IsNullOrEmpty(testStartTime) && string.IsNullOrEmpty(testEndTime)))
            //    {
            //        systemTestSetting.TestStartTime = testStartTime;
            //        systemTestSetting.TestEndTime = testEndTime;
            //    }
            //    TestSettingBLL.AddTestSetting(systemTestSetting);
            //}
            //else
            //{
            //    if (systemTestSetting != null)
            //    {
            //        TestSettingBLL.DeleteTestSetting(systemTestSetting.Id);
            //    }
            //}
        }
Example #22
0
        public static string RecordTest(int CateId)
        {
            string FilePath = ServerHelper.MapPath("~/xml/" + Cookies.User.GetUserID(true).ToString() + "_" + CateId.ToString() + ".xml");

            if (File.Exists(FilePath))
            {
                XmlHelper XmlDoc = new XmlHelper(FilePath);

                int QuestionNum = int.Parse(XmlDoc.ReadAttribute("TestPaper", "QuestionNum"));

                decimal Scorse   = 0; //试卷得分
                int     RightNum = 0; //正确的题目数量

                //从xml里读取答案,进行校卷
                string QuestionList   = string.Empty;
                string UserAnswerList = string.Empty;
                for (int StyleId = 1; StyleId <= 3; StyleId++)
                {
                    string NodeName = GetTestPaperStyleNodeName(StyleId);
                    //判断题型库里是否有考题
                    XmlNode Node = XmlDoc.ReadNode(NodeName);
                    if (Node != null && Node.HasChildNodes)
                    {
                        XmlNodeList NodeList = XmlDoc.ReadChildNodes(NodeName);
                        //遍历节点
                        foreach (XmlNode node in NodeList)
                        {
                            QuestionList   = QuestionList + "," + node.ChildNodes[9].InnerText;
                            UserAnswerList = UserAnswerList + "," + node.ChildNodes[6].InnerText;
                            if (node.ChildNodes[6].InnerText.ToLower() == node.ChildNodes[5].InnerText.ToLower())
                            {
                                RightNum = RightNum + 1;
                            }
                        }
                    }
                }
                TestSettingInfo Model = TestSettingBLL.ReadTestSetting(Cookies.User.GetCompanyID(true), CateId);
                if (QuestionNum == 0)
                {
                    Scorse = 0;
                }
                else
                {
                    Scorse = Convert.ToDecimal(Math.Round((decimal.Parse(Model.PaperScore.ToString()) * RightNum / QuestionNum), 1));//这样计算的总分更准备
                }
                if (QuestionList != string.Empty && QuestionList.StartsWith(","))
                {
                    QuestionList   = QuestionList.Substring(1);
                    UserAnswerList = UserAnswerList.Substring(1);
                }

                TestPaperInfo PaperModel = new TestPaperInfo();
                PaperModel.CateId     = CateId;
                PaperModel.CompanyId  = Cookies.User.GetCompanyID(true);
                PaperModel.UserId     = Cookies.User.GetUserID(true);
                PaperModel.QuestionId = QuestionList;
                PaperModel.Answer     = UserAnswerList;
                PaperModel.Scorse     = Scorse;
                if (Scorse >= Model.LowScore)
                {
                    PaperModel.Point = 2;
                }
                AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("ApplyTestPaper"), ShopLanguage.ReadLanguage("TestCate"), CateId);
                TestPaperBLL.AddPaper(PaperModel);
                File.SetLastWriteTime(FilePath, DateTime.Now);

                return("TestPaperShow.aspx?Action=TestPaperResult&CompanyId=" + ProductBLL.ReadProduct(CateId).CompanyID.ToString() + "&CateId=" + CateId.ToString() + "&Scorse=" + Scorse.ToString());
            }

            return(string.Empty);
        }
Example #23
0
        //private List<PostCateInfo> ConvertToPostCate(List<PostInfo> PostList, bool ChildList)
        //{
        //    List<PostCateInfo> PostCateList = new List<PostCateInfo>();
        //    if (PostList != null)
        //    {
        //        foreach (PostInfo Info in PostList)
        //        {
        //            PostCateInfo PostCateModel = new PostCateInfo();
        //            PostCateModel.EncryptFcateID = Info.PostId.ToString();
        //            PostCateModel.Title = Info.PostName;
        //            if (ChildList) PostCateModel.ChildCourseFCateView = ConvertToPostCate(PostBLL.ReadPostList(Info.PostId), false);
        //            PostCateList.Add(PostCateModel);
        //        }
        //    }
        //    return PostCateList;
        //}

        private List <MCourseInfo> GetCourseList()
        {
            int postID   = RequestHelper.GetForm <int>("postID");
            int page     = RequestHelper.GetForm <int>("pageIndex");
            int pageSize = RequestHelper.GetForm <int>("pageSize");
            int classID  = RequestHelper.GetForm <int>("classID");

            if (pageSize <= 0)
            {
                pageSize = base.PageSize;
            }
            List <MCourseInfo> CourseList = new List <MCourseInfo>();
            int    userID          = base.UserID;
            string prepaidCourseId = BLLMTestCate.ReadPrepaidTestCate(userID);

            if (postID < 0)
            {
                postID = int.Parse(CookiesHelper.ReadCookieValue("UserStudyPostId"));
            }

            List <ProductInfo> productList      = new List <ProductInfo>();
            string             inProductID      = PostBLL.ReadPostCourseID(base.UserCompanyID, postID);
            string             passPostCourseID = string.IsNullOrEmpty(inProductID) ? "" : TestPaperBLL.ReadCourseIDStr(TestPaperBLL.ReadList(base.UserID, inProductID, 1));

            inProductID = StringHelper.SubString(inProductID, passPostCourseID);
            ProductSearchInfo productSearch = new ProductSearchInfo();

            if (!string.IsNullOrEmpty(inProductID))
            {
                productSearch.InProductID = inProductID;
                productSearch.IsSale      = 1;
                if (classID > 0)
                {
                    productSearch.ClassID = "|" + classID + "|";
                }
                productSearch.OrderField = "[IsTop],[ClassID],[Sort],[ID]";
                productList = ProductBLL.SearchProductList(page, pageSize, productSearch, ref base.Count);
            }

            int pageCount = (int)Math.Ceiling((double)base.Count / pageSize);

            //加载选修课程(岗位课程罗列完成后,再加载选修)
            if ((classID < 0 || classID == 6) && (page == pageCount) && StringHelper.CompareSingleString("4,5,64", UserBLL.ReadUser(base.UserID).StudyPostID.ToString()))
            {
                productSearch.InProductID = string.Empty;
                productSearch.ClassID     = "|6|";
                productSearch.InBrandID   = base.CompanyBrandID;
                productSearch.NotLikeName = "必修";
                productSearch.IsSale      = 1;
                productList.AddRange(ProductBLL.SearchProductList(productSearch));
            }

            //加载认证考试
            if ((classID < 0 && page == 1) || classID == 4387)
            {
                PostPassInfo passpost = new PostPassInfo();
                passpost.UserId = base.UserID;
                passpost.IsRZ   = 0;

                RenZhengCateInfo rzCate = new RenZhengCateInfo();
                rzCate.InPostID = PostPassBLL.PassPostString(passpost);
                string rzProductID = RenZhengCateBLL.ReadTestCateID(rzCate);
                if (!string.IsNullOrEmpty(rzProductID))
                {
                    productSearch.InProductID = rzProductID;
                    productSearch.ClassID     = string.Empty;
                    productSearch.InBrandID   = base.CompanyBrandID;
                    productSearch.NotLikeName = string.Empty;
                    productSearch.IsSale      = 1;
                    productList.InsertRange(0, ProductBLL.SearchProductList(productSearch));
                }
            }

            //加载大课件
            if ((classID < 0 && page == 1) || classID == 5298)
            {
                productSearch.InProductID = string.Empty;
                productSearch.InBrandID   = string.Empty;
                productSearch.NotLikeName = string.Empty;
                productSearch.IsSale      = 1;
                productSearch.ClassID     = "|5298|";
                productList.InsertRange(0, ProductBLL.SearchProductList(productSearch));
            }

            //加载指定时间考试
            if (classID < 0 && page == 1)
            {
                string parentCompanyID = base.ParentCompanyID;
                if (string.IsNullOrEmpty(parentCompanyID))
                {
                    parentCompanyID = base.UserCompanyID.ToString();
                }
                else
                {
                    parentCompanyID += "," + base.UserCompanyID.ToString();
                }
                List <TestSettingInfo> specialTestList = TestSettingBLL.ReadSpecialTestList(parentCompanyID);
                if (specialTestList.Count > 0)
                {
                    string specialCourseID = TestSettingBLL.ReadSpecialTestCourseID(specialTestList);
                    if (!string.IsNullOrEmpty(specialCourseID))
                    {
                        productSearch.InProductID = specialCourseID;
                        productSearch.ClassID     = string.Empty;
                        productSearch.InBrandID   = base.CompanyBrandID;
                        productSearch.NotLikeName = string.Empty;
                        productSearch.IsSale      = 1;
                        List <ProductInfo> specialProductList = ProductBLL.SearchProductList(productSearch);
                        productList.InsertRange(0, specialProductList);
                    }
                }
            }

            //重新获取产品ID串
            inProductID      = ProductBLL.ReadProductIdStr(productList);
            passPostCourseID = string.IsNullOrEmpty(inProductID) ? "" : TestPaperBLL.ReadCourseIDStr(TestPaperBLL.ReadList(base.UserID, inProductID, 1));

            //获取未通过的最新记录
            string noPassCourseID = StringHelper.SubString(inProductID, passPostCourseID);
            List <TestPaperReportInfo> noPassTestPaperList = string.IsNullOrEmpty(noPassCourseID) ? new List <TestPaperReportInfo>() : TestPaperBLL.ReadThelatestList(base.UserID, noPassCourseID);

            List <AttributeRecordInfo> attributeRecordList = AttributeRecordBLL.ReadList("5", noPassCourseID);

            foreach (ProductInfo Info in productList)
            {
                //通过的课程不用显示
                //if (!StringHelper.CompareSingleString(passPostCourseID, Info.ID.ToString()))
                {
                    TestSettingInfo testSetting = TestSettingBLL.ReadTestSetting(base.UserCompanyID, Info.ID);

                    MCourseInfo CourseModel = new MCourseInfo();
                    CourseModel.ClassID   = Info.ID.ToString();
                    CourseModel.Title     = Info.Name;
                    CourseModel.IsPass    = false;
                    CourseModel.PageCount = pageCount;
                    TestPaperReportInfo currentPaper = noPassTestPaperList.Find(delegate(TestPaperReportInfo tempPaper) { return(tempPaper.CourseID == Info.ID); });
                    if (currentPaper != null)
                    {
                        //剩余时间
                        int remainingTime = (testSetting.TestInterval - (int)(DateTime.Now - currentPaper.TestDate).TotalHours);
                        CourseModel.ValidDateShow = remainingTime > 0 ? remainingTime.ToString() : "";
                    }
                    CourseModel.OriginalPrice = Info.MarketPrice.ToString();
                    if (!string.IsNullOrEmpty(Info.ProductNumber))
                    {
                        CourseModel.IsVideo = true;
                    }

                    if (!string.IsNullOrEmpty(Info.Accessory))
                    {
                        CourseModel.IsTest = true;

                        //通过的课程不用再考
                        if (StringHelper.CompareSingleString(passPostCourseID, Info.ID.ToString()))
                        {
                            CourseModel.IsTest = false;
                        }

                        if (testSetting != null && (testSetting.TestStartTime != null || testSetting.TestEndTime != null))
                        {
                            //指定时间考试考过了就不要再考了
                            if (!string.IsNullOrEmpty(CourseModel.ValidDateShow))
                            {
                                CourseModel.IsTest = false;
                            }
                            if (DateTime.Now < testSetting.TestStartTime || DateTime.Now > testSetting.TestEndTime)
                            {
                                CourseModel.IsTest = false;
                            }
                        }
                    }
                    CourseModel.IsPostCourse    = true;
                    CourseModel.IsPrepaidCourse = StringHelper.CompareSingleString(prepaidCourseId, Info.ID.ToString());

                    //产品知识 练车剧本地址
                    {
                        CourseModel.RCUrl = AttributeRecordBLL.ReadAttributeRecord(attributeRecordList, 5, Info.ID).Value;
                        if (!string.IsNullOrEmpty(CourseModel.RCUrl))
                        {
                            CourseModel.IsRC = true;
                        }
                    }
                    CourseList.Add(CourseModel);
                }
            }
            return(CourseList);
        }