{# This file is part of INGInious. See the LICENSE and the COPYRIGHTS files for #}
{# more information about the licensing of this file. #}
{% extends "layout.html" %}
{% block title %}{{ course.get_name(session.language) }}{% endblock %}
{% block head %}
{{ super() }}
{% endblock %}
{% block column %}
{% with current='stats' %}{% include 'course_admin/menu.html' %}{% endwith %}
{% endblock %}
{% set is_admin = user_manager.has_admin_rights_on_course(course) %}
{% block navbar %}
{% endblock %}
{% block content %}
{% with target="stats#alerts", is_stats=True %}
{% include "course_admin/submissions_query.html" %}
{% endwith %}
{% for msg in msgs %}
{{msg}}
{% endfor %}
{{_("Global statistics")}}
{{_("Submissions statistics")}}
{% for stat in stats_global[0] %}
{{ stat[0] }}
{{ stat[1] }}
{% endfor %}
{% if stats_global|length >= 2 and stats_global[1]|length > 0 %}
{{ _("Tag statistics") }}
{{ _("Tag") }}
{{ _("All submissions") }}
{{ _("Best submissions") }}
{% for (tag, v_total, v_best) in stats_global[1] %}
{% set color = "badge alert-danger" if tag.is_misconception() else "badge alert-info" %}
{{ _(tag.get_name(session.language)) }}
{# The number of decimal digits. (10 for 1 decimal, 100 for two decimals, ...) #}
{% set accuracy = 10 %}
{% set val_displayed_total = ((v_total*accuracy)|int)/accuracy %}
{% set val_displayed_best = ((v_best*accuracy)|int)/accuracy %}
{# If the displayed value is 0 but in fact the value is not 0 (e.g. 0.00001), we display the '>' character because we need to know that there is at least one tag True. #}
{% if val_displayed_total == 0 and v_total != 0 %}
{% set val_displayed_total = "> " + str(val_displayed_total) %}
{% endif %}
{% if val_displayed_best == 0 and v_best != 0 %}
{% set val_displayed_best = "> " + str(val_displayed_best) %}
{% endif %}