Commit 9006450d3ef074c0d050bc1575ea6db056f32139

Authored by jack
1 parent f917bbb9

1、修改翻译文案

WebRoot/WEB-INF/jsp/sunvote/teacher/en_paper_view1.jsp 0 → 100644
  1 +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2 +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  3 +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
  4 +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
  5 +<%
  6 + String path = request.getContextPath();
  7 + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  8 +%>
  9 +<!DOCTYPE html>
  10 +<html lang="zh-CN">
  11 + <head>
  12 + <meta charset="utf-8">
  13 + <meta http-equiv="X-UA-Compatible" content="IE=edge">
  14 + <meta name="viewport" content="width=device-width, initial-scale=1">
  15 + <title>中天电子-教育管理系统</title>
  16 +
  17 + <!-- Bootstrap -->
  18 + <!-- <link
  19 + href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
  20 + rel="stylesheet"> -->
  21 + <link rel="stylesheet" href="../static/css/bootstrap.min.css" />
  22 + <link href="../static/css/teach.css" rel="stylesheet">
  23 + <link href="../static/css/paper_view.css?t=2" rel="stylesheet">
  24 +
  25 + <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询(media queries)功能 -->
  26 + <!-- 警告:通过 file:// 协议(就是直接将 html 页面拖拽到浏览器中)访问页面时 Respond.js 不起作用 -->
  27 + <!--[if lt IE 9]>
  28 + <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  29 + <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
  30 + <![endif]-->
  31 + <style>
  32 + .analysis table{display:inline-block;vertical-align:middle;}
  33 + .resolve_box img{vertical-align:top;}
  34 + </style>
  35 + </head>
  36 + <body>
  37 + <div class="container">
  38 + <div class="page-header">
  39 + <h3 class="col-md-6" id="paper_title"></h3>
  40 + <h3 class="col-md-6">Test Time:<span id="time"></span></h3>
  41 + <div class="clearfix"></div>
  42 + </div>
  43 + <div class="content_report">
  44 +
  45 + <div class="col-md-12 analysis">
  46 + <ul>
  47 + <!--<li>
  48 + <div class="stem">
  49 + <p>1.如图,检测4个足球,其中超过标准质量的克数记为正数,不足标准质量的克数记为负数.从轻重的角度看,最接近标准的是(  )</p>
  50 + </div>
  51 + <div class="option">
  52 + <ul>
  53 + <li><span>A.</span><img src="images/option_1.png" /></li>
  54 + <li><span>B.</span><img src="images/option_2.png" /></li>
  55 + <li><span>C.</span><img src="images/option_3.png" /></li>
  56 + <li><span>D.</span><img src="images/option_4.png" /></li>
  57 + </ul>
  58 + <div class="clearfix"></div>
  59 + </div>
  60 + <div class="resolve">
  61 + <div class="resolve_box">
  62 + <p>【答案】 A</p>
  63 + <p>【解析】由图数一数,可知总共有7位小同学,其中扎小辫的女孩有2人,男孩有5人。
  64 + 故选A。</p>
  65 +
  66 + <p>【考点】 10以内数的认识</p>
  67 + </div>
  68 + <div class="clearfix"></div>
  69 + <div class="tab_report_box">
  70 + <div class="col-md-3">
  71 + <p>答错人数</p>
  72 + <div class="round_w_orange">
  73 + <div class="round_n_orange">
  74 + <span>0/0</span>
  75 + </div>
  76 + </div>
  77 + </div>
  78 + <div class="col-md-3">
  79 + <p>错误率</p>
  80 + <div class="round_w_red">
  81 + <div class="round_n_red">
  82 + <span>100%</span>
  83 + </div>
  84 + </div>
  85 + </div>
  86 + <div class="col-md-6">
  87 + <div id="main" style="width:250px;height:140px;"></div>
  88 + </div>
  89 + <div class="clearfix"></div>
  90 + </div>
  91 + </div>
  92 +
  93 + <div class="star_box">
  94 + <div class="col-md-6">错误学生:0/0</div>
  95 + <div class="col-md-6">
  96 + <div class="star">
  97 + <span style="float:left;">难度</span>
  98 + <ul>
  99 + <li class="on"></li>
  100 + <li class="on"></li>
  101 + <li class="off"></li>
  102 + <li class="off"></li>
  103 + <li class="off"></li>
  104 + </ul>
  105 + </div>
  106 + <div class="resolve_click">
  107 + <a onclick="slide($(this))">查看解析</a>
  108 + </div>
  109 + </div>
  110 + <div class="clearfix"></div>
  111 + </div>
  112 + </li>-->
  113 + </ul>
  114 + </div>
  115 + </div>
  116 + <div class="modal fade" id="myModal" tabindex="-1" role="dialog">
  117 + <div class="modal-dialog" role="document">
  118 + <div class="modal-content">
  119 + <div class="modal-header">
  120 + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  121 + <h4 class="modal-title">Mistake List</h4>
  122 + </div>
  123 + <div class="modal-body">
  124 + <table class="table table-bordered">
  125 + <thead>
  126 + <tr>
  127 + <th>No.</th>
  128 + <th>StudentName</th>
  129 + <th>Options</th>
  130 + <th>Answer time</th>
  131 + </tr>
  132 + </thead>
  133 + <tbody class="student_list">
  134 +
  135 + </tbody>
  136 + </table>
  137 + </div>
  138 + <div class="modal-footer">
  139 + <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  140 + <!-- <button type="button" class="btn btn-primary" id="submit">确定</button> -->
  141 + </div>
  142 + </div><!-- /.modal-content -->
  143 + </div><!-- /.modal-dialog -->
  144 + </div><!-- /.modal -->
  145 + </div>
  146 + <script src="../static/js/jquery.min.js"></script>
  147 + <script src="../static/js/bootstrap.min.js"></script>
  148 + <script src="../static/js/echars.js"></script>
  149 + <script src="../static/js/en_paper_view1.js?a=1"></script>
  150 +
  151 +</html>
  152 +
  153 +
  154 +
  155 +
  156 +
... ...
WebRoot/WEB-INF/jsp/sunvote/teacher/en_set_question.jsp
... ... @@ -23,6 +23,10 @@
23 23 <style>
24 24 table{display:inline-block;vertical-align: middle;}
25 25 .resolve_box img{vertical-align:top;}
  26 + .left_menu .tab li{
  27 + font-size:13px;
  28 + }
  29 +
26 30 </style>
27 31 </head>
28 32 <body>
... ...
WebRoot/WEB-INF/jsp/sunvote/teacher/en_test_list.jsp
... ... @@ -86,7 +86,10 @@
86 86 var user_id= "${pd.userId}";
87 87 var url = "<%=basePath%>";
88 88 $(document).ready(function(){
  89 +
89 90 window.top.loading.remove();
  91 + var h_height = $(".head_box").height();
  92 + $(".table_box").css("padding-top",h_height);
90 93 });
91 94 </script>
92 95 <script src="../static/js/en_test_list.js?a=0"></script>
... ...
WebRoot/static/js/en_paper_view1.js 0 → 100644
  1 + var url="";
  2 + function slide(obj){ //查看详情
  3 + obj.closest(".star_box").siblings(".resolve").slideToggle(function(){
  4 + if($(".resolve").css("display") == "none")
  5 + obj.text("Show Analysis");
  6 + else
  7 + obj.text("Hide Analysis");
  8 + });
  9 + }
  10 +
  11 +
  12 + function bar(index,data1,data2,answer,color,sum){ //柱状图
  13 + var myChart = echarts.init(document.getElementById('main'+index));
  14 + myChart.setOption({
  15 + color: ['#3398DB'],
  16 + tooltip : {
  17 + trigger: 'axis',
  18 + axisPointer : { // 坐标轴指示器,坐标轴触发有效
  19 + type : 'line' // 默认为直线,可选为:'line' | 'shadow'
  20 + },
  21 + formatter: function(params){
  22 + return params[0].name+"<br/><div style='display:inline-block;width:10px;height:10px;margin-right:5px;border-radius:5px;background:"+params[0].color+"'></div>Proportion:"+((params[0].value/sum)*100).toFixed(2)+"%<br/><div style='display:inline-block;width:10px;height:10px;margin-right:5px;border-radius:5px;background:"+params[0].color+"'></div>Number:"+params[0].value;
  23 + }
  24 + },
  25 + grid: {
  26 + top: 15,
  27 + left: '0%',
  28 + right: '0%',
  29 + bottom: '0%',
  30 + containLabel: true
  31 + },
  32 + xAxis : [
  33 + {
  34 + type : 'category',
  35 + data : data2,
  36 + axisTick: {
  37 + alignWithLabel: true
  38 + },
  39 + axisLabel: {
  40 + show:true,
  41 + textStyle:{
  42 + color: function (value){
  43 + console.log(value);
  44 + return value == answer ? '#75b3ff' : '#fcb35b';
  45 + }
  46 + }
  47 + }
  48 + }
  49 + ],
  50 + yAxis : [
  51 + {
  52 + type : 'value',
  53 + max: function(value) {
  54 + return sum;
  55 + }
  56 + }
  57 + ],
  58 + series : [
  59 + {
  60 + name:'选项人数',
  61 + type:'bar',
  62 + barWidth: '60%',
  63 + data:data1,
  64 + itemStyle: {
  65 + //通常情况下:
  66 + normal:{
  67 + //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
  68 + color: function (params){
  69 + var colorList = color;
  70 + return colorList[params.dataIndex];
  71 + },
  72 + label : {show: true,position:'top',distance:-4}
  73 + }
  74 + }
  75 + }
  76 + ]
  77 + });
  78 + }
  79 +
  80 +function getQueryString(name) {
  81 + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  82 + var r = window.location.search.substr(1).match(reg);
  83 + if (r != null) return unescape(r[2]); return null;
  84 + }
  85 + var testpaperId=getQueryString("testpaperId");
  86 +
  87 + var _html="";
  88 + $(document).ready(function(){
  89 + window.top.loading.remove();
  90 + $.ajax({
  91 + url:url+"/SunvoteEducation/api/v1/testpaperinfo",
  92 + async:false,
  93 + type:"post",
  94 + data:{ID:testpaperId},
  95 + success:function(data){
  96 + console.log(data);
  97 + $("#paper_title").html(data.data.NAME);
  98 + $("#time").html(data.data.CREATE_DATE);
  99 + if(data.data.QUESTIONS.length>0){
  100 + for(var i=0;i<data.data.QUESTIONS.length;i++){
  101 + _html += '<li class="question_li" data-id="'+data.data.QUESTIONS[i].QUESTION_ID+'"><div class="stem"></div><div class="option"><ul></ul><div class="clearfix"></div></div><div class="resolve"><div class="resolve_box"><p>【Answer】 '+data.data.QUESTIONS[i].ANSWER+'</p><p><span>【Analysis】</span>'+data.data.QUESTIONS[i].ANALYSIS+'</p></div><div class="clearfix"></div><div class="tab_report_box"><div class="col-md-3"><p>Wrong Answerer No.</p><div class="round_w_orange"><div class="round_n_orange"><span>0/0</span></div></div></div><div class="col-md-3"><p>Wrong rate</p><div class="round_w_red"><div class="round_n_red"><span>100%</span></div></div></div><div class="col-md-6"><div id="main'+i+'" style="width:250px;height:140px;"></div></div><div class="clearfix"></div></div></div><div class="star_box"><div class="col-md-6">Wrong sutdent No.:<span class="erro_num">0/0</span></div><div class="col-md-6"><div class="star"><span style="float:left;">difficulty</span></div><div class="resolve_click"><a onclick="slide($(this))">Show Analysis</a></div></div><div class="clearfix"></div></div></li>';
  102 + }
  103 + console.log(_html);
  104 + $(".analysis ul").html(_html);
  105 + for(var j=0;j<data.data.QUESTIONS.length;j++){
  106 + var option_html="";
  107 + var sum=0;
  108 + var right_num=0;
  109 + var data1=[];
  110 + var data2=[];
  111 + var answer="";
  112 + var color=[];
  113 + $(".analysis li .stem").eq(j).append('<span>'+(j+1)+'、</span>'+data.data.QUESTIONS[j].CONTENT);
  114 + var arry_option=data.data.QUESTIONS[j].OPTION_CONTENT;
  115 + var answerinfo=data.data.QUESTIONS[j].ANSWERINFO;
  116 +
  117 + for(var x=0;x<arry_option.length;x++){
  118 + option_html += '<li><span>'+String.fromCharCode(64 + parseInt(x+1))+'.</span>'+arry_option[x]+'</li>';
  119 + }
  120 + for(k=0;k<answerinfo.length;k++){
  121 + data1[k]=parseInt(answerinfo[k].COUNT);
  122 + if(answerinfo[k].ANSWER=="")
  123 + answerinfo[k].ANSWER="Unanswered";
  124 + data2[k]=answerinfo[k].ANSWER;
  125 + color[k]="#fcb35b";
  126 + if(answerinfo[k].ISRIGHT==1){
  127 + right_num=answerinfo[k].COUNT;
  128 + answer=answerinfo[k].ANSWER;
  129 + color[k]="#75b3ff";
  130 + }
  131 + sum += parseInt(answerinfo[k].COUNT);
  132 + }
  133 + $(".round_n_orange span").eq(j).text((sum-right_num)+"/"+sum);
  134 + $(".erro_num").eq(j).text((sum-right_num)+"/"+sum);
  135 + $(".round_n_red span").eq(j).text(((sum-right_num)/sum).toFixed(2)*100+"%");
  136 + $(".option").eq(j).find("ul").html(option_html);
  137 +
  138 + star(j,parseInt(data.data.QUESTIONS[j].DIFFICULTY));
  139 + console.log(data1,data2);
  140 + bar(j,data1,data2,answer,color,sum);
  141 + if(data.data.QUESTIONS[j].RANDOM=="1")
  142 + $(".analysis ul").children("li").eq(j).append('<div class="chou">抽</div>');
  143 + }
  144 + }
  145 + },
  146 + error: function (XMLHttpRequest, textStatus, errorThrown) {
  147 + // 错误信息
  148 + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+"");
  149 + window.top.loading.remove();
  150 + }
  151 + })
  152 + })
  153 + function star(index,num){ //难度星级
  154 + $(".star").eq(index).append('<ul></ul>');
  155 + var li_html="";
  156 + for(var i=1;i<=num;i++){
  157 + li_html +='<li class="on"></li>';
  158 + }
  159 + for(var j=num;j<5;j++){
  160 + li_html += '<li class="off"></li>';
  161 + }
  162 +
  163 + $(".star").eq(index).find("ul").html(li_html);
  164 + }
  165 + $(document).on("click",".round_n_orange",function(){ //显示错误学生名单
  166 + var question_id = $(this).closest("li").attr("data-id");
  167 + var student_html="";
  168 + $.ajax({
  169 + url:url+"/SunvoteEducation/api/v1/qstudentinfo",
  170 + async:false,
  171 + type:"post",
  172 + data:{question_id:question_id,test_id:testpaperId},
  173 + success:function(data){
  174 + console.log(data);
  175 + for(var i=0;i<data.data.length;i++){
  176 + if(typeof(data.data[i].ANSWER)=="undefined")
  177 + data.data[i].ANSWER="Unanswered";
  178 + student_html+='<tr><td>'+(i+1)+'</td><td>'+data.data[i].NAME+'</td><td>'+data.data[i].ANSWER+'</td><td>'+data.data[i].PRESS_TIME+'秒</td></tr>';
  179 + }
  180 + $(".student_list").html(student_html);
  181 + },
  182 + error: function (XMLHttpRequest, textStatus, errorThrown) {
  183 + // 错误信息
  184 + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+"");
  185 + window.top.loading.remove();
  186 + }
  187 + });
  188 + $('#myModal').modal('show');
  189 + })
0 190 \ No newline at end of file
... ...
src/com/fh/controller/sunvote/teacher/TeacherController.java
... ... @@ -401,7 +401,12 @@ public class TeacherController extends BaseController {
401 401 PageData pd = new PageData();
402 402 pd = this.getPageData();
403 403 pd.put("userId", userId);
404   - mv.setViewName("sunvote/teacher/paper_view1");
  404 + if(isChineseLanguageClient()){
  405 + mv.setViewName("sunvote/teacher/paper_view1");
  406 + }else{
  407 + mv.setViewName("sunvote/teacher/en_paper_view1");
  408 + }
  409 +
405 410 mv.addObject("pd", pd);
406 411 return mv;
407 412 }
... ...