{# 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 %} {{task.get_name(user_manager.session_language()) }} - {{ course.get_name(user_manager.session_language()) }}{% endblock %} {% set registered = user_manager.course_is_user_registered(course) %} {% set staff = user_manager.has_staff_rights_on_course(course) %} {% set task_dispenser = course.get_task_dispenser() %} {% block column %}

{{ _("Information") }}

{% if task.get_authors(user_manager.session_language()) %} {% endif %} {%if task.get_contact_url(user_manager.session_language()) %} {% endif %} {% if not is_lti() %} {% endif %} {% if registered or staff %} {% endif %} {% set ns = namespace(tags="") %} {% set task_categories = course.get_task_dispenser().get_categories(task.get_id()) %} {% for category in task_categories %} {% set ns.tags = ns.tags + (category + ", ") %} {% endfor %} {% set ns.tags = ns.tags[:-2] %} {% if ns.tags != "" %} {% endif %}
{{ _("Author(s)") }} {{ task.get_authors(user_manager.session_language()) }}
{{ _("Contact") }} {{ _("Contact link") }}
{{ _("Deadline") }} {% set accessibility = task_dispenser.get_accessibility(task.get_id(), user_manager.session_username()) %} {% if accessibility.is_always_accessible() %} {{ _("No deadline") }} {% elif accessibility.is_never_accessible() %} {{ _("It's too late") }} {% else %} {{ accessibility.get_soft_end_date().strftime("%d/%m/%Y %H:%M:%S") }} {% endif %}
{{ _("Status") }} {% if not eval_submission and submissions|length == 0 %} {{ _("Not yet attempted") }} {% elif eval_submission is not none and eval_submission["status"] == "done" and eval_submission["result"] == "success" %} {{ _("Succeeded") }} {% else %} {% set ns = namespace(waiting=False) %} {% for submission in submissions %} {% if submission["status"] == "waiting" %} {% set ns.waiting=True %} {% endif %} {% endfor %} {% if ns.waiting %} {{ _("Waiting for verification") }} {% else %} {{ _("Failed") }} {% endif %} {% endif %}
{{ _("Grade") }} {{ user_task.get('grade', 0) }}%
{{ _("Attempts") }} {{ user_task.get('tried', 0) }}
{{ _("Submission limit") }} {% set submission_limit = course.get_task_dispenser().get_submission_limit(task.get_id()) %} {% if submission_limit == {"amount":-1, "period":-1} %} {{ _("No limitation") }} {% else %} {% if submission_limit["period"] > 0 %} {{ _("{nb_submissions} submissions
every {nb_hours} hour(s)").format(nb_submissions=submission_limit["amount"], nb_hours=submission_limit["period"]) | safe }} {% else %} {{ _("{nb_submissions} submissions").format(nb_submissions=submission_limit["amount"]) }} {% endif %} {% endif %}
{{ _("Category tags") }} {{ ns.tags }}
{# Auto tags may appear for admins. So we force the h3 title even if there is not predefined tags #} {# We do not show the tag header for students if they can not get tags #} {% if visible_tags|length > 0 %}

{{ _("Tags") }}

{% for tag in visible_tags %} {% if tag.get_type() == 0 %} {% elif tag.get_type() == 1 %} {% endif %} {% endfor %}
{% endif %} {%if not is_lti() and staff %}

{{ _("Administration") }}

{% if not course.is_open_to_non_staff() %} {% endif %} {% if not task_dispenser.get_accessibility(task.get_id(), user_manager.session_username()).after_start() %} {% endif %}
  {{ _("View submissions") }} {% if user_manager.has_admin_rights_on_course(course) %}  {{ _("Edit task") }}  {{ _("Debug information") }} {% endif %}
{%elif not is_lti() and registered %}

{{ _("Submitting as") }}

{% if task_dispenser.get_group_submission(task.get_id()) %}   {{ _('Group') }} {% else %}   {{ user_manager.session_realname() }} {% endif %}
  {% set mygroup = user_manager.get_course_user_group(course) %} {% if mygroup and user_manager.session_username() in mygroup['students'] %} {{ _("Group : {}").format(mygroup['description']) }} {% else %} {{ _("Group management") }} {% endif %}
{% endif %} {{ template_helper.call('task_menu', course=course, task=task, template_helper=template_helper) | safe }} {% if registered %}

{{ _("For evaluation") }}

{% if course.get_task_dispenser().get_evaluation_mode(task.get_id()) == "last" %} {{ _("Last submission") }} {% else %} {{ _("Best submission") }} {% endif %}
{% if eval_submission %} {{ eval_submission["submitted_on"].strftime("%d/%m/%Y %H:%M:%S") }} - {{ eval_submission.get("grade",0.0) }}% {% else %}
{{ _("No submission") }}
{% endif %}

{{ _("Submission history") }}

{% elif not user_manager.session_logged_in() %} {% include "signin_button.html" %} {% elif course.is_registration_possible(user_info) %}

{{ _("Enroll in the course") }}

  {{ _("Enroll in the course") }}
{% endif %} {% endblock %} {% block navbar %} {% endblock %} {% block content %}

{{ task.get_name(user_manager.session_language()) }}
{% if not is_lti() %}
{% if previous_taskid %} {% endif %} {% if next_taskid %} {% endif %}
{% endif %}

{# Input random #} {# set up some useful variable that may be used by task author #} {# variable "input" has to be accessible to the eventual javascript present in the context of the task. #}
{{ task.get_context(user_manager.session_language()) | safe }}

{%if user_manager.has_admin_rights_on_course(course) %} {% endif %} {% if is_lti() %} {% set path = get_path("lti", "task") %} {% else %} {% set path = get_path("/course/", course.get_id(), task.get_id()) %} {% endif %}
{# Hide input random in form #} {% for elem in input_random_list %} {% endfor %} {% for problem in task.get_problems() %}
{% if task.get_problems()|length != 1 or problem.get_name(user_manager.session_language()) != "" %}
{% if task.get_problems()|length != 1 %} {{ _("Question {}").format(loop.index) }}: {% endif %} {{ problem.get_name(user_manager.session_language()) }}
{% endif %}
{{ problem.show_input(template_helper, user_manager.session_language(), user_manager.session_username()) | safe }}
{% endfor %} {# no need to check with lti=True/False here as it was already checked by the calling python script. #} {% set groups_ok = user_manager.task_can_user_submit(task, user_manager.session_username(), 'groups') %} {% set tokens_ok = user_manager.task_can_user_submit(task, user_manager.session_username(), 'tokens') %} {% if not registered %} {% elif groups_ok and tokens_ok %} {% if user_manager.has_admin_rights_on_course(course) %}
{% else %} {% endif %} {% elif not task_dispenser.get_accessibility(task.get_id(), user_manager.session_username()).is_open() %} {% elif task_dispenser.get_group_submission(task.get_id()) and not groups_ok %} {% elif not tokens_ok %} {% else %} {% endif %}
{% set auth_methods = user_manager.get_auth_methods() %} {% endblock %}