EXAM001.jsp 13.5 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254
<%@page import="java.net.URLEncoder"%>
<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="com.csc.library.session.*, com.csc.library.utilities.*, com.csc.library.entry.*"%>
<%
   UProfile up = null;
   if (session!=null){
      up = (UProfile)session.getAttribute("userprofile");
   }
%>
<html ng-app='EXAM'>
   <head>
      <link href="../JS/QueryBuilder/bootstrap-3.3.5/css/bootstrap.css" rel="stylesheet">
      <link rel="stylesheet" href="../CSS/TISCO.css" />
      <link rel='stylesheet' href='CSS/ManageExam.css' />
      <script type='text/javascript' src='../JS/SCREEN.js'></script>
      <script type='text/javascript' src='../JS/HOTKEY.js'></script>
      <script type='text/javascript' src='../JS/ICONSMENU.js'></script>
      <script type="text/javascript" src='../JS/jquery-2.1.3.min.js'></script>
      <script type="text/javascript" src='../public/lib/angular/angular.min.js'></script>
      <script type="text/javascript" src="../JS/ANGULAR/SCREEN_ANGULAR.js"></script>
      <script type="text/javascript" src='../public/lib/angular-resource/angular-resource.min.js'></script>
      <script type='text/javascript' src='../public/lib/angular-sanitize/angular-sanitize.min.js'></script>
      <script type="text/javascript" src='../CSS/Bootstrap/js/bootstrap.min.js'></script>
      <script type='text/javascript' src='JS/Module.js'></script>
      <script type='text/javascript' src='JS/services.js'></script>
       <script type='text/javascript' src='JS/filter.js'></script>
      <script type='text/javascript' src='JS/EXAM001/Exam001.Controller.js'></script>
      <script type='text/javascript'>
         setLang("<%=up.get("lang")%>");
         getTitleName();

         function linkHelp(help, input){
            with (document.cscform) {
               obj = eval("document.cscform." + input);
               var param = "PRU084_NEW_APS_ANG.jsp?__helpName=" + help + "&__fieldSearch=" + input + "&__pageCall=" + __screen.value + "&__fixCon=" + __fixCon.value + "&tdeq=1";
               if (obj.value === "") {
                  param = "PRU084_NEW_APS_ANG.jsp?__helpName=" + help + "&__fieldSearch=" + input + "&__pageCall=" + __screen.value + "&__fixCon=" + __fixCon.value + "&tdeq=1";
               }
               win = window.open(param, "Help", "left=300,top=150,width=700,height=400,resizable=yes,scrollbars=yes,toolbar=no,status=yes");
               if (window.focus) {
                  win.focus();
               }
            }
         }

         function postReturnAngular(returnValue){
            var returnval = returnValue.split('#');
            var keyval = returnval[1].substring(0, returnval[1].length-1);
            var scope = angular.element($("form[name=cscform]")).scope();
            scope.$apply(function(){
               scope.queryByKey(returnval[0], keyval);
            });
         }

         function putNewChild(result){
            var scope = angular.element($('form[name="cscform"]')).scope();
            scope.$apply(function(){
               scope.putNewChild(result);
            });
         }

         //put new child for mquestion
         function newChild(questionobj){
            var scope = angular.element($('form[name="cscform"]')).scope();
            scope.$apply(function(){
               scope.putNewQuestion(questionobj);
            });
         }

         function GoSave(){
            if (confirm(MyCode[1])){
               var scope = angular.element($('form[name="cscform"]')).scope();
               scope.$apply(function(){
                  scope.save();
               });
            }
         }

         function GoDelete(){
            if (confirm(MyCode[4])){
               var scope = angular.element($('form[name="cscform"]')).scope();
               scope.$apply(function(){
                  scope.delete();
               });
            }
         }

         $(document).ready(function(){
            $('#add').click(function(){
               if ( $('select[name="__question_type"]').val() == 0 ){
                  window.open("EXAM001_ADD.jsp", "ADD_QUESTION", "toolbar=yes, scrollbars=yes, resizable=yes, top=100, left=300, width=800, height=500");
               }else if ( $('select[name="__question_type"]').val() == 1){
                  window.open("EXAM_ADD_QUESTION.jsp?hasAddQuestion=1", "ADD_QUESTION", "toolbar=yes, scrollbars=yes, resizable=yes, top=100, left=300, width=1200, height=800");
               }
            });
         });
      </script>
   </head>
   <body ng-controller='Exam001'>
      <div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
      <script>initToolTips();</script>
      <form name='cscform'>
         <input type="hidden" name="__screen" value="EXAM001" />
         <input type="hidden" name="__help" value="" />
         <input type="hidden" name="__fixCon" value="" />
         <input type="hidden" name="__cmd" value="">
         <input type='hidden' name="__helpReturn" value="" />

         <script>document.write(Icons("EXAM001, ทะเบียนรายวิชา"));</script>
         <div class='container'>
            <br/>
            <table style="border-spacing: 0;border-collapse: 0;width: 100%;">
               <tr>
                  <td class='header' colspan='2'>EXAM001, ทะเบียนรายวิชา&nbsp;</td>
               </tr>
               <tr>
                  <td class="blankspace" colspan="2"></td>
               </tr>
               <tr>
                  <td class='right'>รหัสรายวิชา</td>
                  <td>
                     <input type='text' name='__questionset1id' ng-model='questset1.questionset1id'/>
                     <a href="javascript:linkHelp('MQUESTIONSET1HELP','__questionset1id');" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('__questionset2id_image','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)">
                        <img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="SEARCH" name="__questionset2id_image" width="20" height="20" border="0" align="absmiddle">
                     </a>
                  </td>
               </tr>
               <tr>
                  <td class='right'>รายละเอียด</td>
                  <td><input type='text' size='100' maxlength='500' ng-model='questset1.questionset1_name'/></td>
               </tr>
               <tr>
                  <td class='right'>หมายเหตุ</td>
                  <td><input type='text' size='100' maxlength='500' ng-model='questset1.remark' /></td>
               </tr>
               <tr>
                  <td class='right'>วิชาบังคับ</td>
                  <td>
                     <label><input type='radio' ng-model='questset1.subject_req' value='1' />ใช่</label>
                     <label><input type='radio' ng-model='questset1.subject_req' value='0' />ไม่ใช่</label>
                  </td>
               </tr>
               <tr>
                  <td class='right'>คะแนนเต็ม</td>
                  <td> {{ questset1.total_score }} คะแนนที่ผ่านเกณฑ์ <input type='text' ng-model='questset1.pass_score' ng-blur='checkPassScore()'/></td>
               </tr>
               <tr>
                  <td class='right'>กำหนดเวลาในการทำข้อสอบ</td>
                  <td>
                     <label><input type='radio' ng-model='questset1.settime' value='1' />กำหนด</label>
                     <label><input type='radio' ng-model='questset1.settime' value='0' />ไม่กำหนด</label>
                  </td>
               </tr>
               <tr ng-if='questset1.settime == 1'>
                  <td class='right'>เวลาในการทำข้อสอบ</td>
                  <td>
                     <select ng-model='questset1.hour' ng-disabled='questset1.settime != 1'>
                        <option ng-repeat='hours in selhour' value='{{ hours }}'>{{ hours }}</option>
                     </select>
                     <span> ชั่วโมง </span>
                     <select ng-model='questset1.minute' ng-disabled='questset1.settime != 1'>
                        <option ng-repeat='minutes in selminute' value='{{ minutes }}'>{{ minutes }}</option>
                     </select>
                     <span> นาที </span>
                  </td>
               </tr>
               <tr>
                  <td class='right'>แจ้งคะแนนสอบ</td>
                  <td>
                     <label><input type='radio' ng-model='questset1.score_report' value='1' />แจ้ง</label>
                     <label><input type='radio' ng-model='questset1.score_report' value='0' />ไม่แจ้ง</label>
                  </td>
               </tr>
               <tr>
                  <td class='right'>สถานะ</td>
                  <td>
                     <label><input type='radio' ng-model='questset1.status' value='1' />ใช้งาน</label>
                     <label><input type='radio' ng-model='questset1.status' value='0' />ไม่ใช้งาน</label>
                  </td>
               </tr>
               <tr>
                  <td class='right'>สถานะการทำข้อสอบ</td>
                  <td>
                     <label><input type='radio' ng-model='questset1.examworkstatus' value='1' />สอบทันที</label>
                     <label><input type='radio' ng-model='questset1.examworkstatus' value='0' />รอการอนุมัติ</label>
                  </td>
               </tr>
               <tr>
                  <td class='right'><span swlang code='SW012909'>ประเภทคำถาม</span></td>
                  <td>
                     <select name='__question_type' ng-model='questset1.question_type' ng-click="checkBeforeChange()">
                        <option value='0'>ทะเบียนส่วน</option>
                        <option value='1' swlang code='SW000105'>คำถาม</option>
                     </select>
                  </td>
               </tr>
               <tr>
                  <td colspan='2'>
                     <table id='tb' class='table' style='width: 98%; margin: 0 auto;'>
                        <tr class='hasborder'>
                           <td class='detailHeader'><span swlang code='SW000015'>select</span></td>
                           <td class='detailHeader'><span swlang code='SW012906'>Question ID</span></td>
                           <td class='detailHeader'><span swlang code='SW000012'>Description</span></td>
                           <td class='detailHeader'><span swlang code='SW000013'>Score</span></td>
                        </tr>
                        <tr ng-repeat='q2 in questset1ch' class='hasborder'>
                           <td class='center'><input type='checkbox' ng-model='q2.ischeck' /> </td>
                           <td ng-bind-html='q2.questionid'></td>
                           <td>
                              <strong ng-bind-html='q2.question_name'></strong>
                              <span ng-if='questset1.question_type == 0'>
                                 <ol ng-repeat='q3 in q2.question_body'>
                                    <strong ng-bind-html='q3.questionset3_name'></strong>
                                    <ol ng-if='q3.question_type == 0' ng-repeat='q4 in q3.questionset4'>
                                       <strong ng-bind-html='q4.questionset4_name'></strong>
                                       <ol>
                                          <li ng-repeat='qbody in q4.question_body' ng-bind-html='qbody.question'></li>
                                       </ol>
                                    </ol>
                                    <ol ng-if='q3.question_type == 1'>
                                       <li ng-repeat='qbody in q3.question_body' ng-bind-html='qbody.question'></li>
                                    </ol>
                                 </ol>
                                 <ol ng-if='q2.question_type == 1'>
                                    <li ng-repeat='qbody in q2.question_body' ng-bind-html='qbody.question'></li>
                                 </ol>
                              </span>
                           </td>
                           <td class='center' ng-bind-html='q2.score'></td>
                        </tr>
                        <tr>
                           <td colspan="4" class="text-center" style="padding-top: 10px; padding-bottom: 10px;">
                              <a id="selectAll" class="btn btn-primary btn-sm" ng-click='selectAll()'>
                                 <span class="glyphicon glyphicon-asterisk"></span> Select All
                              </a>
                              <a id="deselectAll" class="btn btn-primary btn-sm" ng-click='deSelectAll()'>
                                 <span class="glyphicon glyphicon-ban-circle"></span> Deselect All
                              </a>
                              <a id="add" class="btn btn-primary btn-sm">
                                 <span class="glyphicon glyphicon-plus"></span> Add
                              </a>
                              <a id="del" class="btn btn-primary btn-sm" ng-click='delSelect()'>
                                 <span class="glyphicon glyphicon-trash"></span> Delete
                              </a>
                           </td>
                        </tr>
                     </table>
                  </td>
               </tr>
            </table>
         </div>
      </form>
   </body>
</html>