Professional Documents
Culture Documents
CERTIFICATE
External Examiners
1.____________________
2._____________________
1
DECLARATION
DATE:
SIGNATURE:
2
SL.NO CONTENT PAGE
NO.
1. ACKNOWLEDGEMENT 04
2. INTRODUCTION 05
3. ABSTRACT 06
4. SOFTWARE AND HARDWARE 08
REQUIREMENT SPECIFICATION
5. ER DIAGRAMS 12
6. DATABASE 13
7. CODING 17
8. OUTPUTS 90
9. TESTING 100
10. CONCLUSION 107
11. BIBLIOGRAPHY 108
3
1.ACKNOWLEDGEMENT
This project would not have been possible without the guidance and
support of some of our well-wishers and we are ever indebted to them
for their contribution to our work.
Our principal. DR. A. NAGARTHNA for providing us the platform and a
congenial environment to work.
We're grateful to our HOD, DR. Prathiba V Kalburgi for her constant
support and for being as approachable as she has been all along. Most
importantly, we'd like to express our gratitude to our Project Guide, Mrs.
Suma C, who's been our guide, mentor and friend, not just for this project
but ever since our first days in the department. If not for Mrs Suma C,
none of our projects would have taken shape. We'd like to thank her for
trusting us with unconventional and innovative projects, giving us the
independence to take it forward with our ideas, motivating us when we
hit a road block and guiding us throughout the development phase with
his valuable inputs. We'd like to thank the staff of our department for
their much needed encouragement and the fellow students for providing
the best test case scenarios one could ever ask for.
We'd like to thank our families for supporting us throughout the
development process of the project, irrespective of the time of the day
or the number of hours spent in front of the computer. Thank you.
YOGINI ARORA
4
2. INTRODUCTION
Offline examination is a real time project. The
project will be implemented using VB.NET .The
aim of this project is to allow teachers to
conduct examinations for all the students. This
option is only available for the teachers to
terminate the exam. The teachers are also have
this option to set the time limit, edit questions,
and admin can get logged inn all the staff
members and can change the exam password.
When the students start their exam, after the
allotted time, the exam automatically ends and
a grade sheet is printed to the students.
5
3.ABSTRACT
The objective of making this offline
examination system software is to give the
efficiency of working on a software. Which
requires no internet and for the rural areas
where internet is not available they can conduct
the examination easily, efficiently and
reasonably.
How is it an advantage to the colleges and
schools to have the offline software like this?
ADV1: That this is reasonable.
ADV2: No use of internet.
ADV3: The result is automatically displayed on
the screen after the exam get terminated.
ADV4: Anybody can use this software you don’t
require to have any particular qualifications to
use this software.
ADV5: It is easy and efficient for any person to
use this software.
6
ADV6: Any course can be edited or deleted any
subject can be removed or added in the
software.
ADV7: We can pay the fees in this software
without an internet connection.
DISADVANTAGE
THE LAPTOPS OR COMPUTERS WHICH DOESN’T
HAVE VISUAL STUDIO OR MICROSOFT SQL IN
THEIR CONCERNED GADGETS THEY WILL NOT
BE ABLE TO USE THIS SOFTWARE.
7
4.SOFTWARE AND HARDWARE
REQUIREMENT SPECIFICATION:
Hardware Requirements:
Processor: 11th Gen Intel(R) Core (TM) i5-
2.40GHz 2.42 GHz
RAM:16GB
Software Requirements:
Operating System: WINDOWS
Front End: Visual Studio 2022(VB.NET)
Back End: Microsoft SQL server management
studio 18
8
About The Software
Visual studio:
Visual studio is an integrated development
environment(IDA) from Microsoft.
It is used to develop computer programs,website,web
apps,web service,mobile apps etc.
(.Net Framework)
.Net is a framework for developing web-based and
windows-based applications within the Microsoft
environment.
The framework offers a fundamental shift in Microsoft
strategy it moves application development from
clientcentric to server-centric.
Tools used in .Net framework
It comprises several tool bases to control a visual studio
program. we have used tool boxes to develop our project.
It can attach it to code that will run when the form is
loaded,closed or when the mouse is clicked or moved over
it.
9
FORM
The form is the center unit which is a window initially
blank,on which we can paste controls to create our screen
.The form can be of any size or color or we can attach to it
code that will run when the form is loaded,Closed oer
when the mouse is clicked or moved over it.
11
5.ER-DIAGRAM
12
6.DATABASE
TABLE LOGIN
13
TABLE COURSE
TABLE APPROVE
14
TABLE EMPLOYEE
TABLE QUESTION
15
TABLE RESULTS
TABLE PASSWORD
16
7.CODING
FORM 1
FORM LOGIN
Imports System.Data
Imports System.Data.SqlClient
'validation
If Len(Trim(txtusername.Text)) = 0 Then
MessageBox.Show("Please enter Username", "Input
Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
18
txtusername.Focus()
Exit Sub
ElseIf (Len(Trim(txtpass.Text)) = 0) Then
MessageBox.Show("Please enter Password", "Input
Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
txtpass.Focus()
Exit Sub
19
cmd.Parameters.Add(UParam)
cmd.Parameters.Add(PassParam)
cmd.Parameters.Add(type) cmd.Connection = con
cmd.Connection.Open()
'run cmd
dr = cmd.ExecuteReader()
If dr.HasRows Then
name1 = txtusername.Text
utype = cmbusertype.Text
userpass = txtpass.Text
con.Close()
20
Finally
con.Close()
End Try
End Sub
FORM MASTER
Imports System.Data.SqlClient
End With
End Sub
.BringToFront()
.Show()
End With
End Sub
End With
End Sub
End With
End Sub
.TopLevel = False
Panel5.Controls.Add(frmEmployeeViewList)
BringToFront()
.Show()
End With
End Sub
Private Sub NewToolStripMenuItem_Click(sender As Object,
e As EventArgs) Handles NewToolStripMenuItem.Click
With frmFeesPayment
.TopLevel = False
Panel5.Controls.Add(frmFeesPayment)
.BringToFront()
.Show()
End With
End Sub
.TopLevel = False
Panel5.Controls.Add(frmAddNewCourse)
.BringToFront()
.Show()
End With
End Sub
With frmPassword
.TopLevel = False
Panel5.Controls.Add(frmPassword)
.BringToFront()
.Show()
End With
End If
If con.State = 1 Then con.Close()
End Sub
End Sub
27
FORM STUDENT REGISTRATION
Imports System.Data
Imports System.Data.SqlClient
28
If LastNo >= 0 Then
txtstudtno.Text = LastNo Else
txtstudtno.Text = "1"
End If
End Sub
cmbcrs.Items.Add(ds.Tables("tbl_course").Rows(i)(0).ToString)
Next
con.Close()
End Sub
29
gender = "female"
Else
gender = "male"
End If
End Sub
End Sub
30
' qry = "select applicationnum form tbl_registration
where applicationnum=' " & txtapplicationnum.Text & "'"
cmd = New SqlCommand("select studno from
tbl_registration where studno=@studno", con)
Dim UParam As New SqlParameter("@studno",
Me.txtstudtno.Text)
cmd.Parameters.Add(UParam)
cmd.Connection = con cmd.Connection.Open()
Dim dr As SqlDataReader = cmd.ExecuteReader()
If dr.HasRows Then
MsgBox(" STUDENT NUMBER IS ALREADY
EXIST")
con.Close()
Else
'insert record
If con.State = 1 Then con.Close()
radiogender()
qry = "insert into
tbl_registration(studno,studname,addr,contact_no,gender,course,
qualification,dob)values('" & txtstudtno.Text & "','" &
txtstdtname.Text & "','" & txtadd.Text & "','" & txtcontact.Text
& "','" & gender & "','" & cmbcrs.Text & "','" & txtquli.Text &
"',CONVERT(DATE,'" & DateTimePicker1.Value & "',103))"
cmd = New SqlCommand(qry, con)
cmd.Connection = con
cmd.Connection.Open() i=
cmd.ExecuteNonQuery()
If (i >= 1) Then
MsgBox("STUDENT REGISTRATION
SUCCESSFUL")
31
con.Close()
Else
MsgBox("Registration Failed")
con.Close()
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
con.Close()
End Try
If con.State = 1 Then con.Close()
End Sub
End Sub
Private Sub txtstudtno_TextChanged(sender As Object, e As
EventArgs) Handles txtstudtno.TextChanged
End Sub
End Class
FORM FEES
Imports System.Data
Imports System.Data.SqlClient
End Sub
Public Sub showgv()
Try
If con.State = 1 Then con.Close()
33
con.Open()
cmd = New SqlCommand("select course,fees from
tbl_course_fee ", con) da = New
SqlDataAdapter(cmd) Dim dt As New DataTable
da.Fill(dt)
If dt.Rows.Count > 0 Then
dgvfees.DataSource = dt
Else
MsgBox("Record Not Found or table is empty")
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
If con.State = 1 Then con.Close()
End Sub End
Class
34
End Sub
InsertData(qry)
End Sub
Private Sub Bindcourse() '-----------show all courses in
comboBox
cmbcourse1.Items.Clear()
ds.Clear()
If con.State = 1 Then con.Close()
qry = "select distinct (course) from tbl_course with
(nolock)"
FetchData(qry)
cmbcourse1.Items.Add(ds.Tables(0).Rows(i)(0).ToString())
Next
36
Else
MsgBox("Course Not Found")
End If
End Sub
End Sub
End Sub
Private Sub frmAddQuestion_Load(sender As Object, e As
EventArgs) Handles MyBase.Load
37
Bindcourse()
txtQno.ReadOnly = True
btnNext.Visible = False
btnAdd.Enabled = True
End Sub
cmbCourse.Items.Add(ds.Tables(0).Rows(i)(0).ToString())
Next
Else
MsgBox("Course Not Found...")
End If
End Sub
cmbSubject.Items.Add(ds.Tables(0).Rows(i)(0).ToString())
Next
Else
MsgBox("Course Not Found...")
End If
End Sub
End Sub
Try
qry = "select top 1 MAX(q_no)as QID from tbl_Question
where subject= '" & cmbSubject.Text & "'and course='" &
cmbCourse.Text & "' "
cmd = New SqlCommand(qry, con)
con.Open()
Dim dr1 As SqlDataReader = cmd.ExecuteReader()
If (dr1.Read()) Then
Qno = dr1.Item("QID").ToString
txtQno.Text = Val(Qno) + 1 '--------------add 1 in
previous value
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
If con.State = 1 Then con.Close()
End Sub
40
Handles btnAdd.Click
'validation code
If txtQno.Text.Trim() = "" Then
txtQno.Focus() : Exit Sub ElseIf
txtQus.Text.Trim() = "" Then
txtQus.Focus() : Exit Sub
ElseIf txtOptionA.Text.Trim() = "" Then
txtOptionA.Focus() : Exit Sub ElseIf
txtOptionB.Text.Trim() = "" Then
txtOptionB.Focus() : Exit Sub ElseIf
txtOptionC.Text.Trim() = "" Then
txtOptionC.Focus() : Exit Sub ElseIf
txtOptionD.Text.Trim() = "" Then
txtOptionD.Focus() : Exit Sub
ElseIf cmbcorrectAns.Text.Trim() = "" Then
cmbcorrectAns.Focus() : Exit Sub ElseIf
cmbCourse.Text.Trim() = "" Then
cmbCourse.Focus() : Exit Sub ElseIf
cmbSubject.Text.Trim() = "" Then
cmbSubject.Focus() : Exit Sub
End If
Try
qry = "Insert into
tbl_Question(q_no,course,subject,question,op_A,op_B,op_C,op
_D,answer)values('" & txtQno.Text & "','" & cmbCourse.Text &
"','" & cmbSubject.Text & "','" & txtQus.Text & "','" &
txtOptionA.Text & "','" & txtOptionB.Text & "','" &
txtOptionC.Text & "','" & txtOptionD.Text & "','" &
cmbcorrectAns.Text & "')"
41
i = InsertData(qry)
If (i > 0) Then
MsgBox("Question Added successful",
MsgBoxStyle.Information)
btnAdd.Enabled = False
btnNext.Enabled = True btnNext.Visible
= True
Else
MsgBox("Question Not Added ",
MsgBoxStyle.Exclamation)
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
txtQno.Clear()
txtQus.Clear()
txtQus.Focus()
txtOptionA.Clear()
txtOptionB.Clear()
txtOptionC.Clear()
txtOptionD.Clear()
cmbcorrectAns.Text = ""
42
QuestionNo()
btnNext.Visible = False
End Sub
End class
FORM EDIT QUESTION
Imports System.Data
Imports System.Data.SqlClient
While dr.Read
i += 1
DataGridView1.Rows.Add(dr.Item("q_no").ToString, i,
dr.Item("course").ToString, dr.Item("subject").ToString,
dr.Item("question").ToString, dr.Item("op_A").ToString,
dr.Item("op_B").ToString, dr.Item("op_C").ToString,
43
dr.Item("op_D").ToString, dr.Item("answer").ToString) End
While
dr.Close()
con.Close()
lblcount.Text = "(" & DataGridView1.RowCount & ")
Records found."
End Sub
End Sub
.cmbCourse.Text =
DataGridView1.Rows(e.RowIndex).Cells(2).Value.ToString
.cmbSubject.Text =
44
DataGridView1.Rows(e.RowIndex).Cells(3).Value.ToString
.txtQno.Text = _id
.txtQus.Text =
DataGridView1.Rows(e.RowIndex).Cells(4).Value.ToString
.txtOptionA.Text =
DataGridView1.Rows(e.RowIndex).Cells(5).Value.ToString
.txtOptionB.Text =
DataGridView1.Rows(e.RowIndex).Cells(6).Value.ToString
.txtOptionC.Text =
DataGridView1.Rows(e.RowIndex).Cells(7).Value.ToString
.txtOptionD.Text =
DataGridView1.Rows(e.RowIndex).Cells(8).Value.ToString
.cmbcorrectAns.Text =
DataGridView1.Rows(e.RowIndex).Cells(9).Value.ToString
.txtQno.ReadOnly = True
.ShowDialog()
End With
ElseIf colName = "Column12" Then
If (MsgBox("Are you sure want to delete record?",
vbYesNo + vbQuestion) = vbYes) Then
qry = "Delete from tbl_Question where q_no=" &
DataGridView1.Rows(e.RowIndex).Cells(0).Value.ToString &
"" i=
InsertData(qry)
If (i > 0) Then
MsgBox("Question Deleted successful",
MsgBoxStyle.Information)
LoadRecord()
45
Else
MsgBox("Question not Deleted",
MsgBoxStyle.Exclamation)
End If
End If
End If
End Sub End
Class
End Sub
46
If txteno.Text = "" Or txtename.Text = "" Or txtaddrs.Text
= "" Or txtcntct.Text = "" Or (rdbmale.Checked = False And
rdbfemale.Checked = False) Or txtdesign.Text = "" Or
txtusername.Text = "" Or txtpswd.Text = "" Then
MsgBox("please enter all details")
Exit Sub
End If
If txtcntct.Text.Length < 10 Or txtcntct.Text.Length > 11
Then
MsgBox("invalid phone number")
Exit Sub
End If
Try
cmd = New SqlCommand("select emp_no from
tbl_Employee where emp_no=@d1 ", con)
Dim UParam As New SqlParameter("@d1",
Me.txteno.Text)
cmd.Parameters.Add(UParam)
cmd.Connection = con cmd.Connection.Open()
Dim dr As SqlDataReader = cmd.ExecuteReader()
If dr.HasRows Then
MsgBox("EMPLOYEE NUMBER IS ALREADY
EXIST")
con.Close()
Else
'insert record
If con.State = 1 Then con.Close()
radiogender()
qry = "insert into
47
tbl_Employee(emp_no,emp_name,doj,dob,addr,contact,designat
ion,username,password,gender)values('" & txteno.Text & "','" &
txtename.Text & "','" & dtpdoj.Value & "','" & dtpdob.Value &
"','" & txtaddrs.Text & "','" & txtcntct.Text & "','" &
txtdesign.Text & "','" & txtusername.Text & "','" & txtpswd.Text
& "','" & gender & "')"
cmd = New SqlCommand(qry, con)
cmd.Connection = con cmd.Connection.Open()
i = cmd.ExecuteNonQuery()
If (i >= 1) Then
MsgBox("EMPLOYEE REGISTRATION
SUCCESSFULL")
con.Close()
Else
MsgBox("Registration Failed")
con.Close()
End If
reset()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub frmAddEmployee_Load(sender As Object, e As
EventArgs) Handles MyBase.Load
LOAD_EMPNO() txtename.Focus()
48
dtpdob.MaxDate = Today.AddYears(-20)
dtpdoj.MaxDate = Today.Date
End Sub
Public Sub LOAD_EMPNO()
ds.Clear()
txteno.Clear()
If con.State = 1 Then con.Close()
con.Open()
str = "select * from tbl_Employee"
49
gender = "Female"
Else
gender = "Male"
End If
End Sub
Private Sub txtcntct_KeyPress(sender As Object, e As
KeyPressEventArgs) Handles txtcntct.KeyPress
If Char.IsLetter(e.KeyChar) Then
e.Handled = True
End If
End Sub
Private Sub txtename_KeyPress(sender As Object, e As
KeyPressEventArgs) Handles txtename.KeyPress
If Char.IsNumber(e.KeyChar) Then
e.Handled = True
End If
End Sub
End Class
da.Fill(ds, "Table")
Dim i As Integer = 0
Dim j As Integer = 0
'adding the column in listview
For i = 0 To ds.Tables(0).Columns.Count - 1
Me.ListView1.Columns.Add(ds.Tables(0).Columns(i).ColumnN
ame.ToString())
Next
' now adding the item in listview
For i = 0 To ds.Tables(0).Rows.Count - 1
For j = 0 To ds.Tables(0).Columns.Count - 1
itemcoll(j) = ds.Tables(0).Rows(i)(j).ToString()
Next
Dim lvi As New ListViewItem(itemcoll)
Me.ListView1.Items.Add(lvi)
Next
End Sub
End Class
52
FORM APPROVAL STUDENT
Imports System.Data
Imports System.Data.SqlClient
End While
dr.Close()
con.Close()
lblcount.Text = "(" & dgvApprove.RowCount & ") Record
Found."
End Sub
53
Private Sub PictureBox1_Click(sender As Object, e As
EventArgs) Handles PictureBox1.Click
Me.Dispose()
End Sub
con.Close()
MsgBox("Student Approved Successfully",
vbInformation)
loadRecord()
End If
End If
End Sub
54
Object, e As EventArgs) Handles
dgvApprove.SelectionChanged i=
dgvApprove.CurrentRow.Index
_id = dgvApprove.Item(0, i).Value
End Sub
End Class
FORM STUDENT HISTORY
Imports System.Data
Imports System.Data.SqlClient
End If
55
If con.State = 1 Then con.Close()
End Sub
End If
If con.State = 1 Then con.Close()
End Sub
End Sub
57
cmd = New SqlCommand(qry, con)
cmd.Parameters.AddWithValue("@img", path)
cmd.Parameters.AddWithValue("@id", TextBox1.Text)
cmd.ExecuteNonQuery()
con.Close()
Dim a As Image = PictureBox2.Image
a.Save(path)
MsgBox("Profile pic save successfully")
End If
End Sub
End If
58
Else
End If con.Close()
End Sub
End class
FORM FEES PAYMENT
Imports System.Data
Imports System.Data.SqlClient
Public Class frmFeesPayment
Dim regnum As String
Dim recptnum As Integer
Private Sub PictureBox1_Click(sender As Object, e As
EventArgs) Handles PictureBox1.Click
Me.Dispose()
End Sub
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
'select fees
If con.State = 1 Then con.Close()
qry = "select fees from tbl_course_fee where
60
course='" & lblcourse.Text & "' "
cmd = New SqlCommand(qry, con)
con.Open()
dr = cmd.ExecuteReader()
If dr.Read Then
lblfees.Text = dr.Item("fees").ToString
CheckBox1.Checked = False
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
If con.State = 1 Then con.Close()
End Sub
i = InsertData(qry)
If i > 0 Then
MsgBox("Payment Successfully Done",
MsgBoxStyle.Information)
Else
MsgBox("Payment Failed", MsgBoxStyle.Critical)
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
End Sub
Private Sub btncancle_Click(sender As Object, e As
EventArgs) Handles btncancle.Click
txtrollno.Clear() lblcourse.Text
= ""
lblfees.Text = ""
CheckBox1.Checked = False
End Sub
End class
63
FORM FEES DETAILS
Imports System.Data
Imports System.Data.SqlClient
ds = FetchData(qry)
If (ds.Tables(0).Rows.Count > 0) Then
dgvASL.DataSource = ds.Tables(0)
Else
MsgBox("Record not found", vbCritical)
End If
If con.State = 1 Then con.Close()
End Sub
64
Private Sub PictureBox1_Click(sender As Object, e As
EventArgs) Handles PictureBox1.Click
Me.Dispose()
End Sub
loadApprovedStudent()
loadfeesbyid()
End Sub
Public Sub loadfeesbyid()
If con.State = 1 Then con.Close()
con.Open()
End If
If con.State = 1 Then con.Close()
End Sub
End Sub
End If
End Sub
67
Permission")
txtAdminpass.Text = ""
txtConfirmpass.Text = ""
txtOldpass.Text = "" txtNEWpass.Text
= ""
txtAdminpass.Focus()
Else
qry = "select * from tblpassword where password='" &
txtOldpass.Text & "'"
con.Open()
cmd = New SqlCommand(qry, con)
dr = cmd.ExecuteReader
If dr.Read() Then
If txtNEWpass.Text <> txtConfirmpass.Text Then
MsgBox("Please Confirm the password correct")
txtNEWpass.Clear() txtConfirmpass.Clear()
txtNEWpass.Focus()
Else
qry = ("Update tblpassword set password='" &
txtNEWpass.Text & "'")
InsertData(qry)
MsgBox("Password Changed Sucessfully")
clr()
End If
Else
MsgBox("Invalid Old Exam password",
MsgBoxStyle.Critical)
txtOldpass.Clear()
txtOldpass.Focus()
68
End If
End If
con.Close()
End If
End Sub End
Class
cmbsubject1.Items.Add(ds.Tables(0).Rows(i)(0).ToString())
Next
Else
cmbsubject1.Enabled = False
End If
End Sub
71
cmd = New SqlCommand(qry, con)
con.Open()
Dim dr1 As SqlDataReader = cmd.ExecuteReader()
If dr1.Read() Then
'show exam start
Me.Close()
frmExamTest.Show()
Else
MsgBox("Record not found try again")
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Try
If con.State = 1 Then con.Close()
End Sub End
Class
74
qry = "select
q_no,question,op_A,op_B,op_C,op_D,answer from tbl_Question
where course='" & lblcoursename.Text & "'and subject='" &
lblsubject.Text & "' and q_no= '" & lblqstn.Text &
"'"
If con.State = 1 Then con.Close()
cmd = New SqlCommand(qry, con)
con.Open()
Dim dr1 As SqlDataReader = cmd.ExecuteReader()
If dr1.Read Then
txtqstn.Text = dr1.Item("question").ToString
rdboA.Text = dr1.Item("op_A").ToString
rdboB.Text = dr1.Item("op_B").ToString rdboC.Text
= dr1.Item("op_C").ToString rdboD.Text =
dr1.Item("op_D").ToString lblAns.Text =
dr1.Item("answer").ToString
qnum = lblqstn.Text
rdboA.Checked = False
rdboB.Checked = False
rdboC.Checked = False
rdboD.Checked = False End If
qry = "select answer from tbl_studentanswers where
75
Ex_regno='" & rg & "'and course='" & lblcoursename.Text &
"'and subject='" & lblsubject.Text & "'and q_no='" &
lblqstn.Text & "'"
If con.State = 1 Then con.Close()
cmd = New SqlCommand(qry, con)
con.Open()
dr1 = cmd.ExecuteReader()
If dr1.Read Then
If dr1.Item("answer").ToString = "A" Then
rdboA.Checked = True
ElseIf dr1.Item("answer").ToString = "B" Then
rdboB.Checked = True
ElseIf dr1.Item("answer").ToString = "C" Then
rdboC.Checked = True
ElseIf dr1.Item("answer").ToString = "D" Then
rdboD.Checked = True
End If
End If
If qnum <> 0 Then qry = "select max(q_no)
as q_no from tbl_Question where course='" &
lblcoursename.Text & "'and subject='" & lblsubject.Text &
"'"
76
If con.State = 1 Then con.Close()
cmd = New SqlCommand(qry, con)
con.Open()
dr1 = cmd.ExecuteReader()
If dr1.Read Then
If
IsDBNull(Convert.ToInt32(dr1.Item("q_no").ToString)) = False
Then
If qnum <= dr1.Item("q_no").ToString Then
btnNext.Enabled = True Else
btnNext.Enabled = False
btnpreview.Enabled = True
End If
End If
End If
78
Private Sub rdboA_CheckedChanged(sender As Object, e As
EventArgs) Handles rdboA.CheckedChanged
If rdboA.Checked = True Then
answer() 'delete duplicate
qry = "delete from tbl_studentanswers where
Ex_regno='" & rg & "'and course='" & lblcoursename.Text &
"'and subject='" & lblsubject.Text & "'and q_no='" &
lblqstn.Text & "'"
InsertData(qry)
'insert
qry = "insert into
tbl_studentanswers(Ex_regno,course,subject,q_no,answer,crc_a
ns)values('" & rg & "','" & lblcoursename.Text & "','" &
lblsubject.Text & "','" & lblqstn.Text & "','" & ans & "','" &
lblAns.Text & "')"
InsertData(qry)
End If
End Sub
Public Sub answer()
If rdboA.Checked = True Then
ans = "A"
ElseIf rdboB.Checked = True Then
ans = "B"
79
ElseIf rdboC.Checked = True Then
ans = "C"
ElseIf rdboD.Checked = True Then
ans = "D"
Else
MsgBox("Please Answer to Question",
MsgBoxStyle.Exclamation)
End If
End Sub
Private Sub rdboB_CheckedChanged(sender As Object, e As
EventArgs) Handles rdboB.CheckedChanged
If rdboB.Checked = True Then
answer() 'delete duplicate
qry = "delete from tbl_studentanswers where
Ex_regno='" & rg & "'and course='" & lblcoursename.Text &
"'and subject='" & lblsubject.Text & "'and q_no='" &
lblqstn.Text & "'"
InsertData(qry)
'insert
qry = "insert into
tbl_studentanswers(Ex_regno,course,subject,q_no,answer,crc_a
ns)values('" & rg & "','" & lblcoursename.Text & "','" &
lblsubject.Text & "','" & lblqstn.Text & "','" & ans & "','" &
lblAns.Text & "')"
80
InsertData(qry)
End If
End Sub
Private Sub rdboC_CheckedChanged(sender As Object, e As
EventArgs) Handles rdboC.CheckedChanged
If rdboC.Checked = True Then
answer() 'delete duplicate
qry = "delete from tbl_studentanswers where
Ex_regno='" & rg & "'and course='" & lblcoursename.Text &
"'and subject='" & lblsubject.Text & "'and q_no='" &
lblqstn.Text & "'"
InsertData(qry)
'insert
qry = "insert into
tbl_studentanswers(Ex_regno,course,subject,q_no,answer,crc_a
ns)values('" & rg & "','" & lblcoursename.Text & "','" &
lblsubject.Text & "','" & lblqstn.Text & "','" & ans & "','" &
lblAns.Text & "')"
InsertData(qry)
End If
End Sub
Private Sub rdboD_CheckedChanged(sender As Object, e As
81
EventArgs) Handles rdboD.CheckedChanged
If rdboD.Checked = True Then
answer() 'delete duplicate
qry = "delete from tbl_studentanswers where
Ex_regno='" & rg & "'and course='" & lblcoursename.Text &
"'and subject='" & lblsubject.Text & "'and q_no='" &
lblqstn.Text & "'"
InsertData(qry)
'insert
qry = "insert into
tbl_studentanswers(Ex_regno,course,subject,q_no,answer,crc_a
ns)values('" & rg & "','" & lblcoursename.Text & "','" &
lblsubject.Text & "','" & lblqstn.Text & "','" & ans & "','" &
lblAns.Text & "')"
InsertData(qry)
End If
End Sub
82
Handles Timer2.Tick d2
= Now If d2 > d1 Then
frmExamResult.Show()
Me.Close()
Timer2.Enabled = False
Timer2.Stop()
End If
End Sub
Private Sub btnSubmit_Click(sender As Object, e As
EventArgs) Handles btnSubmit.Click
Me.Dispose() frmExamResult.Show()
End Sub
Try
cmd = New SqlCommand(qry, con)
con.Open()
83
Dim dr1 As SqlDataReader = cmd.ExecuteReader()
If dr1.Read() Then lblcoursename.Text =
dr1.Item("course").ToString course =
lblcoursename.Text
End If
If con.State = 1 Then con.Close() qry = "select
subjects from tbl_course where course='" & lblcoursename.Text
& "'and subjects='" & subject & "'and part='" & p & "'"
cmd = New SqlCommand(qry, con) con.Open()
dr1 = cmd.ExecuteReader()
If dr1.Read() Then lblsubject.Text =
dr1.Item("subjects").ToString subject =
lblsubject.Text
End If
If con.State = 1 Then con.Close()
'show question
qry = "select
q_no,question,op_A,op_B,op_C,op_D,answer from tbl_Question
with (nolock) where course='" &
lblcoursename.Text & "'and subject ='" & lblsubject.Text & "' "
cmd = New SqlCommand(qry, con) con.Open()
dr1 = cmd.ExecuteReader()
84
If dr1.Read() Then lblqstn.Text =
dr1.Item("q_no").ToString txtqstn.Text =
dr1.Item("question").ToString rdboA.Text =
dr1.Item("op_A").ToString rdboB.Text =
dr1.Item("op_B").ToString rdboC.Text =
dr1.Item("op_C").ToString rdboD.Text =
dr1.Item("op_D").ToString lblAns.Text =
dr1.Item("answer").ToString qnum = lblqstn.Text
lblstdname.Text = Module1.name1 lblrollno.Text =
Module1.roll1
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
If con.State = 1 Then con.Close()
End Sub
End Class
End Sub
Private Sub frmExamResult_Load(sender As Object, e As
EventArgs) Handles MyBase.Load
lblRegno.Text = rg lblCourse.Text
= course lblSubject.Text = subject
If con.State = 1 Then con.Close()
End If
'total Question
86
con.Open()
dr = cmd.ExecuteReader()
If dr.Read Then
lblTotal.Text = dr.Item("totq").ToString
End If
lblCount.Text = "Fail"
lblStatus.Text = "Fail"
ElseIf Val(lblPercentage.Text) < 50 Then
lblStatus.Text = "Pass By 2nd Division" ElseIf
Val(lblPercentage.Text) < 90 Then
lblCount.Text = "Pass By First Division"
lblStatus.Text = "First division"
ElseIf Val(lblPercentage.Text) >= 90 Then lblCount.Text
= "Super performance pass by First Division"
lblStatus.Text = "Outstanding"
End If
qry = "insert into
tbl_results(Ex_regno,course,subject,total_qstn,correct_qstn,perc,
status)values('" & lblRegno.Text & "','" & lblCourse.Text & "','"
& lblSubject.Text & "','" & lblTotal.Text & "','" & lblC.Text &
"','" & lblPercentage.Text & "','" & lblStatus.text & "')" i
= InsertData(qry)
If i > 0 Then
MsgBox("This your Report card",
87
MsgBoxStyle.Information)
Else
End If
End Sub
Private Sub btnNext_Click(sender As Object, e As
EventArgs) Handles btnNext.Click
lblCourse.Text = ""
lblC.Text = "" lblTotal.Text
= "" lblStatus.Text = ""
lblSubject.Text = ""
lblRegno.Text = ""
lblPercentage.Text = ""
frmLogin.Show()
Me.Close()
End Sub
End Class
MODULE
Imports System.Data
Imports System.Data.SqlClient
Module Module1
Public cmd As New SqlCommand
Public dr As SqlDataReader
Public da As New SqlDataAdapter
Public strUser As String = "priya"
Public connectionstring As String = "Data Source=.;Initial
Catalog=DBExaminationSystem;Integrated Security=True"
Public con As New SqlConnection(connectionstring)
88
Public i As Integer = 0
Public name1 As String = ""
Public utype As String = ""
Public userpass As String = ""
Public str, gender As String
Public ds As New DataSet
Public qry As String = ""
Public _id As String
Public roll1 As String = ""
Public rg As String = ""
Public course, ans As String
Public subject As String = ""
Public p As Integer = 1
Public qnum As Integer
Public d1 As DateTime
Public Function FetchData(ByVal qry As String) As DataSet
da = New SqlDataAdapter(qry, con) ds = New DataSet
da.Fill(ds) Return ds
End Function
'create a function for insert,next and update
Public Function InsertData(ByVal qry As String) As Integer
If con.State = 1 Then con.Close()
cmd = New SqlCommand(qry, con)
con.Open() i=
cmd.ExecuteNonQuery() If
con.State = 1 Then con.Close()
Return i
End Function
End Module
89
8.OUTPUTS
FORM 1
LOGIN FORM
90
FORM MASTER
91
FORM ADD QUESTION
92
FORM ADD STAFF
93
FORM STUDENT APPROVAL
94
FORM STUDENT ADD IMAGE
95
FORM VIEW EXAM FEES
96
FORM STUDENT REGISTRATION
97
FORM STUDENT INFO FOR EXAM
98
FORM QUESTION PAPER
99
9.TESTING
TESTING METHODOLOGIES
In software development project ,errors can be injected at
any stage during the development. For each phase there are
different techniques for detecting and eliminating errors
that originate in that phase. However, some requirements
errors and design errors are likely to remain undetected.
Ultimately,this error will be reflected in the code. Since
code is frequently the only product that can be executed and
whose actual behavior can be observed, testing is the phase
where the errors remaining from the earlier phase also must
be detected.
Hence testing perform savery critical role for quality
assurance and for insuring there liability of so
OBJECTIVE OF TESTING:
Software testing is a critical element of software quality
assurance and represents the ultimate review of
specification,design,coding.The engineer creates a serious
of test cases that are in tended to"demo lish"the software
that has been built.In fact, testing is the one step in this
software engineering process that could be viewed as
destructive rather than constructive.
100
The aim of any software development is to create bug free
reliable and secured system that provides solution to user
requirements. The implementation of a newly designed
application is imported in adopting a successful new
system.
The implementation of the application involved testing and
user training, acceptance and change over.
System testing is the process of checking if the developed
system is working according to the original objectives and
requirements. Initially the system was tested
experimentally with the test data so as to ensure that
software works according to the required specifications and
in the way user expect it to.
The objective of testing is as follows:
Testing is the process of executing a program with the
intent of an error.
A good tester case is one that has a high probability of
finding an undiscovered error.
A successful test is one that uncovers an as yet
undiscovered error.
System testing is the stage of implementation, which is
aimed at ensuring that works accurately and system
efficiently before line operation commences. Testing is
vital to the success of the system. System testing makes a
101
logical assumption that if all parts of the system are correct
the goal will be successfully achieved.
The candidate system is subject to a variety of tests-on-line
responses, volume, stress, recovery, security and usability
tests. A series of tests are performed before the system is
ready for user acceptance testing.
TYPES OF TESTING:
The testing process is divided into three major components
as follows:
•Unit testing
•Integration testing
•Validation testing
UNIT TESTING:
It focuses verification effort on the smallest unit of software
design module. Here using unit test plane prepared in
design description as guide, important control paths are
tested to uncover error within the boundary of the module.
Here at the first Ensure that the information properly flows
in to and out of the unit under the test. The data structure is
examined to ensure that the data stored temporarily
maintains its integrity during all steps in the algorithm
execution.
102
Boundary condition is tested to ensure the modules operate
properly at boundaries established to limit or restrict
processing. All paths in the control structure are exercised
to module, interface is tested to ensure all statements in a
module are executed at least once and finally all
errorshandling paths are tested to see messages are
intelligent, corresponds to errors encountered. And it
providers enough description to assist in the location of the
cause of the error. The test is carried out during the
programming and each module is found to be working
satisfactorily. When an unregistered user gives id and
password the system give the message like this.
INTEGRATION TESTING:
Here the focus of the test Is on the design and construction
of the software architecture. This is a systematic technique
for constructing the program structure and conducting tests
to uncover errors associated with interfacing. Here the
objective is to take unit-testing modules and build a
program that is dictated by design. All the functions were
integrated after successful completion of development and
unit testing. A comprehensive integrated testing was
carried out using integrated test plans in the design phase
of the system development as a guide to ensure the
following things like behavior of function with live data,
interface testing and performance testing.
103
The need for the integrated testing is to find the overall
system performance. The objective is to take unit tested
modules and build a program structure. The entire module
are combined and tested as a whole.The correction is
difficult because the vast expenses of entire program
complete the isolation of causes. Unit testing has applied to
Plantation Management System at the programming stage
and the errors found have been corrected, to maximize the
output. Black box testing is done to find
•In correct or missing function
• Interface errors
• Errors in external database access
• Performance errors
•Initialization and termination errors
The above testing was successfully carried out for these
applications according to the user requirement
specification. The database connection errors and the
accuracy with which data is stored, searched and retrieved
are tested with Corporate Recruitment System.
VALIDATION TESTING:
A the culmination of Integration Testing, software is
completely assembled as an application; interfacing errors
have been uncovered and corrected and a final series of
software test validation test begins.
104
Validation succeeds when the software functions in a
manner that can be reasonably expected by the user.
Software validation is achieved through a series of black
box tests that demonstrate confirm with requirements.
The performance characteristics confer to specification and
accepted .
A deviation form specification is uncovered and deficiency
list is created. Deviation or errors discovered at the step in
this system with the help of users by negotiating to
establish a meeting for resolving difference. This proposed
system under consideration was tested by validation and
found to be working satisfactorily.
OUTPUT TESTING:
After performing the validation testing. The next step is
output testing of the proposed system, since no system
could be useful if it does not produce the required output in
the required format.
Hence the output format is considered in two ways: one is
on the screen and another Sprinted format. The output
format on the screen is found to be correct as the format
was designed in the system design phase according to the
user needs.
105
For the hard copy too, the output comes out as specified by
the user. Hence output testing did not result in any
correction in the system.
106
10. CONCLUSION
Conclusion The offline examination system provides
better functionality for an examination to be more
efficient and reduce manual paperwork in order to
automate all possible tasks. For implementing this
system, visual studio (.net framework) and Microsoft Sql
server are used.
107
11.BIBLIOGRAPHY
108