EXAM001_ADD.jsp 6.44 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
<!DOCTYPE html>
<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="com.csc.library.session.*"%>
<%@page import="com.csc.library.entry.*"%>
<%@page import="com.csc.library.utilities.*"%>
<%
   UProfile up = null;

   if (session != null){
      up = (UProfile)session.getAttribute("userprofile");
   }
%>
<html ng-app='EXAM'>
   <head>
      <link href="../CSS/TISCO.css" rel="stylesheet" type="text/css" />
      <link href="../JS/QueryBuilder/bootstrap-3.3.5/css/bootstrap.css" rel="stylesheet" />
      <script type="text/javascript" src='../JS/jquery-2.1.3.min.js'></script>
      <script src="../JS/bootstrap.min.js"></script>
      <script src='../JS/SCREEN.js'></script>
      <script src="../JS/SWAPLANG_FREEDOM.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='JS/Module.js'></script>
      <script type='text/javascript' src='JS/services.js'></script>
      <script type='text/javascript' src='JS/EXAM001/Exam001Add.Controller.js'></script>
      <style>
         img[height="20"] {
            padding: 0px;
         }

         .table > tbody > tr > td {
            padding: 4px;
            border: 1px solid #CBC5C5;
            vertical-align: middle;
         }

         .valign-center {
            vertical-align: middle;
         }
         p {
            margin: 0px;
         }

         .detailHeader {
            text-align: center;
            background-color: #5992CB;
            color: #FFFFFF;
         }

         td.header {
            color: #ffffff;
            font-weight: bold;
            background-color: #336699;
            text-align: right;
            height: 22px;
            border: none;
         }

         .btn-sm,
         .btn-group-sm > .btn {
            padding: 3px 5px;
            font-size: 12px;
            line-height: 1.5;
            border-radius: 3px;
         }
      </style>
      <script type='text/javascript'>
         setLang("<%=up.get("lang")%>");
         setLangSwapLang("<%=up.get("lang")%>");
      </script>
   </head>
   <body ng-controller='Exam001Add'>
      <br/>
      <div class='container'>
         <div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
         <script>initToolTips();</script>
         <form role="form" id="cscform" name="cscform">
            <table id="tb" class="table">
               <tbody>
                  <tr>
                     <td colspan="4" class="header">EXAM001_ADD, <script>swLang('SELECT');</script>ทะเบียนรายวิชา</td>
                  </tr>
                  <tr>
                     <td class="detailHeader"><script>swLang('SELECT');</script></td>
                     <td class="detailHeader"><script>swLang('QUESTIONID');</script></td>
                     <td class="detailHeader"><script>swLang('DETAIL');</script></td>
                     <td class="detailHeader"><script>swLang('SCORE');</script></td>
                  </tr>
                  <tr ng-repeat='q2 in questset2'>
                     <td class='text-center'><input type='checkbox' ng-model='q2.ischeck' value='{{ q2.questionset2id }}'/> </td>
                     <td>{{ q2.questionset2id }}</td>
                     <td>
                        <strong ng-bind-html='q2.questionset2_name'></strong>
                        <ol ng-if='q2.question_type == 0' ng-repeat='q3 in q2.questionset3'>
                           <strong ng-bind-html='q3.questionset3_name'></strong>
                           <ol>
                              <li ng-if='q3.question_type == 1' ng-repeat='q in q3.question_body' ng-bind-html='q.question'></li>
                           </ol>
                           <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='q in q4.question_body' ng-bind-html='q.question'></li>
                              </ol>
                           </ol>
                        </ol>
                        <ol ng-if='q2.question_type == 1'>
                           <li ng-repeat='q in q2.question_body' ng-bind-html='q.question'></li>
                        </ol>
                     </td>
                     <td class='text-center'>{{ q2.total_score }}</td>
                  </tr>
                  <tr>
                     <td colspan="4" class="text-center" style="height: 50px;">
                        <button type="button" id="selectAll" class="btn btn-primary btn-sm" ng-click='selectAll()'>
                           <span class="glyphicon glyphicon-asterisk"></span> Select All
                        </button>
                        <button type="button" id="deselectAll" class="btn btn-primary btn-sm" ng-click='deSelectAll()'>
                           <span class="glyphicon glyphicon-ban-circle"></span> Deselect All
                        </button>
                        <button type="button" id="add" class="btn btn-primary btn-sm">
                           <span class="glyphicon glyphicon-plus"></span> Add
                        </button>
                        <button type="button" id="close" class="btn btn-primary btn-sm">
                           <span class="glyphicon glyphicon-remove"></span> Close
                        </button>
                     </td>
                  </tr>
                  <tr>
                     <td colspan="4" style="background-color: #336699;height: 12px;"></td>
                  </tr>
               </tbody>
            </table>
         </form>
      </div>
      <script type='text/javascript'>
         $(document).ready(function(){
            $('#add').click(function(){
               var result = '';

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

               window.opener.putNewChild(result);
               window.close();
            });

            $('#close').click(function(){
               window.close();
            });
         });
      </script>
   </body>
</html>