<!--测试题目结果-->
<!--测试页面-->
<ion-header>
  <ion-navbar>
    <ion-title>学习测试</ion-title>
  </ion-navbar>
</ion-header>

<ion-content>
  <div class="main-container">
    <ion-slides (ionSlideDidChange)="slideChanged()">
      <ion-slide *ngFor="let item of list;let i = index">
        <div class="learn-item">
          <div class="learn-title">{{title}}</div>
          <div class="item-container">
            <div class="item-title">
              <!--判断题目类型-->
                  <p>
                    <span class="color-red" *ngIf="item.isAns == 1">*</span>{{i +1}}、
                    <span *ngIf="item.questionType == 1">(单选)</span>
                    <span *ngIf="item.questionType == 2">(多选)</span>
                    <span *ngIf="item.questionType == 3">(填空)</span>
                    <span *ngIf="item.questionType == 4">(判断)</span>
                    <span *ngIf="item.questionType == 5">(问答)</span>
                    {{item.questionContent}}
                  </p>
            </div>
            <div class="ans-tips">
              <span *ngIf="item.result == 1" class="ans-green">回答正确</span>
              <span *ngIf="item.result == 0" class="ans-red">回答错误</span>
              <span *ngIf="item.questionType == 1 || item.questionType == 2 || item.questionType == 4" class="margin-left-20">您的答案：{{item.myAnswer}}</span>
            </div>
            <div class="item-content">
              <div class="padding-0-30">
                <!--单选题-->
                <ng-container *ngIf="item.questionType == 1">
                  <ng-container *ngFor=" let option1 of item.options;let optIndex = index;">
                    <p>
                      <label>
                        <input [(ngModel)]="item.answer" disabled type="radio" [value]="option1.option" [name]="item.questionId">
                        <span class="selectIndex" [ngClass]="{'select-right' : option1.answer == 'right',
                        'select-error':option1.answer == 'error'}">{{option1.option}}</span>&nbsp;&nbsp;
                        {{option1.comment}}
                      </label>
                    </p>
                  </ng-container>
                </ng-container>
                <!--多选题-->
                <ng-container *ngIf="item.questionType == 2">
                  <ng-container *ngFor=" let option2 of item.options;let quesIndex = index;">
                    <p>
                      <label>
                        <input disabled type="checkbox" (change)="mutiSelect(i,option2.option)" [value]="quesIndex" [name]="item.questionId">
                        <span class="selectIndex" [ngClass]="{'select-right' : option2.answer == 'right',
                        'select-error':option2.answer == 'error'}">{{option2.option}}</span>&nbsp;&nbsp;
                        {{option2.comment}}
                      </label>
                    </p>
                  </ng-container>
                </ng-container>
                <!--填空-->
                <ng-container *ngIf="item.questionType == 3">
                  <textarea disabled [(ngModel)]="item.myAnswer" class="content-textarea"></textarea>
                  <div class="border  margin-top-20 padding-10">
                    正确答案：{{item.correctAnswer}}
                  </div>
                </ng-container>
                <!--判断题-->
                <ng-container *ngIf="item.questionType == 4">
                  <p>
                    <label>
                      <input disabled [(ngModel)]="item.answer" [name]="item.questionQueId" value="A" type="radio">
                      <span class=" selectIndex">A</span>&nbsp;&nbsp;
                      是
                    </label>
                  </p>
                  <p>
                    <label>
                      <input disabled [(ngModel)]="item.answer" [name]="item.questionQueId" value="B" type="radio">
                      <span class=" selectIndex">B</span>&nbsp;&nbsp;
                      否
                    </label>
                  </p>
                </ng-container>
                <!--问答-->
                <ng-container *ngIf="item.questionType == 5">
                  <textarea [(ngModel)]="item.answer" disabled class="content-textarea"></textarea>
                  <div class="border margin-top-20 padding-10">
                    正确答案：{{item.correctAnswer}}
                  </div>
                </ng-container>
              </div>
            </div>
          </div>
        </div>
      </ion-slide>
    </ion-slides>
  </div>
  <div class="footer-subject">
    <div (click)="prev()" class="prev">上一题</div>
    <div class="index">{{index +1}} / {{list.length}}</div>
    <div (click)="next()" class="next">下一题</div>
  </div>
  <div class="footer-submit">
    <div class="time">答题得分&nbsp;&nbsp;{{score}}分</div>
    <div class="submit" (click)="lookError()">
      <span>只看错题</span>
    </div>
  </div>
</ion-content>

