index.wxml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <wxs module="filter" src="../../../wxs/exam-fun.wxs"></wxs>
  2. <view class="exam-page p10">
  3. <view class="view-wrap">
  4. <view class="exam-count-down">{{remainTimeStr}}</view>
  5. </view>
  6. <view class="view-wrap-hidden">
  7. </view>
  8. <i-panel i-class="exam-panel-title">
  9. <i-cell-group i-class="exam-cell">
  10. <!-- 单选题 -->
  11. <i-cell wx:if="{{item.type==2}}">
  12. <view>
  13. <rich-text nodes="{{item.index+1}}、[单]{{item.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" wx:if="{{item['answer'+(index+1)]}}">
  16. <view class="radio-answer">
  17. <radio color="#2d8cf0" value="{{index+1}}" checked="{{item.select==index+1}}">
  18. {{answer}}. {{item['answer'+(index+1)]}}
  19. </radio>
  20. </view>
  21. </label>
  22. </radio-group>
  23. </view>
  24. </i-cell>
  25. <!-- 多选题 -->
  26. <i-cell wx:if="{{item.type==3}}">
  27. <view>
  28. <rich-text nodes="{{item.index+1}}、 [多]{{item.title}}"></rich-text>
  29. <checkbox-group class="checkbox-answer" style="margin-top:10rpx" bindchange="checkboxChange">
  30. <label class="checkbox" wx:for="{{preList}}" wx:key="index" wx:for-item="answer" wx:if="{{item['answer'+(index+1)]}}">
  31. <view class="checkbox-answer">
  32. <checkbox color="#2d8cf0" value="{{index+1}}" checked="{{filter.isSelect( index+1, item.select)}}">
  33. {{answer}}. {{item['answer'+(index+1)]}}
  34. </checkbox>
  35. </view>
  36. </label>
  37. </checkbox-group>
  38. </view>
  39. </i-cell>
  40. <!-- 判断 -->
  41. <i-cell wx:if="{{item.type==1}}">
  42. <view>
  43. <rich-text nodes="{{item.index+1}}、[判]{{item.title}}" />
  44. <radio-group class="radio-answer" bindchange="radioChange" data-index="{{index}}">
  45. <label class="radio" wx:for="{{2}}" wx:for-item="answer">
  46. <view class="radio-answer">
  47. <radio color="#2d8cf0" value="{{index+1}}" checked="{{item.select==index+1}}">
  48. {{preList[index]}}. {{item['answer'+(index+1)]}}
  49. </radio>
  50. </view>
  51. </label>
  52. </radio-group>
  53. </view>
  54. </i-cell>
  55. <i-cell wx:if="{{item.type==4}}">
  56. <view>
  57. <rich-text nodes="{{item.index+1}}、[案例]{{item.title}}" />
  58. <i-cell-group i-class="exam-cell" wx:for="{{item.child}}" wx:for-item="child" wx:key="answerId" wx:for-index="cid">
  59. <!-- 案例单选题 -->
  60. <i-cell wx:if="{{child.type==2}}">
  61. <view>
  62. <rich-text nodes="{{cid+1}}、[单]{{child.title}}" />
  63. <radio-group class="radio-answer" bindchange="radioChange" data-index="{{index}}" data-cid="{{cid}}">
  64. <label class="radio" wx:for="{{preList}}" wx:for-item="answer" wx:key="anserIndex" wx:if="{{child['answer'+(index+1)]}}">
  65. <view class="radio-answer">
  66. <radio color="#2d8cf0" value="{{index+1}}" checked="{{child.select==index+1}}">
  67. {{answer}}. {{child['answer'+(index+1)]}}
  68. </radio>
  69. </view>
  70. </label>
  71. </radio-group>
  72. </view>
  73. </i-cell>
  74. <!-- 案例多选题 -->
  75. <i-cell wx:if="{{child.type==3}}">
  76. <view>
  77. <rich-text nodes="{{cid+1}}、 [多]{{child.title}}"></rich-text>
  78. <checkbox-group class="checkbox-answer" style="margin-top:10rpx" data-cid="{{cid}}" bindchange="checkboxChange">
  79. <label class="checkbox" wx:for="{{preList}}" wx:key="index" wx:for-item="answer" wx:if="{{child['answer'+(index+1)]}}">
  80. <view class="checkbox-answer">
  81. <checkbox color="#2d8cf0" value="{{index+1}}" checked="{{filter.isSelect( index+1, child.select)}}">
  82. {{answer}}. {{child['answer'+(index+1)]}}
  83. </checkbox>
  84. </view>
  85. </label>
  86. </checkbox-group>
  87. </view>
  88. </i-cell>
  89. <!-- 案例判断 -->
  90. <i-cell wx:if="{{child.type==1}}">
  91. <view>
  92. <rich-text nodes="{{cid+1}}、[判]{{child.title}}" />
  93. <radio-group class="radio-answer" bindchange="radioChange" data-index="{{index}}" data-cid="{{cid}}">
  94. <label class="radio" wx:for="{{2}}" wx:for-item="answer">
  95. <view class="radio-answer">
  96. <radio color="#2d8cf0" value="{{index+1}}" checked="{{child.select==index+1}}">
  97. {{preList[index]}}. {{child['answer'+(index+1)]}}
  98. </radio>
  99. </view>
  100. </label>
  101. </radio-group>
  102. </view>
  103. </i-cell>
  104. </i-cell-group>
  105. </view>
  106. </i-cell>
  107. </i-cell-group>
  108. <view class="tc">
  109. <button type="primary" size="mini" bindtap='nextAnswer'>下一题</button>
  110. <button type="primary" size="mini" bindtap='dosubmit' class="ml20">交卷</button>
  111. </view>
  112. </i-panel>
  113. </view>
  114. <view class="bg-white p20">
  115. <i-row>
  116. <i-col wx:for="{{info.answers}}" style="float:left;width:12%;text-align:center" wx:key="item.id">
  117. <view class="item-select {{filter.isExamSelect(index, info)}} " bindtap="selectquestion" data-index="{{index}}"> {{index+1}} </view>
  118. </i-col>
  119. </i-row>
  120. </view>
  121. <i-modal title="考试结果" visible="{{modalShow}}" bind:ok="returnRecord" bind:cancel="returnRecord">
  122. <view>我的战绩:{{score}}分 </view>
  123. </i-modal>
  124. <i-action-sheet visible="true" visible="{{timeOutShow}}" mask-closable="{{ false }}">
  125. <view slot="header" style="padding: 16px">
  126. <view class="exam-timeout-title">考试试卷结束,请提交试卷!</view>
  127. <button class="i-btn i-btn-primary i-btn-square" bindtap='dosubmit'>提交</button>
  128. </view>
  129. </i-action-sheet>