Ejemplo n.º 1
0
        public PaperSubject GetPaperSubject(int PaperSubjectId)
        {
            PaperSubject Paper;

            Database db = DatabaseFactory.CreateDatabase();

            string    sqlCommand = "USP_Paper_Subject_G";
            DbCommand dbCommand  = db.GetStoredProcCommand(sqlCommand);

            db.AddInParameter(dbCommand, "p_Paper_Subject_id", DbType.Int32, PaperSubjectId);

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    Paper = SubjectNamelObject(dataReader);
                }
                else
                {
                    Paper = new PaperSubject();
                }
            }



            return(Paper);
        }
Ejemplo n.º 2
0
        private string GetFillPaperString(string strId)
        {
            string               strPaperString  = "";
            PaperItemBLL         paperItemBLL    = new PaperItemBLL();
            PaperSubjectBLL      paperSubjectBLL = new PaperSubjectBLL();
            IList <PaperSubject> paperSubjects   = paperSubjectBLL.GetPaperSubjectByPaperId(int.Parse(strId));

            if (paperSubjects != null)
            {
                for (int i = 0; i < paperSubjects.Count; i++)
                {
                    PaperSubject paperSubject = paperSubjects[i];

                    IList <PaperItem> paperItems = paperItemBLL.GetItemsByPaperSubjectId(paperSubject.PaperSubjectId);

                    strPaperString += " <table width='100%' border='0' cellpadding='0' cellspacing='0'>";
                    strPaperString += " <tr><td  style='font-size:21px'>";
                    strPaperString += " " + GetNo(i) + "、" + paperSubject.SubjectName;
                    strPaperString += " (共" + paperItems.Count + "题,共" + paperItems.Count * paperSubject.UnitScore + "分)</td></tr>";
                    if (paperItems != null)
                    {
                        for (int j = 0; j < paperItems.Count; j++)
                        {
                            PaperItem paperItem = paperItems[j];
                            int       k         = j + 1;
                            string    strij     = i.ToString() + j.ToString();
                            strPaperString += "<tr><td >&nbsp;&nbsp;&nbsp;" + k + "." + paperItem.Content + " (" + paperItem.Score + "分)</td></tr >";

                            if (paperSubject.ItemTypeId == 2)   //多选


                            {
                                string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' });
                                for (int n = 0; n < strAnswer.Length; n++)
                                {
                                    string strN = intToString(n + 1);
                                    strPaperString += "<tr><td >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + strN + "." + strAnswer[n] + "</td></tr>";
                                }
                            }
                            else    //单选


                            {
                                string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' });
                                for (int n = 0; n < strAnswer.Length; n++)
                                {
                                    string strN = intToString(n + 1);

                                    strPaperString += "<tr><td >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + strN + "." + strAnswer[n] + "</td></tr>";
                                }
                            }
                        }
                    }

                    strPaperString += "</table>";
                }
            }

            return(strPaperString);
        }
Ejemplo n.º 3
0
        public IList <PaperSubject> GetPaperSubjectByPaperId(int PaperId)
        {
            IList <PaperSubject> Papers = new List <PaperSubject>();

            Database db = DatabaseFactory.CreateDatabase();

            string    sqlCommand = "USP_PAPER_SUBJECT_Q";
            DbCommand dbCommand  = db.GetStoredProcCommand(sqlCommand);

            db.AddInParameter(dbCommand, "p_PAPER_id", DbType.Int32, PaperId);

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    PaperSubject Paper = SubjectNamelObject(dataReader);
                    Papers.Add(Paper);
                }
            }

            return(Papers);
        }
Ejemplo n.º 4
0
        public int AddPaperSubject(PaperSubject Paper)
        {
            int      i  = 0;
            Database db = DatabaseFactory.CreateDatabase();

            string    sqlCommand = "USP_PAPER_SUBJECT_I";
            DbCommand dbCommand  = db.GetStoredProcCommand(sqlCommand);

            db.AddInParameter(dbCommand, "p_PAPER_ID", DbType.Int32, Paper.PaperId);
            db.AddOutParameter(dbCommand, "p_Paper_Subject_Id", DbType.Int32, Paper.PaperSubjectId);
            db.AddInParameter(dbCommand, "p_Order_Index", DbType.String, Paper.OrderIndex);
            db.AddInParameter(dbCommand, "p_Item_Count", DbType.Int32, Paper.ItemCount);
            db.AddInParameter(dbCommand, "p_Item_Type_Id", DbType.Int32, Paper.ItemTypeId);
            db.AddInParameter(dbCommand, "p_Remark", DbType.String, Paper.Remark);
            db.AddInParameter(dbCommand, "p_Subject_Name", DbType.String, Paper.SubjectName);
            db.AddInParameter(dbCommand, "p_Total_Score", DbType.Decimal, Paper.TotalScore);
            db.AddInParameter(dbCommand, "p_Unit_Score", DbType.Decimal, Paper.UnitScore);
            db.AddInParameter(dbCommand, "p_memo", DbType.String, Paper.Memo);

            DbConnection connection = db.CreateConnection();

            connection.Open();
            DbTransaction transaction = connection.BeginTransaction();

            try
            {
                db.ExecuteNonQuery(dbCommand, transaction);

                i = (int)db.GetParameterValue(dbCommand, "p_Paper_Subject_Id");
                transaction.Commit();
            }
            catch (System.SystemException ex)
            {
                transaction.Rollback();
                throw ex;
            }
            connection.Close();
            return(i);
        }
Ejemplo n.º 5
0
        protected void FillPaper()
        {
            // QueryString id stands for EXAM_RESULT_ID
            string strId = Request.QueryString.Get("id");

            // Not pass id
            if (string.IsNullOrEmpty(strId))
            {
                SessionSet.PageMessage = "参数错误!";

                return;
            }

            PaperItemBLL        kBLL                = new PaperItemBLL();
            PaperSubjectBLL     kBSLL               = new PaperSubjectBLL();
            TaskResultBLL       taskResultBLL       = new TaskResultBLL();
            TaskResultAnswerBLL taskResultAnswerBLL = new TaskResultAnswerBLL();

            RailExam.Model.TaskResult taskResult = taskResultBLL.GetTaskResult(int.Parse(strId));
            // Not found
            if (taskResult == null)
            {
                SessionSet.PageMessage = "数据错误!";

                return;
            }

            IList <PaperSubject>     PaperSubjects     = kBSLL.GetPaperSubjectByPaperId(taskResult.PaperId);
            PaperSubject             paperSubject      = null;
            IList <PaperItem>        PaperItems        = null;
            IList <TaskResultAnswer> taskResultAnswers = taskResultAnswerBLL.GetTaskResultAnswers(taskResult.TaskResultId);

            if (PaperSubjects != null)
            {
                for (int i = 0; i < PaperSubjects.Count; i++)
                {
                    paperSubject = PaperSubjects[i];
                    PaperItems   = kBLL.GetItemsByPaperSubjectId(paperSubject.PaperSubjectId);
                    Response.Write("<table style='width:100%;'>");
                    Response.Write(
                        " <tr class=\"tableFont\" > <td colspan='3' align='left' style='background-color:#54FF9F' >");
                    Response.Write(" " + CommonTool.GetChineseNumber(i + 1) + "");
                    Response.Write(".&nbsp;" + paperSubject.SubjectName + "");
                    Response.Write("  (共" + paperSubject.ItemCount + "题,共" + paperSubject.ItemCount * paperSubject.UnitScore + "分)</td></tr >");

                    if (PaperItems != null)
                    {
                        for (int j = 0; j < PaperItems.Count; j++)
                        {
                            PaperItem paperItem = PaperItems[j];
                            int       k         = j + 1;

                            Response.Write("<tr class=\"tableFont\" > <td colspan='3' style='text-align:left; background-color:gainsboro;'>&nbsp;&nbsp;&nbsp;"
                                           + k + ".&nbsp; " + paperItem.Content + "&nbsp;&nbsp;(" + paperSubject.UnitScore +
                                           "分)</td></tr >");

                            // 组织用户答案
                            TaskResultAnswer theTaskResultAnswer = null;
                            string[]         strUserAnswers      = new string[0];
                            string           strUserAnswer       = string.Empty;

                            foreach (TaskResultAnswer resultAnswer in taskResultAnswers)
                            {
                                if (resultAnswer.PaperItemId == paperItem.PaperItemId)
                                {
                                    theTaskResultAnswer = resultAnswer;
                                    break;
                                }
                            }

                            // 若子表无记录,结束页面输出



                            if (theTaskResultAnswer == null)
                            {
                                SessionSet.PageMessage = "数据错误!";

                                return;
                            }

                            // 否则组织考生答案
                            if (theTaskResultAnswer.Answer != null)
                            {
                                strUserAnswers = theTaskResultAnswer.Answer.Split(new char[] { '|' });
                            }
                            for (int n = 0; n < strUserAnswers.Length; n++)
                            {
                                if (n == 0)
                                {
                                    strUserAnswer += CommonTool.GetSelectLetter(int.Parse(strUserAnswers[n]) + 1);
                                }
                                else
                                {
                                    strUserAnswer += "," + CommonTool.GetSelectLetter(int.Parse(strUserAnswers[n]) + 1);
                                }
                            }

                            //多选



                            if (paperSubject.ItemTypeId == 2)
                            {
                                string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' });
                                for (int n = 0; n < strAnswer.Length; n++)
                                {
                                    string strij = "-" + paperItem.PaperItemId + "-" + i.ToString() + "-"
                                                   + j.ToString() + "-" + n.ToString();
                                    string strName = i.ToString() + j.ToString();

                                    Response.Write(" <tr class=\"tableFont\" ><td colspan='3' align='left'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "
                                                   + "<input type='checkbox' id='Answer" + strij + "' name='Answer" +
                                                   strName
                                                   + "' " + (Array.IndexOf(strUserAnswers, n) > -1 ? "checked" : "")
                                                   + " disabled/> " + CommonTool.GetSelectLetter(n + 1)
                                                   + "." + strAnswer[n] + "</td></tr >");
                                }
                            }
                            else
                            {
                                //单选



                                string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' });
                                for (int n = 0; n < strAnswer.Length; n++)
                                {
                                    string strij = "-" + paperItem.PaperItemId + "-" + i.ToString() + "-" + j.ToString()
                                                   + "-" + n.ToString();
                                    string strName = i.ToString() + j.ToString();

                                    Response.Write("<tr class=\"tableFont\" > <td colspan='3' align='left'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "
                                                   + "<input type='Radio' id='RAnswer" + strij + "' name='RAnswer" + strName
                                                   + "' " + (Array.IndexOf(strUserAnswers, n) > -1 ? "checked" : "")
                                                   + " disabled/> " + CommonTool.GetSelectLetter(n + 1)
                                                   + "." + strAnswer[n] + "</td></tr >");
                                }
                            }

                            // 组织正确答案
                            string[] strRightAnswers = paperItem.StandardAnswer.Split(new char[] { '|' });
                            string   strRightAnswer  = "";
                            for (int n = 0; n < strRightAnswers.Length; n++)
                            {
                                if (n == 0)
                                {
                                    strRightAnswer += CommonTool.GetSelectLetter(n + 1);
                                }
                                else
                                {
                                    strRightAnswer += "," + CommonTool.GetSelectLetter(n + 1);
                                }
                            }

                            Response.Write(" <tr class=\"tableFont\"><td colspan='3' style='color:green; text-align:left; '>&nbsp;&nbsp;&nbsp;★标准答案:"
                                           + "<span id='span-" + paperItem.PaperItemId + "-0' name='span-" +
                                           paperItem.PaperItemId
                                           + "'>" + strRightAnswer + "</span></td></tr>");
                            Response.Write(" <tr class=\"tableFont\"><td colspan='3' style='color:blue; text-align:left; '>&nbsp;&nbsp;&nbsp;★考生答案:"
                                           + "<span id='span-" + paperItem.PaperItemId + "-1' name='span-" +
                                           paperItem.PaperItemId
                                           + "'>" + strUserAnswer + "</span></td></tr>");
                            Response.Write(" <tr class=\"tableFont\" score='" + paperItem.Score
                                           + "'><td style='color:purple; text-align:left; width:20%; '>★评分结果:"
                                           //+ "<input type='radio' id='rbnCorrect" + "-" + paperItem.PaperItemId
                                           //+ "' name='rbnJudge" + "-" + paperItem.PaperItemId
                                           //+ "' " + (strRightAnswer.Equals(strUserAnswer) ? "checked" : "")
                                           //+ "><font color='green'>对</font></input>"
                                           //+ "<input type='radio' id='rbnIncorrect" + "-" + paperItem.PaperItemId
                                           //+ "' name='rbnJudge" + "-" + paperItem.PaperItemId
                                           //+ "' " + (strRightAnswer.Equals(strUserAnswer) ? "" : "checked")
                                           //+ "><font color='red'>错</font></input>"
                                           //+ "<input type='radio' id='rbnPartlyCorrect" + "-" + paperItem.PaperItemId
                                           //+ "' name='rbnJudge" + "-" + paperItem.PaperItemId + "'>半对</input>"
                                           + GetJudgeInputs(paperItem.PaperItemId, theTaskResultAnswer.JudgeStatusId)
                                           + "&nbsp;&nbsp;&nbsp;&nbsp;"
                                           + "得分&nbsp;" + theTaskResultAnswer.JudgeScore.ToString()
                                           + "&nbsp;&nbsp;&nbsp;"
                                           + "评语&nbsp;" + theTaskResultAnswer.JudgeRemark + ""
                                           + "</td></tr>");
                        }
                    }
                    Response.Write(" </table> ");
                }
            }
            else
            {
                SessionSet.PageMessage = "数据错误!";

                return;
            }
        }
Ejemplo n.º 6
0
        protected void FillPaper()
        {
            string strId = Request.QueryString.Get("id");

            if (string.IsNullOrEmpty(strId))
            {
                SessionSet.PageMessage = "缺少参数!";

                return;
            }

            PaperItemBLL kBLL = new PaperItemBLL();
            // PaperSubjectBLL psBLL = new PaperSubjectBLL();
            PaperSubjectBLL      kBSLL         = new PaperSubjectBLL();
            IList <PaperSubject> PaperSubjects = kBSLL.GetPaperSubjectByPaperId(int.Parse(strId));

            if (PaperSubjects != null)
            {
                for (int i = 0; i < PaperSubjects.Count; i++)
                {
                    PaperSubject      paperSubject = PaperSubjects[i];
                    IList <PaperItem> PaperItems   = kBLL.GetItemsByPaperSubjectId(paperSubject.PaperSubjectId);

                    Response.Write("<table width='95%' class='contentTable'>");
                    Response.Write(" <tr> <td align='left' style='background-color:#54FF9F' >");
                    Response.Write(" " + GetNo(i) + "");
                    Response.Write("、" + paperSubject.SubjectName + "");
                    Response.Write("  (共" + paperSubject.ItemCount + "题,共" + paperSubject.TotalScore + "分)</td></tr >");

                    if (PaperItems != null)
                    {
                        for (int j = 0; j < PaperItems.Count; j++)
                        {
                            PaperItem paperItem = PaperItems[j];
                            int       k         = j + 1;

                            Response.Write("<tr > <td align='left'>&nbsp;&nbsp;&nbsp;" + k + ".&nbsp; " + paperItem.Content +
                                           "&nbsp;&nbsp; (" + paperItem.Score + "分)</td></tr >");
                            //多选



                            if (paperSubject.ItemTypeId == 2)
                            {
                                string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' });
                                for (int n = 0; n < strAnswer.Length; n++)
                                {
                                    string strN  = intToString(n + 1);
                                    string strij = "-" + paperItem.PaperItemId + "-" + i.ToString() + "-" + j.ToString() +
                                                   "-" + n.ToString();
                                    string strName = i.ToString() + j.ToString();

                                    Response.Write(
                                        " <tr ><td align='left'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type='checkbox' id='Answer" +
                                        strij + "' name='Answer" + strName + "'> " + strN + "." + strAnswer[n] +
                                        "</td></tr >");
                                }
                            }
                            else
                            {
                                //单选



                                string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' });
                                for (int n = 0; n < strAnswer.Length; n++)
                                {
                                    string strN  = intToString(n + 1);
                                    string strij = "-" + paperItem.PaperItemId + "-" + i.ToString() + "-" + j.ToString() +
                                                   "-" + n.ToString();
                                    string strName = i.ToString() + j.ToString();
                                    Response.Write(
                                        "<tr > <td align='left'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type='Radio' id='RAnswer" +
                                        strij + "' name='RAnswer" + strName + "'> " + strN + "." + strAnswer[n] +
                                        "</td></tr >");
                                }
                            }

                            //string[] strRightAnswer = paperItem.StandardAnswer.Split(new char[] { '|' });
                            //string strNew = "";
                            //for (int n = 0; n < strRightAnswer.Length; n++)
                            //{
                            //    string strN = intToString(int.Parse(strRightAnswer[n])+1);
                            //    if (n == 0)
                            //    {
                            //        strNew += strN;
                            //    }
                            //    else
                            //    {

                            //        strNew += "," + strN;
                            //    }
                            //}

                            //Response.Write(" <tr ><td style='background-color:#7EC0EE' align='left'>★标准答案: " + strNew + "</td></tr >");
                        }
                    }
                    Response.Write(" </table> ");
                }

                Response.Write(" <table><tr><td align='center'><a  onclick='SaveRecord()'  href='#'><b>提交练习</b></a>  ");
                Response.Write("  &nbsp;&nbsp;&nbsp;&nbsp;<a  onclick='Save()'  href='#'><b>关闭</b></a> </td></tr></table>");
            }
            else
            {
                SessionSet.PageMessage = "未找到记录!";
            }
        }
Ejemplo n.º 7
0
 public void UpdatePaperSubject(PaperSubject PaperSubject)
 {
     dal.UpdatePaperSubject(PaperSubject);
 }
Ejemplo n.º 8
0
 public int AddPaperSubject(PaperSubject PaperSubject)
 {
     return(dal.AddPaperSubject(PaperSubject));
 }
Ejemplo n.º 9
0
        protected void FillPaper()
        {
            // QueryString id stands for EXAM_RESULT_ID
            string strId = Request.QueryString.Get("id");

            // Not pass id
            if (string.IsNullOrEmpty(strId))
            {
                return;
            }

            PaperItemBLL        kBLL                = new PaperItemBLL();
            PaperSubjectBLL     kBSLL               = new PaperSubjectBLL();
            ExamResultBLL       examResultBLL       = new ExamResultBLL();
            ExamResultAnswerBLL examResultAnswerBLL = new ExamResultAnswerBLL();

            RailExam.Model.ExamResult examResult = examResultBLL.GetExamResult(int.Parse(strId));
            // Not found
            if (examResult == null)
            {
                return;
            }

            IList <PaperSubject>     PaperSubjects     = kBSLL.GetPaperSubjectByPaperId(examResult.PaperId);
            PaperSubject             paperSubject      = null;
            IList <PaperItem>        PaperItems        = null;
            IList <ExamResultAnswer> examResultAnswers = examResultAnswerBLL.GetExamResultAnswers(examResult.ExamResultId);

            if (PaperSubjects != null)
            {
                for (int i = 0; i < PaperSubjects.Count; i++)
                {
                    paperSubject = PaperSubjects[i];
                    PaperItems   = kBLL.GetItemsByPaperSubjectId(paperSubject.PaperSubjectId);
                    Response.Write("<table width='100%'>");
                    Response.Write(" <tr > <td class='ExamBigTitle' >");
                    Response.Write(" " + GetNo(i) + "");
                    Response.Write(".&nbsp;" + paperSubject.SubjectName + "");
                    Response.Write("  (共" + paperSubject.ItemCount + "题,共" + paperSubject.TotalScore + "分)</td></tr >");

                    // 用于前台JS判断是否完成全部试题
                    hfPaperItemsCount.Value = paperSubject.ItemCount.ToString();

                    if (PaperItems != null)
                    {
                        for (int j = 0; j < PaperItems.Count; j++)
                        {
                            PaperItem paperItem = PaperItems[j];
                            int       k         = j + 1;

                            Response.Write("<tr > <td class='ExamResultItem'>&nbsp;&nbsp;&nbsp;"
                                           + k + ".&nbsp; " + paperItem.Content + "&nbsp;&nbsp;(" + paperItem.Score + "分)</td></tr >");

                            // 组织用户答案
                            ExamResultAnswer theExamResultAnswer = null;
                            string[]         strUserAnswers      = new string[0];
                            string           strUserAnswer       = string.Empty;

                            foreach (ExamResultAnswer resultAnswer in examResultAnswers)
                            {
                                if (resultAnswer.PaperItemId == paperItem.PaperItemId)
                                {
                                    theExamResultAnswer = resultAnswer;
                                    break;
                                }
                            }

                            // 若子表无记录,结束页面输出



                            if (theExamResultAnswer == null)
                            {
                                SessionSet.PageMessage = "数据错误!";

                                return;
                            }

                            // 否则组织考生答案
                            if (theExamResultAnswer.Answer != null)
                            {
                                strUserAnswers = theExamResultAnswer.Answer.Split(new char[] { '|' });
                            }
                            for (int n = 0; n < strUserAnswers.Length; n++)
                            {
                                string strN = intToString(int.Parse(strUserAnswers[n]) + 1);
                                if (n == 0)
                                {
                                    strUserAnswer += strN;
                                }
                                else
                                {
                                    strUserAnswer += "," + strN;
                                }
                            }

                            //多选



                            if (paperSubject.ItemTypeId == 2)
                            {
                                string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' });
                                for (int n = 0; n < strAnswer.Length; n++)
                                {
                                    string strN  = intToString(n + 1);
                                    string strij = "-" + paperItem.PaperItemId + "-" + i.ToString() + "-"
                                                   + j.ToString() + "-" + n.ToString();
                                    string strName = i.ToString() + j.ToString();

                                    Response.Write(" <tr ><td class='ExamItemAnswer'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "
                                                   + "<input type='checkbox' id='Answer" + strij + "' name='Answer" + strName
                                                   + "' " + (Array.IndexOf(strUserAnswers, n) > -1 ? "checked" : "")
                                                   + " disabled/> " + strN + "." + strAnswer[n] + "</td></tr >");
                                }
                            }
                            else
                            {
                                //单选



                                string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' });
                                for (int n = 0; n < strAnswer.Length; n++)
                                {
                                    string strN  = intToString(n + 1);
                                    string strij = "-" + paperItem.PaperItemId + "-" + i.ToString() + "-" + j.ToString()
                                                   + "-" + n.ToString();
                                    string strName = i.ToString() + j.ToString();

                                    Response.Write("<tr > <td class='ExamItemAnswer'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "
                                                   + "<input type='Radio' id='RAnswer" + strij + "' name='RAnswer" + strName
                                                   + "' " + (Array.IndexOf(strUserAnswers, n) > -1 ? "checked" : "")
                                                   + " disabled/> " + strN + "." + strAnswer[n] + "</td></tr >");
                                }
                            }

                            // 组织正确答案
                            string[] strRightAnswers = paperItem.StandardAnswer.Split(new char[] { '|' });
                            string   strRightAnswer  = "";
                            for (int n = 0; n < strRightAnswers.Length; n++)
                            {
                                string strN = intToString(int.Parse(strRightAnswers[n]) + 1);
                                if (n == 0)
                                {
                                    strRightAnswer += strN;
                                }
                                else
                                {
                                    strRightAnswer += "," + strN;
                                }
                            }

                            Response.Write(" <tr><td class='ExamAnswer'>&nbsp;&nbsp;&nbsp;★标准答案:"
                                           + "<span id='span-" + paperItem.PaperItemId + "-0' name='span-" + paperItem.PaperItemId
                                           + "'>" + strRightAnswer + "</span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;考生答案:"
                                           + "<span id='span-" + paperItem.PaperItemId + "-1' name='span-" + paperItem.PaperItemId
                                           + "'>" + strUserAnswer + "</span></td></tr>");
                            Response.Write(" <tr score='" + paperItem.Score
                                           + "'><td class='ExamJudge'>★评分结果:"
                                           + GetJudgeInputs(paperItem.PaperItemId, theExamResultAnswer.JudgeStatusId)
                                           + "&nbsp;&nbsp;&nbsp;&nbsp;"
                                           + "得分<input type='text' id='txtScore" + "-" + paperItem.PaperItemId
                                           + "' name='txtScore" + "-" + paperItem.PaperItemId
                                           + "' value='" + theExamResultAnswer.JudgeScore.ToString(".00")
                                           + "' size='8'></input>&nbsp;&nbsp;&nbsp;&nbsp;"
                                           + "评语<input type='text' id='txtMemo" + "-" + paperItem.PaperItemId
                                           + "' name='txtMemo" + "-" + paperItem.PaperItemId + "' size='40' value='"
                                           + theExamResultAnswer.JudgeRemark + "'></input>"
                                           + "</td></tr>");
                        }
                    }
                    Response.Write(" </table> ");
                }
            }
        }
Ejemplo n.º 10
0
        protected void FillPaper()
        {
            string strId = Request.QueryString.Get("id");

            PaperItemBLL         paperItemBLL    = new PaperItemBLL();
            PaperSubjectBLL      paperSubjectBLL = new PaperSubjectBLL();
            IList <PaperSubject> paperSubjects   = paperSubjectBLL.GetPaperSubjectByPaperId(int.Parse(strId));

            if (paperSubjects != null)
            {
                for (int i = 0; i < paperSubjects.Count; i++)
                {
                    PaperSubject paperSubject = paperSubjects[i];

                    IList <PaperItem> paperItems = paperItemBLL.GetItemsByPaperSubjectId(paperSubject.PaperSubjectId);

                    Response.Write(" <table width='95%' >");
                    Response.Write(" <tr><td id='PaperBigTitle' >");
                    Response.Write(" " + GetNo(i) + "、" + paperSubject.SubjectName + "");
                    Response.Write("  (共" + paperItems.Count + "题,共" + paperItems.Count * paperSubject.UnitScore + "分)</td></tr>");
                    if (paperItems != null)
                    {
                        for (int j = 0; j < paperItems.Count; j++)
                        {
                            PaperItem paperItem = paperItems[j];
                            int       k         = j + 1;
                            string    strij     = i.ToString() + j.ToString();
                            Response.Write("<tr><td id='PaperItem'>&nbsp;&nbsp;&nbsp;" + k + ".&nbsp; " + paperItem.Content + "&nbsp;&nbsp; (" + paperSubject.UnitScore + "分)</td></tr >");

                            if (paperSubject.ItemTypeId == 2)   //多选


                            {
                                string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' });
                                for (int n = 0; n < strAnswer.Length; n++)
                                {
                                    string strN = intToString(n + 1);
                                    Response.Write("<tr><td id='PaperItemAnswer'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='checkbox' id='Answer" + strij + "' name='Answer" + strij + "'> " + strN + "." + strAnswer[n] + "</td></tr>");
                                }
                            }
                            else    //单选


                            {
                                string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' });
                                for (int n = 0; n < strAnswer.Length; n++)
                                {
                                    string strN = intToString(n + 1);

                                    Response.Write("<tr><td id='PaperItemAnswer'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='Radio' id='RAnswer" + strij + "' name='RAnswer" + strij + "'> " + strN + "." + strAnswer[n] + "</td></tr>");
                                }
                            }

                            string[] strRightAnswer = paperItem.StandardAnswer.Split(new char[] { '|' });
                            string   strNew         = string.Empty;
                            for (int n = 0; n < strRightAnswer.Length; n++)
                            {
                                string strN = intToString(int.Parse(strRightAnswer[n]) + 1);
                                if (n == 0)
                                {
                                    strNew += strN;
                                }
                                else
                                {
                                    strNew += "," + strN;
                                }
                            }

                            Response.Write("<tr><td id='PaperAnswer'>&nbsp;&nbsp;&nbsp;★标准答案: " + strNew + "</td></tr>");
                        }
                    }

                    Response.Write("<tr><td>&nbsp;</td></tr></table>");
                }
            }
        }
Ejemplo n.º 11
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            PaperStrategyBookChapterBLL psbcBll = new PaperStrategyBookChapterBLL();
            int Ncount = psbcBll.GetBookChapterCount(int.Parse(Request.QueryString.Get("id")));

            if (Ncount == 0)
            {
                SessionSet.PageMessage = "请添加策略!";
                return;
            }

            string strPaperID = Request.QueryString.Get("Paperid");

            if (!string.IsNullOrEmpty(strPaperID))
            {
                int nStrategyId = int.Parse(Request.QueryString.Get("id"));
                int nPaperId    = int.Parse(strPaperID);

                PaperStrategyBLL paperStrategyBLL = new PaperStrategyBLL();

                RailExam.Model.PaperStrategy paperStrategy = paperStrategyBLL.GetPaperStrategy(nStrategyId);

                PaperStrategySubjectBLL paperStrategySubjectBLL = new PaperStrategySubjectBLL();

                IList <PaperStrategySubject> paperStrategySubjects = paperStrategySubjectBLL.GetPaperStrategySubjectByPaperStrategyId(nStrategyId);

                int nStrategyMode = paperStrategy.StrategyMode;

                for (int i = 0; i < paperStrategySubjects.Count; i++)
                {
                    //大题
                    PaperSubjectBLL paperSubjectBLL = new PaperSubjectBLL();

                    PaperSubject paperSubject = new PaperSubject();

                    paperSubject.ItemCount   = paperStrategySubjects[i].ItemCount;
                    paperSubject.ItemTypeId  = paperStrategySubjects[i].ItemTypeId;
                    paperSubject.Memo        = paperStrategySubjects[i].Memo;
                    paperSubject.OrderIndex  = paperStrategySubjects[i].OrderIndex;
                    paperSubject.PaperId     = nPaperId;
                    paperSubject.Remark      = paperStrategySubjects[i].Remark;
                    paperSubject.SubjectName = paperStrategySubjects[i].SubjectName;
                    paperSubject.TotalScore  = paperStrategySubjects[i].TotalScore;
                    paperSubject.UnitScore   = paperStrategySubjects[i].UnitScore;

                    decimal nUnitScore = paperSubject.UnitScore;

                    int nPaperSubjectId = paperSubjectBLL.AddPaperSubject(paperSubject);

                    ItemBLL itemBLL = new ItemBLL();

                    if (nStrategyMode == 2)  //教材章节模式
                    {
                        PaperStrategyBookChapterBLL paperStrategyBookChapterBLL = new PaperStrategyBookChapterBLL();

                        IList <PaperStrategyBookChapter> paperStrategyBookChapters = paperStrategyBookChapterBLL.GetItemsByPaperStrategySubjectID(paperStrategySubjects[i].PaperStrategySubjectId);

                        for (int k = 0; k < paperStrategyBookChapters.Count; k++)
                        {
                            //策略
                            int nChapterId  = paperStrategyBookChapters[k].RangeId;
                            int nRangeType  = paperStrategyBookChapters[k].RangeType;
                            int typeId      = paperStrategyBookChapters[k].ItemTypeId;
                            int nDifficultR = paperStrategyBookChapters[k].ItemDifficultyRandomCount;
                            //int nDifficulty1 = paperStrategyBookChapters[k].ItemDifficulty1Count;
                            //int nDifficulty2 = paperStrategyBookChapters[k].ItemDifficulty2Count;
                            //int nDifficulty3 = paperStrategyBookChapters[k].ItemDifficulty3Count;
                            //int nDifficulty4 = paperStrategyBookChapters[k].ItemDifficulty4Count;
                            //int nDifficulty5 = paperStrategyBookChapters[k].ItemDifficulty5Count;
                            decimal uScore        = paperStrategyBookChapters[k].UnitScore;
                            string  strExcludeIDs = paperStrategyBookChapters[k].ExcludeChapterId;

                            //难度1
                            //IList<RailExam.Model.Item> itemList = itemBLL.GetItemsByStrategy(nRangeType,1, nChapterId, typeId, strExcludeIDs);

                            //SavePaperItem(itemList, nDifficulty1, nPaperId, nPaperSubjectId, nUnitScore);

                            ////难度2
                            //itemList = itemBLL.GetItemsByStrategy(nRangeType,2, nChapterId, typeId, strExcludeIDs);

                            //SavePaperItem(itemList, nDifficulty2, nPaperId, nPaperSubjectId, nUnitScore);

                            ////难度3
                            //itemList = itemBLL.GetItemsByStrategy(nRangeType,3, nChapterId, typeId, strExcludeIDs);

                            //SavePaperItem(itemList, nDifficulty3, nPaperId, nPaperSubjectId, nUnitScore);

                            ////难度4
                            //itemList = itemBLL.GetItemsByStrategy(nRangeType,4, nChapterId, typeId, strExcludeIDs);

                            //SavePaperItem(itemList, nDifficulty4, nPaperId, nPaperSubjectId, nUnitScore);

                            ////难度5
                            //itemList = itemBLL.GetItemsByStrategy(nRangeType,5, nChapterId, typeId, strExcludeIDs);

                            //SavePaperItem(itemList, nDifficulty5, nPaperId, nPaperSubjectId, nUnitScore);

                            //随机难度

                            Random ObjRandom = new Random();

                            int ndr = ObjRandom.Next(1, 5);

                            //IList<RailExam.Model.Item>  itemList = itemBLL.GetItemsByStrategy(nRangeType, ndr, nChapterId, typeId, strExcludeIDs);

                            //SavePaperItem(itemList, nDifficultR, nPaperId, nPaperSubjectId, nUnitScore);
                        }
                    }
                }
                int     itemCount  = 0;
                decimal totalScore = 0;

                PaperItemBLL paperBLL = new PaperItemBLL();
                IList <RailExam.Model.PaperItem> PaperItems = paperBLL.GetItemsByPaperId(nPaperId);

                if (PaperItems.Count > 0)
                {
                    itemCount  = PaperItems.Count;
                    totalScore = PaperItems[0].Score * PaperItems.Count;
                }


                btnPreview.Visible      = true;
                this.btnedit.Visible    = true;
                this.btnSave.Visible    = false;
                NewButton.Visible       = false;
                btnLast.Visible         = false;
                SessionSet.PageMessage  = "随机生成试卷共" + itemCount + "题," + totalScore + "分,如果试卷题数不等于设定的总题数请手工进行修改!";
                ViewState["DeleteFlag"] = 1;
            }
            else
            {
                Response.Write("<script>top.window.opener.form1.Refresh.value='true';top.window.opener.form1.submit();top.window.close();</script>");
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            int nStrategyId = int.Parse(hfStrategyId.Value);
            int nPaperId    = int.Parse(Request.QueryString.Get("id"));

            PaperStrategyBLL paperStrategyBLL = new PaperStrategyBLL();

            RailExam.Model.PaperStrategy paperStrategy = paperStrategyBLL.GetPaperStrategy(nStrategyId);

            PaperStrategySubjectBLL paperStrategySubjectBLL = new PaperStrategySubjectBLL();

            IList <PaperStrategySubject> paperStrategySubjects = paperStrategySubjectBLL.GetPaperStrategySubjectByPaperStrategyId(nStrategyId);

            int nStrategyMode = paperStrategy.StrategyMode;

            txtStrategyName.Text = paperStrategy.PaperStrategyName;

            for (int i = 0; i < paperStrategySubjects.Count; i++)
            {
                //大题
                PaperSubjectBLL paperSubjectBLL = new PaperSubjectBLL();

                PaperSubject paperSubject = new PaperSubject();

                paperSubject.ItemCount   = paperStrategySubjects[i].ItemCount;
                paperSubject.ItemTypeId  = paperStrategySubjects[i].ItemTypeId;
                paperSubject.Memo        = paperStrategySubjects[i].Memo;
                paperSubject.OrderIndex  = paperStrategySubjects[i].OrderIndex;
                paperSubject.PaperId     = nPaperId;
                paperSubject.Remark      = paperStrategySubjects[i].Remark;
                paperSubject.SubjectName = paperStrategySubjects[i].SubjectName;
                paperSubject.TotalScore  = paperStrategySubjects[i].TotalScore;
                paperSubject.UnitScore   = paperStrategySubjects[i].UnitScore;

                decimal nUnitScore = paperSubject.UnitScore;

                int nPaperSubjectId = paperSubjectBLL.AddPaperSubject(paperSubject);

                ItemBLL itemBLL = new ItemBLL();

                if (nStrategyMode == 2)  //教材章节模式
                {
                    PaperStrategyBookChapterBLL paperStrategyBookChapterBLL = new PaperStrategyBookChapterBLL();

                    IList <PaperStrategyBookChapter> paperStrategyBookChapters = paperStrategyBookChapterBLL.GetItemsByPaperStrategySubjectID(paperStrategySubjects[i].PaperStrategySubjectId);

                    for (int k = 0; k < paperStrategyBookChapters.Count; k++)
                    {
                        //策略
                        int nChapterId  = paperStrategyBookChapters[k].RangeId;
                        int typeId      = paperStrategyBookChapters[k].ItemTypeId;
                        int nRangeType  = paperStrategyBookChapters[k].RangeType;
                        int nDifficultR = paperStrategyBookChapters[k].ItemDifficultyRandomCount;
                        //int nDifficulty1 = paperStrategyBookChapters[k].ItemDifficulty1Count;
                        //int nDifficulty2 = paperStrategyBookChapters[k].ItemDifficulty2Count;
                        //int nDifficulty3 = paperStrategyBookChapters[k].ItemDifficulty3Count;
                        //int nDifficulty4 = paperStrategyBookChapters[k].ItemDifficulty4Count;
                        //int nDifficulty5 = paperStrategyBookChapters[k].ItemDifficulty5Count;
                        decimal uScore        = paperStrategyBookChapters[k].UnitScore;
                        string  strExcludeIDs = paperStrategyBookChapters[k].ExcludeChapterId;

                        ////难度1
                        //IList<RailExam.Model.Item> itemList = itemBLL.GetItemsByStrategy(nRangeType, 1, nChapterId, typeId, strExcludeIDs);

                        //SavePaperItem(itemList, nDifficulty1, nPaperId, nPaperSubjectId, nUnitScore);

                        ////难度2
                        //itemList = itemBLL.GetItemsByStrategy(nRangeType, 2, nChapterId, typeId, strExcludeIDs);

                        //SavePaperItem(itemList, nDifficulty2, nPaperId, nPaperSubjectId, nUnitScore);

                        ////难度3
                        //itemList = itemBLL.GetItemsByStrategy(nRangeType, 3, nChapterId, typeId, strExcludeIDs);

                        //SavePaperItem(itemList, nDifficulty3, nPaperId, nPaperSubjectId, nUnitScore);

                        ////难度4
                        //itemList = itemBLL.GetItemsByStrategy(nRangeType, 4, nChapterId, typeId, strExcludeIDs);

                        //SavePaperItem(itemList, nDifficulty4, nPaperId, nPaperSubjectId, nUnitScore);

                        ////难度5
                        //itemList = itemBLL.GetItemsByStrategy(nRangeType, 5, nChapterId, typeId, strExcludeIDs);

                        //SavePaperItem(itemList, nDifficulty5, nPaperId, nPaperSubjectId, nUnitScore);

                        //随机难度

                        Random ObjRandom = new Random();

                        int ndr = ObjRandom.Next(1, 5);

                        //IList<RailExam.Model.Item> itemList = itemBLL.GetItemsByStrategy(nRangeType, ndr, nChapterId, typeId, strExcludeIDs);

                        //SavePaperItem(itemList, nDifficultR, nPaperId, nPaperSubjectId, nUnitScore);
                    }
                }
                else    //试题辅助分类模式
                {
                    PaperStrategyItemCategoryBLL paperStrategyItemCategoryBLL = new PaperStrategyItemCategoryBLL();

                    IList <PaperStrategyItemCategory> paperStrategyItemCategorys = paperStrategyItemCategoryBLL.GetItemsByPaperSubjectId(paperStrategySubjects[i].PaperStrategySubjectId);

                    for (int k = 0; k < paperStrategyItemCategorys.Count; k++)
                    {
                        //策略
                        int nChapterId  = paperStrategyItemCategorys[k].ItemCategoryId;
                        int typeId      = paperStrategyItemCategorys[k].ItemTypeId;
                        int nDifficultR = paperStrategyItemCategorys[k].ItemDifficultyRandomCount;
                        //int nDifficulty1 = paperStrategyItemCategorys[k].ItemDifficulty1Count;
                        //int nDifficulty2 = paperStrategyItemCategorys[k].ItemDifficulty2Count;
                        //int nDifficulty3 = paperStrategyItemCategorys[k].ItemDifficulty3Count;
                        //int nDifficulty4 = paperStrategyItemCategorys[k].ItemDifficulty4Count;
                        //int nDifficulty5 = paperStrategyItemCategorys[k].ItemDifficulty5Count;
                        decimal uScore        = paperStrategyItemCategorys[k].UnitScore;
                        string  strExcludeIDs = paperStrategyItemCategorys[k].ExcludeCategorysId;

                        ////难度1
                        //IList<RailExam.Model.Item> itemList = itemBLL.GetItemsByStrategyItem(1, nChapterId, typeId, strExcludeIDs);

                        //SavePaperItem(itemList, nDifficulty1, nPaperId, nPaperSubjectId, nUnitScore);

                        ////难度2
                        //itemList = itemBLL.GetItemsByStrategyItem(2, nChapterId, typeId, strExcludeIDs);

                        //SavePaperItem(itemList, nDifficulty2, nPaperId, nPaperSubjectId, nUnitScore);

                        ////难度3
                        //itemList = itemBLL.GetItemsByStrategyItem(3, nChapterId, typeId, strExcludeIDs);

                        //SavePaperItem(itemList, nDifficulty3, nPaperId, nPaperSubjectId, nUnitScore);

                        ////难度4
                        //itemList = itemBLL.GetItemsByStrategyItem(4, nChapterId, typeId, strExcludeIDs);

                        //SavePaperItem(itemList, nDifficulty4, nPaperId, nPaperSubjectId, nUnitScore);

                        ////难度5
                        //itemList = itemBLL.GetItemsByStrategyItem(5, nChapterId, typeId, strExcludeIDs);

                        //SavePaperItem(itemList, nDifficulty5, nPaperId, nPaperSubjectId, nUnitScore);

                        //随机难度

                        Random ObjRandom = new Random();

                        int ndr = ObjRandom.Next(1, 5);

                        IList <RailExam.Model.Item> itemList = itemBLL.GetItemsByStrategyItem(ndr, nChapterId, typeId, strExcludeIDs);

                        SavePaperItem(itemList, nDifficultR, nPaperId, nPaperSubjectId, nUnitScore);
                    }
                }
            }

            int     itemCount  = 0;
            decimal totalScore = 0;

            PaperItemBLL paperBLL = new PaperItemBLL();
            IList <RailExam.Model.PaperItem> PaperItems = paperBLL.GetItemsByPaperId(nPaperId);

            if (PaperItems.Count > 0)
            {
                itemCount  = PaperItems.Count;
                totalScore = PaperItems[0].Score * PaperItems.Count;
            }

            SessionSet.PageMessage = "随机生成试卷共" + itemCount + "题," + totalScore + "分,如果试卷题数不等于设定的总题数请手工进行修改!";
            this.btnSave.Visible   = false;
            this.btnLast.Visible   = false;
            btnPreview.Visible     = true;
            btnEdit.Visible        = true;
        }
Ejemplo n.º 13
0
        protected void FillResultPaper(string strTaskResultId)
        {
            string strId = strTaskResultId;

            // Not pass id
            if (string.IsNullOrEmpty(strId))
            {
                return;
            }

            PaperItemBLL        kBLL                = new PaperItemBLL();
            PaperSubjectBLL     kBSLL               = new PaperSubjectBLL();
            TaskResultBLL       examResultBLL       = new TaskResultBLL();
            TaskResultAnswerBLL examResultAnswerBLL = new TaskResultAnswerBLL();
            TaskResult          examResult          = examResultBLL.GetTaskResult(int.Parse(strId));

            // Not found
            if (examResult == null)
            {
                return;
            }

            IList <PaperSubject>     PaperSubjects     = kBSLL.GetPaperSubjectByPaperId(examResult.PaperId);
            PaperSubject             paperSubject      = null;
            IList <PaperItem>        PaperItems        = null;
            IList <TaskResultAnswer> examResultAnswers = examResultAnswerBLL.GetTaskResultAnswers(examResult.TaskResultId);

            if (PaperSubjects != null)
            {
                for (int i = 0; i < PaperSubjects.Count; i++)
                {
                    paperSubject = PaperSubjects[i];
                    PaperItems   = kBLL.GetItemsByPaperSubjectId(paperSubject.PaperSubjectId);
                    Response.Write("<table width='100%' class='contentTable'>");
                    Response.Write(" <tr > <td align='left' style='background-color:#54FF9F' >");
                    Response.Write(" " + GetNo(i) + "");
                    Response.Write(".&nbsp;" + paperSubject.SubjectName + "");
                    Response.Write("  (共" + paperSubject.ItemCount + "题,共" + paperSubject.ItemCount * paperSubject.UnitScore + "分)</td></tr >");

                    // 用于前台JS判断是否完成全部试题
                    hfPaperItemsCount.Value = paperSubject.ItemCount.ToString();

                    if (PaperItems != null)
                    {
                        for (int j = 0; j < PaperItems.Count; j++)
                        {
                            PaperItem paperItem = PaperItems[j];
                            int       k         = j + 1;

                            Response.Write("<tr > <td style='text-align:left; background-color:gainsboro;'>&nbsp;&nbsp;&nbsp;"
                                           + k + ".&nbsp; " + paperItem.Content + "&nbsp;&nbsp;(" + paperSubject.UnitScore + "分)</td></tr >");

                            // 组织用户答案
                            TaskResultAnswer theExamResultAnswer = null;
                            string[]         strUserAnswers      = new string[0];
                            string           strUserAnswer       = string.Empty;

                            foreach (TaskResultAnswer resultAnswer in examResultAnswers)
                            {
                                if (resultAnswer.PaperItemId == paperItem.PaperItemId)
                                {
                                    theExamResultAnswer = resultAnswer;
                                    break;
                                }
                            }

                            // 若子表无记录,结束页面输出



                            if (theExamResultAnswer == null)
                            {
                                SessionSet.PageMessage = "数据错误!";

                                return;
                            }

                            // 否则组织考生答案
                            if (theExamResultAnswer.Answer != null)
                            {
                                strUserAnswers = theExamResultAnswer.Answer.Split(new char[] { '|' });
                            }
                            for (int n = 0; n < strUserAnswers.Length; n++)
                            {
                                string strN = intToString(int.Parse(strUserAnswers[n]) + 1);
                                if (n == 0)
                                {
                                    strUserAnswer += strN;
                                }
                                else
                                {
                                    strUserAnswer += "," + strN;
                                }
                            }

                            //多选



                            if (paperSubject.ItemTypeId == 2)
                            {
                                string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' });
                                for (int n = 0; n < strAnswer.Length; n++)
                                {
                                    string strN  = intToString(n + 1);
                                    string strij = "-" + paperItem.PaperItemId + "-" + i.ToString() + "-"
                                                   + j.ToString() + "-" + n.ToString();
                                    string strName = i.ToString() + j.ToString();

                                    Response.Write(" <tr ><td align='left'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "
                                                   + "<input type='checkbox' id='Answer" + strij + "' name='Answer" + strName
                                                   + "' " + (Array.IndexOf(strUserAnswers, n) > -1 ? "checked" : "")
                                                   + " disabled/> " + strN + "." + strAnswer[n] + "</td></tr >");
                                }
                            }
                            else
                            {
                                //单选



                                string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' });
                                for (int n = 0; n < strAnswer.Length; n++)
                                {
                                    string strN  = intToString(n + 1);
                                    string strij = "-" + paperItem.PaperItemId + "-" + i.ToString() + "-" + j.ToString()
                                                   + "-" + n.ToString();
                                    string strName = i.ToString() + j.ToString();

                                    Response.Write("<tr > <td align='left'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "
                                                   + "<input type='Radio' id='RAnswer" + strij + "' name='RAnswer" + strName
                                                   + "' " + (Array.IndexOf(strUserAnswers, n) > -1 ? "checked" : "")
                                                   + " disabled/> " + strN + "." + strAnswer[n] + "</td></tr >");
                                }
                            }

                            // 组织正确答案
                            string[] strRightAnswers = paperItem.StandardAnswer.Split(new char[] { '|' });
                            string   strRightAnswer  = "";
                            for (int n = 0; n < strRightAnswers.Length; n++)
                            {
                                string strN = intToString(int.Parse(strRightAnswers[n]) + 1);
                                if (n == 0)
                                {
                                    strRightAnswer += strN;
                                }
                                else
                                {
                                    strRightAnswer += "," + strN;
                                }
                            }

                            Response.Write(" <tr><td style='color:green; text-align:left; '>&nbsp;&nbsp;&nbsp;★标准答案:"
                                           + "<span id='span-" + paperItem.PaperItemId + "-0' name='span-" + paperItem.PaperItemId
                                           + "'>" + strRightAnswer + "</span></td></tr>");

                            Response.Write(" <tr><td style='color:blue; text-align:left; '>&nbsp;&nbsp;&nbsp;★考生答案:"
                                           + "<span id='span-" + paperItem.PaperItemId + "-1' name='span-" + paperItem.PaperItemId
                                           + "'>" + strUserAnswer + "</span></td></tr>");

                            Response.Write(" <tr score='" + paperItem.Score
                                           + "'><td style='color:purple; text-align:left; '>★"//

                                           + "得分<input type='text'  readonly id='txtScore" + "-" + paperItem.PaperItemId
                                           + "' name='txtScore" + "-" + paperItem.PaperItemId
                                           + "' value='" + theExamResultAnswer.JudgeScore.ToString(".00")
                                           + "' size='8'  style='width:20%'></input>&nbsp;&nbsp;&nbsp;&nbsp;"
                                           + "评语<input type='text' readonly id='txtMemo" + "-" + paperItem.PaperItemId
                                           + "' name='txtMemo" + "-" + paperItem.PaperItemId + "' size='40' value='"
                                           + theExamResultAnswer.JudgeRemark + "'  style='width:70%'></input>"
                                           + "</td></tr>");
                        }
                    }

                    Response.Write(" </table> ");
                }
            }

            Response.Write("<table width='100%'> <tr></tr><tr><td style='color:purple;text-align:left; '> ★★★该作业最终得分:" + examResult.Score + "分 </td></tr></table>");

            Response.Write("<table width='100%'> <tr><td style='text-align:center; '><a onclick='Close()' href='#'><b>关闭</b></a> </td></tr></table>");
        }