Press "Enter" to skip to content

Code of question paper online exam system

How online examination system works

The teacher or course builder creates an account with an exam builder. In such an exam system you can create questions and add them to the exam. You can choose between multiple choice questions or free text questions. The students are provided with a link to the online exam, they sign up and can take the exam. They see the results immediately afterwards.

I think it will be very useful to learner. Any student can easily use this code and make his/her project completely.

To get help you can see the video.

Source code for question paper.

jRadioButton1.setActionCommand("int");
jRadioButton2.setActionCommand("float");
jRadioButton3.setActionCommand("double");
jRadioButton4.setActionCommand("long");
jRadioButton5.setActionCommand("ascii");
jRadioButton6.setActionCommand("iso-latin-1");
jRadioButton7.setActionCommand("unicode");
jRadioButton8.setActionCommand("none");
try {
if (jTextField1.getText().equals("")) {
JOptionPane.showMessageDialog(null, "Enter Your Email...");
} else {
String sql = "select email from admin where email=? ";
pst = con.prepareStatement(sql);
pst.setString(1, jTextField1.getText());
rs = pst.executeQuery();
if (rs.next()) {
String a1 = buttonGroup1.getSelection().getActionCommand();
String a2 = buttonGroup2.getSelection().getActionCommand();

String sql2 = "select * from answers where id=1 ";
pst = con.prepareStatement(sql2);
rs = pst.executeQuery();
if (rs.next()) {
String add1 = rs.getString("ans1");
String add2 = rs.getString("ans2");

if (a1.equals(add1)) {
count++;
}
if(a2.equals(add2)){
count++;
}

String sql3 = "insert into marks(email,mark) values(?,?)";
pst = con.prepareStatement(sql3);
pst.setString(1, jTextField1.getText());
pst.setString(2, String.valueOf(count));
pst.execute();

dispose();
new Marks().setVisible(true);
}
} else {
JOptionPane.showMessageDialog(null, jTextField1.getText() + " Email not Exist...");
}
}
} catch (Exception e) {
JOptionPane.showMessageDialog(null, e);
}

Interface of after run the question paper.

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *