{% extends "oahpa.html" %} {% comment %} This is the main game template, which is used in mgame.html, and other templates belonging to specific games. Settings form is rendered here, and most of the form for the game. Morfa templates are a bit more complex, and there are sub-templates which inherit up two levels. Inheritance is something like this: oahpa_main.html oahpa.html drills/game.html drills/mgame.html drills/mgame_a.html drills/mgame_l.html drills/mgame_n.html drills/mgame_v.html drills/quizz.html drills/num.html * NB! oahpa_main.html is different from drills/oahpa_main.html but the latter is not in use at the moment. Game form is kind of messy now, but previously survived on many many tables. Currently working on cleaning this up, because it's much easier to extend. Should probably use something like the following:
{{ lemma }}
{{ lemma }}
{{ lemma }}
{% endcomment %} {% load i18n %} {% get_current_language as LANGUAGE_CODE %} {% block game_content %} {% ifnotequal gametype "sahka" %}
{% endifnotequal %} {# instructions #} {% ifnotequal gametype "sahka" %} {% ifnotequal gametype "sahka_main" %}
{% endifnotequal %} {% endifnotequal %} {% block gamename %}{% endblock %}
{% block instructions %}{% endblock %} {% ifnotequal gametype "sahka" %} {% ifnotequal gametype "sahka_main" %}
{% endifnotequal %} {% endifnotequal %} {# end instructions #}
{% for form in forms %} {% ifequal settings.gametype 'context' %} {% ifnotequal forlop.counter 1 %} {% endifnotequal %} {% endifequal %} {% block question %}{% endblock %} {# Show correct answers if "show correct" is pressed #} {% if form.answer %} {% endif %} {% endfor %} {% block submit %}{% endblock %}
 
{% if form.answertext1 %}{{ form.answertext1 }}{% endif %} {% if form.pron %}  {{ form.pron }}  {% endif %} {% if show_correct %} {% ifequal form.error "correct" %} {{ form.userans }} {% else %} {% ifequal form.error "error" %} {{ form.userans }} {% else %} ___________________ {% endifequal %} {% endifequal %} {% else %} {# If just test answers, mark correct answers as green #} {% ifnotequal form.userans "" %} {% ifequal form.error "correct" %} {{ form.userans }} {% else %} {# Answer field #} {{ form.answer }} {% endifequal %} {% else %} {# Answer field #} {{ form.answer }} {% endifnotequal %} {% endif %} {% if form.pron_imp %}  {{ form.pron_imp }}  {% endif %} {% if form.answertext2 %}{{ form.answertext2 }}{% endif %} {% if show_correct %} {% ifnotequal form.error "correct" %} {{ form.correct_answers }} {% else %} {% comment %} Spelling relaxing here. {% endcomment %} {% ifequal form.is_relaxed "relaxed" %}({{ form.correct_answers }}){% endifequal %} {{ form.relaxed }} {% endifnotequal %} {% else %} {% ifequal form.error "error" %} {% if form.feedback %} {% else %} {% endif %} {% endifequal %} {% if forloop.last %} {% ifequal gametype "sahka" %}
{% if messages %}
{% for m in messages %}{{ m }}
{% endfor %}
{% endif %}
{% endifequal %} {% endif %} {% endif %}
{{ form.word_id }} {{ form.tag_id }} {{ form.question_id }} {{ form.answer_id }} {{ form.utterance_id }} {{ form.qstring }} {{ form.astring }} {% block hidden %}{% endblock %} {% for detail, value in form.qattrs.items %} {% endfor %} {% for detail, value in form.aattrs.items %} {% endfor %}
{% if 1 %}  
{% if all_correct %} {% trans "Congratulations!" %} {% endif %}
{% trans "Your score:" %} {{ score }} {% endif %} {% if comment %}
{{ comment }} {% endif %}
{% endblock %}