📄 view.asp
字号:
<!--#include file="../../inc/config.asp" -->
<!--#include file="../../inc/conn.asp" -->
<!--#include file="../../inc/function.asp" -->
<!--#include file="../../inc/web.asp" -->
<%
Dim lanxUserID
lanxUserID = 0
dim testID
if Request.QueryString("testID")<>"" then
testID=Request.QueryString("testID")
else
testID=1
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%= webName %></title>
<link href="../../Styles/lanx.css" rel="stylesheet" type="text/css">
<link href="../../Styles/Navigator.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<%
'获取页面头部
getMainTop()
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="16%" valign="top">
<%
'获取左侧导航
getLeftNav()
%>
</td>
<td valign="top">
<table width="98%" border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td height="22" align="center" bgcolor="#000000">
<strong>
<font color="#FFFFFF">
--== 蓝易考试系统(ASP)V1.0 ==-- </font> </strong> </td>
</tr>
<tr>
<td>
<!--取得试卷列表-->
<%displayTest()%>
</td>
</tr>
</table>
</td>
<td width="18%" align="right" valign="top">
<!--右侧导航-->
<% getRightNav() %>
</td>
</tr>
</table>
<%
'获得页面底部
getMainBottom()
%>
</body>
</html>
<%
function displayTest()
dim conn
set conn=Server.CreateObject("ADODB.CONNECTION")
set conn=openExamData()
dim sql,rs
sql="select * from L_testsV where L_testID="&testID
set rs=Server.createObject("adodb.recordset")
rs.open sql,conn,1,3
if not rs.bof and not rs.eof then
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="22">
编号:<%= rs("L_testID") %> 试卷:<%= rs("L_name") %> 状态:<% If rs("L_enabled")=0 Then %>
<span class="STYLE1">无效</span>
<% Else %>
<span class="STYLE1">有效</span>
<% End If %></td>
</tr>
<tr>
<td height="22"> 省市:<%= rs("Province") %> 类别:<%= rs("L_categoryName") %> 修订时间:<%= rs("L_updateTime") %></td>
</tr>
<tr>
<td height="22"> <%= rs("L_description") %></td>
</tr>
<tr>
<td height="22"> <a href="#" onClick="javascript:open('types/addtype.asp?testID=<%= testID %>','','width=550,height=450')">增加题型</a></td>
</tr>
</table>
<br />
<form action="action.asp" method="post" name="frmTest">
<% displayTypes(testID) %>
<input name="L_userID" type="hidden" value="0" />
<input name="L_testID" type="hidden" value="<%= testID %>" />
<input name="L_updateTime" type="hidden" value="<%= now() %>" />
<input name="action" type="hidden" value="save" /></form>
<%
end if
'释放资源
rs.close
set rs=nothing
end function
function displayTypes(testID)
dim conn
set conn=Server.CreateObject("ADODB.CONNECTION")
set conn=openExamData()
dim sql,rs
sql="select * from L_typesV where L_testID="&testID&" order by L_position asc"
set rs=Server.createObject("adodb.recordset")
rs.open sql,conn,1,3
if not rs.bof and not rs.eof then
do while not rs.eof
%>
<%= rs("L_sequence") %>、<%= rs("L_baseTypesName") %>(<%= rs("L_baseTypesDescription") %><%= rs("L_typesDescription") %>)
<input type="submit" value="保存答案" />
<br />
[<a href="#" onClick="javascript:open('types/editType.asp?L_TypeID=<%= rs("L_TypeID") %>','','width=550,height=450')">修改题型</a>]
[<a href="types/action/delType.asp?L_TypeID=<%= rs("L_TypeID") %>&testID=<%= testID %>">删除题型</a>]
[<a href="#" onClick="javascript:open('Questions/addQuestions.asp?L_TypeID=<%= rs("L_TypeID") %>&L_testID=<%= testID %>','','width=550,height=450')">增加题目</a>]
<% if rs("L_enabled")=0 then %>
[<a href="types/action/updateType.asp?TypeID=<%= rs("L_TypeID") %>&enabled=1&testID=<%= testID %>">正常启用</a>]
<% Else %>
[<a href="types/action/updateType.asp?TypeID=<%= rs("L_TypeID") %>&enabled=0&testID=<%= testID %>">题型作废</a>]
<% End If %>
<br />
<% call displayQuestions(rs("L_baseTypeID"),rs("L_TypeID")) %>
<%
rs.movenext
loop
end if
'释放资源
rs.close
set rs=nothing
end function
function displayQuestions(baseTypeID,TypeID)
select case baseTypeID
case 1
displayQuestions_1(TypeID)
case 2
displayQuestions_1(TypeID)
case 3
displayQuestions_3(TypeID)
case 4
displayQuestions_4(TypeID)
case 5
displayQuestions_5(TypeID)
case 6
displayQuestions_6(TypeID)
case 7
displayQuestions_7(TypeID)
case else
end select
end function
function displayQuestions_1(TypeID)
'选择题,包括单选和多选
dim conn
set conn=Server.CreateObject("ADODB.CONNECTION")
set conn=openExamData()
dim sql,rs
sql="select * from L_questionsV where L_TypeID="&TypeID&" order by L_position asc"
set rs=Server.createObject("adodb.recordset")
rs.open sql,conn,1,3
if not rs.bof and not rs.eof then
do while not rs.eof
%>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
<%= rs("L_sequence") %>、<%= rs("L_description") %>
<input type="submit" value="保存答案" />
<br />
此题状态:
<% if rs("L_enabled")=1 then %>
<span class="STYLE1">有效</span>
<% Else %>
<span class="STYLE1">无效</span>
<% End If %>
此题分值:<span class="STYLE1"><%= rs("L_parvalue") %></span>
标准答案:<%= getSolution(0,rs("L_questionID")) %>
<br />
此题解析:<%= rs("L_parse") %>
<br />
[<a href="#" onClick="javascript:open('Questions/editQuestions.asp?L_questionID=<%= rs("L_questionID") %>','','width=550,height=450')">修改题目</a>]
[<a href="Questions/action/delQuestions.asp?L_questionID=<%= rs("L_questionID") %>&testID=<%= testID %>">删除题目</a>]
[<a href="#" onClick="javascript:open('options/addOptions.asp?L_questionID=<%= rs("L_questionID") %>&L_testID=<%= testID %>','','width=550,height=450')">增加选项</a>]
<% if rs("L_enabled")=0 then %>
[<a href="questions/action/updateQuestions.asp?questionID=<%= rs("L_questionID") %>&enabled=1&testID=<%= testID %>">正常启用</a>]
<% Else %>
[<a href="questions/action/updateQuestions.asp?questionID=<%= rs("L_questionID") %>&enabled=0&testID=<%= testID %>">题目作废</a>]
<% End If %>
<br />
<%= displayOptions(rs("L_questionID")) %>
<%
rs.movenext
loop
end if
'释放资源
rs.close
set rs=nothing
end function
function displayOptions(questionID)
'选择题的选项
dim conn
set conn=Server.CreateObject("ADODB.CONNECTION")
set conn=openExamData()
dim sql,rs
sql="select * from L_options where L_questionID="&questionID&" order by L_position asc"
set rs=Server.createObject("adodb.recordset")
rs.open sql,conn,1,3
if not rs.bof and not rs.eof then
do while not rs.eof
%>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
<input name="<%= questionID %>" type="checkbox" value="<%= rs("L_sequence") %>" />
<%= rs("L_sequence") %>.<%= rs("L_description") %>
<b>管理:{</b>
[<a href="#" onClick="javascript:open('options/editOptions.asp?L_OptionID=<%= rs("L_OptionID") %>','','width=550,height=450')">修改选项</a>]
[<a href="options/action/delOptions.asp?L_OptionID=<%= rs("L_OptionID") %>&testID=<%= testID %>">删除选项</a>]
<% if rs("L_enabled")=0 then %>
[<a href="options/action/updateOptions.asp?OptionID=<%= rs("L_OptionID") %>&enabled=1&testID=<%= testID %>">正常启用</a>]
<% Else %>
[<a href="options/action/updateOptions.asp?OptionID=<%= rs("L_OptionID") %>&enabled=0&testID=<%= testID %>">选项作废</a>]
<% End If %>
<% if rs("L_enabled")=1 then %>
<span class="STYLE1">有效</span>
<% Else %>
<span class="STYLE1">无效</span>
<% End If %>
<b>}</b>
<br />
<%
rs.movenext
loop
end if
'释放资源
rs.close
set rs=nothing
end function
function displayQuestions_3(TypeID)
'判断题
dim conn
set conn=Server.CreateObject("ADODB.CONNECTION")
set conn=openExamData()
dim sql,rs
sql="select * from L_questionsV where L_TypeID="&TypeID&" order by L_position asc"
set rs=Server.createObject("adodb.recordset")
rs.open sql,conn,1,3
if not rs.bof and not rs.eof then
do while not rs.eof
%>
<style type="text/css">
<!--
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -