studentAnswerDetail.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <div class="stu_answer_detail">
  3. <div class="title">【作 答】</div>
  4. <div class="desc">
  5. <!-- v-model="rightAnswerValue" -->
  6. <el-radio-group
  7. v-if="answerType == 'online'"
  8. @change="rightAnswerValue = defaultRightAnswerValue"
  9. >
  10. <el-radio
  11. v-for="radioItem in questionOption"
  12. :key="radioItem.value"
  13. :label="radioItem.value"
  14. :class="{
  15. 'is-correct-radio is-checked': rightAnswerValue === radioItem.value,
  16. 'is-wrong-radio is-checked': studentAnswerVal===radioItem.value && rightAnswerValue !== studentAnswerVal
  17. }"
  18. >{{ radioItem.label }}</el-radio>
  19. </el-radio-group>
  20. <ImageJumpPreview
  21. :fileMessage="fileMessage" height="400px"
  22. :filePadding="{padding:`0 ${imgPreviewPadding}`}"
  23. :navBarWidth="{width:`calc(100% - ${imgPreviewPadding} + 20px)`}"
  24. :navBarLeft="{left: `calc(${imgPreviewPadding} / 2 - 10px)`}"
  25. :navTotalPage="5"
  26. v-model:currentNavPage="currentNavPage"
  27. ></ImageJumpPreview>
  28. </div>
  29. </div>
  30. </template>
  31. <script>
  32. import ImageJumpPreview from '../../components/ImageJumpPreview.vue'
  33. export default ({
  34. name:'StudentAnswerDetail',
  35. components: {
  36. ImageJumpPreview,
  37. },
  38. data(){
  39. return {
  40. answerType:'photo', //答题方式 //线上答题和上传图片 online \ photo
  41. studentAnswerVal:'D',
  42. rightAnswerValue:'B',
  43. defaultRightAnswerValue:'B',
  44. questionOption:[
  45. {
  46. label:'A',
  47. value:'A'
  48. },
  49. {
  50. label:'B',
  51. value:'B'
  52. },
  53. {
  54. label:'C',
  55. value:'C'
  56. },
  57. {
  58. label:'D',
  59. value:'D'
  60. },
  61. ],
  62. fileMessage:{
  63. name:'24-b5fa-0ddc8797a6c0.png',
  64. url:'https://jtzx001.oss-accelerate.aliyuncs.com/huijiaoyan_test/20260805_50007/05171802_60fcf6dd-4276-4d24-b5fa-0ddc8797a6c0.png'
  65. },
  66. imgPreviewPadding:'70px',
  67. currentNavPage:1
  68. }
  69. },
  70. methods: {},
  71. computed:{},
  72. mounted() {
  73. },
  74. })
  75. </script>
  76. <style lang="scss" scoped>
  77. .stu_answer_detail{
  78. padding: 16px;
  79. display: flex;
  80. gap:10px;
  81. .title {
  82. text-align: right;
  83. width: 70px;
  84. flex-shrink: 0;
  85. font-weight: 600;
  86. }
  87. .desc{
  88. flex: 1 1;
  89. line-height: 24px;
  90. }
  91. // 2. 错误选项样式(红色)
  92. ::v-deep .is-wrong-radio {
  93. position: relative !important;
  94. // 圆圈边框
  95. .el-radio__inner {
  96. border-color: #F56C6C !important;
  97. }
  98. // 选中状态(圆点填充)
  99. &.is-checked .el-radio__inner {
  100. position: relative !important;
  101. background-color: none;
  102. &::after{
  103. width: 8px;
  104. height: 8px;
  105. border-radius: 100%;
  106. background-color: #F56C6C !important;
  107. content: "";
  108. position: absolute;
  109. left: 50%;
  110. top: 50%;
  111. transform: translate(-50%, -50%) scale(1) !important;
  112. transition: transform 0.15s ease-in;
  113. }
  114. }
  115. }
  116. // 正确选项样式 蓝色
  117. ::v-deep .is-correct-radio {
  118. position: relative !important;
  119. // 圆圈边框
  120. .el-radio__inner {
  121. border-color: #2E64FA !important;
  122. }
  123. // 选中状态(圆点填充)
  124. &.is-checked .el-radio__inner {
  125. position: relative !important;
  126. background-color: none;
  127. &::after{
  128. width: 8px;
  129. height: 8px;
  130. border-radius: 100%;
  131. background-color: #2E64FA!important;
  132. content: "";
  133. position: absolute;
  134. left: 50%;
  135. top: 50%;
  136. transform: translate(-50%, -50%) scale(1) !important;
  137. transition: transform 0.15s ease-in;
  138. }
  139. }
  140. }
  141. }
  142. </style>