subject.wxml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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" value="对">正确</radio></view>
  63. <view><radio color="#358BFF" 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">
  67. <checkbox color="#358BFF" value="{{opt[0]}}">{{opt}}</checkbox></view>
  68. </checkbox-group>
  69. <radio-group class="option" wx:else bindchange='answer' data-id='{{item.id}}'>
  70. <view wx:for="{{item.options}}" wx:for-item="opt" wx:key="*this">
  71. <radio color="#358BFF" value="{{opt[0]}}">{{opt}}</radio>
  72. </view>
  73. </radio-group>
  74. </view>
  75. </view>
  76. <view class="btn">
  77. <text class="{{idx<=1?'hide':''}}" bindtap="prev">上一题</text>
  78. <text class="{{idx>=data.questions.length?'hide':''}}" bindtap="next">下一题</text>
  79. <view bindtap="post" wx:if='{{status != 1}}'>交卷</view>
  80. </view>
  81. <view class="ans_bg" wx:if='{{show}}'>
  82. <view class="ans_card">
  83. <view>答题卡 <image bindtap="closeAns" class="close" mode="widthFix" src="../../images/close.png"></image></view>
  84. <block wx:if='{{status}}'>
  85. <block wx:for="{{data.questions}}">
  86. <text wx:if='{{item.post_answer}}' class="{{item.correct ? 'right':'error'}}" bindtap="skip" data-id='{{index}}'>{{index+1}}</text>
  87. <text wx:else bindtap="skip" data-id='{{index}}'>{{index+1}}</text>
  88. </block>
  89. </block>
  90. <block wx:else>
  91. <text wx:for="{{data.questions}}" class="{{item.post_answer ? 'act':''}}" bindtap="skip" data-id='{{index}}'>{{index+1}}</text>
  92. </block>
  93. </view>
  94. </view>