Files
notytex/templates/assessment_detail.html
2025-08-06 20:34:55 +02:00

372 lines
25 KiB
HTML

{% extends "base.html" %}
{% block title %}{{ assessment.title }} - Gestion Scolaire{% endblock %}
{% block content %}
<div class="space-y-8">
<!-- Hero Section moderne avec gradient -->
<div class="bg-gradient-to-r from-purple-600 to-blue-600 text-white rounded-xl p-8 shadow-lg">
<div class="flex items-center justify-between">
<div class="flex-1">
<a href="{{ url_for('assessments.list') }}" class="text-white/80 hover:text-white text-sm font-medium mb-3 inline-block transition-colors">
← Retour aux évaluations
</a>
<h1 class="text-4xl font-bold mb-2">{{ assessment.title }}</h1>
<div class="flex items-center space-x-6 text-lg opacity-90">
<span class="flex items-center">
<svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20">
<path d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
{{ assessment.class_group.name }}
</span>
<span class="flex items-center">
<svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z" clip-rule="evenodd"/>
</svg>
{{ assessment.date.strftime('%d/%m/%Y') }}
</span>
<span class="flex items-center">
<svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20">
<path d="M7 3a1 1 0 000 2h6a1 1 0 100-2H7zM4 7a1 1 0 011-1h10a1 1 0 110 2H5a1 1 0 01-1-1zM2 11a2 2 0 012-2h12a2 2 0 012 2v4a2 2 0 01-2 2H4a2 2 0 01-2-2v-4z"/>
</svg>
Trimestre {{ assessment.trimester }}
</span>
</div>
</div>
<div class="hidden lg:block">
<div class="w-24 h-24 bg-white/20 rounded-full flex items-center justify-center">
<svg class="w-12 h-12" fill="currentColor" viewBox="0 0 20 20">
<path d="M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"/>
<path fill-rule="evenodd" d="M4 5a2 2 0 012-2v1a1 1 0 102 0V3a2 2 0 012 2v6a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm2.5 2.5a.5.5 0 000 1h3a.5.5 0 000-1h-3z" clip-rule="evenodd"/>
</svg>
</div>
</div>
</div>
</div>
<form id="delete-form" method="POST" action="{{ url_for('assessments.delete', id=assessment.id) }}" style="display: none;"></form>
<!-- Actions principales mises en avant -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
<a href="{{ url_for('grading.assessment_grading', assessment_id=assessment.id) }}"
class="group bg-gradient-to-r from-green-500 to-green-600 text-white rounded-xl p-6 hover:from-green-600 hover:to-green-700 transition-all duration-300 transform hover:scale-105 shadow-lg hover:shadow-xl">
<div class="flex items-center">
<div class="w-12 h-12 bg-white/20 rounded-xl flex items-center justify-center mr-4 group-hover:bg-white/30 transition-colors">
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 20 20">
<path d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"/>
</svg>
</div>
<div>
<h3 class="text-lg font-bold mb-1">Noter</h3>
<p class="text-sm opacity-90">Saisir les notes</p>
</div>
</div>
</a>
<a href="{{ url_for('assessments.results', id=assessment.id) }}"
class="group bg-gradient-to-r from-purple-500 to-purple-600 text-white rounded-xl p-6 hover:from-purple-600 hover:to-purple-700 transition-all duration-300 transform hover:scale-105 shadow-lg hover:shadow-xl">
<div class="flex items-center">
<div class="w-12 h-12 bg-white/20 rounded-xl flex items-center justify-center mr-4 group-hover:bg-white/30 transition-colors">
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M3 3a1 1 0 000 2v8a2 2 0 002 2h2.586l-1.293 1.293a1 1 0 101.414 1.414L10 15.414l2.293 2.293a1 1 0 001.414-1.414L12.414 15H15a2 2 0 002-2V5a1 1 0 100-2H3zm11.707 4.707a1 1 0 00-1.414-1.414L10 9.586 8.707 8.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/>
</svg>
</div>
<div>
<h3 class="text-lg font-bold mb-1">Résultats</h3>
<p class="text-sm opacity-90">Stats & graphiques</p>
</div>
</div>
</a>
<a href="{{ url_for('assessments.edit', id=assessment.id) }}"
class="group bg-gradient-to-r from-blue-500 to-blue-600 text-white rounded-xl p-6 hover:from-blue-600 hover:to-blue-700 transition-all duration-300 transform hover:scale-105 shadow-lg hover:shadow-xl">
<div class="flex items-center">
<div class="w-12 h-12 bg-white/20 rounded-xl flex items-center justify-center mr-4 group-hover:bg-white/30 transition-colors">
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 20 20">
<path d="M17.414 2.586a2 2 0 00-2.828 0L7 10.172V13h2.828l7.586-7.586a2 2 0 000-2.828z"/>
<path fill-rule="evenodd" d="M2 6a2 2 0 012-2h4a1 1 0 010 2H4v10h10v-4a1 1 0 112 0v4a2 2 0 01-2 2H4a2 2 0 01-2-2V6z" clip-rule="evenodd"/>
</svg>
</div>
<div>
<h3 class="text-lg font-bold mb-1">Modifier</h3>
<p class="text-sm opacity-90">Évaluation complète</p>
</div>
</div>
</a>
<button onclick="if(confirm('Êtes-vous sûr de vouloir supprimer cette évaluation ?')) { document.getElementById('delete-form').submit(); }"
class="group bg-gradient-to-r from-red-500 to-red-600 text-white rounded-xl p-6 hover:from-red-600 hover:to-red-700 transition-all duration-300 transform hover:scale-105 shadow-lg hover:shadow-xl">
<div class="flex items-center">
<div class="w-12 h-12 bg-white/20 rounded-xl flex items-center justify-center mr-4 group-hover:bg-white/30 transition-colors">
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd"/>
</svg>
</div>
<div>
<h3 class="text-lg font-bold mb-1">Supprimer</h3>
<p class="text-sm opacity-90">Définitivement</p>
</div>
</div>
</button>
</div>
<!-- Indicateur de progression et informations clés -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
<!-- État des corrections - Carte principale -->
<div class="lg:col-span-2 bg-white shadow rounded-xl p-6">
<div class="flex items-center justify-between mb-6">
<h2 class="text-xl font-bold text-gray-900">État des corrections</h2>
{% set progress = assessment.grading_progress %}
{% if progress.status == 'completed' %}
<span class="bg-green-100 text-green-800 text-sm px-3 py-1 rounded-full font-medium">Terminé</span>
{% elif progress.status == 'in_progress' %}
<span class="bg-orange-100 text-orange-800 text-sm px-3 py-1 rounded-full font-medium">En cours</span>
{% elif progress.status == 'not_started' %}
<span class="bg-red-100 text-red-800 text-sm px-3 py-1 rounded-full font-medium">À faire</span>
{% endif %}
</div>
<!-- Indicateur visuel principal -->
<div class="text-center mb-6">
{% if progress.status == 'completed' %}
<div class="w-24 h-24 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4">
<svg class="w-12 h-12 text-green-600" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/>
</svg>
</div>
<h3 class="text-2xl font-bold text-green-600 mb-2">100% Terminé</h3>
<p class="text-gray-600">Toutes les corrections sont saisies</p>
{% elif progress.status == 'in_progress' %}
<div class="relative w-24 h-24 mx-auto mb-4">
<svg class="w-24 h-24 transform -rotate-90" viewBox="0 0 100 100">
<circle cx="50" cy="50" r="40" stroke="#fed7aa" stroke-width="8" fill="none"/>
<circle cx="50" cy="50" r="40" stroke="#ea580c" stroke-width="8" fill="none"
stroke-dasharray="251.2" stroke-dashoffset="{{ 251.2 - (251.2 * progress.percentage / 100) }}"
class="transition-all duration-1000 ease-out"/>
</svg>
<div class="absolute inset-0 flex items-center justify-center">
<span class="text-xl font-bold text-orange-600">{{ progress.percentage }}%</span>
</div>
</div>
<h3 class="text-2xl font-bold text-orange-600 mb-2">En cours</h3>
<p class="text-gray-600">{{ progress.completed }} notes sur {{ progress.total }} saisies</p>
<a href="{{ url_for('grading.assessment_grading', assessment_id=assessment.id) }}"
class="inline-flex items-center mt-4 bg-orange-500 hover:bg-orange-600 text-white px-4 py-2 rounded-lg font-medium transition-colors">
<svg class="w-4 h-4 mr-2" fill="currentColor" viewBox="0 0 20 20">
<path d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"/>
</svg>
Continuer la correction
</a>
{% elif progress.status == 'not_started' %}
<div class="w-24 h-24 bg-red-100 rounded-full flex items-center justify-center mx-auto mb-4">
<svg class="w-12 h-12 text-red-600" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"/>
</svg>
</div>
<h3 class="text-2xl font-bold text-red-600 mb-2">0% - À commencer</h3>
<p class="text-gray-600">Aucune note n'a encore été saisie</p>
<a href="{{ url_for('grading.assessment_grading', assessment_id=assessment.id) }}"
class="inline-flex items-center mt-4 bg-red-500 hover:bg-red-600 text-white px-4 py-2 rounded-lg font-medium transition-colors">
<svg class="w-4 h-4 mr-2" fill="currentColor" viewBox="0 0 20 20">
<path d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"/>
</svg>
Démarrer la correction
</a>
{% endif %}
</div>
<!-- Détails techniques -->
<div class="bg-gray-50 rounded-lg p-4">
<div class="grid grid-cols-2 gap-4 text-sm">
<div>
<span class="text-gray-500">Notes saisies :</span>
<span class="font-medium text-gray-900">{{ progress.completed }}/{{ progress.total }}</span>
</div>
{% if progress.students_count %}
<div>
<span class="text-gray-500">Élèves :</span>
<span class="font-medium text-gray-900">{{ progress.students_count }}</span>
</div>
{% endif %}
</div>
</div>
</div>
<!-- Informations générales - Carte latérale -->
<div class="bg-white shadow rounded-xl p-6">
<h2 class="text-lg font-bold text-gray-900 mb-4">Informations générales</h2>
<div class="space-y-4">
<div class="flex items-center justify-between">
<span class="text-sm font-medium text-gray-500">Classe</span>
<span class="text-sm font-bold text-gray-900">{{ assessment.class_group.name }}</span>
</div>
<div class="flex items-center justify-between">
<span class="text-sm font-medium text-gray-500">Date</span>
<span class="text-sm font-bold text-gray-900">{{ assessment.date.strftime('%d/%m/%Y') }}</span>
</div>
<div class="flex items-center justify-between">
<span class="text-sm font-medium text-gray-500">Trimestre</span>
<span class="text-sm font-bold text-gray-900">{{ assessment.trimester }}</span>
</div>
<div class="flex items-center justify-between">
<span class="text-sm font-medium text-gray-500">Coefficient</span>
<span class="text-sm font-bold text-gray-900">{{ assessment.coefficient }}</span>
</div>
<div class="flex items-center justify-between">
<span class="text-sm font-medium text-gray-500">Exercices</span>
<span class="text-sm font-bold text-gray-900">{{ assessment.exercises|length }}</span>
</div>
{% if assessment.description %}
<div class="border-t border-gray-200 pt-4">
<span class="text-sm font-medium text-gray-500">Description</span>
<p class="mt-1 text-sm text-gray-900 bg-blue-50 p-3 rounded-lg">{{ assessment.description }}</p>
</div>
{% endif %}
</div>
</div>
</div>
<!-- Exercices -->
<div class="bg-white shadow rounded-xl">
<div class="px-6 py-5 border-b border-gray-200 flex justify-between items-center">
<div class="flex items-center">
<h2 class="text-xl font-bold text-gray-900">Structure de l'évaluation</h2>
<span class="ml-3 bg-blue-100 text-blue-800 text-sm px-3 py-1 rounded-full font-medium">
{{ assessment.exercises|length }} exercice(s)
</span>
</div>
<div class="text-sm text-gray-500 flex items-center">
<svg class="w-4 h-4 mr-1" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/>
</svg>
Utilisez "Modifier" pour ajouter des exercices
</div>
</div>
<div class="px-6 py-6">
{% if assessment.exercises %}
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
{% for exercise in assessment.exercises|sort(attribute='order') %}
<div class="bg-white border border-gray-200 rounded-xl shadow-sm hover:shadow-md transition-shadow duration-300">
<!-- En-tête de la card -->
<div class="p-4 border-b border-gray-100">
<div class="mb-2">
<div class="flex items-center">
<span class="w-8 h-8 bg-gradient-to-br from-purple-500 to-blue-600 rounded-full flex items-center justify-center text-white text-sm font-bold mr-3">
{{ loop.index }}
</span>
<div>
<h3 class="text-base font-bold text-gray-900 leading-tight">{{ exercise.title }}</h3>
{% set total_points = exercise.grading_elements | map(attribute='max_points') | sum %}
{% if total_points > 0 %}
<span class="text-xs text-purple-600 font-medium">
{{ total_points }} points total
</span>
{% endif %}
</div>
</div>
</div>
{% if exercise.description %}
<p class="text-xs text-gray-600 line-clamp-2">{{ exercise.description }}</p>
{% endif %}
</div>
<!-- Éléments de notation -->
<div class="p-4">
{% if exercise.grading_elements %}
<div class="space-y-2">
{% for element in exercise.grading_elements %}
<div class="flex items-center justify-between text-sm">
<div class="flex-1 min-w-0">
<div class="font-medium text-gray-900 truncate">{{ element.label }}</div>
<div class="flex items-center space-x-1 mt-1">
{% if element.domain %}
<span class="text-xs px-2 py-0.5 rounded-full"
style="background-color: {{ element.domain.color }}20; color: {{ element.domain.color }};">
{{ element.domain.name }}
</span>
{% endif %}
{% if element.skill %}
<span class="text-xs text-purple-700 bg-purple-100 px-2 py-0.5 rounded-full">
{{ element.skill }}
</span>
{% endif %}
{% if element.grading_type == 'competences' %}
<span class="text-xs text-green-700 bg-green-100 px-2 py-0.5 rounded-full">
Échelle
</span>
{% endif %}
</div>
</div>
<span class="font-bold text-gray-900 ml-2">{{ element.max_points }}</span>
</div>
{% if not loop.last %}
<hr class="border-gray-100">
{% endif %}
{% endfor %}
</div>
{% else %}
<p class="text-xs text-gray-500 text-center py-4">Aucun élément de notation</p>
{% endif %}
</div>
</div>
{% endfor %}
</div>
{% else %}
<div class="text-center py-12">
<div class="w-24 h-24 bg-gradient-to-br from-gray-100 to-gray-200 rounded-full flex items-center justify-center mx-auto mb-6">
<svg class="w-12 h-12 text-gray-400" stroke="currentColor" fill="none" viewBox="0 0 48 48">
<path d="M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8m9-16v20m5-14H9m1 4h8m1 2h8m-8 6h8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</div>
<h3 class="text-xl font-bold text-gray-900 mb-2">Aucun exercice créé</h3>
<p class="text-gray-600 mb-6 max-w-md mx-auto">
Cette évaluation ne contient pas encore d'exercices. Utilisez le bouton "Modifier" pour structurer votre évaluation.
</p>
<a href="{{ url_for('assessments.edit', id=assessment.id) }}"
class="inline-flex items-center bg-gradient-to-r from-blue-500 to-blue-600 hover:from-blue-600 hover:to-blue-700 text-white px-6 py-3 rounded-xl font-semibold shadow-lg hover:shadow-xl transform hover:scale-105 transition-all duration-300">
<svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z" clip-rule="evenodd"/>
</svg>
Ajouter des exercices
</a>
</div>
{% endif %}
</div>
</div>
<!-- Actions secondaires -->
<div class="bg-white shadow rounded-xl">
<div class="px-6 py-5 border-b border-gray-200">
<h2 class="text-xl font-bold text-gray-900">Actions supplémentaires</h2>
</div>
<div class="px-6 py-6">
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
<button disabled class="flex items-center justify-center px-4 py-3 border-2 border-dashed border-gray-300 rounded-xl text-sm font-medium text-gray-500 cursor-not-allowed transition-colors">
<svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z" clip-rule="evenodd"/>
</svg>
Exporter PDF
<span class="ml-2 text-xs bg-gray-200 text-gray-600 px-2 py-1 rounded-full">Bientôt</span>
</button>
<button disabled class="flex items-center justify-center px-4 py-3 border-2 border-dashed border-gray-300 rounded-xl text-sm font-medium text-gray-500 cursor-not-allowed transition-colors">
<svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M4 2a2 2 0 00-2 2v11a3 3 0 106 0V4a2 2 0 00-2-2H4z" clip-rule="evenodd"/>
</svg>
Imprimer
<span class="ml-2 text-xs bg-gray-200 text-gray-600 px-2 py-1 rounded-full">Bientôt</span>
</button>
<button disabled class="flex items-center justify-center px-4 py-3 border-2 border-dashed border-gray-300 rounded-xl text-sm font-medium text-gray-500 cursor-not-allowed transition-colors">
<svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20">
<path d="M8 5a1 1 0 100 2h5.586l-1.293 1.293a1 1 0 001.414 1.414l3-3a1 1 0 000-1.414l-3-3a1 1 0 10-1.414 1.414L13.586 5H8zM12 15a1 1 0 100-2H6.414l1.293-1.293a1 1 0 10-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L6.414 15H12z"/>
</svg>
Dupliquer
<span class="ml-2 text-xs bg-gray-200 text-gray-600 px-2 py-1 rounded-full">Bientôt</span>
</button>
</div>
</div>
</div>
</div>
{% endblock %}