From 0b46638a51dfa0eea6c5fd33f6f54317c7b8485f Mon Sep 17 00:00:00 2001 From: Elvis Date: Thu, 12 Jul 2018 14:42:08 +0800 Subject: [PATCH] 标准答案 --- WebRoot/WEB-INF/jsp/software/firmware/firmware_itemview.jsp | 37 +++++++++---------------------------- WebRoot/WEB-INF/jsp/sunvote/teacher/creat_question.jsp | 63 +++++++++++++++++++++------------------------------------------ WebRoot/static/js/control-604.js | 138 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------- resources/mybatis1/api/V1Mapper.xml | 1 + src/com/fh/controller/software/firm/FirmController.java | 1 - src/com/fh/controller/sunvote/event/EventController.java | 8 +++++--- 6 files changed, 129 insertions(+), 119 deletions(-) diff --git a/WebRoot/WEB-INF/jsp/software/firmware/firmware_itemview.jsp b/WebRoot/WEB-INF/jsp/software/firmware/firmware_itemview.jsp index a3971e2..f0f4ff5 100644 --- a/WebRoot/WEB-INF/jsp/software/firmware/firmware_itemview.jsp +++ b/WebRoot/WEB-INF/jsp/software/firmware/firmware_itemview.jsp @@ -41,7 +41,7 @@


- +
@@ -56,33 +56,14 @@
货品编号: ${pd.PRODUCT_NO}



- - - - - - - - - - - - - - - - - - - - - - - - - -
产品功能:${pd.PRODUCT_FUNC}
产品性能:${pd.PRODUCT_PERF}
适配硬件:${pd.ADAPTABLE_HARDWARE}
适配软件:${pd.ADAPTABLE_SOFTWARE}
产品认证:${pd.PRODUCT_CERT}
注意事项:${pd.REMARK} -
+
+
产品功能:${pd.PRODUCT_FUNC}

+
产品性能:${pd.PRODUCT_PERF}

+
适配硬件:${pd.ADAPTABLE_HARDWARE}

+
适配软件:${pd.ADAPTABLE_SOFTWARE}

+
产品认证:${pd.PRODUCT_CERT}

+
注意事项:${pd.REMARK}

+
diff --git a/WebRoot/WEB-INF/jsp/sunvote/teacher/creat_question.jsp b/WebRoot/WEB-INF/jsp/sunvote/teacher/creat_question.jsp index 848b8af..76bbfc5 100644 --- a/WebRoot/WEB-INF/jsp/sunvote/teacher/creat_question.jsp +++ b/WebRoot/WEB-INF/jsp/sunvote/teacher/creat_question.jsp @@ -28,8 +28,8 @@

测验时长:45分钟

- - + +
@@ -37,32 +37,7 @@
- +
@@ -78,7 +53,7 @@
- +
@@ -93,6 +68,8 @@ + +
@@ -122,8 +99,8 @@ diff --git a/WebRoot/static/js/control-604.js b/WebRoot/static/js/control-604.js index 5f87cf1..ffc3983 100644 --- a/WebRoot/static/js/control-604.js +++ b/WebRoot/static/js/control-604.js @@ -3,7 +3,8 @@ var score=0; function creat(str_ans,a_num,fraction){ $(".section").remove(); - $(".content").append('

一、单选

') + /*$(".content").append('

一、单选

')*/ + $(".content").append('

请在试题选项上点击,亮色为该试题的正确答案 

'); var str=str_ans.split(''); console.log(str); for(i=0;i

'+question_num+'、多选题

'); for(var i=index_s_2;i<=index_e_2;i++){ $(".section-"+answer_index_b+" .question_list").append('
'+i+'、
    '); @@ -102,10 +103,21 @@ option=String.fromCharCode(0x41+j); $(".section-"+answer_index_b+" .question"+i+' ul').append('
  • '+option+'
  • '); } + }*/ + case 5: //多选题 + $(".content").html(""); + $(".content").append('

    请在试题选项上点击,亮色为该试题的正确答案 

    '); + for(var i=index_s_2;i<=index_e_2;i++){ + $(".section0" +" .question_list").append('
    '+i+'、
      '); + for(var j=0;j'+option+''); + } } break; } - $(".section-"+answer_index_b).attr("data-score",$(".section-"+answer_index_b).find(".question").length*fraction2); +// $(".section-"+answer_index_b).attr("data-score",$(".section-"+answer_index_b).find(".question").length*fraction2); + $(".section0").attr("data-score",$(".section0").find(".question").length*fraction2); } $(document).on('click','.remove',function(){ //删除按钮 @@ -132,9 +144,9 @@ /*添加试题的确定按钮*/ $("#addQuestion_submit").click(function(){ $("#fast").attr("disabled","disabled"); - var type_2=parseInt($("#type").val()); - var index_s_2=parseInt($("#index_s_2").val()); - var index_e_2=parseInt($("#index_e_2").val()); + var type_2=5;//parseInt($("#type").val()) + var index_s_2=1;//parseInt($("#index_s_2").val()) + var index_e_2=parseInt($("#index_s_2").val()); //var answer_2=$("#answer_2").val(); var num_ans_2=$("#num_ans_2").val(); var fraction2=parseInt($("#fraction2").val()); @@ -142,7 +154,7 @@ alert("请输入题目开始序号"); return; }else if(isNaN(index_e_2)){ - alert("请输入题目结束序号"); + alert("请输入题目个数");//alert("请输入题目结束序号"); return; }else if(isNaN(fraction2)){ alert("请输入题目分数"); @@ -202,7 +214,7 @@ if($(".section").length>0){ var rank=0 for(i=0;i<$(".section").length;i++){ - rank++; + /*rank++; data.questions[i]={ chapter_id: "0", problem_type_id: "0", @@ -220,7 +232,7 @@ rank: rank, no_name: $(".section").eq(i).find(".que_num").text(), questions:[] - } + }*/ for(j=0;j<$(".section").eq(i).find(".question_list").children(".question").length;j++){ rank++; var on_num=$(".section").eq(i).find(".question").eq(j).find(".on").length; @@ -229,7 +241,7 @@ answer+=$(".section").eq(i).find(".question").eq(j).find(".on").eq(k).text(); //console.log(answer); } - data.questions[i].questions[j]={ + data.questions[j]={ chapter_id: "0", problem_type_id: "0", knowledge_id: "0", @@ -244,7 +256,7 @@ part_score: "0", remark: "", rank: rank, - no_name: (i+1)+'.'+(j+1), + no_name: (j+1), } } } @@ -317,7 +329,8 @@ function fastSort(array,head,tail){ if(testData.questions.length > 0){ fastSort(testData.questions,0,testData.questions.length-1); for(var i = 0 ; i < testData.questions.length;i++){ - if(testData.questions[0].questions.length > 1){ + + if(testData.questions[0].questions && testData.questions[0].questions.length > 1){ fastSort(testData.questions[i].questions,0,testData.questions[i].questions.length-1); } } @@ -328,40 +341,64 @@ function creatHtml(data){ console.log(data); $(".header_box h1").html(data.title); $("#time").html(data.exam_time); + + if(data.questions.length>0){ + $(".time").removeAttr("data-target"); + $(".remove").remove(); + $(".btn_box").remove(); + } + for(var i=0;i

      '+data.questions[i].no_name+''+''+data.questions[i].content+'

      ') - if(data.questions.length>0){ - $(".time").removeAttr("data-target"); - $(".remove").remove(); - $(".btn_box").remove(); + if(data.questions[i].questions){ + $(".content").append('

      '+data.questions[i].no_name+''+''+data.questions[i].content+'

      '); + }else{ + if(i == 0){ + $(".content").append('
      '); + } + $(".section0").find(".question_list").append('
      '+(i+1)+'、
        '); + for(var k=0;k'+String.fromCharCode(0x41+k)+''); + for(var l=0;l'+(j+1)+'、
          '); - if($(".section-"+i).find(".que_name").text()=="判断题"){ - for(var k=0;k√'); - }else if(k%2==1){ - $(".section-"+i).find(".question"+(j+1)+' ul').append('
        • ×
        • '); + + if(data.questions[i].questions){ + for(var j=0;j'+(j+1)+'、
            '); + if($(".section-"+i).find(".que_name").text()=="判断题"){ + for(var k=0;k√'); + }else if(k%2==1){ + $(".section-"+i).find(".question"+(j+1)+' ul').append('
          • ×
          • '); + } + + if(str_temp=="√") + $(".section-"+i).find(".question"+(j+1)+' ul li').eq(0).attr("class","btn btn-default on"); + else + $(".section-"+i).find(".question"+(j+1)+' ul li').eq(1).attr("class","btn btn-default on"); } - - if(str_temp=="√") - $(".section-"+i).find(".question"+(j+1)+' ul li').eq(0).attr("class","btn btn-default on"); - else - $(".section-"+i).find(".question"+(j+1)+' ul li').eq(1).attr("class","btn btn-default on"); - } - }else{ - for(var k=0;k'+String.fromCharCode(0x41+k)+''); - for(var l=0;l'+String.fromCharCode(0x41+k)+''); + for(var l=0;l answerLen){ - if(($("#answer").val().length + 1 )% 6 == 0){ - $("#answer").val($("#answer").val()+" "); + var answerStr = $("#answer").val(); + var result = ""; + if(answerStr.length > 5){ + answerStr = answerStr.replace(new RegExp(" ","gm"),""); + for(var i = 0 ; i < answerStr.length ; i++){ + result += answerStr[i]; + if(i % 5 == 4){ + result += " "; + } + } + }else{ + result = answerStr; } + $("#answer").val(result); } answerLen = $("#answer").val().length; }) diff --git a/resources/mybatis1/api/V1Mapper.xml b/resources/mybatis1/api/V1Mapper.xml index d2c2d68..721c31c 100644 --- a/resources/mybatis1/api/V1Mapper.xml +++ b/resources/mybatis1/api/V1Mapper.xml @@ -103,6 +103,7 @@ and sv_paperquestion.PAPER_ID = #{PAPER_ID} + order by LENGTH(sv_paperquestion.RANK),sv_paperquestion.RANK diff --git a/src/com/fh/controller/software/firm/FirmController.java b/src/com/fh/controller/software/firm/FirmController.java index 3f8a211..5907f3e 100644 --- a/src/com/fh/controller/software/firm/FirmController.java +++ b/src/com/fh/controller/software/firm/FirmController.java @@ -24,7 +24,6 @@ import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; import com.fh.controller.base.BaseController; -import com.fh.controller.sunvote.Myelfun; import com.fh.entity.Page; import com.fh.service.software.firm.FirmManager; import com.fh.service.software.firmware.FirmwareManager; diff --git a/src/com/fh/controller/sunvote/event/EventController.java b/src/com/fh/controller/sunvote/event/EventController.java index ffdccb3..5b98b98 100644 --- a/src/com/fh/controller/sunvote/event/EventController.java +++ b/src/com/fh/controller/sunvote/event/EventController.java @@ -8,7 +8,9 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; + import javax.annotation.Resource; + import org.springframework.beans.propertyeditors.CustomDateEditor; import org.springframework.stereotype.Controller; import org.springframework.web.bind.WebDataBinder; @@ -16,14 +18,14 @@ import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; + import com.fh.controller.base.BaseController; import com.fh.entity.Page; +import com.fh.service.sunvote.event.EventManager; import com.fh.util.AppUtil; +import com.fh.util.Jurisdiction; import com.fh.util.ObjectExcelView; import com.fh.util.PageData; -import com.fh.util.Jurisdiction; -import com.fh.util.Tools; -import com.fh.service.sunvote.event.EventManager; /** * 说明:事件记录 -- libgit2 0.21.4