Beispiel #1
0
        private void BindProgramsInfo()
        {
            DataTable dt = new DataTable();

            objML_StudentProfile.ID = Session["UserName"].ToString();
            //objML_StudentProfile.ExamName = Session["ExamName"].ToString();
            dt = objBL_StudentProfile.BL_Result(objML_StudentProfile);
            if (dt.Rows.Count > 0)
            {
                GrdCategory.DataSource = dt;
                GrdCategory.DataBind();
                int i = 0;
                int y = 0;
                foreach (GridViewRow row in GrdCategory.Rows)
                {
                    Label lblTick              = (Label)row.FindControl("lbl");
                    Label lblStudentAns        = (Label)row.FindControl("StudentAns");
                    Label lblCorrctAns         = (Label)row.FindControl("CorrectAns");
                    Label lblStudentPreviewAns = (Label)row.FindControl("lblCorrect");
                    if (lblCorrctAns.Text == lblStudentAns.Text)
                    {
                        lblTick.Text = "✔";
                        i            = i + 1;
                    }
                    else if (lblStudentAns.Text == "")
                    {
                        lblTick.Text = "🏳️";
                    }
                    else
                    {
                        lblTick.Text = "❌";
                        lblStudentPreviewAns.Text = lblCorrctAns.Text;
                        y = y + 1;
                    }
                }
                lblCorrect.Text  = i.ToString();
                lblWrong.Text    = y.ToString();
                lblTotalQus.Text = dt.Rows.Count.ToString();
            }
        }