TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Paul Rajs
NA
641
139.5k
how to Calculate Online Test Result & Marks using c# Code
Jul 11 2017 6:29 AM
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.
protected void Button1_Click(object sender, EventArgs e)
{
try
{
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();
}
}
Thanks with
Paul.S
"Man becomes what he Thinks about"
Reply
Answers (
1
)
How I create .prn File for Barcode using c#
combo box to datagrid view..didn't get items in grid view