<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<?xml version="1.0" encoding="UTF-8"?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!-- todo -->
<!-- todo -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
<link href="../css/theme.css" rel="stylesheet" type="text/css"></link>
<link type="text/css" rel="stylesheet" href="../css/print.css" media="print">
<title>结果展示</title>
<script type="text/javascript" src="../js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="../js/qm.core.js"></script>
<script type="text/javascript" src="../js/qm.result.js"></script>
<script type="text/javascript">
	$(document)
			.ready(
					function() {
						QM.result.init($("#question").val(),$("#answer").val());
						//todo
						var val=QM.open;
						var total=QM.question;
						var correct=QM.correct;

						//生成分数栏
						if(val==true){
							$div=$("<div style='margin-bottom: 10px;'></div>");
							$table=$("<table style='width:100%'></table>");
							
							$tr1=$("<tr><td width='50%'>总分值</td><td width='50%'>个人得分</td></tr>");
							$score=$("<tr><td>${content.totalScore}</td><td>${content.account}</td></tr>");
							
							$tr2=$("<tr><td width='50%'>考题数</td><td width='50%'>答对数目</td></tr>");
							$question=$("<tr><td>"+total+"</td><td>"+correct+"</td></tr>");
							
							$("#analysis").append($div);
							$div.append($table);
							$table.append($tr1);
							$table.append($score);
							$table.append($tr2);
							$table.append($question);
						}
						
						var $button = $("#jump");
						$button.click(function(){
							var jumpType = $("input[name='s_jumpType']").val();
							if(jumpType != null && jumpType == "HOMEPAGE"){
								window.location.href = contextPath+"/qm/answer/index.jsp";
							}else{
								document.forms[0].action = '../questionnaire/list.action';
								document.forms[0].submit();
							}
							
						});
					});
	function f1(){
		var obj=document.getElementById("contentResult");
		var content=obj.innerHTML;
		$("#i1").val(content);
		document.forms[0].submit();
	}

</script>
</head>
<body style="overflow: auto;width: 100%;height: 90%;">
<div style="background: #f5f5f5; height:65px;" class="noprint">
	<a id='jump'  class='btn btn-primary' style="display:none;">返回</a>
	<a id='download' class='btn btn-primary_green' onclick="f1();" target="_blank" style="display:none;">下载</a>
	<a class='btn btn-primary_green btn-print' href='javascript:print();'>打印</a>
	</div>
	<tr>
		<td class="tdLabel"></td>
		<td><textarea name="content.content" cols="" rows="" id="question" style ="display:none">${content.content}</textarea></td>
	</tr>
	<tr>
		<td class="tdLabel"></td>
		<td><textarea name="content.answer" cols="" rows="" id="answer" style ="display:none">${content.answer}</textarea></td>
	</tr>
	<tr style="display:none;">
		<td colspan="2">
		<input type="hidden" name="s_jumpType" value="${requestScope.s_jumpType}" id="s_jumpType"/> </td>
	</tr>
		
	<tr style="display:none;">
		<td colspan="2">
		<input type="hidden" name="content.id" value="${content.id}" id="content_id"/> </td>
	</tr>
	<tr style="display:none;">
		<td colspan="2">
		<input type="hidden" name="content.userId" value="${content.userId}" id="content_userId"/> </td>
	</tr>
	<input type="hidden" id="_back_url_type" name="type" value="${requestScope.type}" />
	<input type="hidden" id="_back_url_status" name="status" value="${requestScope.status}" />
	<div id="contentResult" style="width: 100%;height: 98%;overflow: auto;">	
			<div style="padding-bottom:10px;text-align: center; border-bottom: 3px #8ad748 solid;"><h1>${content.title}</h1></div>
			<div id="analysis" style='padding: 15px 0px 0px 15px; margin-bottom: 10px;border-bottom: 1px solid #f4f4f4;'>1.基本情况分析
				
			</div>
			<div style='padding: 15px 0px 0px 15px; margin-bottom: 10px;border-bottom: 1px solid #f4f4f4;'>
				<div id="maiDiv" style="text-align:left"></div>
			</div>
		</div>
	<form action="download.action" method="post">
		<input type="hidden" id="_back_url_type" name="type" value="${requestScope.type}" />
	<input type="hidden" id="_back_url_status" name="status" value="${requestScope.status}" />
	    <input id="i1" type="hidden" name="content" value=""/>
	</form>
		<!-- todo -->
<script language="javascript">  
</script> 
</body>
</html>