answer.wxml 4.5 KB

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