Files
notytex/templates/assessment_grading.html
Bertrand Benjamin 3e49bd467c refactor: restructure codebase into modular architecture
- Split monolithic app.py (400+ lines) into organized modules
- Extract models, forms, and commands into separate files
- Implement Flask blueprints for route organization
- Maintain full functionality with cleaner architecture
- Update all templates to use new blueprint URLs
- Enhance README with technical documentation

Structure:
├── app.py (50 lines) - Flask app factory
├── models.py (62 lines) - SQLAlchemy models
├── forms.py (43 lines) - WTForms definitions
├── commands.py (74 lines) - CLI commands
└── routes/ - Blueprint modules for each feature

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-03 20:59:10 +02:00

159 lines
11 KiB
HTML

{% extends "base.html" %}
{% block title %}Saisie des notes - {{ assessment.title }} - Gestion Scolaire{% endblock %}
{% block content %}
<div class="space-y-6">
<div class="flex justify-between items-center">
<div>
<a href="{{ url_for('assessments.detail', id=assessment.id) }}" class="text-blue-600 hover:text-blue-800 text-sm font-medium mb-2 inline-block">
← Retour à l'évaluation
</a>
<h1 class="text-2xl font-bold text-gray-900">Saisie des notes</h1>
<p class="text-gray-600">{{ assessment.title }} - {{ assessment.class_group.name }}</p>
</div>
</div>
{% if not grading_elements %}
<div class="bg-yellow-50 border border-yellow-200 rounded-md p-4">
<div class="flex">
<div class="flex-shrink-0">
<svg class="h-5 w-5 text-yellow-400" viewBox="0 0 20 20" fill="currentColor">
<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>
<div class="ml-3">
<h3 class="text-sm font-medium text-yellow-800">Aucun élément de notation</h3>
<div class="mt-2 text-sm text-yellow-700">
<p>Cette évaluation n'a pas encore d'éléments de notation configurés. Vous devez d'abord créer des exercices et leurs éléments de notation.</p>
</div>
<div class="mt-4">
<a href="{{ url_for('assessments.detail', id=assessment.id) }}" class="text-sm font-medium text-yellow-800 underline hover:text-yellow-900">
Configurer l'évaluation →
</a>
</div>
</div>
</div>
</div>
{% else %}
<form method="POST" action="{{ url_for('grading.save_grades', assessment_id=assessment.id) }}" class="space-y-6">
<!-- Informations sur les types de notation -->
<div class="bg-blue-50 border border-blue-200 rounded-md p-4">
<h3 class="text-sm font-medium text-blue-900 mb-2">Guide de saisie</h3>
<div class="text-xs text-blue-800 space-y-1">
<p><strong>Points :</strong> Saisissez une valeur numérique (ex: 2.5, 3, 0)</p>
<p><strong>Score :</strong> 0=non acquis, 1=en cours, 2=acquis, 3=expert, .=non évalué</p>
</div>
</div>
<!-- Tableau de saisie -->
<div class="bg-white shadow rounded-lg overflow-hidden">
<div class="px-6 py-4 border-b border-gray-200">
<h2 class="text-lg font-medium text-gray-900">Grille de notation</h2>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider sticky left-0 bg-gray-50">
Élève
</th>
{% for element in grading_elements %}
<th scope="col" class="px-3 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider min-w-32">
<div>{{ element.label }}</div>
<div class="font-normal text-xs mt-1">
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium
{% if element.grading_type == 'score' %}bg-purple-100 text-purple-800{% else %}bg-green-100 text-green-800{% endif %}">
{% if element.grading_type == 'score' %}Score/{{ element.max_points|int }}{% else %}/{{ element.max_points }}{% endif %}
</span>
</div>
{% if element.skill %}
<div class="text-xs text-gray-400 mt-1">{{ element.skill }}</div>
{% endif %}
</th>
{% endfor %}
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
{% for student in students %}
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900 sticky left-0 bg-white">
{{ student.first_name }} {{ student.last_name }}
</td>
{% for element in grading_elements %}
{% set grade_key = student.id ~ '_' ~ element.id %}
{% set existing_grade = existing_grades.get(grade_key) %}
<td class="px-3 py-4 whitespace-nowrap text-center">
<div class="space-y-2">
{% if element.grading_type == 'score' %}
<select name="grade_{{ student.id }}_{{ element.id }}" class="block w-full text-sm border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500">
<option value="">-</option>
<option value="." {% if existing_grade and existing_grade.value == '.' %}selected{% endif %}>. (non évalué)</option>
<option value="0" {% if existing_grade and existing_grade.value == '0' %}selected{% endif %}>0 (non acquis)</option>
<option value="1" {% if existing_grade and existing_grade.value == '1' %}selected{% endif %}>1 (en cours)</option>
<option value="2" {% if existing_grade and existing_grade.value == '2' %}selected{% endif %}>2 (acquis)</option>
<option value="3" {% if existing_grade and existing_grade.value == '3' %}selected{% endif %}>3 (expert)</option>
</select>
{% else %}
<input type="number" step="0.1" min="0" max="{{ element.max_points }}"
name="grade_{{ student.id }}_{{ element.id }}"
value="{% if existing_grade %}{{ existing_grade.value }}{% endif %}"
class="block w-full text-sm border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500 text-center"
placeholder="0">
{% endif %}
<input type="text"
name="comment_{{ student.id }}_{{ element.id }}"
value="{% if existing_grade and existing_grade.comment %}{{ existing_grade.comment }}{% endif %}"
class="block w-full text-xs border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500"
placeholder="Commentaire (optionnel)">
</div>
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="px-6 py-4 bg-gray-50 border-t border-gray-200 flex justify-end space-x-3">
<a href="{{ url_for('assessments.detail', id=assessment.id) }}" class="px-4 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors">
Annuler
</a>
<button type="submit" class="px-4 py-2 bg-blue-600 text-white rounded-md text-sm font-medium hover:bg-blue-700 transition-colors">
Sauvegarder les notes
</button>
</div>
</div>
</form>
<!-- Légende -->
<div class="bg-white shadow rounded-lg">
<div class="px-6 py-4 border-b border-gray-200">
<h3 class="text-lg font-medium text-gray-900">Légende des exercices</h3>
</div>
<div class="px-6 py-4">
<div class="space-y-4">
{% for exercise in assessment.exercises|sort(attribute='order') %}
<div class="border-l-4 border-blue-500 pl-4">
<h4 class="font-medium text-gray-900">{{ exercise.title }}</h4>
{% if exercise.description %}
<p class="text-sm text-gray-600 mt-1">{{ exercise.description }}</p>
{% endif %}
<div class="mt-2 space-y-1">
{% for element in exercise.grading_elements %}
<div class="text-sm text-gray-700">
<span class="font-medium">{{ element.label }}</span>
{% if element.skill %} - {{ element.skill }}{% endif %}
{% if element.description %} : {{ element.description }}{% endif %}
</div>
{% endfor %}
</div>
</div>
{% endfor %}
</div>
</div>
</div>
{% endif %}
</div>
{% endblock %}