<wxs module="filter" src="../../../wxs/exam-fun.wxs"></wxs>
<view class="exam-page">
  <view class="view-wrap-hidden">
  </view>
  <view>
    <view class="exam-name-title">
      <h1>{{info.title}}</h1>
    </view>

    <view class="exam-result mt50">
      <h1 class=""> 试卷结果: {{info.correct}}/{{info.counter}}</h1>
      <h1 class="exam-result-detail">试卷耗时: {{info.useTime}}秒</h1>
    </view>

    <i-panel  wx:for="{{answers}}"  wx:for-item="item"   wx:key="answerId"  i-class="exam-panel-title">   
      <i-cell-group i-class="exam-cell">
          <!-- 单选题 -->
          <i-cell wx:if="{{item.type==1}}"> 
            <view>
              <rich-text nodes="{{index+1}}.[单]{{item.title}}" />
              <radio-group class="radio-answer" >
                <label class="radio" wx:for="{{preList}}" wx:for-item="answer" 
                  wx:key="anserIndex" wx:if="{{item['answer'+(index+1)]}}"  >
                  <view class="radio-answer">
                    <radio color="#2d8cf0" value="{{index+1}}" checked="{{item.select==index+1}}" disabled>
                      {{answer}}. {{item['answer'+(index+1)]}}
                    </radio>
                  </view>
                </label>
              </radio-group>
            </view>
          </i-cell>
          <!-- 多选题 -->
          <i-cell wx:if="{{item.type==2}}"> 
            <view >
              <text> {{index+1}}. [多]{{item.title}} </text>
              <checkbox-group class="checkbox-answer" style="margin-top:30rpx" >
                <label class="checkbox" wx:for="{{preList}}" wx:for-item="answer" wx:key="index"  wx:if="{{item['answer'+(index+1)]}}" >
                  <view class="checkbox-answer">
                    <checkbox color="#2d8cf0" value="{{index+1}}" checked="{{filter.isSelect(index,item.select)}}" disabled>
                      {{answer}}. {{item['answer'+(index+1)]}}
                    </checkbox>
                  </view>
                </label>
              </checkbox-group>
            </view>
          </i-cell>
          <!-- 判断 -->
          <i-cell wx:if="{{item.type==3}}"> 
            <view>
              <rich-text nodes="{{index+1}}.[判]{{item.title}}" />
              <radio-group class="radio-answer"  >
                <label class="radio" wx:for="{{2}}" wx:for-item="answer" wx:key="answerIndex" >
                  <view class="radio-answer">
                    <radio color="#2d8cf0" value="{{index+1}}" checked="{{item.select==index+1}}" disabled>
                      {{preList[index]}}. {{item['answer'+(index+1)]}}
                    </radio>
                  </view>
                </label>
              </radio-group>
            </view>
          </i-cell>

          <view class="exam-clear">
            <view class="exam-extend-item" style="padding-left:0px">
              结果:
              <text class="question-answer-right question-answer-result" 
                wx:if="{{item.select==item.result}}">正确
              </text>
              <text class="question-answer-error question-answer-result"
               wx:else>错误</text>
            </view>

            <view class="exam-extend-item" style="padding-left:0px" wx:if="{{item.star}}">
              难度:
              <i-rate value="{{item.star}}" i-class="exam-item-rate" />
            </view>

            <view class="exam-extend-item" wx:if="{{item.content}}">
              <rich-text nodes="解析: {{item.content}}" />
            </view>

            <view class="exam-extend-item">
              <text wx:if="{{item.type==1}}"> 正确答案: {{preList[item.result-1]}}</text>
              <text wx:elif="{{item.type==2}}"> 正确答案: {{filter.getMultResult(item.result)}}</text>
              <text wx:else> 正确答案: {{item.result==1?'正确':'错误'}}</text>
            </view>
          </view>
      </i-cell-group>
    </i-panel>

    <i-spin size="large" fix wx:if="{{ spinShow }}"></i-spin>
    <i-message id="message" />
  </view>
</view>