add.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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. <!--<script src="__CDN__/assets/addons/exam/element/index.js"></script>-->
  7. <!--<link rel="stylesheet" type="text/css" href="__CDN__/assets/addons/exam/element/index.css" />-->
  8. <div id="app">
  9. <form id="question-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
  10. <div class="form-group">
  11. <label class="control-label col-xs-12 col-sm-2">{:__('Cate_id')}:</label>
  12. <div class="col-xs-12 col-sm-8">
  13. <input id="c-cate_id" data-rule="required" data-source="exam/cate/selectpage" data-params='{"custom[kind]":"QUESTION","isTree":true}' class="form-control selectpage" name="row[cate_id]" type="text" value="">
  14. </div>
  15. </div>
  16. <!--<div class="form-group">
  17. <label class="control-label col-xs-12 col-sm-2">{:__('Exam_type_id')}:</label>
  18. <div class="col-xs-12 col-sm-8">
  19. <input id="c-exam_type_id" data-rule="required" data-source="exam_type/index" class="form-control selectpage" name="row[exam_type_id]" type="text" value="">
  20. </div>
  21. </div>-->
  22. <div class="form-group">
  23. <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
  24. <div class="col-xs-12 col-sm-8">
  25. <div id="c-title1" v-show="showTitleEditor">
  26. <textarea id="c-title" class="form-control editor" name="row[title]"></textarea>
  27. </div>
  28. <input id="c-title2" class="form-control" name="row[title_fill]" type="text" @change="changeTitle" v-model:value="title" v-show="showTitleFill">
  29. </div>
  30. </div>
  31. <div class="form-group">
  32. <label class="control-label col-xs-12 col-sm-2">{:__('title_video')}:</label>
  33. <div class="col-xs-12 col-sm-8">
  34. <div class="input-group">
  35. <input id="c-title_video" class="form-control" size="50" name="row[title_video]" type="text">
  36. <div class="input-group-addon no-border no-padding">
  37. <span><button type="button" id="plupload-title_video" class="btn btn-danger plupload" data-input-id="c-title_video" data-mimetype="mp4" data-multiple="false" data-preview-id="p-title_video"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
  38. <span><button type="button" id="fachoose-title_video" class="btn btn-primary fachoose" data-input-id="c-title_video" data-mimetype="mp4" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
  39. </div>
  40. <span class="msg-box n-right" for="c-title_video"></span>
  41. </div>
  42. <ul class="row list-inline plupload-preview" id="p-title_video"></ul>
  43. </div>
  44. </div>
  45. <div class="form-group">
  46. <label class="control-label col-xs-12 col-sm-2">{:__('Kind')}:</label>
  47. <div class="col-xs-12 col-sm-8">
  48. <div class="radio">
  49. {foreach name="kindList" item="vo"}
  50. <label for="row[kind]-{$key}">
  51. <input @change="changeKind" id="row[kind]-{$key}" name="row[kind]" type="radio" value="{$key}" {in name="key" value="SINGLE" }checked{/in} /> {$vo}
  52. </label>
  53. {/foreach}
  54. </div>
  55. </div>
  56. </div>
  57. <input name="row[is_material_child]" type="hidden" value="0">
  58. <input name="row[material_question_id]" type="hidden" value="">
  59. <input name="row[material_score]" type="hidden" value="0">
  60. <!--<div class="form-group" id="is_material_child">
  61. <label class="control-label col-xs-12 col-sm-2">{:__('is_material_child')}:</label>
  62. <div class="col-xs-12 col-sm-8">
  63. <div class="radio">
  64. <label for="row[is_material_child]-0">
  65. <input @change="changeIsMaterialChild" id="row[is_material_child]-0" name="row[is_material_child]" type="radio" value="0" checked /> 否
  66. </label>
  67. <label for="row[is_material_child]-1">
  68. <input @change="changeIsMaterialChild" id="row[is_material_child]-1" name="row[is_material_child]" type="radio" value="1" /> 是
  69. </label>
  70. </div>
  71. </div>
  72. </div>
  73. <div class="form-group is_material_child">
  74. <label class="control-label col-xs-12 col-sm-2">{:__('material_question_id')}:</label>
  75. <div class="col-xs-12 col-sm-8">
  76. <input id="c-material_question_id" data-source="exam/question/index" data-field="title" data-params='{"custom[kind]":"MATERIAL"}' class="form-control selectpage" name="row[material_question_id]" type="text" value="" style="width: 100%;">
  77. </div>
  78. </div>
  79. <div class="form-group is_material_child">
  80. <label class="control-label col-xs-12 col-sm-2">{:__('material_score')}:</label>
  81. <div class="col-xs-12 col-sm-8">
  82. <input id="c-material_score" class="form-control" name="row[material_score]" type="number" value="0" step="1">
  83. </div>
  84. </div>-->
  85. <!--原题型 -->
  86. <div v-show="kind === 'JUDGE' || kind === 'SINGLE' || kind === 'MULTI'">
  87. <div class="form-group">
  88. <label class="control-label col-xs-12 col-sm-2">{:__('Options_json')}:</label>
  89. <div class="col-xs-12 col-sm-8">
  90. <dl class="fieldlist" data-name="row[options_json]">
  91. <dd>
  92. <ins>{:__('Key')}</ins>
  93. <ins>{:__('Value')}</ins>
  94. </dd>
  95. <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
  96. <textarea name="row[options_json]" class="form-control hide" cols="30" rows="5"></textarea>
  97. </dl>
  98. <textarea id="c-options_img" name="row[options_img]" class="form-control hide" cols="30" rows="5"></textarea>
  99. </div>
  100. </div>
  101. <div class="form-group">
  102. <label class="control-label col-xs-12 col-sm-2">{:__('Answer')}:</label>
  103. <div class="col-xs-12 col-sm-8">
  104. <input id="c-answer" class="form-control" name="row[answer]" type="text" readonly="readonly">
  105. </div>
  106. </div>
  107. </div>
  108. <!--填空题-->
  109. <div v-show="kind === 'FILL'">
  110. <div class="form-group">
  111. <label class="control-label col-xs-12 col-sm-2">填空位:</label>
  112. <div class="col-xs-12 col-sm-8">
  113. <button type="button" class="btn btn-success" @click="addFillOptions()"><i class="fa fa-plus"></i> 新增填空位</button>
  114. <div v-for="(option, index) in fillOptions" :key="index">
  115. <p style="margin-left: 10px; margin-top: 10px;">填空位({{(index + 1)}})答案(任意答案匹配即算正确)</p>
  116. <div class="fill-option" v-for="(answer, key) in option.answers" :key="key">
  117. <div>
  118. <input type="text" class="form-control" :name="'row[answer]['+index+'][answers][]'" v-model="fillOptions[index].answers[key]" placeholder="请输入答案" />
  119. </div>
  120. <div class="m-l-10">
  121. <button type="button" class="btn btn-danger" @click="deleteFillAnswer(index, key)"><i class="fa fa-trash"></i> </button>
  122. </div>
  123. </div>
  124. <button type="button" class="btn btn-info" @click="addFillAnswer(index)"><i class="fa fa-plus"></i> 新增答案项</button>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. <!--简答题-->
  130. <div v-show="kind === 'SHORT'">
  131. <div class="form-group">
  132. <label class="control-label col-xs-12 col-sm-2">标准答案:</label>
  133. <div class="col-xs-12 col-sm-8">
  134. <textarea id="c-short_answer" class="form-control" name="row[short_answer]" rows="5"></textarea>
  135. </div>
  136. </div>
  137. <div class="form-group">
  138. <label class="control-label col-xs-12 col-sm-2">关键词:</label>
  139. <div class="col-xs-12 col-sm-8">
  140. <button type="button" class="btn btn-success" @click="addShortOptions()"><i class="fa fa-plus"></i> 新增关键词</button>
  141. <p style="margin-left: 10px; margin-top: 10px;" class="text-info">任意关键词匹配得分数</p>
  142. <div v-for="(option, index) in shortOptions" :key="index" class="row m-t-5">
  143. <div class="col-sm-7">
  144. <input type="text" class="form-control" :name="'row[answer_config]['+index+'][answer]'" v-model="option.answer" placeholder="请输入关键词" />
  145. </div>
  146. <div class="col-sm-2">
  147. <label class="m-t-5">得</label>
  148. <input type="number" step="1" min="1" class="form-control" :name="'row[answer_config]['+index+'][score]'" v-model="option.score" placeholder="请输入分数" style="width: 60px;"/>
  149. <label class="m-t-5">分</label>
  150. </div>
  151. <div class="col-sm-3">
  152. <button type="button" class="btn btn-danger" @click="deleteShortAnswer(index)"><i class="fa fa-trash"></i> </button>
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. <!--材料题-->
  159. <div v-show="kind === 'MATERIAL'">
  160. <div class="form-group">
  161. <label class="control-label col-xs-12 col-sm-2">选择题目:</label>
  162. <div class="col-xs-12 col-sm-8">
  163. <button class="btn btn-success" type="button" @click="selectMaterialQuestion()"><i class="fa fa-search"></i> 选择题目</button>
  164. <!--材料题子题目设置-->
  165. {include file="../application/admin/view/exam/question/material_questions.html" /}
  166. </div>
  167. </div>
  168. </div>
  169. <!--<div class="form-group">
  170. <label class="control-label col-xs-12 col-sm-2">{:__('Difficulty')}:</label>
  171. <div class="col-xs-12 col-sm-8">
  172. <select id="c-difficulty" data-rule="required" class="form-control selectpicker" name="row[difficulty]">
  173. {foreach name="difficultyList" item="vo"}
  174. <option value="{$key}" {in name="key" value="GENERAL"}selected{/in}>{$vo}</option>
  175. {/foreach}
  176. </select>
  177. </div>
  178. </div>-->
  179. <div class="form-group">
  180. <label class="control-label col-xs-12 col-sm-2">{:__('Explain')}:</label>
  181. <div class="col-xs-12 col-sm-8">
  182. <!-- <input id="c-explain" class="form-control" name="row[explain]" type="text">-->
  183. <textarea id="c-explain" class="form-control editor" name="row[explain]"></textarea>
  184. </div>
  185. </div>
  186. <div class="form-group">
  187. <label class="control-label col-xs-12 col-sm-2">{:__('explain_video')}:</label>
  188. <div class="col-xs-12 col-sm-8">
  189. <div class="input-group">
  190. <input id="c-explain_video" class="form-control" size="50" name="row[explain_video]" type="text">
  191. <div class="input-group-addon no-border no-padding">
  192. <span><button type="button" id="plupload-explain_video" class="btn btn-danger plupload" data-input-id="c-explain_video" data-mimetype="mp4" data-multiple="false" data-preview-id="p-explain_video"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
  193. <span><button type="button" id="fachoose-explain_video" class="btn btn-primary fachoose" data-input-id="c-explain_video" data-mimetype="mp4" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
  194. </div>
  195. <span class="msg-box n-right" for="c-explain_video"></span>
  196. </div>
  197. <ul class="row list-inline plupload-preview" id="p-explain_video"></ul>
  198. </div>
  199. </div>
  200. <div class="form-group">
  201. <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
  202. <div class="col-xs-12 col-sm-8">
  203. <div class="radio">
  204. {foreach name="statusList" item="vo"}
  205. <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="NORMAL"}checked{/in} /> {$vo}</label>
  206. {/foreach}
  207. </div>
  208. </div>
  209. </div>
  210. <div class="form-group layer-footer">
  211. <label class="control-label col-xs-12 col-sm-2"></label>
  212. <div class="col-xs-12 col-sm-8">
  213. <input type="button" id="valid" @click="valid" class="hide">
  214. <!--<input type="hidden" id="options_extend" name="row[options_extend]">-->
  215. <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
  216. <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
  217. </div>
  218. </div>
  219. </form>
  220. </div>
  221. <!--试题设置扩展-->
  222. {include file="../application/admin/view/exam/question/extend.html" /}