<?php

/**
 * @file
 * Radix theme implementation to display a node.
 *
 * @see template_preprocess()
 * @see template_preprocess_node()
 * @see template_process()
 *
 * @ingroup themeable
 */
?>
<article class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
  <div class="col-md-4 col-sm-4 col-xs-12">
    <?= render($content['field_image']); ?>
  </div>
  <div class="col-md-4 col-sm-4 col-xs-12 quiz-page-details">
    <?= render($content['field_category']); ?>
    <?= render($content['body']); ?>
    <?= render($content['field_max_points']); ?>
  </div>
  <div class="col-md-4 col-xs-12 col-sm-4">
    <?= $content['stats']['#markup']; ?>
  </div>
  <div class="col-xs-12 text-center">
    <?php if (isset($content['field_instruction'])): ?>
      <?php if(strlen($content['field_instruction'][0]['#markup']) > 20): ?>
        <a type="button" class="btn btn-lg btn-primary education-content" data-toggle="modal" data-target="#quiz-introduction"><?= t('Treść edukacyjna'); ?></a>
      <?php endif ;?>
    <?php endif; ?>
    <?php
      $form = drupal_get_form('bigw_quiz_take_form', $content);
      print drupal_render($form);
    ?>
  </div>
</article>
<div class="modal fade" id="quiz-introduction" tabindex="-1" role="dialog" aria-labelledby="quiz-introduction-label">
  <div class="modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
      </div>
      <div class="modal-body">
        <?= render($content['field_instruction']); ?>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default btn-lg" data-dismiss="modal"><?= t('Ok'); ?></button>
      </div>
    </div>
  </div>
</div>