stu_test_free_bak.jsp
资源名称:0102010.rar [点击查看]
上传用户:nbluoke
上传日期:2013-08-09
资源大小:4851k
文件大小:6k
源码类别:
教育系统应用
开发平台:
WORD
- <%@ page contentType="text/html; charset=gb2312" language="java"%>
- <%@ page import="java.sql.*" %>
- <%@ page import="jinghua.*"%>
- <jsp:useBean id="DBCon" class="jinghua.JinghuaConn" scope="session">
- </jsp:useBean>
- <%!Connection con;
- boolean debug=false;
- String studentID="";
- String gradenote="";
- Statement stmt=null;
- ResultSet rs=null;
- String sql="";
- %>
- <%
- try{
- studentID=(String)session.getAttribute("studentID");
- if(studentID==null){
- throw new Exception();
- }
- }catch(Exception e){
- Tools.showalert("您还没有登录,或连接超时,请重新登录!",out);
- Tools.showJS("window.open('../login.jsp','_self')",out);
- }
- try{
- con=DBCon.getConnection();
- //获取学生的年级信息
- //sql="select id,gradenote,grade.Name as gn "+
- //"from student INNER JOIN grade ON (student.gradenote = grade.note) "+
- //" where stuid='"+studentID+"'";
- sql="select id,gradenote from UserInfo where vcUserNo='"+studentID+"'";
- try{
- stmt=con.createStatement();
- rs=stmt.executeQuery(sql);
- if(rs.next()){
- gradenote=rs.getString("gradenote");
- rs.close();
- stmt.close();
- }
- if(debug){
- out.print("<br>stuID="+studentID+"<br>gradenote="+gradenote);
- }
- }
- catch(SQLException se){
- out.print("<br> query student error sql="+sql);
- out.print("<br>"+se.toString());
- }
- catch(Exception e){
- out.print("<br> query student error sql="+sql);
- out.print("<br>"+e.toString());
- }
- //--年级,科目,知识点三个下拉列表框联动-->
- out.print(Tools.sub_know(con));
- out.print(Tools.grade_sub(con));
- }
- catch(Exception e){
- System.out.print(e.toString());
- }
- finally{
- DBCon.dropConnection();
- }
- %>
- <!--年级,科目,知识点三个下拉列表框联动-->
- <script language="JavaScript">
- function changegs(locationid){
- document.myform.Subject.length =1;
- document.myform.KnowPoint.length =1;
- var locationid=locationid;
- var i;
- for (i=0;i < gscount; i++){
- if (grade_sub[i][0] == locationid) {
- document.myform.Subject.options[document.myform.Subject.length] = new Option(grade_sub[i][2], grade_sub[i][1]);
- }
- }
- }
- function changesk(locationid){
- document.myform.KnowPoint.length =1;
- var locationid=locationid;
- var i;
- for (i=0;i < gskcount; i++){
- if (grade_sub_know[i][1] == locationid){
- document.myform.KnowPoint.options[document.myform.KnowPoint.length] = new Option(grade_sub_know[i][3], grade_sub_know[i][2]);
- }
- }
- }
- function InitForm(){
- changegs('<%=gradenote%>')
- }
- </script>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>精化学堂-自由测试</title>
- <link rel="stylesheet" type="text/css" href="../css.css">
- </head>
- <body bgcolor="#C8D6F0" onLoad="InitForm()">
- <FORM action="free_test_paper.jsp" method="post" name="myform" target="_blank" id="myform">
- <table width="400" height="175" border="1" align="center" cellspacing="1" bordercolor="#799AE1" id="AutoNumber3" style="border-collapse: collapse">
- <tr>
- <td height="35" colspan="5" align="center" valign="baseline" nowrap background="images/admin_bg_1.gif" bgcolor="#FFFDE8"><font size="+1"><strong>请选择测验内容</strong></font></td>
- </tr>
- <tr>
- <td width="98" height="43" align="center" valign="baseline" nowrap background="images/admin_bg_1.gif" bgcolor="#FFFDE8">
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td nowrap><strong>科 目:</strong></td>
- </tr>
- <tr>
- <td> <select name=Subject
- size="1" id=select8 onclick="changesk(document.myform.Subject.options[document.myform.Subject.selectedIndex].value)">
- <option value="all" selected>全 部</option>
- </select> </td>
- </tr>
- </table></td>
- <td width="209" align="center" valign="baseline" nowrap background="images/admin_bg_1.gif" bgcolor="#FFFDE8"><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td nowrap><strong>知识点:</strong></td>
- </tr>
- <tr>
- <td> <select name=KnowPoint id="select9">
- <option value="all" selected>----全 部----</option>
- </select> </td>
- </tr>
- </table></td>
- <td width="75" colspan="2" align="center" valign="baseline" nowrap background="../images/admin_bg_1.gif" bgcolor="#FFFDE8"><table width="92%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td nowrap><strong>难易度:</strong></td>
- </tr>
- <tr>
- <td> <select name=hard id="select10">
- <option value="1" selected>任意</option>
- <option value="2">容易</option>
- <option value="3">中等</option>
- <option value="4">较难</option>
- </select> </td>
- </tr>
- </table></td>
- </tr>
- <tr valign="middle">
- <td height="29" colspan="5" align="center" nowrap background="images/admin_bg_1.gif" bgcolor="#FFFDE8">
- <strong>测试顺序:</strong>
- <input type="radio" name="testorder" value="1">
- 随机顺序
- <input type="radio" name="testorder" value="2">
- 从难到易
- <input type="radio" name="testorder" value="3">
- 从易到难</td>
- </tr>
- <tr valign="middle">
- <td height="14" colspan="5" align="center" nowrap background="images/admin_bg_1.gif" bgcolor="#FFFDE8"><font color="#000000"><strong>试题数</strong></font><strong>:</strong>
- <input name="testnumber" type="text" id="testnumber2" value="5" size="10">
- </td>
- </tr>
- <tr>
- <td height="15" colspan="5" align="center" valign="baseline" nowrap background="images/admin_bg_1.gif" bgcolor="#FFFDE8"><input name="testbegin" type="submit" class="s02" id="testbegin2" onClick="window.close()" value="开 始"></td>
- </tr>
- </table>
- </FORM>
- <p> </p>
- </body>
- </html>