{% load i18n %} {% load unfold %} {% component "unfold/components/container.html" with component_class="CourseAnalyticsComponent" %}
{% component "unfold/components/title.html" with class="text-2xl font-bold text-gray-800" %} {% trans "Course Analytics Dashboard" %} {% endcomponent %} {% component "unfold/components/text.html" with class="text-sm text-gray-600" %} {% trans "Comprehensive analytics and insights for your course" %} {% endcomponent %}
{% component "unfold/components/card.html" with class="bg-gradient-to-br from-blue-50 to-blue-100 border-none shadow-md hover:shadow-lg transition-all duration-300" %}
{% component "unfold/components/title.html" with class="text-4xl font-bold text-blue-700 m-0" %} {{ total_lessons }} {% endcomponent %} {% component "unfold/components/text.html" with class="text-sm font-medium text-blue-800 mt-1 opacity-80" %} {% trans "Total Lessons" %} {% endcomponent %}
{% endcomponent %} {% component "unfold/components/card.html" with class="bg-gradient-to-br from-purple-50 to-purple-100 border-none shadow-md hover:shadow-lg transition-all duration-300" %}
{% component "unfold/components/title.html" with class="text-4xl font-bold text-purple-700 m-0" %} {{ quiz_scores_data.data.datasets.0.data|length }} {% endcomponent %} {% component "unfold/components/text.html" with class="text-sm font-medium text-purple-800 mt-1 opacity-80" %} {% trans "Total Quizzes" %} {% endcomponent %}
{% endcomponent %} {% component "unfold/components/card.html" with class="bg-gradient-to-br from-green-50 to-green-100 border-none shadow-md hover:shadow-lg transition-all duration-300" %}
{% component "unfold/components/title.html" with class="text-4xl font-bold text-green-700 m-0" %} {{ total_participants }} {% endcomponent %} {% component "unfold/components/text.html" with class="text-sm font-medium text-green-800 mt-1 opacity-80" %} {% trans "Active Participants" %} {% endcomponent %}
{% endcomponent %}
{% component "unfold/components/card.html" with class="border border-gray-200 shadow-md hover:shadow-lg transition-all duration-300" %}
{% component "unfold/components/title.html" with class="text-xl font-bold mb-2 text-gray-800" %} {% trans "Lesson Completion Distribution" %} {% endcomponent %} {% component "unfold/components/text.html" with class="text-sm text-gray-600 mb-6" %} {% trans "Percentage of course completion by participants" %} {% endcomponent %}
{% component "unfold/components/chart/bar.html" with data=completion_data.data height=300 %} {% endcomponent %}
{% endcomponent %} {% component "unfold/components/card.html" with class="border border-gray-200 shadow-md hover:shadow-lg transition-all duration-300" %}
{% component "unfold/components/title.html" with class="text-xl font-bold mb-2 text-gray-800" %} {% trans "Quiz Scores Distribution" %} {% endcomponent %} {% component "unfold/components/text.html" with class="text-sm text-gray-600 mb-6" %} {% trans "Distribution of scores across all quizzes" %} {% endcomponent %}
{% component "unfold/components/chart/bar.html" with data=quiz_scores_data.data height=300 %} {% endcomponent %}
{% endcomponent %}
{% component "unfold/components/card.html" with class="border border-gray-200 shadow-md hover:shadow-lg transition-all duration-300" %}
{% component "unfold/components/title.html" with class="text-xl font-bold mb-6 text-gray-800" %} {% trans "Course Engagement Metrics" %} {% endcomponent %}
{% trans "Lesson Completion Rate" %} {{ engagement_metrics.lesson_completion_rate }}%
{% component "unfold/components/progress.html" with value=engagement_metrics.lesson_completion_rate class="h-2 bg-blue-200" bar_class="bg-blue-600" %} {% endcomponent %}

{% trans "Average percentage of lessons completed by participants" %}

{% trans "Quiz Participation Rate" %} {{ engagement_metrics.quiz_participation_rate }}%
{% component "unfold/components/progress.html" with value=engagement_metrics.quiz_participation_rate class="h-2 bg-purple-200" bar_class="bg-purple-600" %} {% endcomponent %}

{% trans "Percentage of participants who attempted at least one quiz" %}

{% trans "Average Quiz Score" %} {{ engagement_metrics.average_quiz_score }}%
{% component "unfold/components/progress.html" with value=engagement_metrics.average_quiz_score class="h-2 bg-green-200" bar_class="bg-green-600" %} {% endcomponent %}

{% trans "Average score across all quizzes" %}

{% endcomponent %}
{% component "unfold/components/card.html" with class="border border-gray-200 shadow-md hover:shadow-lg transition-all duration-300" %}
{% component "unfold/components/title.html" with class="text-xl font-bold mb-4 text-gray-800" %} {% trans "Top Performing Students" %} {% endcomponent %}
{% for student in top_students %} {% endfor %}
{% trans "Student" %} {% trans "Completion" %} {% trans "Avg. Score" %}
{{ student.initials }}
{{ student.name }}
{{ student.completion_percentage }}%
{{ student.average_score }}%
{% endcomponent %} {% component "unfold/components/card.html" with class="border border-gray-200 shadow-md hover:shadow-lg transition-all duration-300" %}
{% component "unfold/components/title.html" with class="text-xl font-bold mb-4 text-gray-800" %} {% trans "Recent Activity" %} {% endcomponent %}
    {% for activity in recent_activity %}
  • {% if not forloop.last %} {% endif %}
    {% if activity.type == 'lesson_completion' %} {% elif activity.type == 'quiz_completion' %} {% elif activity.type == 'course_join' %} {% endif %}
    {% if activity.type == 'lesson_completion' %} {{ activity.student_name }} درس {{ activity.lesson_title }} را تکمیل کرد {{ activity.time_ago }} {% elif activity.type == 'quiz_completion' %} {{ activity.student_name }} در کوئیز {{ activity.quiz_title }} نمره {{ activity.score }}% کسب کرد {{ activity.time_ago }} {% elif activity.type == 'course_join' %} {{ activity.student_name }} به دوره پیوست {{ activity.time_ago }} {% endif %}
  • {% endfor %}
{% endcomponent %}
{% endcomponent %}