{% extends "base.html" %} {% import "icons.html" as icon %} {% import "player.html" as player %} {% block title %}{{ exercise.title }}{% endblock %} {% block styles %} {% endblock %} {% block body_attributes %} data-exercise="{{ exercise.identifier }}" data-type="{{ exercise.type }}"{% endblock %} {% block header %} {# Where the student is: a dot per item, then the end. A dot says how its item went, and a click on it goes there. #}
{% if exercise.type == "shadowing" %} {# The takes of the sentence on screen, and how often it was heard. #}

{{ icon.mic() }}0 {{ icon.headphones() }}0

{% endif %} {# A word to the agent, about the item on screen. #}
{% endblock %} {% block content %} {% set reading = exercise.text or exercise.media %}
{# What every item is about, kept beside them from one to the next. #} {% if reading %} {% endif %}
{% if exercise.instructions %}

{{ exercise.instructions }}

{% endif %}
{% for item in items %} {% set index = loop.index0 %} {# One item per screen. An answered item is rebuilt from what the student sent, and how it went: they find it as they left it, with the right answer beside a wrong one. #}
{% if item.instruction %}

{{ item.instruction }}

{% endif %}
{% if item.media and exercise.type != "shadowing" %} {% with media = item.media, size = "big" %} {% include "media.html" %} {% endwith %} {% endif %} {% if exercise.type == "gap-fill" %} {# Only the spaces written in the prompt: l'___ and و___ stay joined to their blank. #}

{%- for segment in item.segments -%} {{ segment }} {%- if not loop.last -%} {%- endif -%} {%- endfor -%}

{% elif exercise.type in ("mcq", "multi-select") %}

{{ item.prompt }}

{# One to pick, or every one that applies. An option that holds a sound or a picture is a tile with its own player, and the tiles stand side by side. Short texts are tiles to hit; longer ones are rows to read. #} {% set box = "checkbox" if exercise.type == "multi-select" else "radio" %} {% set sensed = item.options|selectattr("media")|list|length > 0 %} {% set tiles = not sensed and item.options and item.options|length <= 4 and item.options|map(attribute="text")|map("length")|max <= 10 %}
    {% for option in item.options %}
  • {% if option.media %} {# Nothing but its number is written on it: the name is the answer's, and would give the answer away. The tile is chosen by a click anywhere on it but its own buttons (exercise.js). #}
    {{ loop.index }} {% with media = option.media, size = "big" if item.options|length <= 2 else "" %} {% include "media.html" %} {% endwith %} {{ icon.check() }}{{ icon.cross() }}
    {% else %} {% endif %}
  • {% endfor %}
{% elif exercise.type == "matching" %} {% if item.prompt %}

{{ item.prompt }}

{% endif %}
    {% for entry in item.left %}
  • {% if entry.media %} {% with media = entry.media, size = "small" %} {% include "media.html" %} {% endwith %} {% else %} {{ entry.text }} {% endif %} {# Every entry is in each place, unseen and stacked, so that a place is as wide as the widest of them, empty or filled. #}
  • {% endfor %}
    {% for choice in item.choices %}
  • {% endfor %}
{% elif exercise.type == "ordering" %} {% if item.prompt %}

{{ item.prompt }}

{% endif %} {# The sentence is built from its start, on the right in a language written right to left. #}
{% for segment in item.shuffled %} {% endfor %}
{% elif exercise.type == "shadowing" %} {# Heard first, read if wanted: blurred, so that it shows how many words there are and not which, and a click shows it. #} {# The sound is played by the page rather than by an
{% endfor %} {# The end: nothing to send, every answer is already in the file. What is left is how it went, and the items still open. #}
{# A note is written to the agent and read when the student says they are done. What was already written about the item on screen is shown above the field and is not touched again: notes are only ever added. #} {% endblock %} {% block footer %} {# One button to press next, always in the same place: βœ“ while the item holds an answer not yet checked, β†’ otherwise. β†’ never stands beside an answer that was not checked, so it cannot be taken for sending it. #} {% endblock %} {% block scripts %} {% endblock %}