예제 #1
0
        /// <summary>
        /// 考卷预览试卷
        /// </summary>
        /// <param name="singleList"></param>
        /// <param name="judgeList"></param>
        /// <returns></returns>
        public ActionResult ViewSelectedPaper(string paperTitle, string singleList, string judgeList)
        {
            // 教师选中的试卷题目数据
            DataTable singleTable = new SingleBLL().GetSingleList(singleList);
            DataTable judgeTable  = new JudgeBLL().GetJudgeList(judgeList);

            DataSet dataSet = new DataSet();

            dataSet.Tables.Add(singleTable);
            dataSet.Tables.Add(judgeTable);

            if (singleTable.Rows.Count > 0 && judgeTable.Rows.Count > 0)
            {
                return(Content(new AjaxResult
                {
                    state = ResultType.success.ToString(),
                    data = dataSet
                }.ToJson()));
            }
            else
            {
                return(Content(new AjaxResult
                {
                    state = ResultType.info.ToString(),
                    data = null,
                    message = "试卷预览失败,题量出错!"
                }.ToJson()));
            }
        }
예제 #2
0
        /// <summary>
        /// 考试信息发布页面显示
        /// </summary>
        /// <returns></returns>
        public ActionResult ExamRelease()
        {
            // 获取教师信息
            User      user      = (User)Session["User"];
            Guid      userId    = user.ID;
            DataTable userTable = new TeacherBLL().GetTeacher(userId);

            ViewBag.TeacherName = userTable.Rows[0]["Name"];
            ViewBag.CourseName  = userTable.Rows[0]["CourseName"];


            // 教师任课的所有班级
            DataTable classTable = new ClassBLL().GetTeacherAllClass(userId);

            // 教师专业的题库数据
            Guid      courseId    = Guid.Parse(userTable.Rows[0]["CourseID"].ToString());
            DataTable singleTable = new SingleBLL().GetSingleOptinsByCourse(courseId);
            DataTable judegTable  = new JudgeBLL().GetJudgeOptinsByCourse(courseId);

            // 打包DataSet传到前端
            DataSet ds = new DataSet();

            ds.Tables.Add(singleTable);
            ds.Tables.Add(judegTable);
            ds.Tables.Add(classTable);

            return(View(ds));
        }
예제 #3
0
        /// <summary>
        /// 开始考试
        /// </summary>
        /// <returns></returns>
        public ActionResult BeginExam(Guid guid)
        {
            DataTable table_paper = new ExaminationBLL().GetExamByID(guid);             // 获取试卷信息

            // 检测考试是否过期
            if (table_paper.Rows.Count == 0)
            {
                return(RedirectToAction("../Student/ExamOnline"));
            }
            // 给前台传递试卷信息
            ViewBag.PaperName   = table_paper.Rows[0]["PaperTitle"].ToString();                                                  // 试卷名称
            ViewBag.ReleaseTime = Convert.ToDateTime(table_paper.Rows[0]["ReleaseTime"]).ToString("yyyy年MM月dd日HH时mm分");          // 发布时间
            ViewBag.CourseName  = table_paper.Rows[0]["CourseName"].ToString();                                                  // 科目名
            ViewBag.TeacherName = table_paper.Rows[0]["Name"].ToString();                                                        // 教师名
            ViewBag.RollOutTime = table_paper.Rows[0]["RollOutTime"].ToString();                                                 // 考试时长

            // 选择题信息
            string    single_list  = table_paper.Rows[0]["SingleList"].ToString();
            DataTable single_table = new SingleBLL().GetSingleList(single_list, "desc");                // 选择题信息列表

            // 判断题信息
            string    judge_list  = table_paper.Rows[0]["JudgeList"].ToString();
            DataTable judge_table = new JudgeBLL().GetJudgeList(judge_list, "desc");                    // 判断题信息列表

            // 选择题排序规则
            string    single_option  = table_paper.Rows[0]["SingleOption"].ToString();
            DataTable s_option_table = GetOptionsTable(single_option);                                  // 选择题选项排序规则

            // 判断题排序规则
            string    judge_option   = table_paper.Rows[0]["JudgeOption"].ToString();
            DataTable j_option_table = GetOptionsTable(judge_option);                                   // 判断题选项排序规则

            // 打包提交
            DataSet dataSet = new DataSet();

            dataSet.Tables.Add(single_table);
            dataSet.Tables.Add(s_option_table);
            dataSet.Tables.Add(judge_table);
            dataSet.Tables.Add(j_option_table);


            // 试卷信息
            Session["PaperID"]      = guid;
            Session["PaperOptions"] = dataSet; // 试卷题目所有信息(包含排序规则)

            return(View(dataSet));
        }
예제 #4
0
        /// <summary>
        /// 历史考试详细信息
        /// </summary>
        /// <param name="guid"></param>
        /// <returns></returns>
        public ActionResult HistoryExam(Guid guid)
        {
            DataTable table_paper = new ResultDetailBLL().GethistoryDetailByID(guid);             // 获取试卷信息

            // 给前台传递试卷信息
            ViewBag.PaperName   = table_paper.Rows[0]["PaperTitle"].ToString();                                                  // 试卷名称
            ViewBag.ReleaseTime = Convert.ToDateTime(table_paper.Rows[0]["ReleaseTime"]).ToString("yyyy年MM月dd日HH时mm分");          // 发布时间
            ViewBag.CourseName  = table_paper.Rows[0]["CourseName"].ToString();                                                  // 科目名
            ViewBag.TeacherName = table_paper.Rows[0]["Name"].ToString();                                                        // 教师名
            ViewBag.RollOutTime = table_paper.Rows[0]["RollOutTime"].ToString();
            ViewBag.ResultPoint = table_paper.Rows[0]["Result"].ToString();
            ViewBag.OverTime    = Convert.ToDateTime(table_paper.Rows[0]["OverTime"]).ToString("yyyy/MM/dd HH:mm");                  // 提交时间

            // 选择题信息
            string    single_list  = table_paper.Rows[0]["SingleList"].ToString();
            DataTable single_table = new SingleBLL().GetSingleList(single_list, "desc");                // 选择题信息列表

            // 判断题信息
            string    judge_list  = table_paper.Rows[0]["JudgeList"].ToString();
            DataTable judge_table = new JudgeBLL().GetJudgeList(judge_list, "desc");                    // 判断题信息列表

            // 选择题排序规则
            string    single_option  = table_paper.Rows[0]["SingleOption"].ToString();
            DataTable s_option_table = GetOptionsTable(single_option);                                  // 选择题选项排序规则

            // 判断题排序规则
            string    judge_option   = table_paper.Rows[0]["JudgeOption"].ToString();
            DataTable j_option_table = GetOptionsTable(judge_option);                                   // 判断题选项排序规则

            // 用户选择答案
            string    user_select  = table_paper.Rows[0]["SelectList"].ToString();
            DataTable select_table = GetOptionsTable(user_select);

            // 打包提交
            DataSet dataSet = new DataSet();

            dataSet.Tables.Add(single_table);
            dataSet.Tables.Add(s_option_table);
            dataSet.Tables.Add(judge_table);
            dataSet.Tables.Add(j_option_table);
            dataSet.Tables.Add(select_table);

            return(View(dataSet));
        }