{% extends "base.html" %} {% block title %}{{ lesson.title }} - LLM Lab{% endblock %} {% block content %}

Map / stage {{ lesson.stage }}

{{ lesson.title }}

{{ lesson.kind }} {{ lesson.est_minutes }} min source: {{ lesson.source }} {{ lesson.id }}

{# What the database already knew but this page used to throw away on reload. Bound up front because `state` is an empty dict for a lesson never attempted, and Jinja's Undefined raises the moment you compare it to a number. #} {% set status = state.status or 'not_started' %} {% set qscore = state.quiz_score or 0 %} {% set tpass = state.tests_pass or 0 %} {% set ttotal = state.tests_total or 0 %}

{%- if status == 'done' %}Completed {%- elif status == 'in_progress' %}In progress {%- else %}Not started yet{%- endif -%} {% if lesson.quiz %} quiz {{ (qscore * 100) | round | int }}%{% if state.quiz_ts %} · {{ state.quiz_ts|ago }}{% endif %} {% endif %} {% if has_exercise %} tests {{ tpass }}/{{ ttotal }}{% if state.tests_ts %} · {{ state.tests_ts|ago }}{% endif %} {% endif %} {% if can_mark_read %} {% endif %}

{% if locked %}
Prerequisite not finished: {{ locked }}. You can read on, but the ramp assumes you did that one first.
{% endif %} {% if lesson.stub %}
This lesson is a stub. Read {{ lesson.source }} directly.
{% endif %} {% if introduces %}

New terms in this lesson

{% for term in introduces %}
{{ term.forms[0] }}{% if term.expand %} ({{ term.expand }}){% endif %}
{{ term.plain }}
{% endfor %}
{% endif %}
{{ body_html|safe }}
{% if lesson.quiz %}

Check yourself

{% for item in lesson.quiz %} {% set qi = loop.index0 %}
{{ loop.index }}. {{ item.q }} {% if item.type in ("mcq", "multi") %} {% for option in item.options %} {% endfor %} {% if item.type == "multi" %}

Select all that apply.

{% endif %} {% elif item.type == "numeric" %} {% else %}
What is being graded
    {% for point in item.rubric %}
  • {{ point }}
  • {% endfor %}
{% endif %}
{% endfor %} {% set qpassed = qscore >= mastery %} {{ (qscore * 100) | round | int }}%{{ ' — passed' if qpassed else ' — keep going' }}
{% endif %} {% if has_exercise %}

Code exercise

Edit the files in PyCharm, then run the tests here.

{{ exercise_path }}
{% set green = ttotal > 0 and tpass == ttotal %} {{ tpass }}/{{ ttotal }} passing {# The last run's output survives a reload, so the failure you were reading is still there tomorrow morning. #} {% if state.tests_output %}
Last run, {{ state.tests_ts|ago }}
{{ state.tests_output }}
{% else %} {% endif %}
{% endif %}

Design Journal

Any constant you chose or met in this lesson goes here. Stage 9 quizzes you on these rows.

{% if journal %} {% for row in journal %} {% endfor %}
NameValueWhereWhy
{{ row.name }}{{ row.value }} {{ row.location }}{{ row.why }}
{% endif %}
{% endblock %}