aboutsummaryrefslogtreecommitdiffhomepage
path: root/services/app/templates/answer_view.html.twig
blob: 24b5a1c3a7f2bf47565ff74bde0e075ac1f523f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{% extends '_page.html.twig' %}

{% block content %}
  <nav>
    <ol class="breadcrumb">
      <li class="breadcrumb-item"><a href="{{ url_for('quiz_list') }}">問題一覧</a></li>
      <li class="breadcrumb-item"><a href="{{ url_for('quiz_view', { qslug: quiz.slug }) }}">{{ quiz.title }}</a></li>
      <li class="breadcrumb-item"><a href="{{ url_for('answer_list', { qslug: quiz.slug }) }}">回答一覧</a></li>
      <li class="breadcrumb-item active">#{{ answer.answer_number }}</li>
    </ol>
  </nav>

  <h2>{{ quiz.title }}</h2>
  <p>
    {{ quiz.description }}
  </p>
  <h2>回答 #{{ answer.answer_number }}</h2>
  <p>
    {{ answer.author_name }} が {{ answer.submitted_at|date('Y-m-d H:i:s', 'Asia/Tokyo') }} に投稿
  </p>
  <h2>コード</h2>
  <p>
    {{ answer.code_size }} byte
  </p>
  <pre><code class="hljs language-php">{{ answer.code }}</code></pre>
  <h2>実行結果</h2>
  <div class="js-phper-token">
    {% if phper_token %}
      <div class="alert alert-success">
        バーディー! {{ phper_token }}
      </div>
    {% endif %}
  </div>
  <div class="mt-3">
    ステータス: <span class="js-aggregated-execution-status" data-answer-id="{{ answer.answer_id }}">{{ answer.execution_status.label() }}</span>
    {% if answer.execution_status.showLoadingIndicator() %}
      <div class="js-aggregated-execution-status-loading-indicator spinner-border text-primary spinner-border-sm" role="status"><span class="visually-hidden">Loading...</span></div>
    {% endif %}
  </div>
  <div class="mt-3">
    <table class="table table-striped table-bordered">
      <thead>
        <tr>
          <th>テストケース</th>
          <th>ステータス</th>
        </tr>
      </thead>
      <tbody>
        {% for ex in testcase_executions %}
          <tr>
            <td>{{ loop.index }}</td>
            <td>
              <span class="js-testcase-execution-status" data-testcase-execution-id="{{ ex.testcase_execution_id }}">{{ ex.status.label() }}</span>
              {% if ex.status.showLoadingIndicator() %}
                <span class="js-testcase-execution-status-loading-indicator spinner-border text-primary spinner-border-sm" role="status" data-testcase-execution-id="{{ ex.testcase_execution_id }}"><span class="visually-hidden">Loading...</span></span>
              {% endif %}
            </td>
          </tr>
        {% endfor %}
      </tbody>
    </table>
  </div>
  <script type="module" src="{{ base_path() }}/assets/loading.js"></script>
{% endblock %}