Quiz Management System Documentation
Quiz Management System Documentation
Quiz Management System Documentation
Submitted To:
Submitted By:
Table of Contents
Introduction.......................................................................................................................................................................... 1
Modules and Coding ......................................................................................................................................... 2
Quiz Management System Form ..................................................................................................... 2
Welcome Form ....................................................................................................................................... 4
MDI Parent Form................................................................................................................................... 7
INTRODUCTION:
This project is about ONLINE QUIZ SYSTEM which provides the facility to both Teachers and Students. Teachers have a
separate login system to generate quiz according to subject. A program has a facility to Insert questions in quiz along
with different functionalities like update quiz, view quiz, select quiz and delete quiz. There is also a separate
Administrative Login provided to teachers so that students can’t cheat by entering into teacher’s login and getting the
quizzes. Students have separate section for login, and take quiz. After taking quizzes the program will check the quizzes,
For entering into whole process there is a system of Login where students and teachers give their ID and password. If
there is a new user in process the program also have a facility to register a new student. Besides that system also checks
either password is accurate or not and it does also provides facility to recover password in case of loose your password
and to change the existing password. Along with all this, there are different types of exception handling, security and
search modules are made to make the program more convenient and user friendly.
Class Code
//INTERFCES//
interface Marks_Evaluation_Criteria
{
decimal count();
}
interface System_Database
{
void selection(string query, string tablename);
void insert(string query);
void update(string query);
void delete(string query);
//INHERITENCE INTERFACE//
interface Exception_handling:System_Database
{
int loginerrorchek(string a, string b, string c);
int passrecoveryerrorchek1(string b);
int passrecoveryerrorchek2(string a, string b);
int adminpasschangeerror(string b);
int studentpasschangeerror(string b);
int deleteloginerrorchk(string b);
int viewquestionerorchek(string b);
int editquestionerrorchek(string b);
}
{
om = om + increament;
return om;
}
}
public class maxmarks : obtainmarks
{
//CLASSES//
//CONSTRUCTOR FUNCTION//
public quizsystem()
{
conn.ConnectionString = connection;
conn.Open();
}
//SIMPLE METHODS//
return ans;
}
}
return ans;
}
public int adminpasschangeerror(string b)
{
int i = 0;
int ans = 4;
foreach (DataRow row in dataset.Tables[0].Rows)
{
if (Convert.ToString(row["pass"]) == b)
{
ans = 1;
}
else
{
i++;
}
}
if (i == dataset.Tables["login"].Rows.Count)
{
ans = 0;
}
return ans;
}
public int studentpasschangeerror(string b)
{
int i = 0;
int ans = 4;
foreach (DataRow row in dataset.Tables[0].Rows)
{
if (Convert.ToString(row["pass"]) == b)
{
ans = 1;
}
else
{
i++;
}
}
if (i == dataset.Tables["login"].Rows.Count)
{
ans = 0;
}
return ans;
}
questions[2] = Convert.ToString(row["ans2"]);
questions[3] = Convert.ToString(row["ans3"]);
questions[4] = Convert.ToString(row["ans4"]);
questions[5] = Convert.ToString(row["ans5"]);
questions[6] = Convert.ToString(row["crctans"]);
ans = 1;
}
else
{
i++;
}
}
if (i == dataset.Tables["addquest"].Rows.Count)
{
ans = 0;
}
return ans;
}
public int editquestionerrorchek(string b)
{
int i = 0;
int ans = 4;
foreach (DataRow row in dataset.Tables[0].Rows)
{
if (Convert.ToString(row["qno"]) == b)
{
ans = 1;
}
else
{
i++;
}
}
if (i == dataset.Tables["addquest"].Rows.Count)
{
ans = 0;
}
return ans;
}
timer1.Start();
p.Value = 0;
timer2.Start();
}
This is a snapshot of MDI parent login form where Teachers and students make their login and enters for further
processing.
else
{
p.Value += 2;
}
}
obj.selection(loginquery,"login");
x=obj.loginerrorchek(username,pass,comboBox1.SelectedText);
if(x==1)
{
if (comboBox1.SelectedIndex == 0)
{
p.Value = 0;
timer1.Start();
Form1 form1obj = new Form1();
form1obj.Show();
this.Hide();
}
else if (comboBox1.SelectedIndex == 1)
{
p1.Value = 0;
timer2.Start();
Form4 form4obj = new Form4();
form4obj.Show();
this.Hide();
}
}
else if(x==0)
{
if (MessageBox.Show("Make Sure The Username and Password and Domain you entered is Correct?" + "\r\n" + "Do you
wish to try again ", "Incorrect Password", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
this.Activate();
textBox1.Clear();
textBox2.Clear();
comboBox1.SelectedIndex=-1;
}
else
{
this.Close();
}
}
}
Now this is a processing which leads to relevant process which is chosen, such as starting client windows.
CODING OF FORM 4:
This screen is used for creating students login by fulfilling the relevant information like user name, password, security
CODING OF FORM 9:
// CREATE LOGIN FOR STUDENT FORM CODE//
{
string occu = textBox1.Text;
string name = textBox2.Text;
string pass = textBox4.Text;
string ans = textBox5.Text;
string insertstudentinfo = "insert into login values('" + name + "' , '" + pass + "' , '" + occu + "' , '" + ans + "' , '" +
comboBox1.SelectedItem + "')";
quizsystem loginobj = new quizsystem();
loginobj.insert(insertstudentinfo);
if (MessageBox.Show("Record has been stored successfully ", "Success", MessageBoxButtons.OK) == DialogResult.OK)
{
this.Close();
}
loginobj.conn.Close();
}
catch (Exception)
{
MessageBox.Show("This Account is Already Exist, Try Another Username");
}
}
private void button2_Click(object sender, EventArgs e)
{
if (textBox2.Text == "")
{
MessageBox.Show("Must enter Username", "Access Denied");
}
else
{
pictureBox2.Visible = true;
label9.Visible = false;
label10.Visible = false;
string uname = textBox2.Text;
int x = 5;
string nameselect = "select * from login where name = '" + uname + "'";
quizsystem selectobj = new quizsystem();
selectobj.selection(nameselect, "login");
x = selectobj.passrecoveryerrorchek1(uname);
if (x == 1)
{
p.Value = 0;
timer1.Start();
}
else if (x == 0)
{
p1.Value = 0;
timer2.Start();
}
}
}
This window is for taking quizzes from students, which is prepared by the Administrator.
radioButton5.Enabled = false;
}
}
vqtm.Text = Convert.ToString(row["qt"]);
}
addquestobj2.conn.Close();
string viewasqt = "select * from answersheetdb";
quizsystem addquestobj3 = new quizsystem();
addquestobj3.selection(viewasqt, "answersheetdb");
foreach (DataRow row in addquestobj3.dataset.Tables["answersheetdb"].Rows)
{
vqtans.Text = Convert.ToString(row["qt"]);
}
addquestobj2.conn.Close();
textBox8.Text = Convert.ToString(row["qno"]);
}
addquestobj1.conn.Close();
/////////////////////////////////////////////////////////////////////
}
addquestobj.conn.Close();
listBox1.SelectedIndex = 0;
}
string insert1 = "insert into answersheet values('" + rolno + "','" + nam + "','" + qno.Text + "','" + qs.Text + "','" + opt1.Text +
"','" + opt2.Text + "','" + opt3.Text + "','" + opt4.Text + "','" + opt5.Text + "','" + ansstmt + "','" + ans + "','" + rsltstmt + "','" + rs + "','" +
crctans + "')";
quizsystem insertanswersheet = new quizsystem();
insertanswersheet.insert(insert1);
string insert2 = "insert into answersheetdb values('" + vqtans.Text +"','" + rolno + "','" + nam + "','" + qno.Text + "','" +
qs.Text + "','" + opt1.Text + "','" + opt2.Text + "','" + opt3.Text + "','" + opt4.Text + "','" + opt5.Text + "','" + ansstmt + "','" + ans + "','" +
rsltstmt + "','" + rs + "','" + crctans + "')";
insertanswersheet.insert(insert2);
insertanswersheet.conn.Close();
if (listBox1.SelectedIndex == listBox1.Items.Count - 1)
{
if (MessageBox.Show("Thank You" + "\r\n" + "Press Ok To Proceed", "Completion", MessageBoxButtons.OK) ==
DialogResult.OK)
{
}
}
textBox4.Clear();
}
}
else
{
if (radioButton1.Checked || radioButton2.Checked || radioButton3.Checked || radioButton4.Checked ||
radioButton5.Checked)
{
obj[1].count();
mm.Text = Convert.ToString(obj[1].m);
if (textBox9.Text == cans.Text)
{
obj[0].count();
gm.Text = Convert.ToString(obj[0].om);
textBox3.Text = "Correct Answer";
}
else if (textBox9.Text != cans.Text)
{
textBox3.Text = "Wrong Answer";
textBox4.Text = cans.Text;
}
string insert1 = "insert into answersheet values('" + rolno + "','" + nam + "','" + qno.Text + "','" + qs.Text + "','" + opt1.Text +
"','" + opt2.Text + "','" + opt3.Text + "','" + opt4.Text + "','" + opt5.Text + "','" + ansstmt + "','" + ans + "','" + rsltstmt + "','" + rs + "','" +
crctans + "')";
quizsystem insertanswersheet = new quizsystem();
insertanswersheet.insert(insert1);
string insert2 = "insert into answersheetdb values('" + vqtans.Text + "','" + rolno + "','" + nam + "','" + qno.Text + "','" +
qs.Text + "','" + opt1.Text + "','" + opt2.Text + "','" + opt3.Text + "','" + opt4.Text + "','" + opt5.Text + "','" + ansstmt + "','" + ans + "','" +
rsltstmt + "','" + rs + "','" + crctans + "')";
insertanswersheet.insert(insert2);
insertanswersheet.conn.Close();
radioButton1.Enabled = true;
radioButton2.Enabled = true;
radioButton3.Enabled = true;
radioButton4.Enabled = true;
radioButton5.Enabled = true;
radioButton1.Checked = false;
radioButton2.Checked = false;
radioButton3.Checked = false;
radioButton4.Checked = false;
radioButton5.Checked = false;
textBox9.Clear();
listBox1.SelectedIndex = listBox1.SelectedIndex += 1;
}
else
{
MessageBox.Show("Must Select The Option for Answer", "Denied");
}
}
}
catch (Exception ex)
{
if (MessageBox.Show("Quiz has been solved by you before" + "\r\n" + "so please I advised you to leave now", "Access Denied",
MessageBoxButtons.OK) == DialogResult.OK)
{
this.Close();
}
}
textBox4.Clear();
}
}
}
These two forms are made for password recovery. Students enter his / her user name, if the user name is correct the
next form appears otherwise the error will shown. In next form student have to answer a security question. If the
answer is right the correct password will be shown otherwise the error message will shown.
CODING OF FORM:
//BACK BUTTON//
//AFTER USERNAME VERIFIED SQURITY QUESTION VERIFY PROGRESSBARR RUN ON THIS WORKING//
//AFTER USERNAME ENTER SECURITY AREA WILL SHOW AND WHEN IT MATCH THEN SHOW PASSWORD//
{
label5.Text = selectobj.pass;
p1.Value = 0;
timer2.Start();
pictureBox2.Visible = true;
}
else if (x == 0)
{
if (MessageBox.Show("Make Sure The Username you entered is Correct?" + "\r\n" + "Do you wish to try again ",
"Incorrect Username", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
this.Activate();
comboBox1.SelectedItem = -1;
textBox2.Clear();
}
}
}
Students can also logout from the system after giving quiz by clicking on logout from the main menu and then the
CODING OF FORM:
After clicking on confirm logout sign the next window appears for shutdown. Which means now the user is no more sign
in.
CODING OF FORM:
//OPACITY FUNCTION USE ON THIS-------AFTER OPACITY=0 MAIN LOGIN FORM WILL APPEAR AGAIN//
Now another phase of program designed for Teachers, from the same login window teachers can also login by selecting administrator
mode from the occupation option. Once giving admin login, the screen appears for admin members to go through into quiz process.
CODING OF FORM:
This screen is used for creating Administration login by fulfilling the relevant information like user name, password,
security question and its answer. There is also an option for recovering old password for Administration and changing
CODING OF FORM:
//BACK BUTTON//
{
if (textBox4.Text != textBox3.Text)
{
label6.Visible = true;
label5.Visible = false;
pictureBox1.Visible = false;
}
else
{
string username = textBox2.Text;
string occu = textBox1.Text;
string newpass = textBox4.Text;
string ans = textBox5.Text;
string oldpass = textBox6.Text;
int x = 5;
string select = "select * from login";
quizsystem obj = new quizsystem();
obj.selection(select, "login");
x = obj.adminpasschangeerror(oldpass);
if (x == 1)
{
string update = "update login set name='" + username + "', pass='" + newpass + "', ans='" + ans + "',sq='" +
comboBox1.SelectedItem + "',occu='" + occu + "' where pass='" + oldpass + "'";
obj.update(update);
MessageBox.Show("Your Username and Password Has Been Changed Successfully");
obj.conn.Close();
}
else if (x == 0)
{
MessageBox.Show("Old Password is Incorrect", "denied");
}
}
Below form is facilitating teachers for modifying quizzes, creating quiz and adding questions in quiz. This module has
CODING OF FORM:
//ON FORM LOAD VIEW OF PREVIOUS QUIZ TITLE INFO FOR EDIT//
}
}
}
This is a form for adding questions one by one in quiz by respective teacher.
CODING OF FORM:
//FOR CORRECT OPTION FOR ANSWER RADIOBUTTONS CODE ON CREATE QUIZ GROUPBOX//
if (t1.Text != " " && t2.Text != "" && t3.Text != "" && t4.Text != "" && t5.Text != ""&& t6.Text != "" && t7.Text != "")
{
string tb1 = t1.Text;
string tb2 = t2.Text;
string tb3 = t3.Text;
string tb4 = t4.Text;
string tb5 = t5.Text;
string tb6 = t6.Text;
string tb7 = t7.Text;
string tb8 = t8.Text;
string getbox = textBox1.Text;
string insertqt = "insert into marksheetdb values('" + tb1 + "','" + " " + "','" + " " + "','" + " " + "','" + " " + "','" + " " + "')";
string insertqt1 = "insert into answersheetdb values('" + tb1 + "','" + " " + "','" + " " + "','" + " " + "','" + " " + "','" + " " + "','" + " " +
"','" + " " + "','" + " " + "','" + " " + "','" + " " + "','" + " " + "','" + " " + "','" + " " + "','" + " " + "')";
quizsystem insertqtobj = new quizsystem();
insertqtobj.insert(insertqt);
insertqtobj.insert(insertqt1);
string edit = "update createquiz set qt='" + tb1 + "' , cn='" + tb2 + "',ct='" + tb3 + "',ci='" + tb4 + "' , mm='" + tb5 + "',ta='" + tb6 +
"',qd='" + tb7 + "',et='" + tb8 + "' where qt='" + getbox + "'";
quizsystem createobj = new quizsystem();
createobj.update(edit);
MessageBox.Show("Quiz Title has been Added Successfully", "Success");
createobj.conn.Close();
if (textBox2.Text == "")
{
groupBox3.Visible = false;
groupBox1.Visible = true;
}
else if (textBox2.Text != "")
{
string addquestview = "select * from addquest";
quizsystem addquestobj = new quizsystem();
addquestobj.selection(addquestview, "addquest");
foreach (DataRow row in addquestobj.dataset.Tables["addquest"].Rows)
{
listBox1.Items.Add(Convert.ToString(row["qno"]));
}
addquestobj.conn.Close();
listBox1.SelectedIndex = 0;
groupBox2.Visible = true;
groupBox3.Visible = false;
}
}
else
{
MessageBox.Show("Make sure that all the required lines are fullfilled", "Access Denied");
t1.Focus();
}
}
tb7.Clear();
tb9.Clear();
tb11.Clear();
tb13.Clear();
}
else
{
MessageBox.Show("Must Select the Correct Answer Option", "Denied");
}
}
else
{
MessageBox.Show("Make Sure that all the required lines are fullfilled", "Access Denied");
tb1.Focus();
}
}
catch (Exception)
{
MessageBox.Show("The Question you entered is Already Exist", "Denied");
tb1.Clear();
tb1.Focus();
}
}
//VIEW CODE AGAIN AND EDIT QUESTION ENTERY ON ADD QUESTION GROUPBOX AND IF THERE IS NO ENTRY IN THE
BACK END IT IS ALSO A EXCEPTION HANDLEING CODEE FOR NULL VIEW CODE//
createobj.conn.Close();
}
else if (x == 0)
{
MessageBox.Show("The question which u trying to edid is not in the entry", "denied");
}
//FOR DELETE GROUPBOX IF THERE IS NO QUESTIONS IN THE BACK END FOR LAST QUESTION DELETE IF THERE IS ONLY
1 QUESTION IN BACK END CODE//
listBox1.SelectedIndex = listBox1.SelectedIndex += 1;
if (listBox1.SelectedIndex == listBox1.Items.Count-1)
{
button10.Visible = false;
button8.Visible = true;
}
}
//CREATE QUESTIONS GROUPBOX-----FOR APPEAR CREATE QUIZ TITLE FORM -----EDIT BUTTON CODE//
button10.Visible = false;
button8.Visible = true;
}
}
Following in the delete form appeared before teachers create quiz window if there is already any quiz exists in the
CODING OF FORM:
//FOR DELETE GROUPBOX IF THERE IS NO QUESTIONS IN THE BACK END FOR LAST QUESTION DELETE IF THERE IS ONLY 1
QUESTION IN BACK END CODE//
An option of Google search is added to help the teachers. By clicking on search in main menu helps tab the internet
This is a form for editing questions for prints during the printing reports to make the interface more users friendly.
CODING OF FORM:
{
MessageBox.Show("The Question Number you entered dosent Exist", "Denied");
tb1.Focus();
}
}
{
MessageBox.Show("The question which u trying to edid is not in the entry", "denied");
}
}
tb1.Focus();
}
}
catch (Exception)
{
MessageBox.Show("The Question you entered is Already Exist", "Denied");
tb1.Clear();
tb1.Focus();
}
}
}
}
REPORTS
PAPER SHOW REPORT (FORM 8)
Following is the report screen made for teachers, such as print quiz and paper show for the purpose of print reports.
CODING OF FORM:
This is an answer sheet form made for teachers to show in class to students in soft form as well as they can take prints
FORM CODING:
CODING OF FORM:
}
}
//VIEW BUTTON FROM WHERE U CAN SEARCH STUDENT MARK SHEET THROUGH ROLLNO//
cr1.SetDataSource(ds.Tables["marksheet"]);
crystalReportViewer1.ReportSource = cr1;
}
else
{
MessageBox.Show("Must enter the roll no","Denied");
textBox1.Clear();
textBox1.Focus();
}
}
//BACK BUTTON//
LOGIN DATABASE
CONCLUSION:
We have tried to provided an online and offline solutions for Teachers and students. This
software can easily be deployed in all education institutions for the purpose of quiz
generation and quiz taking system. We have made this system user friendly. It is a best
solution for online and offline Quiz system from our side.