index.wxml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <wxs module="filter" src="../../../wxs/exam-fun.wxs"></wxs>
  2. <view class="exam-page">
  3. <view class="view-wrap">
  4. <view class="exam-count-down" wx:if="{{isFinish}}">已经交卷</view>
  5. <view class="exam-count-down" wx:else>{{remainTimeStr}}</view>
  6. </view>
  7. <view class="view-wrap-hidden">
  8. </view>
  9. <view>
  10. <view class="exam-name-title">
  11. <h1>{{info.title}}</h1>
  12. </view>
  13. <form bindsubmit='formSubmit'>
  14. <i-panel title="{{titleItem.title}}"
  15. wx:for="{{list}}"
  16. wx:for-item="item"
  17. wx:key="answerId"
  18. i-class="exam-panel-title">
  19. <i-cell-group i-class="exam-cell">
  20. <!-- 单选题 -->
  21. <i-cell wx:if="{{item.type==2}}">
  22. <view class="single">
  23. <rich-text nodes="{{index+1}}.[单]{{item.title}}" />
  24. <radio-group class="radio-answer" bindchange="radioChange" data-index="{{index}}" >
  25. <label class="radio" wx:for="{{preList}}" wx:for-item="answer" wx:key="anserIndex" wx:if="{{item['answer'+(index+1)]}}">
  26. <view class="radio-answer">
  27. <radio color="#2d8cf0" value="{{index+1}}" checked="{{item.select==index+1}}" disabled="{{item.select>0?true:false}}" >
  28. {{preList[index]}}. {{item['answer'+(index+1)]}}
  29. </radio>
  30. </view>
  31. </label>
  32. </radio-group>
  33. <view class="exam-clear mt20" wx:if="{{isFinish || item.select>0}}" >
  34. <view class="exam-extend-item" >
  35. 答题结果:
  36. <text class="question-answer-right question-answer-result"
  37. wx:if="{{item.select==item.result}}">正确
  38. </text>
  39. <text class="question-answer-error question-answer-result"
  40. wx:else>错误</text>
  41. </view>
  42. <view class="exam-extend-item">
  43. 正确答案:
  44. <text wx:if="{{item.type==2}}"> {{preList[item.result-1]}}</text>
  45. </view>
  46. </view>
  47. </view>
  48. </i-cell>
  49. <!-- 多选题 -->
  50. <i-cell wx:if="{{item.type==3}}">
  51. <view >
  52. <rich-text nodes="{{index+1}}.[多]{{item.title}}" />
  53. <checkbox-group class="checkbox-answer" style="margin-top:30rpx" bindchange="checkboxChange" data-index="{{index}}">
  54. <label class="checkbox" wx:for="{{preList}}" wx:for-item="answer" wx:if="{{item['answer'+(index+1)]}}">
  55. <view class="checkbox-answer">
  56. <checkbox color="#2d8cf0" value="{{index+1}}" disabled="{{!!item._select}}">
  57. {{answer}}. {{item['answer'+(index+1)]}}
  58. </checkbox>
  59. </view>
  60. </label>
  61. </checkbox-group>
  62. </view>
  63. <view class="exam-clear mt20" wx:if="{{isFinish || item._select}}">
  64. <view class="exam-extend-item" >
  65. 答题结果:
  66. <text class="question-answer-right question-answer-result"
  67. wx:if="{{item.select==item.result}}">正确
  68. </text>
  69. <text class="question-answer-error question-answer-result"
  70. wx:else>错误</text>
  71. </view>
  72. <view class="exam-extend-item">
  73. 正确答案:
  74. <text> {{filter.getMultResult(item.result)}}</text>
  75. </view>
  76. </view>
  77. </i-cell>
  78. <!-- 判断 -->
  79. <i-cell wx:if="{{item.type==1}}">
  80. <view>
  81. <rich-text nodes="{{index+1}}.[判]{{item.title}}" />
  82. <radio-group class="radio-answer" bindchange="radioChange" data-index="{{index}}" >
  83. <label class="radio" wx:for="{{2}}" wx:for-item="answer" >
  84. <view class="radio-answer">
  85. <radio color="#2d8cf0" value="{{index+1}}" checked="{{item.select==index+1}}" disabled="{{item.select>0?true:false}}" >
  86. {{preList[index]}}. {{item['answer'+(index+1)]}}
  87. </radio>
  88. </view>
  89. </label>
  90. </radio-group>
  91. </view>
  92. <view class="exam-clear mt20" wx:if="{{isFinish || item.select>0}}" >
  93. <view class="exam-extend-item" >
  94. 答题结果:
  95. <text class="question-answer-right question-answer-result"
  96. wx:if="{{item.select==item.result}}">正确
  97. </text>
  98. <text class="question-answer-error question-answer-result"
  99. wx:else>错误</text>
  100. </view>
  101. <view class="exam-extend-item">
  102. 正确答案:
  103. <text> {{item.result==1?'正确':'错误'}}</text>
  104. </view>
  105. </view>
  106. </i-cell>
  107. </i-cell-group>
  108. </i-panel>
  109. <view>
  110. <button class="i-btn i-btn-primary i-btn-square" form-type='submit' disabled="{{!!isFinish}}">提交</button>
  111. </view>
  112. <i-action-sheet visible="true" visible="{{timeOutShow}}" mask-closable="{{ false }}">
  113. <view slot="header" style="padding: 16px">
  114. <view class="exam-timeout-title">考试试卷结束,请提交试卷!</view>
  115. <button class="i-btn i-btn-primary i-btn-square" form-type='submit'>提交</button>
  116. </view>
  117. </i-action-sheet>
  118. </form>
  119. <i-modal title="考试结果" visible="{{modalShow}}" bind:ok="returnRecord" bind:cancel="returnRecord">
  120. <view>我的分数:{{result.correct}} </view>
  121. </i-modal>
  122. <i-spin size="large" fix wx:if="{{ spinShow }}"></i-spin>
  123. <i-message id="message" />
  124. </view>
  125. </view>