edit.html 13 KB

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