{# 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(session.language) }} - {{ course.get_name(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(session.language) %} {% endif %} {%if task.get_contact_url(session.language) %} {% endif %} {% if not session.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(session.language) }}
{{ _("Contact") }} {{ _("Contact link") }}
{{ _("Deadline") }} {% set accessibility = task_dispenser.get_accessibility(task.get_id(), session.username) %} {% if accessibility.is_never_accessible() %} {{ _("It's too late") }} {% elif accessibility.get_std_soft_end_date() %} {{ show_time(accessibility.get_soft_end_date()) }} {% else %} {{ _("No deadline") }} {% 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.grade }}%
{{ _("Attempts") }} {{ user_task.tried }}
{{ _("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 session.is_lti and staff %}

{{ _("Administration") }}

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

{{ _("Submitting as") }}

{% if task_dispenser.get_group_submission(task.get_id()) %}   {{ _('Group') }} {% else %}   {{ session.realname }} {% endif %}
  {% set mygroup = user_manager.get_course_user_group(course) %} {% if mygroup and session.username in mygroup['students'] %} {{ _("Group : {}").format(mygroup['description']) }} {% else %} {{ _("Group management") }} {% endif %}
{% endif %} {% for entry in plugin_manager.call_hook('task_menu', course=course, task=task) %} {{ entry | safe }} {% endfor %} {% 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 %} {{ show_time(eval_submission['submitted_on']) }} - {{ eval_submission.grade }}% {% else %}
{{ _("No submission") }}
{% endif %}

{{ _("Submission history") }}

{% elif not session.loggedin %} {% 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(session.language) }}
{% if not session.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(session.language) | safe }}

{%if user_manager.has_admin_rights_on_course(course) %} {% endif %} {% if session.is_lti %} {% set path = url_for("ltitaskpage") %} {% else %} {% set path = url_for("taskpage", courseid=course.get_id(), taskid=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(session.language) != "" %}
{% if task.get_problems()|length != 1 %} {{ _("Question {}").format(loop.index) }}: {% endif %} {{ problem.get_name(session.language) }}
{% endif %}
{{ problem.show_input(session.language, 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(course, task, session.username, 'groups') %} {% set tokens_ok = user_manager.task_can_user_submit(course, task, 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(), 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 %}