<?php
/**available variables:
 * quiz_data = users finished quizzes
 * selected_tid = current selected tid
 */
?>

<?php if (!empty($quiz_data)): ?>
  <h2><?= t("Aktualny stan punktów"); ?>:</h2>
  <div class="points-result">
    <div class="points-result row init">
      <div class="left col-md-2">
        <span><?= t("Punkty"); ?></span>
      </div>
      <div class="middle col-md-6">
        <span><?= t("Nazwa testu"); ?></span>
      </div>
      <div class="right col-md-4">
        <span><?= t("Data"); ?></span>
      </div>
    </div>
    <?php
    $i = 1;
    foreach ($quiz_data as $quiz_key => $quiz): ?>
      <div class="row row-<?= $i; ?>">
        <div class="left col-md-2">
          <span><?= $quiz['points']; ?></span>
        </div>
        <div class="middle col-md-6">
          <span><?= $quiz['title']; ?></span>
        </div>
        <div class="right col-md-4">
          <?php if ($quiz['date'] != NULL):
            $date = date("d.m.Y - H:i", $quiz['date']);
            ?>
            <span><?= $date; ?></span>
          <?php endif; ?>
        </div>
      </div>
      <?php
      $i++;
    endforeach; ?>
    <?php if ($pager != ''): ?>
      <div class="pager">
        <?= $pager; ?>
      </div>
    <?php endif; ?>
  </div>
<?php else: ?>
  <div class="row no-results">

  </div>
<?php endif; ?>

