-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.jsp
34 lines (29 loc) · 1.01 KB
/
next.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html>
<head>
<title>D Valut</title>
</head>
<body>
<%
String paper = (String)request.getParameter("testName");
String given_ans = request.getParameter("ans");
int qsnLimit=(Integer) session.getAttribute("qsnNum");
System.out.println(qsnLimit);
String correct_ans = (String) session.getAttribute("cans");
int question_passed = (Integer) session.getAttribute("question_passed");
if(question_passed>qsnLimit-2){
response.sendRedirect("http://localhost:8080/submit.jsp");
}
question_passed ++;
session.setAttribute("question_passed", question_passed);
if (given_ans.equals((String)session.getAttribute("cans"))){
int value = (Integer) session.getAttribute("correct_answer");
value ++;
session.setAttribute("correct_answer", value);
}
%>
<script type="text/javascript">
window.location.href = "http://localhost:8080/startTest.jsp?testName=<%=paper%>"
</script>
</body>
</html>