{% extends "layout.html" %} {% block title %}{{ title }}{% endblock %} {% block style %} {% endblock %} {% macro articleContent(content) %} {% for section in content %} {% if section.type == "normal" %} {% autoescape false %}{{ section.content }}{% endautoescape %} {% elif section.type == "exercise" %}
Exercise #{{ exercise }}
{% autoescape false %}{{ section.content }}{% endautoescape %}
{% autoescape false %}{{ section.code.base|code }}{% endautoescape %}
{% set exercise = exercise + 1 %}
{% elif section.type == "quiz" %}
Quiz #{{ exercise }}
{% autoescape false %}{{ section.content }}{% endautoescape %} {% for quiz in section.quiz %}
Question {{ loop.index }} of {{ section.quiz.length }}
{% autoescape false %}{{ quiz.base }}{% endautoescape %}
{% endfor %} {% set exercise = exercise + 1 %}
{% endif %} {% endfor %} {% endmacro %} {% set exercise = 1 %} {% block content %} {# Pages content #} {% for item in progress.chapters %}

{{ item.title }}

{% if pages[item.path] %} {{ articleContent(pages[item.path].content) }} {% endif %}
{% endfor %} {# Exercise solutions #} {% if exercise > 1 %} {% set exercise = 1 %}

Exercise Solutions

Exercise Solutions

{% for item in progress.chapters %} {% if pages[item.path] %} {% for section in pages[item.path].content %} {% if section.type == "exercise" %}
Exercise #{{ exercise }}
{% autoescape false %}{{ section.content }}{% endautoescape %}
{% autoescape false %}{{ section.code.solution|code }}{% endautoescape %}
{% set exercise = exercise + 1 %}
{% elif section.type == "quiz" %}
Quiz #{{ exercise }}
{% autoescape false %}{{ section.content }}{% endautoescape %} {% for quiz in section.quiz %}
Question {{ loop.index }} of {{ section.quiz.length }}
{% autoescape false %}{{ quiz.solution }}{% endautoescape %}
{% endfor %} {% set exercise = exercise + 1 %}
{% endif %} {% endfor %} {% endif %} {% endfor %}
{% endif %} {% endblock %} {% block javascript %}{% endblock %}