vmesel/PyJobs

View on GitHub
pyjobs/assessment/templates/quiz_index.html

Summary

Maintainability
Test Coverage
{% extends 'base.html' %}
{% load i18n %}
{% load static %}
{% load humanize %}

{%block metas%}
<meta property="og:image" content="{% url 'quiz_thumbnail' assessment.slug %}" />
<meta property="og:title" content="{{ assessment.name }} {% blocktranslate %}no{% endblocktranslate %} {{WEBSITE_NAME}} | {{WEBSITE_NAME}}" />
<meta property="og:locale" content="pt_BR" />
<meta property="og:description" content="{{assessment.description|truncatechars:240}}}" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta content="{{assessment.description|truncatechars:240}}}" name="description"/>
<meta name="description" content="{{assessment.description|truncatechars:240}}}"/>
<title>{{ assessment.name }} {% blocktranslate %}no{% endblocktranslate %} {{WEBSITE_NAME}}</title>
<meta name="twitter:description" content="{{assessment.description|truncatechars:250}}}"/>
<meta property="og:site_name" content="{{WEBSITE_NAME}}" />
{% endblock %}

{%block main%}
    <div class="container" style="min-height: 100vh; padding-top: 50px;">
        <h2 style="text-align: center; font-weight: bold;">{{assessment.name}}</h2>
        <h3 style="font-size: 18px;">{% blocktranslate %}Categoria:{% endblocktranslate %} <span style="font-weight: bold;">{{ assessment.theme.name }}</span></h3>
        <hr/>
        <h3 style="font-size: 18px;">{% blocktranslate %}Descrição:{% endblocktranslate %}</h3>
        <p style="margin-top: 20px">
            {{ assessment.description }}
        </p>
        {% if request.user.is_authenticated %}
        {% if started_answering and not finished %}
            <a href="{% url 'question_page' assessment.slug %}">
                <input type="button" class="botao" value="{% translate 'Continuar Respondendo' %}" style="margin-top: 20px;">
            </a>
        {% elif started_answering and finished %}
            <a href="{% url 'question_page' assessment.slug %}">
                <input type="button" class="botao" value="{% translate 'Ver resultado' %}" style="margin-top: 20px;">
            </a>
        {% else %}
        <a href="{% url 'question_page' assessment.slug %}">
            <input type="button" class="botao" value="{% translate 'Começar o Quiz' %}" style="margin-top: 20px;">
        </a>
        {% endif %}
        {% else %}
            <a href="{% url 'login' %}">
                <input type="button" class="botao" value="{% translate 'Se Logue na Plataforma' %}" style="margin-top: 20px;">
            </a>
        {% endif %}
        {% if assessment.public %}
        <center>
            <table style="width: 500px; margin-top: 50px;">
                <thead>
                <tr style="background-color: #00d1bd; border-bottom: 1px solid #000; color: #fff;">
                    <th style="width: 50%; text-align: center; font-size: 18px;">{% translate 'Usuário' %}</th>
                    <th style="width: 50%; text-align: center; font-size: 18px;">{% translate 'Pontuação' %}</th>
                </tr>
                </thead>
                {% for candidate_answer in quiz_ranking %}
                    <tr style="border-bottom: 1px solid #000;">
                        <td style="width: 50%; text-align: center; font-size: 18px;">{{candidate_answer.user__username}}</td>
                        <td style="width: 50%; text-align: center; font-size: 18px;">{{candidate_answer.points}}%</td>
                    </tr>
                {% endfor %}
                </table>
        </center>
    {% endif %}
    </div>
{%endblock%}