index.wxml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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.parentId>0?'案单':'单'}}]{{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.parentId>0?'案多':'多'}}]{{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:for-index="sindex"
  45. wx:if="{{item['answer'+(sindex+1)]}}">
  46. <view class="checkbox-answer">
  47. <checkbox color="#2d8cf0" value="{{sindex+1}}" disabled="{{!!item._select}}"
  48. checked="{{filter.isSelect(sindex+1,item.select)}}">
  49. {{answer}}. {{item['answer'+(sindex+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.parentId>0?'案判':'判'}}]{{item.title}}" />
  72. <radio-group class="radio-answer" bindchange="radioChange" data-index="{{index}}">
  73. <label class="radio">
  74. <view class="radio-answer">
  75. <radio color="#2d8cf0" value="1" checked="{{item.select==1}}"
  76. disabled="{{item.select>0?true:false}}">
  77. {{item['answer1']}}
  78. </radio>
  79. </view>
  80. </label>
  81. <label class="radio">
  82. <view class="radio-answer">
  83. <radio color="#2d8cf0" value="2" checked="{{item.select==2}}"
  84. disabled="{{item.select>0?true:false}}">
  85. {{item["answer2"]}}
  86. </radio>
  87. </view>
  88. </label>
  89. </radio-group>
  90. </view>
  91. <view class="exam-clear mt20" wx:if="{{ item.select>0}}">
  92. <view class="exam-extend-item">
  93. 答题结果:
  94. <text class="question-answer-right question-answer-result" wx:if="{{item.select==item.result}}">正确
  95. </text>
  96. <text class="question-answer-error question-answer-result" wx:else>错误</text>
  97. </view>
  98. <view class="exam-extend-item">
  99. 正确答案:
  100. <text> {{item.result==1?'正确':'错误'}}</text>
  101. </view>
  102. </view>
  103. </i-cell>
  104. </i-cell-group>
  105. </i-panel>
  106. <view wx:if="{{from==-1}}" style="text-align:center;margin-top:40rpx">
  107. <view wx:if="{{list.length>0}}">
  108. <i-button bindtap="emptyAnswer" type="primary" size="default">清空重做</i-button>
  109. </view>
  110. <view wx:else>
  111. <span>恭喜你,清空所有错题</span>
  112. </view>
  113. </view>
  114. </view>