material_questions.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <div>
  2. <!--统计信息-->
  3. <div class="margin-bottom">
  4. <el-row :gutter="24">
  5. <el-col :span="6">
  6. <div>
  7. <el-statistic title="总题数/分数">
  8. <template slot="formatter"> {{materialSummary.total_quantity}}/{{materialSummary.total_score}} </template>
  9. </el-statistic>
  10. </div>
  11. </el-col>
  12. <el-col :span="6">
  13. <div>
  14. <el-statistic title="判断题数/分数">
  15. <template slot="formatter"> {{materialSummary.judge_quantity}}/{{materialSummary.judge_score}} </template>
  16. </el-statistic>
  17. </div>
  18. </el-col>
  19. <el-col :span="6">
  20. <div>
  21. <el-statistic title="单选题数/分数">
  22. <template slot="formatter"> {{materialSummary.single_quantity}}/{{materialSummary.single_score}} </template>
  23. </el-statistic>
  24. </div>
  25. </el-col>
  26. <el-col :span="6">
  27. <div>
  28. <el-statistic title="多选题数/分数">
  29. <template slot="formatter"> {{materialSummary.multi_quantity}}/{{materialSummary.multi_score}} </template>
  30. </el-statistic>
  31. </div>
  32. </el-col>
  33. </el-row>
  34. <el-row :gutter="24" class="m-t-5">
  35. <el-col :span="6">
  36. <div>
  37. <el-statistic title="填空题数/分数">
  38. <template slot="formatter"> {{materialSummary.fill_quantity}}/{{materialSummary.fill_score}} </template>
  39. </el-statistic>
  40. </div>
  41. </el-col>
  42. <el-col :span="6">
  43. <div>
  44. <el-statistic title="简答题数/分数">
  45. <template slot="formatter"> {{materialSummary.short_quantity}}/{{materialSummary.short_score}} </template>
  46. </el-statistic>
  47. </div>
  48. </el-col>
  49. </el-row>
  50. </div>
  51. <!--试题列表-->
  52. <el-table :data="materialQuestions" height="350" border style="width: 100%">
  53. <el-table-column prop="id" label="ID" width="80"></el-table-column>
  54. <el-table-column prop="cates.name" label="分类" width="120">
  55. <template slot-scope="scope">
  56. <span v-if="scope.row.cate">{{scope.row.cate.name}}</span>
  57. <span v-else-if="scope.row.cates">{{scope.row.cates.name}}</span>
  58. </template>
  59. </el-table-column>
  60. <el-table-column prop="title" label="标题"></el-table-column>
  61. <el-table-column prop="kind" label="题型" width="80">
  62. <template slot-scope="scope">
  63. <el-tag size="small" effect="plain" v-if="scope.row.kind == 'JUDGE'">判断题</el-tag>
  64. <el-tag size="small" effect="plain" v-else-if="scope.row.kind == 'SINGLE'" type="success">单选题</el-tag>
  65. <el-tag size="small" effect="plain" v-else-if="scope.row.kind == 'MULTI'" type="info">多选题</el-tag>
  66. <el-tag size="small" effect="plain" v-else-if="scope.row.kind == 'FILL'" type="warning">填空题</el-tag>
  67. <el-tag size="small" effect="plain" v-else-if="scope.row.kind == 'SHORT'" type="danger">简答题</el-tag>
  68. </template>
  69. </el-table-column>
  70. <el-table-column prop="score" label="分数" align="center">
  71. <template slot-scope="scope">
  72. <div v-if="scope.row.kind == 'SHORT'">
  73. <!--简答题最大分数-->
  74. <div>
  75. <span>最大得分数</span>
  76. <el-input-number size="mini" v-model="scope.row.score" :min="1" step-strictly @change="scoreChange(scope.$index)"></el-input-number>
  77. </div>
  78. <div class="m-t-5">
  79. <!--设置简答题各关键词分数-->
  80. <el-button size="small" type="primary" @click="openShortScoreDialog(scope.row, scope.$index)">设置关键词分数</el-button>
  81. </div>
  82. </div>
  83. <div v-else>
  84. <el-input-number size="mini" v-model="scope.row.score" :min="1" step-strictly @change="scoreChange(scope.$index)"></el-input-number>
  85. </div>
  86. </template>
  87. </el-table-column>
  88. <el-table-column fixed="right" label="操作" width="100">
  89. <template slot-scope="scope">
  90. <el-button type="danger" icon="el-icon-delete" size="small" @click="deleteQuestion(scope.$index)">删除</el-button>
  91. </template>
  92. </el-table-column>
  93. </el-table>
  94. <button id="valid" type="button" @click="valid()" class="hide">验证</button>
  95. <input type="hidden" name="row[material_questions]" id="c-material_questions">
  96. </div>
  97. <!--简答题关键词分数设置弹窗-->
  98. <el-dialog title="简答题关键词分数设置" :visible.sync="shortScoreDialogVisible" width="50%">
  99. <el-table :data="shortScoreConfig" height="350" border style="width: 100%">
  100. <el-table-column prop="answer" label="关键词"></el-table-column>
  101. <el-table-column prop="score" label="得分数">
  102. <template slot-scope="scope">
  103. <el-input-number size="mini" v-model="scope.row.score" :min="1" step-strictly></el-input-number>
  104. </template>
  105. </el-table-column>
  106. </el-table>
  107. <div slot="footer" class="dialog-footer">
  108. <el-button @click="shortScoreDialogVisible = false">取 消</el-button>
  109. <el-button type="primary" @click="shortScoreDialogVisible = false; shortScoreSubmit()">确 定</el-button>
  110. </div>
  111. </el-dialog>