想要一个简单的测试网页,可以做十道选择题,点击最后的提交按钮,相应题目会显示是否做错及正确答案
1个回答
展开全部
exam=tempload("shiti.txt") '载入txt文本,这个函数自己写一个
exam_array=split(exam,".")
for i=1 to ubound(exam_array)
response.write"<p>"
numb= mid(exam_array(i-1),instrRev(exam_array(i-1),vbcrlf)+1,len(exam_array(i-1))-instrRev(exam_array(i-1),vbcrlf))
response.write numb & "."
templi=exam_array(i)
templi=replace(templi,"①","<input type='radio' name='radio_"&numb&"' value='1'>①")
templi=replace(templi,"②","<input type='radio' name='radio_"&numb&"' value='2'>②")
templi=replace(templi,"③","<input type='radio' name='radio_"&numb&"' value='3'>③")
templi=replace(templi,"④","<input type='radio' name='radio_"&numb&"' value='4'>④")
templi=replace(templi,"⑤","<input type='radio' name='radio_"&numb&"' value='5'>⑤")
templi=mid(templi,1,instrRev(exam_array(i),vbcrlf)-1)
response.write replace(templi,vbcrlf,"<br>")
response.write"</p>"
next
上述代码没经过调试,思路大概就这样的,凑合着看着用吧答案的序号根据所有题目中,最多答案的那个题的答案个数来设定。这个是特殊字符,只能这样处理了,没有更好的办法
exam_array=split(exam,".")
for i=1 to ubound(exam_array)
response.write"<p>"
numb= mid(exam_array(i-1),instrRev(exam_array(i-1),vbcrlf)+1,len(exam_array(i-1))-instrRev(exam_array(i-1),vbcrlf))
response.write numb & "."
templi=exam_array(i)
templi=replace(templi,"①","<input type='radio' name='radio_"&numb&"' value='1'>①")
templi=replace(templi,"②","<input type='radio' name='radio_"&numb&"' value='2'>②")
templi=replace(templi,"③","<input type='radio' name='radio_"&numb&"' value='3'>③")
templi=replace(templi,"④","<input type='radio' name='radio_"&numb&"' value='4'>④")
templi=replace(templi,"⑤","<input type='radio' name='radio_"&numb&"' value='5'>⑤")
templi=mid(templi,1,instrRev(exam_array(i),vbcrlf)-1)
response.write replace(templi,vbcrlf,"<br>")
response.write"</p>"
next
上述代码没经过调试,思路大概就这样的,凑合着看着用吧答案的序号根据所有题目中,最多答案的那个题的答案个数来设定。这个是特殊字符,只能这样处理了,没有更好的办法
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |