MatchingQuestion.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <QuestionBase>
  3. <template #content>
  4. <div class="stem">
  5. <el-input
  6. v-if="data.property.stem_type === stemTypeList[0].value"
  7. v-model="data.stem"
  8. rows="3"
  9. resize="none"
  10. type="textarea"
  11. placeholder="输入题干"
  12. />
  13. <RichText v-if="data.property.stem_type === stemTypeList[1].value" v-model="data.stem" placeholder="输入题干" />
  14. <el-input
  15. v-show="data.property.is_enable_description"
  16. v-model="data.description"
  17. rows="3"
  18. resize="none"
  19. type="textarea"
  20. placeholder="输入描述"
  21. />
  22. </div>
  23. </template>
  24. <template #property></template>
  25. </QuestionBase>
  26. </template>
  27. <script>
  28. import QuestionBase from '../common/QuestionBase.vue';
  29. import RichText from '@/components/common/RichText.vue';
  30. import {
  31. stemTypeList,
  32. switchOption,
  33. scoreTypeList,
  34. computedQuestionNumber,
  35. changeOptionType,
  36. questionNumberTypeList,
  37. } from '@/views/exercise_questions/data/common';
  38. import { matchingTypeList, matchingData } from '@/views/exercise_questions/data/matching';
  39. export default {
  40. name: 'MatchingQuestion',
  41. components: {
  42. QuestionBase,
  43. RichText,
  44. },
  45. data() {
  46. return {
  47. matchingTypeList,
  48. data: JSON.parse(JSON.stringify(matchingData)),
  49. };
  50. },
  51. methods: {
  52. /**
  53. * 设置题目内容
  54. * @param {object} param
  55. * @param {string} param.content 题目内容
  56. */
  57. setQuestion({ content }) {
  58. this.data = JSON.parse(content);
  59. },
  60. },
  61. };
  62. </script>
  63. <style lang="scss" scoped></style>