<%@ page contentType="text/html;charset=UTF-8"%>
<link rel="stylesheet" type="text/css" href="${ctxStatic}/jBox/Source/jBox.css">
<script type="text/javascript" src="${ctxStatic}/jBox/Source/jBox.min.js"></script>

<div id="trial-detail-content" class="container-fluid" style="display:none">
<div class="row-fluid">
    <div id="trial-left-div" class="span7" style="overflow-y:scroll">
    </div>
    <div id="trial-right-div" class="span5">
        <table id="contentTable" class="table table-striped table-bordered table-condensed">
            <thead>
                <tr>
                    <th>评卷员</th>
                    <th>姓名</th>
                    <th>给分</th>
                    <th>时间</th>
                </tr>
            </thead>
            <tbody id="trial-history">
            </tbody>
        </table>
    </div>
</div>
</div>

<script type="text/javascript">
var trialDetailModal = new jBox('Modal', {isolateScroll: false});

$(document).ready(function() {
    $('#trial-left-div').height($(window).height()*0.83);
});

function initTrialDetailPopover(title, libraryId) {
	initTrialDetailContent(libraryId); 
	trialDetailModal.setWidth($(window).width()*0.9);
	trialDetailModal.setHeight($(window).height()*0.85);
	trialDetailModal.setTitle(title);
	trialDetailModal.open();
}

function initTrialDetailContent(libraryId){
	$('#trial-history').empty();
	$('#trial-left-div').empty();
	$.ajax({
        type:"GET",
        url:'${ctx}/admin/exam/trial/detail?libraryId='+libraryId,  
        dataType:"json",
        success:function(data){
	        if(data.success==true) {
	            for (var i = 0; i < data.historyList.length; i++) {
	                var history = data.historyList[i];
	                $('#trial-history').append('<tr><td>'+history.loginName+'</td><td>'+history.name+'</td><td>'+history.score+'</td><td>'+history.time+'</td></tr>');
	            }
	            new ImageLoader( {
	                server: data.imageServer
	            }).merge(data.urls, data.pictureConfig, function(image){
                    trialDetailModal.setContent($('#trial-detail-content'));
                    $(image).width($('#trial-left-div').width()*0.95);
                    $(image).appendTo('#trial-left-div');
                }, function(error){
	                trialDetailModal.setTitle('加载失败');
	            });
	        }else {
	            trialDetailModal.setTitle('加载失败')
	        }
        }
    });
}
</script>



