コード例 #1
0
ファイル: FrmE_PaperView.cs プロジェクト: s7loves/mypowerscgl
        private void InitData()
        {
            PdDic.Clear();
            SelectDic.Clear();
            MuSelectDic.Clear();

            E_Examination exam = ClientHelper.PlatformSqlMap.GetOneByKey<E_Examination>(E_ID);
            E_ExaminationPaper expaper = ClientHelper.PlatformSqlMap.GetOneByKey<E_ExaminationPaper>(exam.EP_ID);
            ESet = ClientHelper.PlatformSqlMap.GetOneByKey<E_ExamSetting>(expaper.SettingID);

            string sqlwhere = "  b.E_ID='" + E_ID + "' and b.EP_ID='" + expaper.ID + "' and b.UserID='" + UserID + "' order by ExamQuestonType,cast(b.RandomID as int) asc";
            IList<E_QuestionBank> banklist = ClientHelper.PlatformSqlMap.GetList<E_QuestionBank>("SelectE_QuestionBankCount", sqlwhere);
            foreach (E_QuestionBank item in banklist)
            {
                if (item.Type == "判断题")
                {
                    PdDic.Add(item.ID, item);
                }
                if (item.Type == "单项选择题")
                {
                    SelectDic.Add(item.ID, item);
                   
                }
                if (item.Type == "多项选择题")
                {
                    MuSelectDic.Add(item.ID, item);
                  
                }
            }

                ViewQuestionPaper();

        }
コード例 #2
0
ファイル: FrmE_PaperEdit.cs プロジェクト: s7loves/mypowerscgl
        private void InitData()
        {
            PdDic.Clear();
            SelectDic.Clear();
            MuSelectDic.Clear();
            RealEREPDic.Clear();
            if (SetId != string.Empty)
            {
                //
                ESet = Client.ClientHelper.PlatformSqlMap.GetOneByKey<E_ExamSetting>(SetId);
                string sqlwhere = " where ESETID='" + SetId + "'";
                IList<E_R_ESetPro> eresblist = Client.ClientHelper.PlatformSqlMap.GetList<E_R_ESetPro>(sqlwhere);
                ereslist = eresblist;
                foreach (E_R_ESetPro item in eresblist)
                {
                    TurnE_R_ESetPro teres = new TurnE_R_ESetPro();
                    teres.ID = item.ID;
                    teres.PROID = item.PROID;
                    teres.JudgeNUM = item.JudgeNUM;
                    teres.SelectNUM = item.SelectNUM;
                    teres.MuSelectNUM = item.MuSelectNUM;
                    RealEREPDic.Add(teres.PROID, teres);
                }



                if (EPID != string.Empty)
                {
                    string sqlwhere2 = " where ExID='" + EPID + "'";
                    IList<E_ExaminationPaperQuestion> eepqlist = Client.ClientHelper.PlatformSqlMap.GetListByWhere<E_ExaminationPaperQuestion>(sqlwhere2);
                    string str = string.Empty;
                    if (eepqlist.Count > 0)
                    {
                        foreach (E_ExaminationPaperQuestion item in eepqlist)
                        {
                            str += "'" + item.QuID + "' ,";
                        }
                        str = str.Substring(0, str.Length - 1);

                        string stsqlwhere = " where ID in (" + str + ")";
                        IList<E_QuestionBank> banklist = Client.ClientHelper.PlatformSqlMap.GetListByWhere<E_QuestionBank>(stsqlwhere);
                        if (banklist.Count > 0)
                        {
                            foreach (E_QuestionBank item in banklist)
                            {
                                if (item.Type == "判断题")
                                {
                                    PdDic.Add(item.ID, item);
                                    RealEREPDic[item.Professional].RealJudgeNUM += 1;
                                }
                                if (item.Type == "单项选择题")
                                {
                                    SelectDic.Add(item.ID, item);
                                    RealEREPDic[item.Professional].RealSelectNUM += 1;
                                }
                                if (item.Type == "多项选择题")
                                {
                                    MuSelectDic.Add(item.ID, item);
                                    RealEREPDic[item.Professional].RealMuSelectNUM += 1;
                                }
                            }

                        }
                    }

                }
                ViewQuestionPaper();
            }


        }
コード例 #3
0
 void gridViewOperation_FocusedRowChanged(object sender, E_ExamSetting obj)
 {
     if (FocusedRowChanged != null)
         FocusedRowChanged(gridView1, gridView1.GetFocusedRow() as E_ExamSetting);
 }
コード例 #4
0
ファイル: FrmUserExam.cs プロジェクト: s7loves/mypowerscgl
        public IList<E_QuestionBank> GetExamQuestionList()
        {
            Pdlist.Clear();
            Selectlist.Clear();
            MuSelectlist.Clear();
            IList<E_QuestionBank> returnlist = new List<E_QuestionBank>();

            try
            {

                E_Examination exam = Exam;
                if (exam != null)
                {
                    E_ExaminationPaper eep = Client.ClientHelper.PlatformSqlMap.GetOneByKey<E_ExaminationPaper>(exam.EP_ID);
                    ESet = ClientHelper.PlatformSqlMap.GetOneByKey<E_ExamSetting>(eep.SettingID);
                    if (eep != null)
                    {
                        if (eep.Paper_Type == "指定试题")
                        {
                            //试题已经准备好了
                            if (eep.BySCol1 == "1")
                            {
                                string strtemp = " select QuID from E_ExaminationPaperQuestion where ExID='" + eep.ID + "'";
                                string stsqlwhere = " where ID in (" + strtemp + ") order by  Type";
                                IList<E_QuestionBank> banklist = Client.ClientHelper.PlatformSqlMap.GetListByWhere<E_QuestionBank>(stsqlwhere);

                                if (banklist.Count > 0)
                                {
                                    foreach (E_QuestionBank item in banklist)
                                    {
                                        if (item.Type == "判断题")
                                        {
                                            Pdlist.Add(item);
                                        }
                                        if (item.Type == "单项选择题")
                                        {
                                            Selectlist.Add(item);
                                        }
                                        if (item.Type == "多项选择题")
                                        {
                                            MuSelectlist.Add(item);
                                        }
                                    }
                                    //随机顺序
                                    if (eep.OrderRandom)
                                    {
                                        int[] pdtemparray = ThisHelper.OrderINT(Pdlist.Count);
                                        for (int i = 0; i < pdtemparray.Length; i++)
                                        {
                                            returnlist.Add(Pdlist[pdtemparray[i]]);
                                        }
                                        int[] selecttemparray = ThisHelper.OrderINT(Selectlist.Count);
                                        for (int i = 0; i < selecttemparray.Length; i++)
                                        {
                                            returnlist.Add(Selectlist[selecttemparray[i]]);
                                        }
                                        int[] muselecttemparray = ThisHelper.OrderINT(MuSelectlist.Count);
                                        for (int i = 0; i < muselecttemparray.Length; i++)
                                        {
                                            returnlist.Add(MuSelectlist[muselecttemparray[i]]);
                                        }
                                    }
                                    else
                                    {
                                        for (int i = 0; i < Pdlist.Count; i++)
                                        {
                                            returnlist.Add(Pdlist[i]);
                                        }
                                        for (int i = 0; i < Selectlist.Count; i++)
                                        {
                                            returnlist.Add(Selectlist[i]);
                                        }
                                        int[] muselecttemparray = ThisHelper.OrderINT(MuSelectlist.Count);
                                        for (int i = 0; i < MuSelectlist.Count; i++)
                                        {
                                            returnlist.Add(MuSelectlist[i]);
                                        }

                                    }


                                }
                                //没有试题,则用随机试题
                                else
                                {
                                    CreateRandomQuestion(eep.SettingID, returnlist);
                                }

                            }
                            //没有准备好,则用随机试题
                            else
                            {
                                CreateRandomQuestion(eep.SettingID, returnlist);
                            }
                        }
                        else if (eep.Paper_Type == "随机试题")
                        {
                            CreateRandomQuestion(eep.SettingID, returnlist);

                        }
                    }
                }
            }
            catch (Exception)
            {

            }

            return returnlist;
        }
コード例 #5
0
        /// <summary>
        /// 新建对象设置Key值
        /// </summary>
        /// <param name="newobj"></param>
        void gridViewOperation_CreatingObjectEvent(E_ExamSetting newobj) {

        }