?? que_add.asp
字號:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!-- #include file="cookies.asp" -->
<!-- #include file="conn/conn.asp" -->
<% '沒有試卷,不能加入題目
set rs=createobject("adodb.recordset")
sql="select * from exam order by ename"
rs.Open sql,conn,1,1
if rs.eof then
%>
<script>
window.alert("請先創(chuàng)建試卷!")
history.go(-1);
</script>
<%
end if
rs.close
set rs=nothing
%>
<script language="JavaScript">
function check()
{
if(document.form1.ename.value == '')
{
window.alert('請選擇所屬課題');
document.form1.ename.focus();
return false;
}
if(document.form1.qid.value == '')
{
window.alert('請輸入題目編號');
document.form1.qid.focus();
return false;
}
if(document.form1.qname.value == '')
{
window.alert('請輸入題目名稱');
document.form1.qname.focus();
return false;
}
if(document.form1.key1.value == '' )
{
window.alert('請輸入可選項A');
document.form1.key1.focus();
return false;
}
if(document.form1.key2.value == '')
{
window.alert('請輸入可選項B');
document.form1.key2.focus();
return false;
}
if(!(document.form1.rightkey[0].checked||document.form1.rightkey[1].checked||document.form1.rightkey[2].checked||document.form1.rightkey[3].checked||document.form1.rightkey[4].checked||document.form1.rightkey[5].checked||document.form1.rightkey[6].checked))
{
window.alert('請選擇標(biāo)準(zhǔn)答案');
return false;
}
}
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>網(wǎng)上考試系統(tǒng) - 創(chuàng)建題目</title>
</head>
<body bgcolor="#EEEEEE">
<!-- #include file="button_t.asp" -->
<table width="760" border="0" align="center" bgcolor="#FFFFFF">
<%'計算當(dāng)前題號
set rs=server.createobject("adodb.recordset")
sql="select * from question order by qid"
rs.open sql,conn,1,1
rs.movelast
x=rs("qid")+1 '最大題號加1
rs.close
set rs=nothing
%>
<tr>
<td>
<table width="80%" border="0" align="left">
<tr>
<td> </td>
</tr></table></td>
</tr>
<tr>
<td>
<table width="100%" border="0">
<form name="form1" method="post" onsubmit="return check();" action="que_save.asp">
<tr>
<td> <div align="right">所屬課程:</div></td>
<td> <% '動態(tài)顯示課程名下拉框
set rstype=createobject("adodb.recordset")
sql="select * from curricula order by id"
rstype.Open sql,conn,1,1%>
<select name="ename">
<option value="">請選擇</option>
<%do while not rstype.EOF%>
<option value="<%=rstype("name")%>"><%=rstype("name")%></option>
<%
rstype.MoveNext
loop
rstype.close
set rstype=nothing
%>
</select>
</td>
</tr>
<tr>
<td> <div align="right">題 目:</div></td>
<td> <textarea name="qname" cols="70" id="qname"></textarea></td>
</tr>
<tr>
<td> <div align="right">題 型:</div></td>
<td> <input type="radio" name="qtype" value="1" checked>
單選題
<input type="radio" name="qtype" value="2">
多選題
<input type="radio" name="qtype" value="3">
判斷題
</td>
</tr>
<tr>
<td valign="top"> <div align="right">可 選 項:</div></td>
<td> <p>A:
<input name="key1" type="text" id="key1" size="55">
<input name="rightkey" type="checkbox" value="A">
<font size="2">(請選擇標(biāo)準(zhǔn)答案)</font><br>
B:
<input name="key2" type="text" id="key2" size="55">
<input name="rightkey" type="checkbox" value="B">
<br>
C:
<input name="key3" type="text" id="key3" size="55">
<input name="rightkey" type="checkbox" value="C">
<br>
D:
<input name="key4" type="text" id="key4" size="55">
<input name="rightkey" type="checkbox" value="D">
<br>
E:
<input name="key5" type="text" id="key43" size="55">
<input name="rightkey" type="checkbox" id="rightkey" value="E">
<br>
F:
<input name="key6" type="text" id="key5" size="55">
<input name="rightkey" type="checkbox" id="rightkey3" value="F">
<br>
</p></td>
</tr>
<tr>
<td valign="top"> <div align="right"></div></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> <input name="rkon" type="submit" id="rkon" value="提交"> <input type="reset" name="Submit2" value="取 消">
<input type="hidden" name="qid" value="<%=x%>"></td>
</tr>
</form>
</table></td>
</tr>
</table>
</body>
</html>
<%
conn.close
set conn=nothing
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -