<div class="tc1_nr">
<?php $bank_num=0; $bank_type_num_=0; foreach ($_SESSION['paper']['Child'] as $v): $bank_type_num_++;?>
<?php if ($v['Child']): ?>

<?php else: ?>

	<?php $bank_key = array_rand($v['banks'],1); if ($_SESSION['bank_types'][$v['banks'][$bank_key]['bank_type_id']]['judge_type'] == 0): ?>
	<!--
	<div class="dt_rtitle1 bank_type_num bank_type_num_<?php echo $bank_type_num_; ?>" ><?php echo $v['title']; ?></div>
	-->
	<div class="tc1_tit"><?php echo $v['title']?><span style="font-size:12px;"><?php echo $v['remark']?"(".$v['remark'].")":"";?></span></div>
	<?php endif; ?>
	<?php foreach ($v['banks'] as $bank): $bank_num++; $bank_num_ = $bank_num; ?>
		<?php include('Tpl/'.C('DEFAULT_THEME').'/selfconf/banks/manualscore.php');?>
	<?php endforeach; ?>
	
<?php endif; ?>
<?php endforeach; ?>
</div>

<div class="tijiao">
<input type="button" id="up_manual" class="tj2" value="提　交" />
<input type="button" id="close_manual" class="tj2" value="关　闭" />
</div>


<script type="text/javascript">
$(document).ready(function() {
	
	$("#close_manual").click(function(){
		$(".tc1").css("display","none");
		finishExam();
	});
	
	$("#up_manual").click(function(){
		$(".tc1").css("display","none");
		
		var msg = "";
		$(".manual_score").each(function(){
			var bank_id = parseInt($(this).attr("bankid"));
			var manual_score = parseInt($(this).attr("value"));
			var bank_score = parseInt($(this).attr("bankscore"));
			
			if (!isNaN(manual_score))
			{
				if (manual_score >= 0 && manual_score <= bank_score)
				{
					$.post("<?php echo U(MODULE_NAME.'/saveManualScore'); ?>",{bank_id:bank_id,manual_score:manual_score});
				}
				else
				{
					msg = "您填写的分数超出本题分数";
				}
			}
		});
		if (msg)
		{
			$(".tc1").css("display","");
			alert("您填写的分数超出本题分数");
		}
		else
		{
			finishExam();
		}
	});
	
});
</script>