edit.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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="edit-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="{$row.cate_id|htmlentities}">
  14. </div>
  15. </div>
  16. <div class="form-group">
  17. <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
  18. <div class="col-xs-12 col-sm-8">
  19. <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text"
  20. value="{$row.title|htmlentities}" placeholder="请输入试卷名称">
  21. </div>
  22. </div>
  23. <div class="form-group">
  24. <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
  25. <div class="col-xs-12 col-sm-8">
  26. <div class="input-group">
  27. <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
  28. <div class="input-group-addon no-border no-padding">
  29. <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>
  30. <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>
  31. </div>
  32. <span class="msg-box n-right" for="c-image"></span>
  33. </div>
  34. <ul class="row list-inline faupload-preview" id="p-image"></ul>
  35. </div>
  36. </div>
  37. <div class="form-group">
  38. <label class="control-label col-xs-12 col-sm-2">{:__('Quantity')}:</label>
  39. <div class="col-xs-12 col-sm-8">
  40. <input id="c-quantity" data-rule="required" class="form-control" name="row[quantity]" type="number"
  41. value="{$row.quantity|htmlentities}" step="1" min="1" placeholder="请输入试卷总题数">
  42. </div>
  43. </div>
  44. <div class="form-group">
  45. <label class="control-label col-xs-12 col-sm-2">{:__('Total_score')}:</label>
  46. <div class="col-xs-12 col-sm-8">
  47. <input id="c-total_score" data-rule="required" class="form-control" name="row[total_score]" type="number"
  48. value="{$row.total_score|htmlentities}" step="1" min="1" placeholder="请输入试卷总分数">
  49. </div>
  50. </div>
  51. <div class="form-group">
  52. <label class="control-label col-xs-12 col-sm-2">{:__('Pass_score')}:</label>
  53. <div class="col-xs-12 col-sm-8">
  54. <input id="c-pass_score" data-rule="required" class="form-control" name="row[pass_score]" type="number"
  55. value="{$row.pass_score|htmlentities}" step="1" min="1" placeholder="请输入及格分数">
  56. </div>
  57. </div>
  58. <div class="form-group">
  59. <label class="control-label col-xs-12 col-sm-2">{:__('Mode')}:</label>
  60. <div class="col-xs-12 col-sm-8">
  61. <div class="radio">
  62. {foreach name="modeList" item="vo"}
  63. <label for="row[mode]-{$key}">
  64. <input @change="changeMode" id="row[mode]-{$key}" name="row[mode]" type="radio" value="{$key}" {in name="key" value="$row.mode" }checked{/in} /> {$vo}
  65. </label>
  66. {/foreach}
  67. </div>
  68. </div>
  69. </div>
  70. <div class="form-group">
  71. <label class="control-label col-xs-12 col-sm-2">{:__('Configs')}:</label>
  72. <div class="col-xs-12 col-sm-8" v-show="mode === 'RANDOM'" id="div_random_configs">
  73. <input id="c-configs" data-rule="required" class="form-control hide" name="row[configs]" type="text"
  74. value="{$row.configs|htmlentities}">
  75. {include file="../application/admin/view/exam/paper/configs_setting.html" /}
  76. </div>
  77. <div class="col-xs-12 col-sm-8" v-show="mode === 'FIX'">
  78. <a href="javascript:;" class="btn btn-sm btn-success btn-fix-configs margin-bottom" @click="openQuestionSelect()"><i class="fa fa-cog"></i> 固定选题配置</a>
  79. {include file="../application/admin/view/exam/paper/configs_setting_fix.html" /}
  80. </div>
  81. </div>
  82. <div class="form-group">
  83. <label class="control-label col-xs-12 col-sm-2">{:__('Limit_time')}:</label>
  84. <div class="col-xs-12 col-sm-8" style="line-height: 31px;">
  85. <input id="c-limit_time" data-rule="required" class="form-control hide" name="row[limit_time]"
  86. value="{$row.limit_time|default=0}" type="number" step="1" min="0" placeholder="考试限时,0不限制"
  87. style="width: 200px">
  88. <input id="c-limit_time_hour" data-rule="required" class="form-control" name="row[limit_time_hour]"
  89. type="number" step="1" min="0" max="23" value="0" style="width: 100px" placeholder="考试限时小时">时
  90. <input id="c-limit_time_minute" data-rule="required" class="form-control" name="row[limit_time_minute]"
  91. type="number" step="1" min="0" max="60" value="60" style="width: 100px" placeholder="考试限时分钟,0不限制">分
  92. </div>
  93. </div>
  94. <div class="form-group">
  95. <label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
  96. <div class="col-xs-12 col-sm-8">
  97. <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="{:$row.start_time?datetime($row.start_time):''}">
  98. </div>
  99. </div>
  100. <div class="form-group">
  101. <label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
  102. <div class="col-xs-12 col-sm-8">
  103. <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="{:$row.end_time?datetime($row.end_time):''}">
  104. <p class="text-info">* 试卷使用时间,清空则不限制试卷使用时间</p>
  105. </div>
  106. </div>
  107. <!--<div class="form-group">
  108. <label class="control-label col-xs-12 col-sm-2">仅用于考场:</label>
  109. <div class="col-xs-12 col-sm-8">
  110. <input id="c-is_only_room" name="row[is_only_room]" type="hidden" value="{$row.is_only_room|default=0}">
  111. <a href="javascript:;" data-toggle="switcher" class="btn-is_only_room" data-input-id="c-is_only_room" data-yes="1" data-no="0" >
  112. <i class="fa fa-toggle-on text-success {if condition="!isset($row['is_only_room']) || !$row['is_only_room']"}fa-flip-horizontal text-gray{/if} fa-2x"></i>
  113. </a>
  114. <p class="text-info">* 开启该功能后,该试卷将不再显示于前端试卷列表,仅考场可使用</p>
  115. </div>
  116. </div>-->
  117. <!--<div class="form-group">
  118. <label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
  119. <div class="col-xs-12 col-sm-8">
  120. <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="{:$row.end_time?datetime($row.end_time):''}">
  121. <p class="text-info">* 试卷结束使用时间,清空则不限制试卷使用时间</p>
  122. </div>
  123. </div>-->
  124. <div class="form-group">
  125. <label class="control-label col-xs-12 col-sm-2">每人限制考试次数:</label>
  126. <div class="col-xs-12 col-sm-8" style="line-height: 31px;">
  127. <input id="c-limit_count" data-rule="required" class="form-control" name="row[limit_count]" type="number"
  128. step="1" min="0" value="{$row.limit_count|default=1}" style="width: 200px" placeholder="考试限时,0不限制">
  129. </div>
  130. </div>
  131. <div class="form-group">
  132. <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
  133. <div class="col-xs-12 col-sm-8">
  134. <div class="radio">
  135. {foreach name="statusList" item="vo"}
  136. <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio"
  137. value="{$key}" {in name="key" value="$row.status" }checked{/in}
  138. /> {$vo}</label>
  139. {/foreach}
  140. </div>
  141. </div>
  142. </div>
  143. <!--<div class="form-group">
  144. <label class="control-label col-xs-12 col-sm-2">可参加考试的用户:</label>
  145. <div class="col-xs-12 col-sm-8">
  146. <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="{$row.user_ids}">
  147. </div>
  148. </div>-->
  149. <div class="form-group layer-footer">
  150. <label class="control-label col-xs-12 col-sm-2"></label>
  151. <div class="col-xs-12 col-sm-8">
  152. <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
  153. <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
  154. </div>
  155. </div>
  156. </form>
  157. </div>
  158. <!--试卷设置扩展-->
  159. {include file="../application/admin/view/exam/paper/extend.html" /}