rs.open "select * from 测试表 where 项目类别=0",c1,1,1
'此为单选题,项目类别=0为单选,项目类别=1为多选
for i=1 to rs.recordcount
tp_flag=0
tp_flag_count=0
'利用循环把测试题目全部显示出来%>
<b><%=i%>、<%=rs("测试标题")%></b> <%=trim(rs(“分值”))%>分<br>
<input type=hidden name=na<%=i%> value=<%=rs("id")%>>
<%tp_flag=split(server.htmlencode(replace(trim(rs("测试内容")),chr(10),"")),chr(13))
'利用chr(13)来分割选项
for e=0 to ubound(tp_flag)
'表示通过split分割后形成数组后的最后一个值
if trim(tp_flag(e))<>"" then
tp_flag_count=tp_flag_count+1
%> <input type="radio" value=<%=tp_flag_count%> name=no<%=rs("id")%>> <%=xuanxiang(tp_flag_count)%>、<%=tp_flag(e)%><br>
<%
if tp_flag_count>=10 then exit for
end if
next%>
<br>
<%rs.movenext
next
rs.close%>
<input type=submit value="提交试卷" name=b1> <input type=reset value="重置" name=b1>
</form>
|