?? 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 + -