📄 english.jsp
字号:
resultp.close();
j=0;
i=0;
int k=0;
String Q_id=null;
//产生4个随即数
for(num=0;num<2;num++)
{
randnum[num]=0;
}
while (true)
{
isexsit=false;
i = rand.nextInt(maxid+1);
for(num=0;num<j;num++)
{
if (randnum[num]==i)
{
isexsit=true;
break;
}
}
if (!isexsit)
{
p = conn.prepareStatement("select * from eng_read where id=?");
p.setInt(1,i);
result=p.executeQuery();
%>
<%
while(result.next())
{ k=0;
Q_id=result.getString("q_id");
%>
<table width="75%" height="50" border="0" align="center" cellpadding="0" cellspacing="1" class="table">
<tr>
<td bgcolor="#8CDAFF"><div align="left"><%=j+1%>.<%=result.getString("passage")%>
</div></td>
</tr>
</table>
<% p = conn.prepareStatement("select * from eng_read_choose where q_id=?");
p.setString(1,Q_id);
resultee=p.executeQuery();
while(resultee.next())
{
%> <table width="75%" height="140" border="0" align="center" cellpadding="0" cellspacing="1" class="table">
<tr>
<td bgcolor="#8CDAFF"><div
align="left"><%=h%>.<%=resultee.getString("question")%>答案选择:
<select name="select<%=h%>" id="select<%=h%>">
<option value="o" selected></option>
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
<option value="D">D</option>
</select>
<input type="hidden" name="h<%=h%>" value="<%=resultee.getString("id")%>">
</div></tr></td>
<tr>
<td><div align="left">
A.<%=resultee.getString("k_a")%></div></td>
</tr>
<tr>
<td><div align="left">
B.<%=resultee.getString("k_b")%></div></td>
</tr>
<tr>
<td><div align="left">
C.<%=resultee.getString("k_c")%></div></td>
</tr>
<tr>
<td><div align="left">
D.<%=resultee.getString("k_d")%></div></td>
</tr>
</table>
<% h++;
}
resultee.close();
randnum[j]=i;System.out.println(i);
j++;
}
}
if (j>=1) break;
}
result.close();
%>
<!--第三部分-->
<table width="75%" height="50" border="0" align="center" cellpadding="0" cellspacing="1" class="table">
<tr><td bgcolor="#8CDAFF"><font size=4><div align="center">Part three Cloze<br></div></font><font size=3><div align="left">Diretions:</div></font><div align="left"> For each blank in the following passage. choose best answer from the choice given below. Mark you anser on the Answer Sheetby drawing with a pencil a short bar across thecorresponding letter in the brackets.<br></div></td></tr>
<%
conn = linejdbc.getopenConnection();
p = conn.prepareStatement("select max(id) from eng_cloze");
resultp = p.executeQuery();
resultp.next();
result=null;
resultee=null;
maxid=resultp.getInt(1);
resultp.close();
while (true)
{ j=0;
i = rand.nextInt(maxid+1);
p = conn.prepareStatement("select * from eng_cloze where id=?");
p.setInt(1,i);
result=p.executeQuery();
if(result.next())
{ j++;
Q_id=result.getString("q_id");
}
if (j>=1) break;
}
System.out.println(i);%>
<table width="75%" height="50" border="0" align="center" cellpadding="0" cellspacing="1" class="table">
<tr>
<td bgcolor="#8CDAFF"><div align="left"><%=result.getString("passage")%>
</div></td>
</tr>
</table>
<% p = conn.prepareStatement("select * from eng_cloze_choose where q_id=?");
p.setString(1,Q_id);
resultee=p.executeQuery();
while(resultee.next())
{ %>
<table width="75%" height="140" border="0" align="center" cellpadding="0" cellspacing="1" class="table">
<tr>
<td bgcolor="#8CDAFF"><div align="left"><%=h%>.答案选择:
<select name="select<%=h%>" id="select<%=h%>">
<option value="o" selected></option>
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
<option value="D">D</option>
</select>
<input type="hidden" name="h<%=h%>"
value="<%=resultee.getString("id")%>" >
</div></tr></td>
<tr>
<td><div align="left">
A.<%=resultee.getString("k_a")%></div></td>
</tr>
<tr>
<td><div align="left">
B.<%=resultee.getString("k_b")%></div></td>
</tr>
<tr>
<td><div align="left">
C.<%=resultee.getString("k_c")%></div></td>
</tr>
<tr>
<td><div align="left">
D.<%=resultee.getString("k_d")%>
</div></td>
</tr>
</table>
<% h++;
}
resultee.close();
result.close();
%>
<!--第四部分-->
<table width="75%" height="50" border="0" align="center" cellpadding="0" cellspacing="1" class="table">
<tr><td bgcolor="#8CDAFF"><font size=4><div align="center">Part four Dialogue Completion<br></div></font><font size=3><div align="left">Diretions:</div></font><div align="left"> There are ten short incompletes between two speakers,each following by four choice marked A, B, C and D. Choose the answerthat appropriately suit the conversational context and best completes the dialogue. Mark you anser on the Answer Sheetby drawing with a pencil a short bar across thecorresponding letter in the brackets.<br></div></td></tr>
<%
conn = linejdbc.getopenConnection();
p = conn.prepareStatement("select max(id) from eng_dial_com");
resultp = p.executeQuery();
resultp.next();
maxid=resultp.getInt(1);
resultp.close();
j=0;
for(num=0;num<6;num++)
{
randnum[num]=0;
}
while (true)
{
isexsit=false;
i = rand.nextInt(maxid+1);
for(num=0;num<j;num++)
{
if (randnum[num]==i)
{
isexsit=true;
break;
}
}
if (!isexsit)
{
p = conn.prepareStatement("select * from eng_dial_com where id=?");
p.setInt(1,i);
result=p.executeQuery();
while(result.next())
{
%>
<table width="75%" height="140" border="0" align="center" cellpadding="0" cellspacing="1" class="table">
<tr>
<td bgcolor="#8CDAFF"><div align="left"><%=h%>.<%=result.getString("dialogue")%>答案选择:
<select name="select<%=h%>" id="select<%=h%>">
<option value="o" selected></option>
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
<option value="D">D</option>
</select>
<input type="hidden" name="h<%=h%>" value="<%=result.getString("id")%>">
</div></tr></td>
<tr>
<td><div align="left">
A.<%=result.getString("k_a")%></div></td>
</tr>
<tr>
<td><div align="left">
B.<%=result.getString("k_b")%></div></td>
</tr>
<tr>
<td><div align="left">
C.<%=result.getString("k_c")%></div></td>
</tr>
<tr>
<td><div align="left">
D.<%=result.getString("k_d")%>
</div></td>
</tr>
</table>
<% randnum[j]=i;System.out.println(i);
j++;
h++;
}
}
if (j==4) break;
}
result.close();
p.close();
conn.close();
System.out.print("题目抽取完毕!!!!");
%>
<p> </p>
<p align="center">
<input name="image1" type="image" id="image1" onClick="formDaan.submit()" src="img/gogoOK.jpg" align="absmiddle" width="75" height="35" border="0">
</p>
</form>
<div align="center"> </div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -