示例#1
0
        public ActionResult paper()
        {
            M_Exam_Sys_Papers paperMod = paperBll.SelReturnModel(Mid);
            DataTable         QuestDT  = questBll.SelByIDSForExam(paperMod.QIDS, paperMod.id);//获取问题,自动组卷则筛选合适的IDS
            DataTable         typeDT   = ansBll.GetTypeDT(QuestDT);

            ViewBag.pname   = paperMod.p_name;
            ViewBag.questDt = QuestDT;
            ViewBag.typeDt  = typeDT;
            return(View());
        }
示例#2
0
        private void MyBind()
        {
            M_UserInfo mu = userBll.GetLogin();
            // if (mu.UserID < 1 || Mid < 1) { return; }
            M_Exam_Sys_Papers paperMod = paperBll.SelReturnModel(Mid);

            //M_Temp tempMod = tempBll.SelModelByUid(mu.UserID, 10);
            //ExTime = DataConverter.CLng(paperMod.p_UseTime);
            //if (tempMod == null || string.IsNullOrEmpty(tempMod.Str1)) { function.WriteErrMsg("试题篮为空,请先选择试题!"); }
            Title_L.Text = paperMod.p_name;
            //string ids = "";
            //DataTable dt = SqlHelper.ExecuteTable(CommandType.Text, "SELECT p_id FROM ZL_Exam_Sys_Questions");
            //foreach (DataRow dr in dt.Rows)
            //{
            //    ids += dr["p_id"] + ",";
            //}
            //ids = ids.TrimEnd(',');
            QuestDT = questBll.SelByIDSForExam(paperMod.QIDS, paperMod.id); //获取问题,自动组卷则筛选合适的IDS
                                                                            //QuestDT.DefaultView.RowFilter = "";
                                                                            //QuestDT_Hid.Value = JsonConvert.SerializeObject(QuestDT.DefaultView.ToTable(false, "p_id,p_title,p_type,p_defaultScores,istoshare,pid".Split(',')));
            DataTable typeDT = answerBll.GetTypeDT(QuestDT);

            MainRPT.DataSource = typeDT;
            MainRPT.DataBind();
        }
示例#3
0
 public VM_ExamDetail(M_UserInfo mu, M_Exam_Sys_Papers paperMod, HttpRequestBase Request)
 {
     this.mu       = mu;
     this.paperMod = paperMod;
     Action        = (Request.QueryString["action"] ?? "").ToLower();
     FlowID        = Request.QueryString["FlowID"] ?? "";
     QuestDT       = questBll.SelByIDSForExam(paperMod.QIDS, paperMod.id);//获取问题,自动组卷则筛选合适的IDS
     QuestDT.DefaultView.RowFilter = "";
     QuestDT_Hid = JsonConvert.SerializeObject(QuestDT.DefaultView.ToTable(false, "p_id,p_title,p_type,p_defaultScores,istoshare,pid".Split(',')));
     typeDT      = answerBll.GetTypeDT(QuestDT);
     ExTime      = DataConverter.CLng(paperMod.p_UseTime);
     if (Action.Equals("view"))//显示答案
     {
         AnswerDT = answerBll.SelByPid(mu.UserID, paperMod.id, FlowID);
         if (AnswerDT.Rows.Count < 1)
         {
             function.WriteErrMsg("你尚未完成答卷");
         }
         AnswerDT.DefaultView.RowFilter = "";
         Answer_Hid = JsonConvert.SerializeObject(AnswerDT.DefaultView.ToTable(true, "ID,QID,QType,QTitle,Answer,IsRight,Remark".Split(',')));
         answerMod  = answerBll.SelMainModel(FlowID);
         //-----显示得分
         //MySchool_T.Enabled = false;
         //MyClass_T.Enabled = false;
         //UName_T.Enabled = false;
         useTime    = "用时 " + (answerMod.CDate - answerMod.StartDate).TotalMinutes.ToString("f0") + " 分钟";
         totalScore = "得分:" + DataConverter.CLng(AnswerDT.Select("Remind=1")[0]["TotalScore"]);
     }
 }
示例#4
0
        public ActionResult ViewPaperCenter()
        {
            if (!B_ARoleAuth.AuthCheckEx(ZLEnum.Auth.exam, "paper"))
            {
                return(null);
            }
            if (Mid < 1)
            {
                function.WriteErrMsg("请输入试卷ID"); return(null);
            }
            M_Exam_Sys_Papers paperMod = paperBll.SelReturnModel(Mid);

            ViewBag.title   = paperMod.p_name;
            ViewBag.paperid = paperMod.id;
            ViewBag.desc    = paperMod.p_Remark;
            //获取问题,自动组卷则筛选合适的IDS
            DataTable questDt = questBll.SelByIDSForExam(paperMod.QIDS, Mid) ?? new DataTable();
            DataTable typeDt  = answerBll.GetTypeDT(questDt) ?? new DataTable();

            ViewBag.questDt = questDt;
            ViewBag.typeDt  = typeDt;
            return(View());
        }
        private void MyBind()
        {
            M_Exam_Sys_Papers paperMod = paperBll.SelReturnModel(PaperID);

            Title_T.Text = paperMod.p_name;
            QuestDT      = questBll.SelByIDSForExam(paperMod.QIDS, PaperID);//获取问题,自动组卷则筛选合适的IDS
            if (QuestDT != null)
            {
                QuestDT.DefaultView.RowFilter = "";
                DataTable typeDT = answerBll.GetTypeDT(QuestDT);
                MainRPT.DataSource = typeDT;
                MainRPT.DataBind();
            }
        }
示例#6
0
        public void MyBind()
        {
            M_Exam_Sys_Questions model = questionBll.GetSelect(QID);

            if (model == null)
            {
                function.WriteErrMsg("无效id!");
            }
            Title_L.Text = model.p_title;
            Grade_L.Text = B_GradeOption.GetGradeOption(model.p_Views).GradeName;
            Diff_L.Text  = questionBll.GetDiffStr(model.p_Difficulty);
            QType_L.Text = M_Exam_Sys_Questions.GetTypeStr(model.p_Type);
            if (!string.IsNullOrEmpty(model.Tagkey))
            {
                KeyWord_L.Text = knowBll.GetNamesByIDS(model.Tagkey);
            }
            Content_Li.Text = model.p_Content;
            if (model.p_Type == 10)
            {
                Content_Li.Text   = model.LargeContent;
                Option_Li.Visible = false;
                Quest_RPT.Visible = true;
                DataTable dt = questionBll.SelByIDSForExam(model.p_id.ToString());
                dt.DefaultView.RowFilter = "pid>0";
                dt.DefaultView.Sort      = "order desc";
                Quest_RPT.DataSource     = dt;
                Quest_RPT.DataBind();
            }
            else
            {
                Option_Li.Text = questionBll.GetSubmit(model.p_id, model.p_Type, ref AngularJS);
            }
            Socre_L.Text       = model.p_defaultScores.ToString();
            QuestNum_L.Text    = model.p_ChoseNum.ToString();
            Answer_L.Text      = model.p_Answer;
            AnswerHtml_Li.Text = model.p_shuming;
            Jiexi_Li.Text      = model.Jiexi;
        }