subject.wxml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <wxs module="util" src="../../utils/pub.wxs"></wxs>
  2. <view class="top" wx:if="{{status != 1}}">
  3. <text bindtap="openAns">答题卡</text>
  4. 总题数:{{idx}}/{{data.questions.length}}
  5. <view>{{time}}</view>
  6. </view>
  7. <view class="top" wx:else>
  8. <text bindtap="reDo">重做试卷</text>
  9. <text bindtap="openAns" style="margin-right: 5px;">答题卡</text>
  10. 总题数:{{idx}}/{{data.questions.length}}
  11. </view>
  12. <!-- 判断 -->
  13. <view class="content" wx:for="{{data.questions}}" hidden="{{idx != index+1}}" wx:key="idx">
  14. <view class="num">{{index+1}}、
  15. <view>
  16. <image wx:if="{{item.qtype == 1}}" src="../../images/danx.svg" mode="widthFix"></image>
  17. <image wx:if="{{item.qtype == 2}}" src="../../images/duox.svg" mode="widthFix"></image>
  18. <image wx:if="{{item.qtype == 3}}" src="../../images/pd.svg" mode="widthFix"></image>
  19. {{item.title}}
  20. </view>
  21. </view>
  22. <!-- <view class="ques"> {{item.title}} </view> -->
  23. <view class="ans" wx:if="{{status}}">
  24. <view class="option" wx:for="{{item.options}}" wx:for-item="opt" wx:key="*this" wx:if='{{item.qtype == 1}}'>
  25. <view wx:if='{{opt[0] == item.answer}}' class="correct">
  26. {{opt}}
  27. </view>
  28. <view wx:elif='{{opt[0] == item.post_answer && !item.correct}}' class="error">
  29. {{opt}}
  30. </view>
  31. <view wx:else>
  32. {{opt}}
  33. </view>
  34. </view>
  35. <view class="option" wx:for="{{item.options}}" wx:for-item="opt" wx:key="*this" wx:if='{{item.qtype == 2}}'>
  36. <view wx:if='{{util.includes(item.post_answer, opt[0]) && item.correct}}' class="correct">
  37. {{opt}}
  38. </view>
  39. <view wx:elif='{{util.includes(item.post_answer, opt[0]) && !item.correct}}' class="error">
  40. {{opt}}
  41. </view>
  42. <view wx:else>
  43. {{opt}}
  44. </view>
  45. </view>
  46. <view class="option" wx:if='{{item.qtype == 3}}' wx:for="{{flag}}" wx:for-item="opt">
  47. <view wx:if='{{opt.value == item.answer}}' class="correct">{{opt.name}}</view>
  48. <view wx:elif='{{opt.value == item.post_answer && !item.correct}}' class="error">{{opt.name}}</view>
  49. <view wx:else>{{opt.name}}</view>
  50. </view>
  51. <view>
  52. <view style="color:#000;margin-bottom: 15rpx;"><text style="color: #666;">正确答案:</text>{{item.answer}}
  53. <text style="padding: 0 10px;"></text>
  54. <text style="color: #666;">您的答案:</text>{{item.post_answer?item.post_answer:''}}
  55. </view>
  56. <view style="color:#666">答案解析:</view>
  57. <view class="analysis">{{item.analysis}}</view>
  58. </view>
  59. </view>
  60. <view class="ans" wx:if="{{!status}}">
  61. <radio-group class="option" wx:if="{{item.qtype == 3}}" bindchange='answer' data-id='{{item.id}}'>
  62. <view ><radio color="#358BFF" checked="{{item.post_answer=='对'}}" value="对">正确</radio></view>
  63. <view><radio color="#358BFF" checked="{{item.post_answer=='错'}}" value="错">错误</radio></view>
  64. </radio-group>
  65. <checkbox-group class="option" wx:elif="{{item.qtype == 2}}" bindchange='answer' data-id='{{item.id}}'>
  66. <view wx:for="{{item.options}}" wx:for-item="opt" wx:key="*this" wx:for-index="i">
  67. <checkbox color="#358BFF" value="{{opt[0]}}">{{opt}}</checkbox>
  68. </view>
  69. </checkbox-group>
  70. <radio-group class="option" wx:else bindchange='answer' data-id='{{item.id}}'>
  71. <view wx:for="{{item.options}}" wx:for-item="opt" wx:key="*this">
  72. <radio color="#358BFF" checked="{{item.post_answer==opt[0]}}" value="{{opt[0]}}">{{opt}}</radio>
  73. </view>
  74. </radio-group>
  75. <view wx:if='{{item.post_answer_str}}' style="position: relative;">
  76. <image wx:if='{{item.correct}}' mode="widthFix" class="flag" src="../../images/gou.png"></image>
  77. <image wx:else class="flag" style="width: 20px;" mode="widthFix" src="../../images/cuo.png"></image>
  78. <view style="color: green;">正确答案:{{item.answer}}</view>
  79. <view style="color:#666">答案解析:</view>
  80. <view class="analysis">{{item.analysis}}</view>
  81. </view>
  82. </view>
  83. </view>
  84. <view class="btn">
  85. <text class="{{idx<=1?'hide':''}}" bindtap="prev">上一题</text>
  86. <text class="{{idx>=data.questions.length?'hide':''}}" bindtap="next">下一题</text>
  87. <view bindtap="post" wx:if='{{status != 1}}'>交卷</view>
  88. </view>
  89. <view class="ans_bg" wx:if='{{show}}'>
  90. <view class="ans_card">
  91. <view>答题卡 <image bindtap="closeAns" class="close" mode="widthFix" src="../../images/close.png"></image></view>
  92. <block wx:if='{{status}}'>
  93. <block wx:for="{{data.questions}}">
  94. <text wx:if='{{item.post_answer}}' class="{{item.correct ? 'right':'error'}}" bindtap="skip" data-id='{{index}}'>{{index+1}}</text>
  95. <text wx:else bindtap="skip" data-id='{{index}}'>{{index+1}}</text>
  96. </block>
  97. </block>
  98. <block wx:else>
  99. <block wx:for="{{data.questions}}">
  100. <text wx:if='{{item.post_answer_str}}' class="{{item.correct ? 'right':'error'}}" bindtap="skip" data-id='{{index}}'>{{index+1}}</text>
  101. <text wx:else class="{{item.post_answer ? 'act':''}}" bindtap="skip" data-id='{{index}}'>{{index+1}}</text>
  102. </block>
  103. </block>
  104. </view>
  105. </view>