-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoutput.jsp
More file actions
38 lines (37 loc) · 774 Bytes
/
output.jsp
File metadata and controls
38 lines (37 loc) · 774 Bytes
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
35
36
37
38
<html>
DONE!!!
<%@ page import="java.lang.*"%>
<%@ page import="java.io.*"%>
<%
String option = request.getParameter("quiz");
String quizno = null;
if(option.equals("c"))
{
quizno="11";
}
else if(option.equals("cpp"))
{
quizno="12";
}
else if(option.equals("java"))
{
quizno="13";
}
String output = "";
String read_console=null;
String filepath = "/home/ttt/ppp/testingc/testing-version-2/";
File f = new File(filepath);
String run= "java Autocheck "+quizno+" "+option;
Process p = Runtime.getRuntime().exec(run,null,f);
try
{
p.waitFor();
}catch(Exception e){}
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
while((read_console=br.readLine())!=null)
{
output= output+"</br>"+read_console;
}
%>
<%=output%>
</html>