{% extends "base.html" %} {% block title %}Quiz Levels - Rainwater Quest{% endblock %} {% block content %}

Rainwater Harvesting Learning Path

Hello, {% if username %}{{ username }}{% else %}Guest{% endif %}!

Current Points: {{ user_progress.points }}

{% if all_videos_and_quizzes_completed %}

Congratulations, you've completed the course!

You've earned the "Ultimate HydroHero" badge!

View & Print Your Certificate
{% endif %}

Your Learning Progress

{# Loop through actual video data from your backend #} {% for video in videos %} {% set video_id = video.id %} {% set is_completed = video_id in user_progress.completed_videos %} {% set quiz_taken = video_id in user_progress.video_quiz_scores %} {# Determine if the node is active: first node, or previous node completed #} {% set is_active = not is_completed and (loop.index0 == 0 or videos[loop.index0 - 1].id in user_progress.completed_videos) %} {% set is_locked = not is_completed and not is_active %}
{% if is_completed %}✅{% elif is_active %}▶️{% else %}🔒{% endif %} {# Thematic icons based on status #}
Level {{ loop.index }}
{{ video.title }}
{% if is_locked %} {% elif is_active %} Start Level {% elif is_completed and not quiz_taken %} Take Quiz {% elif quiz_taken %} {% endif %}
{% endfor %} {# Placeholder for remaining levels if 'videos' list is less than 10 #} {% if videos|length < 10 %} {% for i in range(videos|length + 1, 11) %} {# Start from the next level number up to 10 #}
🔒
Level {{ i }}
Upcoming Topic
{% endfor %} {% endif %}

Your Badges:

{% if user_progress.unlocked_badges %} {% else %}

No badges unlocked yet. Keep learning!

{% endif %}
{% endblock %}