⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sj301.jsp

📁 基于Struts的试卷分析系统
💻 JSP
字号:
<%@ page language="java" contentType="text/html; charset=GBK" pageEncoding="GBK"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> 
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<html:html>
<head>
<title>添加试卷分析</title>
<meta http-equiv=Content-Type content="text/html; charset=GBK">
<meta http-equiv="Content-Style-Type" content="text/css">
<link href="./css/common.css" rel="stylesheet" type="text/css">
	<script language="JavaScript" src='<html:rewrite page="/java_script/gyomukanri.js" />'></script>
	<script language="JavaScript" src="./java_script/EventListener.js"></script>
	<script language="JavaScript">	
		// [登陆]按纽按下
		 function doToroku(){
		    formWithActionName(document.forms[0],'<html:rewrite page="/Sj301AddData.do" />');
	    }
	    
	    // 计算总成绩及学分
	    function doCalculate(i){
		    var txt_pscj = document.forms[0]["list_ps_scorse["+i+"]"].value; 	//平时成绩
		    var txt_sycj = document.forms[0]["list_sy_scorse["+i+"]"].value;	//实验成绩
		    var txt_qmcj = document.forms[0]["list_qm_scorse["+i+"]"].value;	//期末成绩
		    var hdn_ps_weight = document.forms[0].hdn_ps_weight.value;			//隐藏变量平时权重
		    var hdn_sy_weight = document.forms[0].hdn_sy_weight.value;			//隐藏变量实验权重
		    var hdn_qm_weight = document.forms[0].hdn_qm_weight.value;			//隐藏变量期末权重 
		    
		   // if ((txt_pscj == "" && txt_sycj == "") || (txt_sycj == "" && txt_qmcj == "") || (txt_qmcj == "" && txt_pscj == "" )) {
				//alert('请输全成绩(平时成绩/实验成绩/期末成绩)!');
			  //  return false;
			//}		
			
		    // 字符输入不正
		    if (isValidNumber(txt_pscj) == false){
		    	document.forms[0]["list_ps_scorse["+i+"]"].focus();
		    	return false;
		    }
		    if (isValidNumber(txt_sycj) == false){
		    	document.forms[0]["list_sy_scorse["+i+"]"].focus();
		    	return false;
		    }
		    if (isValidNumber(txt_qmcj) == false){
		    	document.forms[0]["list_qm_scorse["+i+"]"].focus();
		    	return false;
		    }
		    
		    // 计算总成绩及学分
		    if (txt_pscj!= "" && txt_sycj!= "" && txt_qmcj!= "") {
		    	var txt_zp_scorse = parseFloat(getTrueNumber(txt_pscj)) * parseFloat(getTrueNumber(hdn_ps_weight))
		    					  + parseFloat(getTrueNumber(txt_sycj)) * parseFloat(getTrueNumber(hdn_sy_weight))
		    					  + parseFloat(getTrueNumber(txt_qmcj)) * parseFloat(getTrueNumber(hdn_qm_weight));
		    	document.forms[0]["list_zp_scorse["+i+"]"].value = Math.getValue(txt_zp_scorse);
		    	if (txt_zp_scorse < parseFloat("60")){
		    		document.forms[0]["list_xuefen["+i+"]"].value = "0";
		    		document.forms[0]["list_beizhu["+i+"]"].value = "重修"; 
		    	} else {
		    		document.forms[0]["list_xuefen["+i+"]"].value = document.forms[0].hdn_xuefen.value;
		    		document.forms[0]["list_beizhu["+i+"]"].value = ""; 
		    	}
		    	
		    	return true;	
		    }
		}

		// 输入字符是否匹配(/[^0-9]/)
		function isValidNumber(inputNumber) {
			var j;
			for(j=0; j<inputNumber.length; j++) {
				if ((inputNumber.charAt(j) < '0' || inputNumber.charAt(j) > '9')) {
					if(inputNumber == "" || inputNumber.charAt(j) == '.'){
						continue;
					}
					alert('字符不正');
					return false;		
				}
			}
			return true;					
		}
		
		// 总评成绩变化触发的事件
		function doFormPropertyChange(property,i) {
			var txt_zp_scorse = property.value;
			if (parseFloat(txt_zp_scorse) < parseFloat("60")) {
				document.forms[0]["list_xuefen["+i+"]"].value = "0";
		    	document.forms[0]["list_beizhu["+i+"]"].value = "重修"; 
		    } else {
		    	document.forms[0]["list_xuefen["+i+"]"].value = document.forms[0].hdn_xuefen.value;
		    	document.forms[0]["list_beizhu["+i+"]"].value = ""; 
		    }
		} 
	</script>
</head>
<body>
<bean:define id="thisForm" name="SJ301DynaForm"/>
<html:form action="/Sj301Init">
<html:hidden name= "thisForm" property="hdn_xuefen" />
<html:hidden name= "thisForm" property="hdn_ps_weight" />
<html:hidden name= "thisForm" property="hdn_sy_weight" />
<html:hidden name= "thisForm" property="hdn_qm_weight" />

<table>
	<tr>
		<td><img src="./img/logo.jpg" align="middle"/></td>
	</tr>
</table>
<table cellSpacing=0 cellPadding=0 width="100%" border=0>
	<tbody>
	 <!--  欢迎栏 -->	
		<tr class="trHeight">
			<td vAlign=center bgColor=#99ccff colSpan=2 height=20>
				<table cellSpacing=0 cellPadding=0 width="100%" border=0>
				<tbody>
					<tr>
						<td width=100>&nbsp;</td>
						<td width=180 height=22 nowrap><div align=center>欢迎你,<bean:write name="thisForm" property="detailSj301Map.username"/> !</div></td>
						<td width=100>&nbsp;</td>
						<td width=200 height=22 nowrap><div align=center>考试时间:<bean:write name="thisForm" property="detailSj301Map.txt_examTime"/></div></td>
						<td width=120 height=22 nowrap><div align=center>课程名称:<bean:write name="thisForm" property="detailSj301Map.txt_course"/></div></td>	
						<td width=150 height=22 nowrap><div align=center>班级名称:<bean:write name="thisForm" property="detailSj301Map.txt_classes"/></div></td>
						<td width=300>&nbsp;</td>
					</tr>
				</tbody>
				</table>
			</td>
		</tr>
		<tr height=15><td>&nbsp;</td></tr>
		<tr class="trHeight">
	    	<td vAlign=top colSpan=2 >
	      		<div align=center>
		        	<table cellSpacing=0 borderColorDark=#ffffff cellPadding=0 width="98%" align=center borderColorlight=#99ccff border=1>
		            <tbody>
						<tr bgColor=#99ccff height=20> 
			            	<td width=65 class="trCenter" nowrap>序号</td>
			                <td width=100 class="trCenter" nowrap>姓名</td>
			                <td width=100 class="trCenter" nowrap><bean:write name="thisForm" property="detailSj301Map.txt_ps_scorse"/></td>
			                <td width=100 class="trCenter" nowrap><bean:write name="thisForm" property="detailSj301Map.txt_sy_scorse"/></td>
			                <td width=100 class="trCenter" nowrap>期末成绩</td>
			                <td width=100 class="trCenter" nowrap>总评成绩</td>
			                <td width=100 class="trCenter" nowrap>获得学分</td>
			                <td width=100 class="trCenter" nowrap>备注</td>
		                 </tr>
					<logic:notEmpty name="thisForm" property="sj301List" >
						<logic:iterate id="Line" name="thisForm" property="sj301List" indexId="i">
						<!--  基数行显示 -->
							<logic:equal name="Line" property = "colorFlg" value= "listdetail0">
								<tr class ="trListDetail1">
									<td width=65 class="trCenter"> <html:text property='<%="list_xuhao[" + i + "]"%>' name="thisForm" styleClass="TextReadOnly input trCenter" readonly="true" size="10" /></td>
									<td width=100 class="trCenter"><html:text property='<%="list_name[" + i + "]"%>' name="thisForm" styleClass="TextReadOnly input trCenter" readonly="true" size="10" /></td>
									<td width=100 class="trCenter"><html:text property='<%="list_ps_scorse[" + i + "]"%>' name="thisForm" styleClass="input trCenter" size="18" onblur='<%="doCalculate("+i+")"%>'/></td>
									<td width=100 class="trCenter"><html:text property='<%="list_sy_scorse[" + i + "]"%>' name="thisForm" styleClass="input trCenter" size="18" onblur='<%="doCalculate("+i+")"%>'/></td>
									<td width=100 class="trCenter"><html:text property='<%="list_qm_scorse[" + i + "]"%>' name="thisForm" styleClass="input trCenter" size="18" onblur='<%="doCalculate("+i+")"%>'/></td>
									<td width=100 class="trCenter"><html:text property='<%="list_zp_scorse[" + i + "]"%>' name="thisForm" styleClass="input trCenter" size="18" /></td>
									<td width=100 class="trCenter"><html:text property='<%="list_xuefen[" + i + "]"%>' name="thisForm" styleClass="input trCenter" size="18" /></td>
									<td width=100 class="trCenter"><html:text property='<%="list_beizhu[" + i + "]"%>' name="thisForm" styleClass="input trCenter" size="18" /></td>
								</tr>
							</logic:equal>
						<!--  偶数行显示 -->
							<logic:equal name="Line" property = "colorFlg" value= "listdetail1">
								<tr class ="trListDetail2">
									<td width=65 class="trCenter"> <html:text property='<%="list_xuhao[" + i + "]"%>' name="thisForm" styleClass="TextReadOnly99 input trCenter" readonly="true" size="10" /></td>
									<td width=100 class="trCenter"><html:text property='<%="list_name[" + i + "]"%>' name="thisForm" styleClass="TextReadOnly99 input trCenter" readonly="true" size="10" /></td>
									<td width=100 class="trCenter"><html:text property='<%="list_ps_scorse[" + i + "]"%>' name="thisForm" styleClass=" input trCenter" size="18" onblur='<%="doCalculate("+i+")"%>'/></td>
									<td width=100 class="trCenter"><html:text property='<%="list_sy_scorse[" + i + "]"%>' name="thisForm" styleClass="input trCenter" size="18" onblur='<%="doCalculate("+i+")"%>'/></td>
									<td width=100 class="trCenter"><html:text property='<%="list_qm_scorse[" + i + "]"%>' name="thisForm" styleClass="input trCenter" size="18" onblur='<%="doCalculate("+i+")"%>'/></td>
									<td width=100 class="trCenter"><html:text property='<%="list_zp_scorse[" + i + "]"%>' name="thisForm" styleClass="input trCenter" size="18" /></td>
									<td width=100 class="trCenter"><html:text property='<%="list_xuefen[" + i + "]"%>' name="thisForm" styleClass="input trCenter" size="18" /></td>
									<td width=100 class="trCenter"><html:text property='<%="list_beizhu[" + i + "]"%>' name="thisForm" styleClass="input trCenter" size="18" /></td>
								</tr>	
							</logic:equal>
						</logic:iterate>	
    				</logic:notEmpty>
    	 			</tbody>
		            </table>
	      		</div>
			</td>
		</tr>	
		<tr height=1><td>&nbsp;</td></tr>
		<tr>
          	<td colspan=2 >
            	<DIV align=center><html:submit property="btn_toroku"  styleClass="buttonToroku" onclick="doToroku();">提交</html:submit></DIV>
          	</td>
        </tr>
		<tr>
			<td vAlign=center colSpan=2 height=34><div align=center>Power By <a href="http://jwc.hbnu.edu.cn/">jwc.hbnu.edu.cn</a></div></td>
		</tr>		
	</tbody>
</table>
</html:form>
</body>
</html:html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -