Online examination system project In Asp Net with c#
Live-Online Examination System is an online examinationing program ran by qualified live examination online perfect for your children to enhance their education online. Online examinationing is an easy way to teach kids and to let them have fun while learning. Live-Online Examination System has advanced online examinationing techniques using an advanaced online classroom to examination children online. By using an online examinationing white board, both kids and examinations can write down their thoughts and communicate effectively over the internet. Your child's most valuable tool is his/her education and online examinationing is a great tool enhancer. By using Live-Online Examination System's online examination services you can create a fun online examination environment for your child.
Code : asp.net and c# Datebase : SQL
Selecting topic for exam :
protected void Page_Load(object sender, EventArgs e)
{
if (Session["UserName"] == null )
{
Response.Redirect("index.aspx");
}
txt_stdId.Text = Session["UserName"].ToString();
}
protected void DdlSubject_SelectedIndexChanged(object sender, EventArgs e)
{
Ddtopic.Items.Clear();
string pr = DdlSubject.SelectedValue.ToString();
// get topic names data set from class file
ds = info.GetTopic(pr);
Ddtopic.DataSource = ds;
Ddtopic.DataBind();
Ddtopic.Items.Insert(0, new ListItem("--Select--", "0"));
}
protected void Ddtopic_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void DdlProgrm_SelectedIndexChanged(object sender, EventArgs e)
{
DdlSubject.Items.Clear();
Ddtopic.Items.Clear();
string pr = DdlProgrm.SelectedValue.ToString();
// get subjects names data set from class file
ds = info.GetSubjects(pr);
DdlSubject.DataSource = ds;
DdlSubject.DataBind();
DdlSubject.Items.Insert(0, new ListItem("--Select--", "0"));
}
protected void ImgBtnStartExm_Click(object sender, ImageClickEventArgs e)
{
string prg = DdlProgrm.SelectedValue.ToString();
string sub = DdlSubject.SelectedValue.ToString();
string stp = Ddtopic.SelectedValue.ToString();
string lvl = Ddllevel.SelectedValue.ToString();
string rng = ddlrange.SelectedValue.ToString();
// get questions and answers from table using data set from class file
DataSet ds = info.GetQuestions(sub, stp, lvl);
int nquestions = ds.Tables[0].Rows.Count;
int SIZE=Convert.ToInt32(rng);
Random r = new Random();
int[] positions = new int[SIZE];
int num;
for (int pos = 0; pos < SIZE; )
{
num = Math.Abs(r.Next(nquestions));
// check whether the number is already in the array
bool found = false;
for (int i = 0; i < pos; i++)
if (num == positions[i]) { found = true; break; }
if (!found)
{
positions[pos] = num;
pos++;
}
} // end of for
DataTable dt1 = new DataTable();
dt1.Columns.Add("topic", typeof(string));
dt1.Columns.Add("question", typeof(string));
dt1.Columns.Add("option1", typeof(string));
dt1.Columns.Add("option2", typeof(string));
dt1.Columns.Add("option3", typeof(string));
dt1.Columns.Add("option4", typeof(string));
dt1.Columns.Add("cans", typeof(string));
dt1.Columns.Add("level", typeof(string));
dt1.Columns.Add("EXPLANATION", typeof(string));
dt1.Columns.Add("(ANALYSIS/CORRECT)", typeof(string));
dt1.Columns.Add("(ANALYSIS /WRONG)", typeof(string));
foreach (int pos in positions)
{
dt1.ImportRow(ds.Tables[0].Rows[pos]);
}
DataSet ds3 = new DataSet();
ds3.Tables.Add(dt1);
Session["questionpaper"] = ds3;
Session["starttime"] = DateTime.Now.ToString();
Response.Redirect("~/login_startexam.aspx?program=" + prg + "&subject=" + sub + " &subtopic=" + stp + " &level=" + lvl + " &range=" + rng);
}
Examination paper : 
protected void Page_Load(object sender, EventArgs e)
{
if (Session["UserName"] == "")
{
Response.Redirect("index.aspx");
}
DateTime dt = Convert.ToDateTime(Session["starttime"]);
lblstarttime.Text = dt.ToString();
lblcurrnttime.Text = DateTime.Now.ToString();
if (!Page.IsPostBack)
{
GridView1.DataSource = (DataSet)Session["questionpaper"];
GridView1.DataBind();
lblSid.Text = Session["UserName"].ToString();
lblsub.Text = Request.QueryString["subject"];
lblprogrm.Text = Request.QueryString["program"];
lbltopic.Text = Request.QueryString["subtopic"];
lbllvl.Text = Request.QueryString["level"];
lblrange.Text = Request.QueryString["range"];
}
}
protected void Button1_Click(object sender, EventArgs e)
{
int d = GridView1.Rows.Count;
string[] choice = new string[d];
int increment = 0;
foreach (GridViewRow r in GridView1.Rows)
{
string opt;
RadioButton radio1;
RadioButton radio2;
RadioButton radio3;
RadioButton radio4;
radio1 = (RadioButton)r.FindControl("ra1");
radio2 = (RadioButton)r.FindControl("ra2");
radio3 = (RadioButton)r.FindControl("ra3");
radio4 = (RadioButton)r.FindControl("ra4");
DataSet ds2 = new DataSet();
ds2 = (DataSet)Session["questionpaper"];
if ((radio1.Checked == true || radio2.Checked == true || radio3.Checked == true || radio4.Checked == true))
{
if (radio1 != null && radio1.Checked)
{
opt = "a";
string str1 = (ds2.Tables[0].Rows[increment]["cans"]).ToString();
if (opt == str1)
{
choice[index++] = str1;
}
else
{
choice[index++] = "a";
}
}
else if (radio2 != null && radio2.Checked)
{
opt = "b";
string str1 = (ds2.Tables[0].Rows[increment]["cans"]).ToString();
if (opt == str1)
{
choice[index++] = str1;
}
else
{
choice[index++] = "b";
}
}
else if (radio3 != null && radio3.Checked)
{
opt = "c";
string str1 = (ds2.Tables[0].Rows[increment]["cans"]).ToString();
if (opt == str1)
{
choice[index++] = str1;
}
else
{
choice[index++] = "c";
}
}
else if (radio4 != null && radio4.Checked)
{
opt = "d";
string str1 = (ds2.Tables[0].Rows[increment]["cans"]).ToString();
if (opt == str1)
{
choice[index++] = str1;
}
else
{
choice[index++] = "d";
}
}
}
else
{
choice[index++] = "empty";
}
increment++;
}
if (GridView1.Rows.Count == increment)
{
string prg = lblprogrm.Text;
string sub = lblsub.Text;
string stp = lbltopic.Text;
string lvl = lbllvl.Text;
string rng = lblrange.Text;
List<string> quest = new List<string>();
List<string> opt1 = new List<string>();
List<string> opt2 = new List<string>();
List<string> opt3 = new List<string>();
List<string> opt4 = new List<string>();
List<string> CAns = new List<string>();
List<string> myans = new List<string>();
DataSet ds2 = (DataSet)Session["questionpaper"];
foreach (DataRow row in ds2.Tables[0].Rows)
{
quest.Add(row["question"].ToString());
opt1.Add(row["option1"].ToString());
opt2.Add(row["option2"].ToString());
opt3.Add(row["option3"].ToString());
opt4.Add(row["option4"].ToString());
CAns.Add(row["cans"].ToString());
}
string[] Questions = quest.ToArray();
string[] Option1 = opt1.ToArray();
string[] Option2 = opt2.ToArray();
string[] Option3 = opt3.ToArray();
string[] Option4 = opt4.ToArray();
string[] correctAns = CAns.ToArray();
int ind;
for (ind = 0; ind <= d - 1; ind++)
{
myans.Add(choice[ind]);
}
string[] mychoice = new string[d];
mychoice = myans.ToArray();
int count = 0;
for (int i = 0; i < correctAns.Length; i++)
{
for (int j = i; j < mychoice.Length; j++)
{
if (correctAns[i] == mychoice[j])
{
count++;
}
i++;
}
}
int scr= 0 ;
Session["scr"] = count++;
TimeSpan duration = Convert.ToDateTime(Session["starttime"]) - DateTime.Now;
string totltime = duration.ToString();
//info.insertexamdetails(lblSid.Text, lblprogrm.Text, lblsub.Text, lbltopic.Text, lbllvl.Text, lblrange.Text, string.Join(",", Questions), string.Join(",", Option1), string.Join(",", Option2), string.Join(",", Option3), string.Join(",", Option4), string.Join(",", correctAns), string.Join(",", mychoice), scr);
info.insertexamdetails(lblSid.Text, lblprogrm.Text, lblsub.Text, lbltopic.Text, lbllvl.Text, lblrange.Text, string.Join("@", Questions), string.Join("@", Option1), string.Join("@", Option2), string.Join("@", Option3), string.Join("@", Option4), string.Join("@", Array.ConvertAll(correctAns, x => x.ToString())), string.Join("@", Array.ConvertAll(mychoice, x => x.ToString())), Convert.ToInt32(Session["scr"]));
Response.Redirect("Result.aspx?program=" + prg + "&subject=" + sub + " &subtopic=" + stp + " &level=" + lvl + " &range=" + rng + " &tottym=" + totltime);
}
}
view my result :

protected void Page_Load(object sender, EventArgs e)
{
lblprogrme.Text = Request.QueryString["program"];
lblsub.Text = Request.QueryString["subject"];
lbltopic.Text = Request.QueryString["subtopic"];
lbllevel.Text = Request.QueryString["level"];
lblNquestions.Text = Request.QueryString["range"];
lblStime.Text = Session["starttime"].ToString();
lblMin.Text = Request.QueryString["tottym"];
int cnt = Convert.ToInt32(Session["scr"]);
lblscore.Text = cnt.ToString();
if (cnt > 19)
lblGrade.Text = "Excellent";
else
if (cnt > 9)
lblGrade.Text = "Average";
else
lblGrade.Text = "Poor";
}
View my answer sheet :

protected void Page_Load(object sender, EventArgs e)
{
bindgrid();
}
private void bindgrid()
{
DataSet ds = info.Getmyexampaper(Session["UserName"].ToString());
string quest = (ds.Tables[0].Rows[0]["examquestions"]).ToString();
string op1 = (ds.Tables[0].Rows[0]["examanswers1"]).ToString();
string op2 = (ds.Tables[0].Rows[0]["examanswers2"]).ToString();
string op3 = (ds.Tables[0].Rows[0]["examanswers3"]).ToString();
string op4 = (ds.Tables[0].Rows[0]["examanswers4"]).ToString();
string corans = (ds.Tables[0].Rows[0]["correctanswer"]).ToString();
string myan = (ds.Tables[0].Rows[0]["myanswer"]).ToString();
DataTable dt = new DataTable();
dt.Columns.Add("QUE");
dt.Columns.Add("OPT1");
dt.Columns.Add("OPT2");
dt.Columns.Add("OPT3");
dt.Columns.Add("OPT4");
dt.Columns.Add("ANS");
dt.Columns.Add("MYANS");
int cnt = Convert.ToInt32(ds.Tables[0].Rows[0]["rang"]);
for (int i = 0; i < cnt; i++)
{
string[] Aquest = quest.Split('@');
string[] Aop1 = op1.Split('@');
string[] Aop2 = op2.Split('@');
string[] Aop3 = op3.Split('@');
string[] Aop4 = op4.Split('@');
string[] Acorans = corans.Split('@');
string[] Amyan = myan.Split('@');
DataRow dr = dt.NewRow();
dr["QUE"] = Aquest[i];
dr["OPT1"] = Aop1[i];
dr["OPT2"] = Aop2[i];
dr["OPT3"] = Aop3[i];
dr["OPT4"] = Aop4[i];
dr["ANS"] = Acorans[i];
dr["MYANS"] = Amyan[i];
dt.Rows.Add(dr);
}
gvdetails.DataSource = dt;
gvdetails.DataBind();
}
public override void VerifyRenderingInServerForm(Control control)
{
/* Verifies that the control is rendered */
}
protected void btnExcel_Click(object sender, ImageClickEventArgs e)
{
Response.ClearContent();
Response.Buffer = true;
Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", "Customers.xls"));
Response.ContentType = "application/ms-excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
gvdetails.AllowPaging = false;
gvdetails.DataBind();
//Change the Header Row back to white color
gvdetails.HeaderRow.Style.Add("background-color", "#FFFFFF");
//Applying stlye to gridview header cells
for (int i = 0; i < gvdetails.HeaderRow.Cells.Count; i++)
{
gvdetails.HeaderRow.Cells[i].Style.Add("background-color", "#507CD1");
}
int j = 1;
//This loop is used to apply stlye to cells based on particular row
foreach (GridViewRow gvrow in gvdetails.Rows)
{
gvrow.BackColor = System.Drawing.Color.White;
if (j <= gvdetails.Rows.Count)
{
if (j % 2 != 0)
{
for (int k = 0; k < gvrow.Cells.Count; k++)
{
gvrow.Cells[k].Style.Add("background-color", "#EFF3FB");
}
}
}
j++;
}
gvdetails.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
}
protected void btnWord_Click(object sender, ImageClickEventArgs e)
{
gvdetails.AllowPaging = false;
gvdetails.DataBind();
Response.ClearContent();
Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", "Customers.doc"));
Response.Charset = "";
Response.ContentType = "application/ms-word";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
gvdetails.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
}
protected void gvdetails_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
gvdetails.PageIndex = e.NewPageIndex;
bindgrid();
}
hi I want source code as zip folder please
ReplyDeletegood job can I download it
ReplyDeletethankyou.
ReplyDeletehi can I download compete source code as a zip folder .........Thank u very very much
ReplyDeleteHi. I want source code. Plz help me..
ReplyDeletecan you give link to download source code???
ReplyDeleteplz send the source code in my mail id: anandcrks@gmail.com
ReplyDeletePlease Send me Source Code on sabaaqeel.aqeelahmad@gmail.com
ReplyDeleteplz send the source code in my mail id:patelsavan1113@gmail.com
ReplyDeletePlease immediately Send me Source Code on manojranjan0@gmail.com or ranjanmanoj@ymail.com..
ReplyDeletethankfully..
please send me source code in zip file!! at fakhar.csv@gmail.com
ReplyDeletehey,
ReplyDeleteplease send me source code in zip file at prafulla.nepal@gmail.com
hey
ReplyDeleteplease send me source code in zip file!! at prafulla.nepal@gmail.com
Please very much, send me source code and data base in rar/zip file!
ReplyDeleteE-mail: flavius.manuel96@gmail.com
hi I want source code as zip folder
ReplyDeletehi ,i want source code ,i like your source code can you send me.This is my email.
ReplyDeletetinwinaung20@gmail.com.Thank you so much.
hi plz send me source code at dh91maurya@gmail.com
ReplyDeleteCould you please send link for download code through anssary@gmail.com
ReplyDeletehi plz send me source code at kriptacool90@gmail.com
ReplyDeletehi plz send me source code at aartidevi200@gmail.com
ReplyDeleteplz its urgent.
hi plz send me source code at aartidevi200@gmail.com
ReplyDeleteplz its urgent.
hi plz send me source code at aartidevi200@gmail.com
ReplyDeleteplz its urgent.
hi plz send me source code at aartidevi200@gmail.com
ReplyDeleteplz its urgent.
hi plz send me source code at aartidevi200@gmail.com
ReplyDeleteplz its urgent.
khushich64@yahoo.com is my id please send me the code
ReplyDeletePLease send the whole source code to vidushibaru@gmail.com
ReplyDeletePlease send me the source code at arvindid@gmail.com
ReplyDeletecan i share this article code in my blog www.dotnetspan.com
ReplyDeleteIt's very nice.... can u Please send me the source code and its description at "signup.bucks@gmail.com" .... i want implement it in real time environment and its urgent....
ReplyDeleteHi can you send me source code siddaram1974@gmail.com
ReplyDeletePlease send me the source code at rajatgoel1993@gmail.com
ReplyDeletehi its very nice can u please send the source code and its description at aneelkurakula@gmail.com
ReplyDeletePlease send the whole source code to sudha.sananth@gmail.com
ReplyDeletePlease send the whole source code to sudha.sananth@gmail.com
ReplyDeletePlease send the whole source code to sudha. alexis@unitec.edu and bd
ReplyDeletePlease send me the source code and steps to execute the program as zippedfile
ReplyDelete
ReplyDeletePlease send the whole source code to tsaganaa@gmail.com
It's very nice.... can u Please send me the source code and its description at "tsaganaa@gmail.com" .... i want implement it in real time environment and its urgent....
ReplyDeleteIt's very nice.... can u Please send me the source code and its description at "tsaganaa@gmail.com" .... i want implement it in real time environment and its urgent....
ReplyDeleteAny version in ASP.NET MVC ? source code in github ?
ReplyDeleteAny final _solution_ with **full source code** sample application ? _IMHO, better samples for minimize learning curve are real applications with full source code and good patterns_
Please send me the source code and steps to execute the program as zip
ReplyDeleteamirnowrozian@gmail.com
Plz Send me the souce code step by step mobaidalikhan@gmail.com
ReplyDeleteplease send me source code pathanyunus1@gmail.com
ReplyDeletePlease send me the source code and steps to execute the program as zippedfile to vmurtezaj@gmail.com
ReplyDeletePlease send me the source code Zip file and steps at amol20989@gmail.com
ReplyDeletePlease send me the source code Zip File and steps at amol20989@gmail.com
ReplyDeleteplease send me code memon_rahib@yahoo.com
ReplyDeletesend me this code please memon_rahib@yahoo.com
ReplyDeletehi i m keran, i will mail you soon . . thankyou
ReplyDeleteSir plz send me source code viveksengar80@gmail.com
DeletePlease send the sourcoe code for this project
Deletesahilbharti.brt135@gmail.com
send me this code please pranitagupta57@gmail.com
ReplyDeletePlease send the whole source code to hardik6992@gmail.com
ReplyDeleteIt is great job karen. Could u send me z source code to ethiogt.gt@gmail.com plz.
ReplyDeleteIt is great job Karen.Could u send me the source code to ethiogt.gt@gmail.com plz.
ReplyDeletesend me this code please on my mail id kanchan.pande1990@gmail.com
ReplyDeletegreat effort, please, can I download the complete project?
ReplyDeletegreat effort, pleas, can I download the complete project?
ReplyDeleteHi Karen can You send me a source code please
ReplyDeleteHi Karen can You send me a source code please
ReplyDeleteplease send me code at mohit55566@gmail.com
ReplyDeleteHi please send me source code on anilahmed08@gmail.com thank you
ReplyDeletePLease send the whole source code to bilalhsa100@gmail.com
ReplyDeletesir please mail me this project code ..........my email is bilalhsa100@gmail.com
ReplyDeleteHey Keran, can you send me source code at : mrmalkar@yahoo.com
ReplyDeletehi, plz send me at raisuddin@rkmsolution.com
ReplyDeletehi my friend
ReplyDeletePlease send me the source code Zip File and steps at empire4672@gmail.com
thanks
hi
DeletePlease send me the source code Zip File and steps at mariafleur.96@gmail.com
thanks
I have need this please send me on Email inam.aa88@gmail.com
ReplyDeleteI Have Need Zip File f this code Please Send Me Dear Karen kumar
ReplyDeletePlease help with the Source Code for better understanding of you assistance thank larshittu@gmail.com
ReplyDeletePlease send me the source code Zip File at adriana.lleshi94@gmail.com
ReplyDeletethanks
Hello sir,
ReplyDeleteI want this code,can you please sent this source code on my mail id : sumathyarulraj@gmail.com.
Hello sir,
ReplyDeletei want this source code file, please sent on this mail id : sumathyarulraj@gmail.com
hello sir, I want this complete project source code file and document. Its very uregent kindly send on this mail id :sumathyarulraj@gmail.com
ReplyDeleteplease sir i requested to source code and data base to send in my email address...my email address is prajapatiabhaji@gmail.com
ReplyDeleteplease sir i requested to source code and data base to send in my email address...my email address is prajapatiabhaji@gmail.com
ReplyDeletesir please mail me this project code .my email is serhat.gunes.92@gmail.com
ReplyDeleteHi your article more helpfull us please send me your source code and db
ReplyDeletepleas could you send the source code to me it will help to learn how to manage small project
ReplyDeletemmao-@hotmail.com
thanks
hi can you send me the horse code it will help me pleas
ReplyDeletehi can you sed me a copy from the horse cod it really help me
ReplyDeletemmao-@hotmail.com
please send me the source code at nireng553@gmail.com it will help me a lot to understand and for further studies
ReplyDeletehello sir can you send me the full project in zib file please at azzam_maher@hotmail.com
ReplyDeleteYour metyhod of telling everything in this paragraph is genuinely good, every one be abpe to without difficulty know it, Thanks a lot.
ReplyDeletehi can you please email this project at buzz10719@gmail.com
ReplyDeleteWhat a ddata oof un-ambiguity and preserveness of precious know-how on tthe topic of unexpected emotions.
ReplyDelete