subject.wxml 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. 总题数 <view>{{idx}}/{{data.questions.length}}</view>
  10. </view>
  11. <!-- 判断 -->
  12. <view class="content" wx:for="{{data.questions}}" hidden="{{idx != index+1}}" wx:key="idx">
  13. <view class="num">{{index+1}}、
  14. <view>
  15. <image wx:if="{{item.qtype == 1}}" src="../../images/danx.svg" mode="widthFix"></image>
  16. <image wx:if="{{item.qtype == 2}}" src="../../images/duox.svg" mode="widthFix"></image>
  17. <image wx:if="{{item.qtype == 3}}" src="../../images/pd.svg" mode="widthFix"></image>
  18. {{item.title}}
  19. </view>
  20. </view>
  21. <!-- <view class="ques"> {{item.title}} </view> -->
  22. <view class="ans" wx:if="{{status}}">
  23. <view class="option" wx:for="{{item.options}}" wx:for-item="opt" wx:key="*this" wx:if='{{item.qtype == 1}}'>
  24. <view wx:if='{{opt[0] == item.answer}}' class="correct">
  25. {{opt}}
  26. </view>
  27. <view wx:elif='{{opt[0] == item.post_answer && !item.correct}}' class="error">
  28. {{opt}}
  29. </view>
  30. <view wx:else>
  31. {{opt}}
  32. </view>
  33. </view>
  34. <view class="option" wx:for="{{item.options}}" wx:for-item="opt" wx:key="*this" wx:if='{{item.qtype == 2}}'>
  35. <view wx:if='{{util.includes(item.post_answer, opt[0]) && item.correct}}' class="correct">
  36. {{opt}}
  37. </view>
  38. <view wx:elif='{{util.includes(item.post_answer, opt[0]) && !item.correct}}' class="error">
  39. {{opt}}
  40. </view>
  41. <view wx:else>
  42. {{opt}}
  43. </view>
  44. </view>
  45. <view class="option" wx:if='{{item.qtype == 3}}' wx:for="{{flag}}" wx:for-item="opt">
  46. <view wx:if='{{opt.value == item.answer}}' class="correct">{{opt.name}}</view>
  47. <view wx:elif='{{opt.value == item.post_answer && !item.correct}}' class="error">{{opt.name}}</view>
  48. <view wx:else>{{opt.name}}</view>
  49. </view>
  50. <view>
  51. <view style="color:#000;margin-bottom: 15rpx;"><text style="color: #666;">正确答案:</text>{{item.answer}}
  52. <text style="padding: 0 10px;"></text>
  53. <text style="color: #666;">您的答案:</text>{{item.post_answer?item.post_answer:''}}
  54. </view>
  55. <view style="color:#666">答案解析:</view>
  56. <view class="analysis">{{item.analysis}}</view>
  57. </view>
  58. </view>
  59. <view class="ans" wx:if="{{!status}}">
  60. <radio-group class="option" wx:if="{{item.qtype == 3}}" bindchange='answer' data-id='{{item.id}}'>
  61. <view><radio color="#358BFF" value="对">正确</radio></view>
  62. <view><radio color="#358BFF" value="错">错误</radio></view>
  63. </radio-group>
  64. <checkbox-group class="option" wx:elif="{{item.qtype == 2}}" bindchange='answer' data-id='{{item.id}}'>
  65. <view wx:for="{{item.options}}" wx:for-item="opt" wx:key="*this">
  66. <checkbox color="#358BFF" value="{{opt[0]}}">{{opt}}</checkbox></view>
  67. </checkbox-group>
  68. <radio-group wx:else bindchange='answer' data-id='{{item.id}}'>
  69. <view wx:for="{{item.options}}" wx:for-item="opt" wx:key="*this">
  70. <radio color="#358BFF" value="{{opt[0]}}">{{opt}}</radio>
  71. </view>
  72. </radio-group>
  73. </view>
  74. </view>
  75. <view class="btn">
  76. <text class="{{idx<=1?'hide':''}}" bindtap="prev">上一题</text>
  77. <text class="{{idx>=data.questions.length?'hide':''}}" bindtap="next">下一题</text>
  78. <view bindtap="post" wx:if='{{status != 1}}'>交卷</view>
  79. </view>
  80. <view class="ans_bg" wx:if='{{show}}'>
  81. <view class="ans_card">
  82. <view>答题卡 <image bindtap="closeAns" class="close" mode="widthFix" src="../../images/back.png"></image></view>
  83. <text wx:for="{{data.questions}}" class="{{item.post_answer ? 'act':''}}" bindtap="skip" data-id='{{index}}'>{{index+1}}</text>
  84. </view>
  85. </view>