scorepaper.js

来自「本在线考试系统采用了面向对象的分析和设计」· JavaScript 代码 · 共 56 行

JS
56
字号
Sys.Application.add_load(page_load);
function page_load()
{
//设置打分状态
	$("span.ScoreStatus").each(
		function()
		{
			if($(this).text()=="False"	)
			{
				$(this).text("未批改").css("color","red");
			}
			else
			{
				$(this).text("已批改").css("color","green");
			}
		}
		)
//绑定打分按钮实践处理	
	$(":button").click(
		function()
		{
			scoreTextBox=this.previousSibling	;
			statusDiv=this.nextSibling;

			questionId=scoreTextBox.id;
			scoreValue=scoreTextBox.scorevalue;
			score=scoreTextBox.value;
		
			if(score>scoreValue)
			{
				alert("得分不能超过分值!");
				scoreTextBox.value=0;
			}
			else
			{
				ExaminationSystem.WebService.PaperWebService.SetScore(
					questionId,score,OnSucceeded,OnFailed,statusDiv);
			}
		}
		);
}
function OnSucceeded(result,context,methodName)
{
	alert("打分成功!");
	$(context).text("已批改").css("color","green");
}

function OnFailed(error,context,methodName)
{
	alert("打分失败!");
}
function page_unload()
{
}

⌨️ 快捷键说明

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