Ejemplo n.º 1
0
    protected void BindCeshiOntime()
    {
        string    kechengid = Session["kechengid"].ToString();
        string    username  = ((FormsIdentity)HttpContext.Current.User.Identity).Ticket.Name;
        DataTable dt        = CeshiInfo.GetStuCeshi(username);

        GridView2.DataSource = dt;
        GridView2.DataBind();
    }
Ejemplo n.º 2
0
    protected void Bindceshi()//绑定测试项目
    {
        string  username  = ((FormsIdentity)HttpContext.Current.User.Identity).Ticket.Name;
        string  kechengid = Session["kechengid"].ToString();
        string  banjiid   = ListBoxbj.SelectedValue;
        DataSet ds        = CeshiInfo.GetTeacherCeshi(username, kechengid, banjiid);

        ListBoxcs.DataSource = ds;
        ListBoxcs.DataBind();
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string username  = ((FormsIdentity)HttpContext.Current.User.Identity).Ticket.Name;
        int    shijuanid = int.Parse(Request.QueryString["shijuanid"]);

        lbl_xuehao.Text      = username;
        lbl_shijuanname.Text = CeshiInfo.GetCeshiName(shijuanid);
        lbl_xingming.Text    = StudentInfo.GetStuXingming(username);
        Jianchashijuan(username, shijuanid);
    }
Ejemplo n.º 4
0
    protected void GridView2_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        string    kechengid = Session["kechengid"].ToString();
        string    username  = ((FormsIdentity)HttpContext.Current.User.Identity).Ticket.Name;
        DataTable dt        = CeshiInfo.GetStuCeshi(username);

        GridView2.DataSource = dt;
        GridView2.PageIndex  = e.NewPageIndex;
        GridView2.DataBind();
    }
Ejemplo n.º 5
0
    protected void BindCeshiChengjiHuizong()
    {
        string    username  = ((FormsIdentity)HttpContext.Current.User.Identity).Ticket.Name;
        string    kechengid = Session["kechengid"].ToString();
        string    banjiid   = Request.QueryString["banjiid"];
        DataTable ds        = CeshiInfo.CeshiHuizong(username, kechengid, banjiid);

        GridView1.DataSource = ds;
        GridView1.DataBind();
    }
    /*测试的几种状态:
     * 1、保存过答案,但由于某种原因又重新进行考试;
     * 2、第一次进行考试,答案全是空的
     * 3、刚刚保存了答案;保持题目原来的答案即可
     * 4、已交卷。不再显示题目及答案。
     */
    protected void Page_Load(object sender, EventArgs e)
    {
        string username  = ((FormsIdentity)HttpContext.Current.User.Identity).Ticket.Name;
        int    shijuanid = 0;

        if (Request.QueryString["shijuanid"] != null)
        {
            shijuanid = int.Parse(Request.QueryString["shijuanid"]);
        }
        else
        {
            Response.Redirect("jiaoshiceshi.aspx");
        }
        if (CeshiInfo.IsIpXianzhi(shijuanid))//如果该考试限制IP地址
        {
            SetStukaoshiIp(username, shijuanid);
            switch (CheckIp(username, shijuanid))
            {
            case 1:    //学生考试机的IP与数据库中登记的IP不一致,需要到原来考试的机器上进行考试
                ScriptManager.RegisterClientScriptBlock(this, typeof(string), "", "alert('考试过程中不允许换机器!请到您初次进行考试的电脑进行考试,或与教师联系。');", true);
                SetTimerStop();
                return;

            case 2:
                ScriptManager.RegisterClientScriptBlock(this, typeof(string), "", "alert('检测到您所在的电脑已有同学进行本次考试!请换台电脑进行考试。');", true);
                SetTimerStop();
                return;
            }
        }
        if (!IsPostBack)
        {
            XianshiTimu(int.Parse(lbl_tihao.Text));
            GetCeshiJibenInfo();
            GetStudentCeshiInfo(username, shijuanid);
        }
    }