{# 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 #}