Commit 0b46638a51dfa0eea6c5fd33f6f54317c7b8485f
1 parent
edbb3c91
标准答案
Showing
6 changed files
with
129 additions
and
119 deletions
WebRoot/WEB-INF/jsp/software/firmware/firmware_itemview.jsp
| @@ -41,7 +41,7 @@ | @@ -41,7 +41,7 @@ | ||
| 41 | </center></div> | 41 | </center></div> |
| 42 | </br></br></br> | 42 | </br></br></br> |
| 43 | <center> | 43 | <center> |
| 44 | - <table id="table_report" class="table table-striped table-bordered table-hover"> | 44 | + <table id="table_report" > |
| 45 | <tr> | 45 | <tr> |
| 46 | <td style="width:75px;text-align: right;padding-top: 13px;">货品编号:</td> | 46 | <td style="width:75px;text-align: right;padding-top: 13px;">货品编号:</td> |
| 47 | <td style="width:75px;text-align: left;padding-top: 13px;">${pd.PRODUCT_NO}</td> | 47 | <td style="width:75px;text-align: left;padding-top: 13px;">${pd.PRODUCT_NO}</td> |
| @@ -56,33 +56,14 @@ | @@ -56,33 +56,14 @@ | ||
| 56 | </tr> | 56 | </tr> |
| 57 | </table> | 57 | </table> |
| 58 | </center></br></br></br> | 58 | </center></br></br></br> |
| 59 | - <table class="table table-striped table-bordered table-hover"> | ||
| 60 | - <tr> | ||
| 61 | - <td style="text-align: right;">产品功能:</td> | ||
| 62 | - <td>${pd.PRODUCT_FUNC}</td> | ||
| 63 | - </tr> | ||
| 64 | - <tr> | ||
| 65 | - <td style="text-align: right;">产品性能:</td> | ||
| 66 | - <td>${pd.PRODUCT_PERF}</td> | ||
| 67 | - </tr> | ||
| 68 | - <tr> | ||
| 69 | - <td style="text-align: right;">适配硬件:</td> | ||
| 70 | - <td>${pd.ADAPTABLE_HARDWARE}</td> | ||
| 71 | - </tr> | ||
| 72 | - <tr> | ||
| 73 | - <td style="text-align: right;">适配软件:</td> | ||
| 74 | - <td>${pd.ADAPTABLE_SOFTWARE}</td> | ||
| 75 | - </tr> | ||
| 76 | - <tr> | ||
| 77 | - <td style="text-align: right;">产品认证:</td> | ||
| 78 | - <td>${pd.PRODUCT_CERT}</td> | ||
| 79 | - </tr> | ||
| 80 | - <tr> | ||
| 81 | - <td style="text-align: right;">注意事项:</td> | ||
| 82 | - <td>${pd.REMARK} | ||
| 83 | - </td> | ||
| 84 | - </tr> | ||
| 85 | - </table> | 59 | + <div style="margin-left:100px;margin-right:100px;"> |
| 60 | + <div>产品功能:${pd.PRODUCT_FUNC}</div></br> | ||
| 61 | + <div>产品性能:${pd.PRODUCT_PERF}</div></br> | ||
| 62 | + <div>适配硬件:${pd.ADAPTABLE_HARDWARE}</div></br> | ||
| 63 | + <div>适配软件:${pd.ADAPTABLE_SOFTWARE}</div></br> | ||
| 64 | + <div>产品认证:${pd.PRODUCT_CERT}</div></br> | ||
| 65 | + <div>注意事项:${pd.REMARK}</div></br> | ||
| 66 | + </div> | ||
| 86 | </div> | 67 | </div> |
| 87 | </form> | 68 | </form> |
| 88 | </div> | 69 | </div> |
WebRoot/WEB-INF/jsp/sunvote/teacher/creat_question.jsp
| @@ -28,8 +28,8 @@ | @@ -28,8 +28,8 @@ | ||
| 28 | <div class="time text-center" data-toggle="modal" data-target=".test_time"><h3>测验时长:<span class="bg-primary" id="time">45</span><span class="bg-primary">分钟</span></h3></div> | 28 | <div class="time text-center" data-toggle="modal" data-target=".test_time"><h3>测验时长:<span class="bg-primary" id="time">45</span><span class="bg-primary">分钟</span></h3></div> |
| 29 | <div class="btn_box pull-right"> | 29 | <div class="btn_box pull-right"> |
| 30 | <input type="button" class="btn btn-success btn-lg" name="save" value="保存" id="save"/> | 30 | <input type="button" class="btn btn-success btn-lg" name="save" value="保存" id="save"/> |
| 31 | - <button type="button" class="btn btn-success btn-lg" data-toggle="modal" data-target=".fast" id="fast">快速出题</button> | ||
| 32 | - <button type="button" class="btn btn-success btn-lg" data-toggle="modal" data-target=".addQuestion" id="addQuestion">添加试题</button> | 31 | + <button type="button" class="btn btn-success btn-lg" data-toggle="modal" data-target=".fast" id="fast">单选出题</button> |
| 32 | + <button type="button" class="btn btn-success btn-lg" data-toggle="modal" data-target=".addQuestion" id="addQuestion">多选出题</button> | ||
| 33 | <div class="clearfix"></div> | 33 | <div class="clearfix"></div> |
| 34 | </div> | 34 | </div> |
| 35 | </div> | 35 | </div> |
| @@ -37,32 +37,7 @@ | @@ -37,32 +37,7 @@ | ||
| 37 | </div> | 37 | </div> |
| 38 | 38 | ||
| 39 | <div class="content container"> | 39 | <div class="content container"> |
| 40 | - <!--<div class="section section-1"> | ||
| 41 | - <div class="title"> | ||
| 42 | - <h3>一、单选</h3> | ||
| 43 | - <input type="button" class="btn btn-danger pull-right remove" name="remove" value="删除" /> | ||
| 44 | - </div> | ||
| 45 | - <div class="question_list"> | ||
| 46 | - <div class="question question1"> | ||
| 47 | - <span>1、</span> | ||
| 48 | - <ul> | ||
| 49 | - <li class="btn btn-default on">A</li> | ||
| 50 | - <li class="btn btn-default">B</li> | ||
| 51 | - <li class="btn btn-default">C</li> | ||
| 52 | - <li class="btn btn-default">D</li> | ||
| 53 | - </ul> | ||
| 54 | - </div> | ||
| 55 | - <div class="question question2"> | ||
| 56 | - <span>2、</span> | ||
| 57 | - <ul> | ||
| 58 | - <li class="btn btn-default">A</li> | ||
| 59 | - <li class="btn btn-default on">B</li> | ||
| 60 | - <li class="btn btn-default">C</li> | ||
| 61 | - <li class="btn btn-default">D</li> | ||
| 62 | - </ul> | ||
| 63 | - </div> | ||
| 64 | - </div> | ||
| 65 | - </div>--> | 40 | + |
| 66 | </div> | 41 | </div> |
| 67 | 42 | ||
| 68 | <!-- 快速出题 --> | 43 | <!-- 快速出题 --> |
| @@ -78,7 +53,7 @@ | @@ -78,7 +53,7 @@ | ||
| 78 | <div class="form-group"> | 53 | <div class="form-group"> |
| 79 | <label for="inputEmail3" class="col-sm-2 control-label">试题答案</label> | 54 | <label for="inputEmail3" class="col-sm-2 control-label">试题答案</label> |
| 80 | <div class="col-sm-10"> | 55 | <div class="col-sm-10"> |
| 81 | - <input type="text" class="form-control" id="answer" placeholder="输入题目答案"> | 56 | + <input type="text" class="form-control" id="answer" placeholder="输入题目答案(例如:“ABCDA”)"> |
| 82 | </div> | 57 | </div> |
| 83 | <div class="clearfix"></div> | 58 | <div class="clearfix"></div> |
| 84 | </div> | 59 | </div> |
| @@ -93,6 +68,8 @@ | @@ -93,6 +68,8 @@ | ||
| 93 | <option value="6">6</option> | 68 | <option value="6">6</option> |
| 94 | <option value="7">7</option> | 69 | <option value="7">7</option> |
| 95 | <option value="8">8</option> | 70 | <option value="8">8</option> |
| 71 | + <option value="9">9</option> | ||
| 72 | + <option value="10">10</option> | ||
| 96 | </select> | 73 | </select> |
| 97 | </div> | 74 | </div> |
| 98 | <div class="clearfix"></div> | 75 | <div class="clearfix"></div> |
| @@ -122,8 +99,8 @@ | @@ -122,8 +99,8 @@ | ||
| 122 | <h4 class="modal-title">添加试题</h4> | 99 | <h4 class="modal-title">添加试题</h4> |
| 123 | </div> | 100 | </div> |
| 124 | <div class="modal-body"> | 101 | <div class="modal-body"> |
| 125 | - <div class="form-group"> | ||
| 126 | - <label for="type" class="col-sm-2 control-label">题目名称</label> | 102 | + <!--<div class="form-group"> |
| 103 | + <label for="type" class="col-sm-2 control-label">题目名称</label> | ||
| 127 | <div class="col-sm-10"> | 104 | <div class="col-sm-10"> |
| 128 | <select class="form-control" id="type"> | 105 | <select class="form-control" id="type"> |
| 129 | <option value="1" selected>单选题</option> | 106 | <option value="1" selected>单选题</option> |
| @@ -132,19 +109,19 @@ | @@ -132,19 +109,19 @@ | ||
| 132 | <option value="4">判断题</option> | 109 | <option value="4">判断题</option> |
| 133 | <option value="5">多选题</option> | 110 | <option value="5">多选题</option> |
| 134 | </select> | 111 | </select> |
| 135 | - </div> | 112 | + </div> |
| 136 | <div class="clearfix"></div> | 113 | <div class="clearfix"></div> |
| 137 | - </div> | 114 | + </div>--> |
| 138 | <div class="form-group"> | 115 | <div class="form-group"> |
| 139 | - <label for="index_s_2" class="col-sm-2 control-label">题号</label> | ||
| 140 | - <div class="col-sm-4"> | ||
| 141 | - <input type="number" class="form-control" id="index_s_2" placeholder=""> | 116 | + <label for="index_s_2" class="col-sm-2 control-label">题数</label> |
| 117 | + <div class="col-sm-10"> | ||
| 118 | + <input type="number" class="form-control" id="index_s_2" placeholder="请输入题目数量"> | ||
| 142 | </div> | 119 | </div> |
| 143 | - <div class="col-sm-1"><span style="line-height:34px;">——</span></div> | 120 | + <!-- <div class="col-sm-1"><span style="line-height:34px;">——</span></div> |
| 144 | <div class="col-sm-4"> | 121 | <div class="col-sm-4"> |
| 145 | <input type="number" class="form-control" id="index_e_2" placeholder=""> | 122 | <input type="number" class="form-control" id="index_e_2" placeholder=""> |
| 146 | - </div> | ||
| 147 | - <div class="clearfix"></div> | 123 | + </div>--> |
| 124 | + <div class="clearfix"></div> | ||
| 148 | </div> | 125 | </div> |
| 149 | <div class="form-group"> | 126 | <div class="form-group"> |
| 150 | <label for="num_ans_2" class="col-sm-2 control-label">选项个数</label> | 127 | <label for="num_ans_2" class="col-sm-2 control-label">选项个数</label> |
| @@ -157,6 +134,8 @@ | @@ -157,6 +134,8 @@ | ||
| 157 | <option value="6">6</option> | 134 | <option value="6">6</option> |
| 158 | <option value="7">7</option> | 135 | <option value="7">7</option> |
| 159 | <option value="8">8</option> | 136 | <option value="8">8</option> |
| 137 | + <option value="9">9</option> | ||
| 138 | + <option value="10">10</option> | ||
| 160 | </select> | 139 | </select> |
| 161 | </div> | 140 | </div> |
| 162 | <div class="clearfix"></div> | 141 | <div class="clearfix"></div> |
| @@ -164,14 +143,14 @@ | @@ -164,14 +143,14 @@ | ||
| 164 | <div class="form-group"> | 143 | <div class="form-group"> |
| 165 | <label for="fraction2" class="col-sm-2 control-label">单题分数</label> | 144 | <label for="fraction2" class="col-sm-2 control-label">单题分数</label> |
| 166 | <div class="col-sm-10"> | 145 | <div class="col-sm-10"> |
| 167 | - <input type="number" class="form-control" id="fraction2" placeholder=""> | 146 | + <input type="number" class="form-control" id="fraction2" placeholder="请输入单题分数"> |
| 168 | </div> | 147 | </div> |
| 169 | <div class="clearfix"></div> | 148 | <div class="clearfix"></div> |
| 170 | </div> | 149 | </div> |
| 171 | </div> | 150 | </div> |
| 172 | <div class="modal-footer"> | 151 | <div class="modal-footer"> |
| 173 | - <button type="button" class="btn btn-default" id="addQuestion_submit">确定</button> | ||
| 174 | - <button type="button" class="btn btn-primary" data-dismiss="modal">取消</button> | 152 | + <button type="button" class="btn btn-default" id="addQuestion_submit">确定</button> |
| 153 | + <button type="button" class="btn btn-primary" data-dismiss="modal">取消</button> | ||
| 175 | </div> | 154 | </div> |
| 176 | </div><!-- /.modal-content --> | 155 | </div><!-- /.modal-content --> |
| 177 | </div><!-- /.modal-dialog --> | 156 | </div><!-- /.modal-dialog --> |
WebRoot/static/js/control-604.js
| @@ -3,7 +3,8 @@ | @@ -3,7 +3,8 @@ | ||
| 3 | var score=0; | 3 | var score=0; |
| 4 | function creat(str_ans,a_num,fraction){ | 4 | function creat(str_ans,a_num,fraction){ |
| 5 | $(".section").remove(); | 5 | $(".section").remove(); |
| 6 | - $(".content").append('<div class="section section-1 single" data-fraction="'+fraction+'" data-score=""> <div class="title"> <h3><span class="que_num">一、</span><span class="que_name">单选</span></h3> <input type="button" class="btn btn-danger pull-right remove" name="remove" value="删除" /> </div> <div class="question_list"></div></div>') | 6 | + /*$(".content").append('<div class="section section-1 single" data-fraction="'+fraction+'" data-score=""> <div class="title"> <h3><span class="que_num">一、</span><span class="que_name">单选</span></h3> <input type="button" class="btn btn-danger pull-right remove" name="remove" value="删除" /> </div> <div class="question_list"></div></div>')*/ |
| 7 | + $(".content").append('<div class="section section-1 single" data-fraction="'+fraction+'" data-score=""><div class="title"><h3><span>请在试题选项上点击,亮色为该试题的正确答案 </span></h3> </div><div class="question_list"></div></div>'); | ||
| 7 | var str=str_ans.split(''); | 8 | var str=str_ans.split(''); |
| 8 | console.log(str); | 9 | console.log(str); |
| 9 | for(i=0;i<str.length;i++){ | 10 | for(i=0;i<str.length;i++){ |
| @@ -94,7 +95,7 @@ | @@ -94,7 +95,7 @@ | ||
| 94 | } | 95 | } |
| 95 | } | 96 | } |
| 96 | break; | 97 | break; |
| 97 | - case 5: //多选题 | 98 | + /*case 5: //多选题 |
| 98 | $(".content").append('<div class="section section-'+answer_index_b+' check" data-fraction="'+fraction2+'" data-score=""> <div class="title"> <h3><span class="que_num">'+question_num+'、</span><span class="que_name">多选题</span></h3> <input type="button" class="btn btn-danger pull-right remove" name="remove" value="删除" /> </div> <div class="question_list"></div></div>'); | 99 | $(".content").append('<div class="section section-'+answer_index_b+' check" data-fraction="'+fraction2+'" data-score=""> <div class="title"> <h3><span class="que_num">'+question_num+'、</span><span class="que_name">多选题</span></h3> <input type="button" class="btn btn-danger pull-right remove" name="remove" value="删除" /> </div> <div class="question_list"></div></div>'); |
| 99 | for(var i=index_s_2;i<=index_e_2;i++){ | 100 | for(var i=index_s_2;i<=index_e_2;i++){ |
| 100 | $(".section-"+answer_index_b+" .question_list").append('<div class="question question'+i+'"><span>'+i+'、</span><ul></ul></div>'); | 101 | $(".section-"+answer_index_b+" .question_list").append('<div class="question question'+i+'"><span>'+i+'、</span><ul></ul></div>'); |
| @@ -102,10 +103,21 @@ | @@ -102,10 +103,21 @@ | ||
| 102 | option=String.fromCharCode(0x41+j); | 103 | option=String.fromCharCode(0x41+j); |
| 103 | $(".section-"+answer_index_b+" .question"+i+' ul').append('<li class="btn btn-default">'+option+'</li>'); | 104 | $(".section-"+answer_index_b+" .question"+i+' ul').append('<li class="btn btn-default">'+option+'</li>'); |
| 104 | } | 105 | } |
| 106 | + }*/ | ||
| 107 | + case 5: //多选题 | ||
| 108 | + $(".content").html(""); | ||
| 109 | + $(".content").append('<div class="section section0'+' check" data-fraction="'+fraction2+'" data-score=""> <div class="title"><h3><span>请在试题选项上点击,亮色为该试题的正确答案 </span></h3> </div> <div class="question_list"></div></div>'); | ||
| 110 | + for(var i=index_s_2;i<=index_e_2;i++){ | ||
| 111 | + $(".section0" +" .question_list").append('<div class="question question'+i+'"><span>'+i+'、</span><ul></ul></div>'); | ||
| 112 | + for(var j=0;j<a_num;j++){ | ||
| 113 | + option=String.fromCharCode(0x41+j); | ||
| 114 | + $(".section0"+" .question"+i+' ul').append('<li class="btn btn-default">'+option+'</li>'); | ||
| 115 | + } | ||
| 105 | } | 116 | } |
| 106 | break; | 117 | break; |
| 107 | } | 118 | } |
| 108 | - $(".section-"+answer_index_b).attr("data-score",$(".section-"+answer_index_b).find(".question").length*fraction2); | 119 | +// $(".section-"+answer_index_b).attr("data-score",$(".section-"+answer_index_b).find(".question").length*fraction2); |
| 120 | + $(".section0").attr("data-score",$(".section0").find(".question").length*fraction2); | ||
| 109 | } | 121 | } |
| 110 | 122 | ||
| 111 | $(document).on('click','.remove',function(){ //删除按钮 | 123 | $(document).on('click','.remove',function(){ //删除按钮 |
| @@ -132,9 +144,9 @@ | @@ -132,9 +144,9 @@ | ||
| 132 | /*添加试题的确定按钮*/ | 144 | /*添加试题的确定按钮*/ |
| 133 | $("#addQuestion_submit").click(function(){ | 145 | $("#addQuestion_submit").click(function(){ |
| 134 | $("#fast").attr("disabled","disabled"); | 146 | $("#fast").attr("disabled","disabled"); |
| 135 | - var type_2=parseInt($("#type").val()); | ||
| 136 | - var index_s_2=parseInt($("#index_s_2").val()); | ||
| 137 | - var index_e_2=parseInt($("#index_e_2").val()); | 147 | + var type_2=5;//parseInt($("#type").val()) |
| 148 | + var index_s_2=1;//parseInt($("#index_s_2").val()) | ||
| 149 | + var index_e_2=parseInt($("#index_s_2").val()); | ||
| 138 | //var answer_2=$("#answer_2").val(); | 150 | //var answer_2=$("#answer_2").val(); |
| 139 | var num_ans_2=$("#num_ans_2").val(); | 151 | var num_ans_2=$("#num_ans_2").val(); |
| 140 | var fraction2=parseInt($("#fraction2").val()); | 152 | var fraction2=parseInt($("#fraction2").val()); |
| @@ -142,7 +154,7 @@ | @@ -142,7 +154,7 @@ | ||
| 142 | alert("请输入题目开始序号"); | 154 | alert("请输入题目开始序号"); |
| 143 | return; | 155 | return; |
| 144 | }else if(isNaN(index_e_2)){ | 156 | }else if(isNaN(index_e_2)){ |
| 145 | - alert("请输入题目结束序号"); | 157 | + alert("请输入题目个数");//alert("请输入题目结束序号"); |
| 146 | return; | 158 | return; |
| 147 | }else if(isNaN(fraction2)){ | 159 | }else if(isNaN(fraction2)){ |
| 148 | alert("请输入题目分数"); | 160 | alert("请输入题目分数"); |
| @@ -202,7 +214,7 @@ | @@ -202,7 +214,7 @@ | ||
| 202 | if($(".section").length>0){ | 214 | if($(".section").length>0){ |
| 203 | var rank=0 | 215 | var rank=0 |
| 204 | for(i=0;i<$(".section").length;i++){ | 216 | for(i=0;i<$(".section").length;i++){ |
| 205 | - rank++; | 217 | + /*rank++; |
| 206 | data.questions[i]={ | 218 | data.questions[i]={ |
| 207 | chapter_id: "0", | 219 | chapter_id: "0", |
| 208 | problem_type_id: "0", | 220 | problem_type_id: "0", |
| @@ -220,7 +232,7 @@ | @@ -220,7 +232,7 @@ | ||
| 220 | rank: rank, | 232 | rank: rank, |
| 221 | no_name: $(".section").eq(i).find(".que_num").text(), | 233 | no_name: $(".section").eq(i).find(".que_num").text(), |
| 222 | questions:[] | 234 | questions:[] |
| 223 | - } | 235 | + }*/ |
| 224 | for(j=0;j<$(".section").eq(i).find(".question_list").children(".question").length;j++){ | 236 | for(j=0;j<$(".section").eq(i).find(".question_list").children(".question").length;j++){ |
| 225 | rank++; | 237 | rank++; |
| 226 | var on_num=$(".section").eq(i).find(".question").eq(j).find(".on").length; | 238 | var on_num=$(".section").eq(i).find(".question").eq(j).find(".on").length; |
| @@ -229,7 +241,7 @@ | @@ -229,7 +241,7 @@ | ||
| 229 | answer+=$(".section").eq(i).find(".question").eq(j).find(".on").eq(k).text(); | 241 | answer+=$(".section").eq(i).find(".question").eq(j).find(".on").eq(k).text(); |
| 230 | //console.log(answer); | 242 | //console.log(answer); |
| 231 | } | 243 | } |
| 232 | - data.questions[i].questions[j]={ | 244 | + data.questions[j]={ |
| 233 | chapter_id: "0", | 245 | chapter_id: "0", |
| 234 | problem_type_id: "0", | 246 | problem_type_id: "0", |
| 235 | knowledge_id: "0", | 247 | knowledge_id: "0", |
| @@ -244,7 +256,7 @@ | @@ -244,7 +256,7 @@ | ||
| 244 | part_score: "0", | 256 | part_score: "0", |
| 245 | remark: "", | 257 | remark: "", |
| 246 | rank: rank, | 258 | rank: rank, |
| 247 | - no_name: (i+1)+'.'+(j+1), | 259 | + no_name: (j+1), |
| 248 | } | 260 | } |
| 249 | } | 261 | } |
| 250 | } | 262 | } |
| @@ -317,7 +329,8 @@ function fastSort(array,head,tail){ | @@ -317,7 +329,8 @@ function fastSort(array,head,tail){ | ||
| 317 | if(testData.questions.length > 0){ | 329 | if(testData.questions.length > 0){ |
| 318 | fastSort(testData.questions,0,testData.questions.length-1); | 330 | fastSort(testData.questions,0,testData.questions.length-1); |
| 319 | for(var i = 0 ; i < testData.questions.length;i++){ | 331 | for(var i = 0 ; i < testData.questions.length;i++){ |
| 320 | - if(testData.questions[0].questions.length > 1){ | 332 | + |
| 333 | + if(testData.questions[0].questions && testData.questions[0].questions.length > 1){ | ||
| 321 | fastSort(testData.questions[i].questions,0,testData.questions[i].questions.length-1); | 334 | fastSort(testData.questions[i].questions,0,testData.questions[i].questions.length-1); |
| 322 | } | 335 | } |
| 323 | } | 336 | } |
| @@ -328,40 +341,64 @@ function creatHtml(data){ | @@ -328,40 +341,64 @@ function creatHtml(data){ | ||
| 328 | console.log(data); | 341 | console.log(data); |
| 329 | $(".header_box h1").html(data.title); | 342 | $(".header_box h1").html(data.title); |
| 330 | $("#time").html(data.exam_time); | 343 | $("#time").html(data.exam_time); |
| 344 | + | ||
| 345 | + if(data.questions.length>0){ | ||
| 346 | + $(".time").removeAttr("data-target"); | ||
| 347 | + $(".remove").remove(); | ||
| 348 | + $(".btn_box").remove(); | ||
| 349 | + } | ||
| 350 | + | ||
| 331 | for(var i=0;i<data.questions.length;i++){ | 351 | for(var i=0;i<data.questions.length;i++){ |
| 332 | - $(".content").append('<div class="section section-'+i+'" data-fraction="'+data.questions[i].score+'"> <h3><span class="que_num">'+data.questions[i].no_name+'</span>'+'<span class="que_name">'+data.questions[i].content+'</span></h3> <input type="button" class="btn btn-danger pull-right remove" name="remove" value="删除" /> <div class="question_list"></div></div>') | ||
| 333 | - if(data.questions.length>0){ | ||
| 334 | - $(".time").removeAttr("data-target"); | ||
| 335 | - $(".remove").remove(); | ||
| 336 | - $(".btn_box").remove(); | 352 | + if(data.questions[i].questions){ |
| 353 | + $(".content").append('<div class="section section-'+i+'" data-fraction="'+data.questions[i].score+'"> <h3><span class="que_num">'+data.questions[i].no_name+'</span>'+'<span class="que_name">'+data.questions[i].content+'</span></h3> <input type="button" class="btn btn-danger pull-right remove" name="remove" value="删除" /> <div class="question_list"></div></div>'); | ||
| 354 | + }else{ | ||
| 355 | + if(i == 0){ | ||
| 356 | + $(".content").append('<div class="section section0"> <div class="question_list"></div></div>'); | ||
| 357 | + } | ||
| 358 | + $(".section0").find(".question_list").append('<div class="question question'+(i+1)+'"><span>'+(i+1)+'、</span><ul></ul></div>'); | ||
| 359 | + for(var k=0;k<parseInt(data.questions[i].option_num);k++){ | ||
| 360 | + str_temp=data.questions[i].answer; | ||
| 361 | + $(".section0").find(".question"+(i+1)+' ul').append('<li class="btn btn-default">'+String.fromCharCode(0x41+k)+'</li>'); | ||
| 362 | + for(var l=0;l<str_temp.length;l++){ | ||
| 363 | + str_temp_arry=str_temp.split(''); | ||
| 364 | + code=str_temp_arry[l].charCodeAt(); | ||
| 365 | + on_index=code-65; | ||
| 366 | + if(on_index==k){ | ||
| 367 | + $(".section0").find(".question"+(i+1)+' ul li').eq(on_index).attr("class","btn btn-default on"); | ||
| 368 | + } | ||
| 369 | + } | ||
| 370 | + } | ||
| 337 | } | 371 | } |
| 338 | - for(var j=0;j<data.questions[i].questions.length;j++){ | ||
| 339 | - $(".section-"+i).find(".question_list").append('<div class="question question'+(j+1)+'"><span>'+(j+1)+'、</span><ul></ul></div>'); | ||
| 340 | - if($(".section-"+i).find(".que_name").text()=="判断题"){ | ||
| 341 | - for(var k=0;k<parseInt(data.questions[i].questions[j].option_num);k++){ | ||
| 342 | - str_temp=data.questions[i].questions[j].answer; | ||
| 343 | - if(k%2==0){ | ||
| 344 | - $(".section-"+i).find(".question"+(j+1)+' ul').append('<li class="btn btn-default">√</li>'); | ||
| 345 | - }else if(k%2==1){ | ||
| 346 | - $(".section-"+i).find(".question"+(j+1)+' ul').append('<li class="btn btn-default">×</li>'); | 372 | + |
| 373 | + if(data.questions[i].questions){ | ||
| 374 | + for(var j=0;j<data.questions[i].questions.length;j++){ | ||
| 375 | + $(".section-"+i).find(".question_list").append('<div class="question question'+(j+1)+'"><span>'+(j+1)+'、</span><ul></ul></div>'); | ||
| 376 | + if($(".section-"+i).find(".que_name").text()=="判断题"){ | ||
| 377 | + for(var k=0;k<parseInt(data.questions[i].questions[j].option_num);k++){ | ||
| 378 | + str_temp=data.questions[i].questions[j].answer; | ||
| 379 | + if(k%2==0){ | ||
| 380 | + $(".section-"+i).find(".question"+(j+1)+' ul').append('<li class="btn btn-default">√</li>'); | ||
| 381 | + }else if(k%2==1){ | ||
| 382 | + $(".section-"+i).find(".question"+(j+1)+' ul').append('<li class="btn btn-default">×</li>'); | ||
| 383 | + } | ||
| 384 | + | ||
| 385 | + if(str_temp=="√") | ||
| 386 | + $(".section-"+i).find(".question"+(j+1)+' ul li').eq(0).attr("class","btn btn-default on"); | ||
| 387 | + else | ||
| 388 | + $(".section-"+i).find(".question"+(j+1)+' ul li').eq(1).attr("class","btn btn-default on"); | ||
| 347 | } | 389 | } |
| 348 | - | ||
| 349 | - if(str_temp=="√") | ||
| 350 | - $(".section-"+i).find(".question"+(j+1)+' ul li').eq(0).attr("class","btn btn-default on"); | ||
| 351 | - else | ||
| 352 | - $(".section-"+i).find(".question"+(j+1)+' ul li').eq(1).attr("class","btn btn-default on"); | ||
| 353 | - } | ||
| 354 | - }else{ | ||
| 355 | - for(var k=0;k<parseInt(data.questions[i].questions[j].option_num);k++){ | ||
| 356 | - str_temp=data.questions[i].questions[j].answer; | ||
| 357 | - $(".section-"+i).find(".question"+(j+1)+' ul').append('<li class="btn btn-default">'+String.fromCharCode(0x41+k)+'</li>'); | ||
| 358 | - for(var l=0;l<str_temp.length;l++){ | ||
| 359 | - str_temp_arry=str_temp.split(''); | ||
| 360 | - code=str_temp_arry[l].charCodeAt(); | ||
| 361 | - on_index=code-65; | ||
| 362 | - if(on_index==k){ | ||
| 363 | - $(".section-"+i).find(".question"+(j+1)+' ul li').eq(on_index).attr("class","btn btn-default on"); | ||
| 364 | - } | 390 | + }else{ |
| 391 | + for(var k=0;k<parseInt(data.questions[i].questions[j].option_num);k++){ | ||
| 392 | + str_temp=data.questions[i].questions[j].answer; | ||
| 393 | + $(".section-"+i).find(".question"+(j+1)+' ul').append('<li class="btn btn-default">'+String.fromCharCode(0x41+k)+'</li>'); | ||
| 394 | + for(var l=0;l<str_temp.length;l++){ | ||
| 395 | + str_temp_arry=str_temp.split(''); | ||
| 396 | + code=str_temp_arry[l].charCodeAt(); | ||
| 397 | + on_index=code-65; | ||
| 398 | + if(on_index==k){ | ||
| 399 | + $(".section-"+i).find(".question"+(j+1)+' ul li').eq(on_index).attr("class","btn btn-default on"); | ||
| 400 | + } | ||
| 401 | + } | ||
| 365 | } | 402 | } |
| 366 | } | 403 | } |
| 367 | } | 404 | } |
| @@ -373,9 +410,20 @@ var answerLen = 0 ; | @@ -373,9 +410,20 @@ var answerLen = 0 ; | ||
| 373 | /*快速建题中,每输入五个答案就加一个空格*/ | 410 | /*快速建题中,每输入五个答案就加一个空格*/ |
| 374 | $("#answer").on("input propertychange",function(event){ | 411 | $("#answer").on("input propertychange",function(event){ |
| 375 | if($("#answer").val().length > answerLen){ | 412 | if($("#answer").val().length > answerLen){ |
| 376 | - if(($("#answer").val().length + 1 )% 6 == 0){ | ||
| 377 | - $("#answer").val($("#answer").val()+" "); | 413 | + var answerStr = $("#answer").val(); |
| 414 | + var result = ""; | ||
| 415 | + if(answerStr.length > 5){ | ||
| 416 | + answerStr = answerStr.replace(new RegExp(" ","gm"),""); | ||
| 417 | + for(var i = 0 ; i < answerStr.length ; i++){ | ||
| 418 | + result += answerStr[i]; | ||
| 419 | + if(i % 5 == 4){ | ||
| 420 | + result += " "; | ||
| 421 | + } | ||
| 422 | + } | ||
| 423 | + }else{ | ||
| 424 | + result = answerStr; | ||
| 378 | } | 425 | } |
| 426 | + $("#answer").val(result); | ||
| 379 | } | 427 | } |
| 380 | answerLen = $("#answer").val().length; | 428 | answerLen = $("#answer").val().length; |
| 381 | }) | 429 | }) |
resources/mybatis1/api/V1Mapper.xml
| @@ -103,6 +103,7 @@ | @@ -103,6 +103,7 @@ | ||
| 103 | <if test="PAPER_ID != null and PAPER_ID != ''"> | 103 | <if test="PAPER_ID != null and PAPER_ID != ''"> |
| 104 | and sv_paperquestion.PAPER_ID = #{PAPER_ID} | 104 | and sv_paperquestion.PAPER_ID = #{PAPER_ID} |
| 105 | </if> | 105 | </if> |
| 106 | + order by LENGTH(sv_paperquestion.RANK),sv_paperquestion.RANK | ||
| 106 | 107 | ||
| 107 | </select> | 108 | </select> |
| 108 | 109 |
src/com/fh/controller/software/firm/FirmController.java
| @@ -24,7 +24,6 @@ import org.springframework.web.multipart.MultipartFile; | @@ -24,7 +24,6 @@ import org.springframework.web.multipart.MultipartFile; | ||
| 24 | import org.springframework.web.servlet.ModelAndView; | 24 | import org.springframework.web.servlet.ModelAndView; |
| 25 | 25 | ||
| 26 | import com.fh.controller.base.BaseController; | 26 | import com.fh.controller.base.BaseController; |
| 27 | -import com.fh.controller.sunvote.Myelfun; | ||
| 28 | import com.fh.entity.Page; | 27 | import com.fh.entity.Page; |
| 29 | import com.fh.service.software.firm.FirmManager; | 28 | import com.fh.service.software.firm.FirmManager; |
| 30 | import com.fh.service.software.firmware.FirmwareManager; | 29 | import com.fh.service.software.firmware.FirmwareManager; |
src/com/fh/controller/sunvote/event/EventController.java
| @@ -8,7 +8,9 @@ import java.util.Date; | @@ -8,7 +8,9 @@ import java.util.Date; | ||
| 8 | import java.util.HashMap; | 8 | import java.util.HashMap; |
| 9 | import java.util.List; | 9 | import java.util.List; |
| 10 | import java.util.Map; | 10 | import java.util.Map; |
| 11 | + | ||
| 11 | import javax.annotation.Resource; | 12 | import javax.annotation.Resource; |
| 13 | + | ||
| 12 | import org.springframework.beans.propertyeditors.CustomDateEditor; | 14 | import org.springframework.beans.propertyeditors.CustomDateEditor; |
| 13 | import org.springframework.stereotype.Controller; | 15 | import org.springframework.stereotype.Controller; |
| 14 | import org.springframework.web.bind.WebDataBinder; | 16 | import org.springframework.web.bind.WebDataBinder; |
| @@ -16,14 +18,14 @@ import org.springframework.web.bind.annotation.InitBinder; | @@ -16,14 +18,14 @@ import org.springframework.web.bind.annotation.InitBinder; | ||
| 16 | import org.springframework.web.bind.annotation.RequestMapping; | 18 | import org.springframework.web.bind.annotation.RequestMapping; |
| 17 | import org.springframework.web.bind.annotation.ResponseBody; | 19 | import org.springframework.web.bind.annotation.ResponseBody; |
| 18 | import org.springframework.web.servlet.ModelAndView; | 20 | import org.springframework.web.servlet.ModelAndView; |
| 21 | + | ||
| 19 | import com.fh.controller.base.BaseController; | 22 | import com.fh.controller.base.BaseController; |
| 20 | import com.fh.entity.Page; | 23 | import com.fh.entity.Page; |
| 24 | +import com.fh.service.sunvote.event.EventManager; | ||
| 21 | import com.fh.util.AppUtil; | 25 | import com.fh.util.AppUtil; |
| 26 | +import com.fh.util.Jurisdiction; | ||
| 22 | import com.fh.util.ObjectExcelView; | 27 | import com.fh.util.ObjectExcelView; |
| 23 | import com.fh.util.PageData; | 28 | import com.fh.util.PageData; |
| 24 | -import com.fh.util.Jurisdiction; | ||
| 25 | -import com.fh.util.Tools; | ||
| 26 | -import com.fh.service.sunvote.event.EventManager; | ||
| 27 | 29 | ||
| 28 | /** | 30 | /** |
| 29 | * 说明:事件记录 | 31 | * 说明:事件记录 |