answer.wxml 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <view class="option">
  2. <view class='option-top'>
  3. <text class=' subtitleColor pink-bg rank'>{{rank}}/{{info.choiceQuestionNum}}</text>
  4. <text class='gray'>{{info.completeNum}}人已答</text>
  5. </view>
  6. <view class='option-title'>{{rank}}.{{info.question}}({{info.radio==0?"单选":"多选"}})</view>
  7. <view class='option-content'>
  8. <!-- 单选 -->
  9. <radio-group wx:if='{{info.radio == 0}}' class='list-block' bindchange="setAnswerChecked">
  10. <label class='align-top item-content label-radio {{info.myAnswer==item.option?"pink-bg":""}} ' wx:for="{{info.choiceOptions}}" wx:key="*this">
  11. <view class='item-media'>
  12. <radio class='radio' checked="{{item.checked}}" disabled='{{answerStatus?true:false}}' value="{{item.option}}" color="#EE3A43" /> {{item.option}}
  13. </view>
  14. <view class='item-inner'>
  15. <view wx:if='{{item.ctype=="text"}}' class='item-text'>{{item.content}}</view>
  16. <image wx:if='{{item.ctype=="image"}}' style="width: 200rpx; height: 100rpx;" mode="aspectFit" src="{{item.content}}"></image>
  17. </view>
  18. <view class='item-after'><text class='{{item.icon}}' wx:if="{{item.icon.length > 0}}"></text></view>
  19. </label>
  20. </radio-group>
  21. <!-- 多选 -->
  22. <checkbox-group wx:if='{{info.radio == 1}}' class='list-block' bindchange="setAnswerChecked">
  23. <label class='align-top item-content label-checkbox {{item.checked?"pink-bg":""}} ' wx:for="{{info.choiceOptions}}" wx:key="*this">
  24. <view class='item-media'>
  25. <checkbox class='checkbox' checked="{{item.checked}}" disabled='{{answerStatus?true:false}}' value="{{item.option}}" color="#EE3A43" /> {{item.option}}
  26. </view>
  27. <view class='item-inner'>
  28. <view wx:if='{{item.ctype=="text"}}' class='item-text'>{{item.content}}</view>
  29. <image
  30. wx:if='{{item.ctype=="image"}}'
  31. style="width: 200rpx; height: 100rpx;"
  32. mode="aspectFit"
  33. src="{{item.content}}"
  34. ></image>
  35. </view>
  36. <view class='item-after'><text class='{{item.icon}}' wx:if="{{item.icon.length > 0}}"></text></view>
  37. </label>
  38. </checkbox-group>
  39. </view>
  40. </view>
  41. <view class='buttons-row buttons-gutter'>
  42. <button class='button button-radius {{answerStatus && rank == 1?"button-light":"button-warn"}}' bindtap='{{!answerStatus?info.myAnswer.length>0?"submitAnswer":"":"changeQuestion"}}' data-rank='{{info.rank-1}}'>{{answerStatus?"上一题":"确认"}}</button>
  43. <button class='button button-radius {{answerStatus?"button-warn":"button-light"}}' data-mark='next' bindtap='{{answerStatus?info.rank==info.choiceQuestionNum?"complete":"changeQuestion":""}}' data-rank='{{info.rank+1}}'>{{info.rank==info.choiceQuestionNum?"完成":"下一题"}}</button>
  44. </view>
  45. <view class='answer' hidden='{{!answerStatus}}'>
  46. <view class='font12 subtitleColor'>正确答案:{{info.answer}}</view>
  47. <view class='font12 answer-detail'>{{info.explain?info.explain:"暂无答案"}}</view>
  48. </view>
  49. <alert show="{{alertStatus}}" _CONFIG_="{{alert}}" bind:close="close" />