<?php
/**available variables:
 * quiz_data = taxonomy term number of users on stage node title
 */
?>
<?php if (!empty($quiz_data)): ?>
  <span><?= t('Ilość osób na poszczególnych etapach zadań'); ?></span>
<?php endif; ?>
<div class="container">
  <?php foreach ($quiz_data as $quiz_data_taxonomy => $quiz_taxonomy): ?>
    <table class="table table-bordered">
      <thead>
      <tr>
        <th><?= t('Quiz'); ?></th>
        <?php foreach ($quiz_taxonomy as $quiz_weight => $quiz_single_data): ?>
          <?php foreach ($quiz_single_data as $quiz_key => $quiz): ?>
            <th><?= $quiz['stage']; ?></th>
          <?php endforeach; ?>
        <?php endforeach; ?>
      </tr>
      </thead>
      <tbody>
      <tr>
        <th><?= $quiz_data_taxonomy; ?></th>
        <?php foreach ($quiz_taxonomy as $quiz_weight => $quiz_single_data): ?>
          <?php foreach ($quiz_single_data as $quiz_key => $quiz): ?>
            <th><?= $quiz['users_on_stage']; ?></th>
          <?php endforeach; ?>
        <?php endforeach; ?>
      </tr>
      </tbody>
    </table>
  <?php endforeach; ?>
</div>
