add.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <script src="__CDN__/assets/libs/jquery/dist/jquery.min.js"></script>
  2. <script src="__CDN__/assets/addons/exam/js/vue.js"></script>
  3. <link rel="stylesheet" type="text/css" href="__CDN__/assets/addons/exam/css/common.css"></link>
  4. <script src="__CDN__/assets/addons/exam/js/element-ui/index.js"></script>
  5. <link rel="stylesheet" type="text/css" href="__CDN__/assets/addons/exam/js/element-ui/index.css"></link>
  6. <div id="app">
  7. <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
  8. <div class="form-group">
  9. <label class="control-label col-xs-12 col-sm-2">{:__('Cate_id')}:</label>
  10. <div class="col-xs-12 col-sm-8">
  11. <input id="c-cate_id" data-rule="required" data-source="exam/cate/selectpage"
  12. data-params='{"custom[kind]":"QUESTION","isTree":true}' class="form-control selectpage" name="row[cate_id]"
  13. type="text" value="">
  14. </div>
  15. </div>
  16. <!--<div class="form-group">
  17. <label class="control-label col-xs-12 col-sm-2">{:__('Kind')}:</label>
  18. <div class="col-xs-12 col-sm-8">
  19. <select id="c-kind" data-rule="required" class="form-control selectpicker" name="row[kind]">
  20. {foreach name="kindList" item="vo"}
  21. <option value="{$key}" {in name="key" value="RANDOM"}selected{/in}>{$vo}</option>
  22. {/foreach}
  23. </select>
  24. </div>
  25. </div>-->
  26. <div class="form-group">
  27. <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
  28. <div class="col-xs-12 col-sm-8">
  29. <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text"
  30. placeholder="请输入试卷名称">
  31. </div>
  32. </div>
  33. <div class="form-group">
  34. <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
  35. <div class="col-xs-12 col-sm-8">
  36. <div class="input-group">
  37. <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="">
  38. <div class="input-group-addon no-border no-padding">
  39. <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
  40. <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
  41. </div>
  42. <span class="msg-box n-right" for="c-image"></span>
  43. </div>
  44. <ul class="row list-inline faupload-preview" id="p-image"></ul>
  45. </div>
  46. </div>
  47. <div class="form-group">
  48. <label class="control-label col-xs-12 col-sm-2">{:__('Quantity')}:</label>
  49. <div class="col-xs-12 col-sm-8">
  50. <input id="c-quantity" data-rule="required" class="form-control" name="row[quantity]" type="number" step="1"
  51. min="1" value="100" placeholder="请输入试卷总题数">
  52. </div>
  53. </div>
  54. <div class="form-group">
  55. <label class="control-label col-xs-12 col-sm-2">{:__('Total_score')}:</label>
  56. <div class="col-xs-12 col-sm-8">
  57. <input id="c-total_score" data-rule="required" class="form-control" name="row[total_score]" type="number"
  58. step="1" min="1" value="100" placeholder="请输入试卷总分数">
  59. </div>
  60. </div>
  61. <div class="form-group">
  62. <label class="control-label col-xs-12 col-sm-2">{:__('Pass_score')}:</label>
  63. <div class="col-xs-12 col-sm-8">
  64. <input id="c-pass_score" data-rule="required" class="form-control" name="row[pass_score]" type="number"
  65. step="1" min="1" placeholder="请输入及格分数">
  66. </div>
  67. </div>
  68. <div class="form-group">
  69. <label class="control-label col-xs-12 col-sm-2">{:__('Mode')}:</label>
  70. <div class="col-xs-12 col-sm-8">
  71. <div class="radio">
  72. {foreach name="modeList" item="vo"}
  73. <label for="row[mode]-{$key}">
  74. <input @change="changeMode" id="row[mode]-{$key}" name="row[mode]" type="radio" value="{$key}" {in name="key" value="RANDOM" }checked{/in} /> {$vo}
  75. </label>
  76. {/foreach}
  77. </div>
  78. </div>
  79. </div>
  80. <div class="form-group">
  81. <label class="control-label col-xs-12 col-sm-2">{:__('Configs')}:</label>
  82. <div class="col-xs-12 col-sm-8" v-show="mode === 'RANDOM'" id="div_random_configs">
  83. <input id="c-configs" class="form-control hide" name="row[configs]" type="text">
  84. <!--<a href="javascript:;" class="btn btn-sm btn-success btn-configs"><i class="fa fa-cog"></i> 随机选题配置</a>-->
  85. {include file="../application/admin/view/exam/paper/configs_setting.html" /}
  86. </div>
  87. <div class="col-xs-12 col-sm-8" v-show="mode === 'FIX'">
  88. <a href="javascript:;" class="btn btn-sm btn-success btn-fix-configs margin-bottom" @click="openQuestionSelect()"><i class="fa fa-cog"></i> 固定选题配置</a>
  89. {include file="../application/admin/view/exam/paper/configs_setting_fix.html" /}
  90. </div>
  91. </div>
  92. <div class="form-group">
  93. <label class="control-label col-xs-12 col-sm-2">{:__('Limit_time')}:</label>
  94. <div class="col-xs-12 col-sm-8" style="line-height: 31px;">
  95. <input id="c-limit_time" data-rule="required" class="form-control hide" name="row[limit_time]" type="number"
  96. step="1" min="0" value="0" style="width: 200px" placeholder="考试限时,0不限制">
  97. <input id="c-limit_time_hour" data-rule="required" class="form-control" name="row[limit_time_hour]"
  98. type="number" step="1" min="0" max="23" value="0" style="width: 100px" placeholder="考试限时小时">时
  99. <input id="c-limit_time_minute" data-rule="required" class="form-control" name="row[limit_time_minute]"
  100. type="number" step="1" min="0" max="60" value="60" style="width: 100px" placeholder="考试限时分钟,0不限制">分
  101. </div>
  102. </div>
  103. <div class="form-group">
  104. <label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
  105. <div class="col-xs-12 col-sm-8">
  106. <input id="c-start_time" data-rule="match(lte, row[end_time], date);" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{:date('Y-m-d H:i:s')}">
  107. </div>
  108. </div>
  109. <div class="form-group">
  110. <label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
  111. <div class="col-xs-12 col-sm-8">
  112. <input id="c-end_time" data-rule="match(gte, row[start_time], date);" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="">
  113. <p class="text-info">* 试卷使用时间,清空则不限制试卷使用时间</p>
  114. </div>
  115. </div>
  116. <!-- <div class="form-group">
  117. <label class="control-label col-xs-12 col-sm-2">{:__('Is_only_room')}:</label>
  118. <div class="col-xs-12 col-sm-8">
  119. <input id="c-is_only_room" name="row[is_only_room]" type="hidden" value="{$row.is_only_room|default=0}">
  120. <a href="javascript:;" data-toggle="switcher" class="btn-is_only_room" data-input-id="c-is_only_room" data-yes="1" data-no="0" >
  121. <i class="fa fa-toggle-on text-success fa-flip-horizontal text-gray fa-2x"></i>
  122. </a>
  123. <p class="text-info">* 开启该功能后,该试卷将不再显示于前端试卷列表,仅考场可使用</p>
  124. </div>
  125. </div>-->
  126. <!--<div class="form-group">
  127. <label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
  128. <div class="col-xs-12 col-sm-8">
  129. <input id="c-end_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="">
  130. <p class="text-info">* 试卷结束使用时间,清空则不限制试卷使用时间</p>
  131. </div>
  132. </div>-->
  133. <div class="form-group">
  134. <label class="control-label col-xs-12 col-sm-2">每人限制考试次数:</label>
  135. <div class="col-xs-12 col-sm-8" style="line-height: 31px;">
  136. <input id="c-limit_count" data-rule="required" class="form-control" name="row[limit_count]" type="number"
  137. step="1" min="0" value="1" style="width: 200px" placeholder="考试限时,0不限制">
  138. </div>
  139. </div>
  140. <div class="form-group">
  141. <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
  142. <div class="col-xs-12 col-sm-8">
  143. <div class="radio">
  144. {foreach name="statusList" item="vo"}
  145. <label for="row[status]-{$key}">
  146. <input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="NORMAL" }checked{/in} /> {$vo}</label>
  147. {/foreach}
  148. </div>
  149. </div>
  150. </div>
  151. <!--<div class="form-group">
  152. <label class="control-label col-xs-12 col-sm-2">选择岗位:</label>
  153. <div class="col-xs-12 col-sm-8">
  154. <select id="c-gangwei_id" multiple="" class="form-control selectpicker" name="">
  155. {foreach name="gangweilist" item="vo"}
  156. <option value="{$vo.id}" >{$vo.name}</option>
  157. {/foreach}
  158. </select>
  159. </div>
  160. </div>-->
  161. <!--<div class="form-group">
  162. <label class="control-label col-xs-12 col-sm-2">可参加考试的用户:</label>
  163. <div class="col-xs-12 col-sm-8">
  164. <input id="c-user_ids" data-source="user/user/index" data-multiple="true" data-order-by="id desc" data-pagination="false" data-field="nickname" class="form-control selectpage" name="row[user_ids]" type="text" value="">
  165. </div>
  166. </div>-->
  167. <div class="form-group layer-footer">
  168. <label class="control-label col-xs-12 col-sm-2"></label>
  169. <div class="col-xs-12 col-sm-8">
  170. <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
  171. <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
  172. </div>
  173. </div>
  174. </form>
  175. </div>
  176. <!--试卷设置扩展-->
  177. {include file="../application/admin/view/exam/paper/extend.html" /}