index.wxml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <wxs module="filter" src="../../../wxs/exam-fun.wxs"></wxs>
  2. <view class="exam-page p10">
  3. <view class="view-wrap-hidden"> </view>
  4. <view class="exam-name-title">
  5. <h1></h1>
  6. </view>
  7. <i-panel wx:for="{{list}}" i-class="exam-panel-title">
  8. <i-cell-group i-class="exam-cell">
  9. <!-- 单选题 -->
  10. <i-cell wx:if="{{item.type ==2}}">
  11. <view class="single">
  12. <rich-text nodes="{{index+1}}.[单]{{item.title}}" />
  13. <radio-group class="radio-answer" bindchange="radioChange" data-index="{{index}}">
  14. <label class="radio" wx:for="{{preList}}" wx:for-item="answer" wx:key="anserIndex"
  15. wx:if="{{item['answer'+(index+1)]}}">
  16. <view class="radio-answer">
  17. <radio color="#2d8cf0" value="{{index+1}}" checked="{{item.select==index+1}}"
  18. disabled="{{item.select>0?true:false}}">
  19. {{preList[index]}}. {{item['answer'+(index+1)]}}
  20. </radio>
  21. </view>
  22. </label>
  23. </radio-group>
  24. <view class="exam-clear mt20" wx:if="{{item.select>0}}">
  25. <view class="exam-extend-item">
  26. 答题结果:
  27. <text class="question-answer-right question-answer-result" wx:if="{{item.select==item.result}}">正确
  28. </text>
  29. <text class="question-answer-error question-answer-result" wx:else>错误</text>
  30. </view>
  31. <view class="exam-extend-item">
  32. 正确答案:
  33. <text wx:if="{{item.type==2}}"> {{preList[item.result-1]}}</text>
  34. </view>
  35. </view>
  36. </view>
  37. </i-cell>
  38. <!-- 多选题 -->
  39. <i-cell wx:if="{{item.type==3}}">
  40. <view>
  41. <rich-text nodes="{{index+1}}.[多]{{item.title}}" />
  42. <checkbox-group class="checkbox-answer" style="margin-top:30rpx" bindchange="checkboxChange"
  43. data-index="{{index}}">
  44. <label class="checkbox" wx:for="{{preList}}" wx:for-item="answer" wx:key=""
  45. wx:if="{{item['answer'+(index+1)]}}">
  46. <view class="checkbox-answer">
  47. <checkbox color="#2d8cf0" value="{{index+1}}" disabled="{{!!item._select}}"
  48. checked="{{filter.isSelect(index+1,item.select)}}">
  49. {{answer}}. {{item['answer'+(index+1)]}}
  50. </checkbox>
  51. </view>
  52. </label>
  53. </checkbox-group>
  54. </view>
  55. <view class="exam-clear mt20" wx:if="{{isFinish || item._select}}">
  56. <view class="exam-extend-item">
  57. 答题结果:
  58. <text class="question-answer-right question-answer-result" wx:if="{{item.select==item.result}}">正确
  59. </text>
  60. <text class="question-answer-error question-answer-result" wx:else>错误</text>
  61. </view>
  62. <view class="exam-extend-item">
  63. 正确答案:
  64. <text> {{filter.getMultResult(item.result)}}</text>
  65. </view>
  66. </view>
  67. </i-cell>
  68. <!-- 判断 -->
  69. <i-cell wx:if="{{item.type==1}}">
  70. <view>
  71. <rich-text nodes="{{index+1}}.[判]{{item.title}}" />
  72. <radio-group class="radio-answer" bindchange="radioChange" data-index="{{index}}">
  73. <label class="radio" wx:for="{{2}}" wx:for-item="answer">
  74. <view class="radio-answer">
  75. <radio color="#2d8cf0" value="{{index+1}}" checked="{{item.select==index+1}}"
  76. disabled="{{item.select>0?true:false}}">
  77. {{preList[index]}}. {{item['answer'+(index+1)]}}
  78. </radio>
  79. </view>
  80. </label>
  81. </radio-group>
  82. </view>
  83. <view class="exam-clear mt20" wx:if="{{ item.select>0}}">
  84. <view class="exam-extend-item">
  85. 答题结果:
  86. <text class="question-answer-right question-answer-result" wx:if="{{item.select==item.result}}">正确
  87. </text>
  88. <text class="question-answer-error question-answer-result" wx:else>错误</text>
  89. </view>
  90. <view class="exam-extend-item">
  91. 正确答案:
  92. <text> {{item.result==1?'正确':'错误'}}</text>
  93. </view>
  94. </view>
  95. </i-cell>
  96. </i-cell-group>
  97. </i-panel>
  98. <view wx:if="{{from==-1}}" style="text-align:center;margin-top:40rpx">
  99. <view wx:if="{{list.length>0}}">
  100. <i-button bindtap="emptyAnswer" type="primary" size="default">清空重做</i-button>
  101. </view>
  102. <view wx:else>
  103. <span>恭喜你,清空所有错题</span>
  104. </view>
  105. </view>
  106. </view>