How to Calculate in Online Test Result Marks using c# Code

Last Reply 12 days ago By dharmendr

Posted 12 days ago

hi Developers , i have done the Module for Online Examination as i want. now i want to Calculate the Result and Marks of the Test. i.E 1. how many Answers is Correct 2.how many Answers is InCorrect 3.how many marks Got.

that's all

i have tried with below query but i cant able to get the exact answer . below am my adding my code . if anyone know how to done this please guide me to i am done this task.

Thanks with

Paul.S "Man becomes what he Thinks about"

protected void Button1_Click(object sender, EventArgs e)
{
LoadQuestion();
}


---> Load Question Function for bind Next Question
protected void LoadQuestion()
{
if (Questions.Tables[0].Rows.Count > 0)
{
SqlConnection con = Connection.DBConn();
//Load Question;
DataRow DR = Questions.Tables[0].Rows[0];
Question.Text = DR[0].ToString() + " of " + totalQs;
sno = DR[0].ToString();
string total = sno;
string no = "1";
decimal SumofTotalCosst = Convert.ToDecimal(total) - Convert.ToDecimal(no.ToString());

decimal ccc;
string insert = "update tbl_Question set Marks='5' where id='" + SumofTotalCosst + "'";
SqlCommand com = new SqlCommand(insert, con);
com.ExecuteNonQuery();

TestName.Text = DR[0].ToString();
TestNo.Text = tno;
Questionlbl.Text = DR[6].ToString();

rbtnAns.Items.Clear();
rbtnAns.Items.Add(DR[8].ToString());
rbtnAns.Items.Add(DR[9].ToString());
rbtnAns.Items.Add(DR[10].ToString());
rbtnAns.Items.Add(DR[11].ToString());
lblKeyfacts.Text = DR[12].ToString();
lblExplanation.Text = DR[13].ToString();
lblObliviating.Text = DR[14].ToString();

Questions.Tables[0].Rows.Remove(DR);

if (Questionlbl.Text.Equals(totalQs.ToString()))
{
IsLastQs = true;
}
}
else
{
//End Of File;
//Response.Write("<script>alert('Thanks For Your Presence! You Can Leave Now.')</script>");
Session.Abandon();
RedirectToResults();
}
}

 

You are viewing reply posted by: dharmendr 12 days ago.
I agree, here is the link: https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html?aff_id=108