private void listQuiz() { string Rnum = cook.Snum; int Qgrade = cook.Sgrade; int Qclass = cook.Sclass; LearnSite.Model.QuizGrade qmodel = new LearnSite.Model.QuizGrade(); LearnSite.BLL.QuizGrade qbll = new LearnSite.BLL.QuizGrade(); qmodel = qbll.GetModelByQobjRclass(Qgrade, Qclass); if (qmodel != null) { if (qmodel.Qopen.Value) { string selectclass = qmodel.Qclass; if (!string.IsNullOrEmpty(selectclass)) { bool isok = true; if (isok) { LearnSite.BLL.Quiz bll = new LearnSite.BLL.Quiz(); DataListonly.DataSource = bll.GetListByQtypeNum(0, qmodel.Qonly.Value, selectclass); DataListonly.DataBind(); DataListmore.DataSource = bll.GetListByQtypeNum(1, qmodel.Qmore.Value, selectclass); DataListmore.DataBind(); DataListjudge.DataSource = bll.GetListByQtypeNum(2, qmodel.Qjudge.Value, selectclass); DataListjudge.DataBind(); Btnquiz.Enabled = true; if (string.IsNullOrEmpty(qmodel.Qanswer.ToString())) { Session[Rnum + "quizQanswer"] = "false"; } else { Session[Rnum + "quizQanswer"] = qmodel.Qanswer.ToString(); } } selectclass = selectclass.Replace("'", ""); showscope.InnerHtml = Qgrade.ToString() + "年级试题范围:<br />" + selectclass.Replace(",", "<br />");//增加试题范围提示 } else { Labelmsg.Text = "老师没有选择试题范围!"; } } else { Btnquiz.Enabled = false; Labelmsg.Text = "测验暂停,请咨询老师开启!"; } } else { Btnquiz.Enabled = false; Labelmsg.Text = "请咨询老师设置本班测验!"; } }
private void showQuestion() { if (Request.QueryString["Vid"] != null) { string qvid = Request.QueryString["Vid"].ToString(); LearnSite.BLL.SurveyQuestion qbll = new LearnSite.BLL.SurveyQuestion(); DataListonly.DataSource = qbll.GetListByQvid(Int32.Parse(qvid)); DataListonly.DataBind(); } }