<div class="wrapper">
  <div class="wrapper-add">
    <div class="container">
      <h2>Pytanie jednokrotnego wyboru</h2>
      <br />
      <div>
        <label class="block">
          <p>Określ liczbę punktów do zdobycia:</p>
          <input type="number" step="1" min="1" name="points" class="form-control" [(ngModel)]="points" required />
        </label>
        <label class="block">
          <p>Wprowadź treść pytania:</p>
          <input type="text" name="question" class="form-control" [(ngModel)]="question"/>
        </label>
        <label class="block">
          <p>Podaj czas na udzielenie odpowiedzi w sekundach (0 - brak limitu):</p>
          <input type="number" step="1" min="0" name="time" class="form-control" [(ngModel)]="time" required/>
        </label>
        <br />
        <label class="block">
         <input type="checkbox" name="{{ help }}" class ="check" [checked]="help" (change)="changeHelp()"/> <p> Zezwól na skorzystanie z koła ratunkowego</p>
        </label>
        <br />
        <br />
        <p>Wpisz możliwe odpowiedzi i zaznacz prawidłową:</p>
        <div>
          <div *ngFor="let answer of answersCorrect; let i = index" class="row">
            <label class="col-md-1">
              <b>OK?</b>
              <input type="checkbox" name="{{ answer.is_good }}" class="form-control" [checked]="answer.is_good" (change)="changeCheckbox(i)"/>
            </label>
            <label class="col-md-8">
              <b>Treść</b>
              <input [(ngModel)]="answer.content" class="form-control" type="text" name="{{ answer.content }}"/>
            </label>
            <div class="col-md-3">
              <b>Akcja</b>
              <br />
              <button class="button min" type="button" (click)="deleteFieldValue(i)"><i class="fas fa-trash-alt"></i> Usuń</button>
            </div>
          </div>
          <br />
          <div class="row">
            <label class="col-md-1">
              <b>OK?</b>
              <input type="checkbox" name="{{ newAttribute.is_good }}" class="form-control" [checked]="newAttribute.is_good" (change)="changeCheckbox2($event)" />
            </label>
            <label class="col-md-8">
              <b>Treść</b>
              <input type="text" name="{{ newAttribute.content }}" class="form-control" [(ngModel)]="newAttribute.content"/>
            </label>
            <div class="col-md-3">
              <b>Akcja</b>
              <br />
              <button class="button min" type="button" (click)="addFieldValue()"><i class="fas fa-check-circle"></i> Dodaj</button>
            </div>
          </div>
        </div>
        <br />
        <br />
        <button *ngIf='!edit' class="button max" type="submit" (click)="addTable()"><i class="fas fa-check-circle"></i> Dodaj pytanie!</button>
        <button *ngIf='edit' class="button max" type="submit" (click)="addTable()"><i class="fas fa-edit"></i> Edytuj pytanie!</button>
        <br />
        <button class="button" (click)="empty()"><i class="fas fa-arrow-left"></i> Powrót</button>
      </div>
    </div>
  </div>
</div>
