clean: code cleaning

This commit is contained in:
2025-08-16 15:50:54 +02:00
parent 6549591f63
commit e1c4e1b0ea
4 changed files with 34 additions and 23 deletions

2
app.py
View File

@@ -14,7 +14,6 @@ from routes.grading import bp as grading_bp
from routes.config import bp as config_bp
from routes.domains import bp as domains_bp
from routes.classes import bp as classes_bp
# from routes.student_movements import bp as student_movements_bp # Désactivé car page supprimée
def create_app(config_name=None):
if config_name is None:
@@ -46,7 +45,6 @@ def create_app(config_name=None):
app.register_blueprint(config_bp)
app.register_blueprint(domains_bp)
app.register_blueprint(classes_bp)
# app.register_blueprint(student_movements_bp) # Désactivé car page supprimée
# Register CLI commands
app.cli.add_command(init_db)

View File

@@ -9,22 +9,40 @@ from .assessment_services import (
GradingStrategyFactory
)
# Import de l'ancien service pour rétrocompatibilité
import importlib.util
import os
# Legacy service - TODO: Migrer vers architecture moderne
# Import via path absolu pour éviter circularité
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent.parent))
# Charger AssessmentService depuis services.py
try:
services_file_path = os.path.join(os.path.dirname(__file__), '..', 'services.py')
spec = importlib.util.spec_from_file_location("legacy_services", services_file_path)
legacy_services = importlib.util.module_from_spec(spec)
spec.loader.exec_module(legacy_services)
AssessmentService = legacy_services.AssessmentService
except Exception:
# Fallback en cas d'erreur
# Import direct pour éviter la circularité
from importlib import import_module
spec_path = Path(__file__).parent.parent / 'services.py'
if spec_path.exists():
# Import dynamique du module legacy
import importlib.util
spec = importlib.util.spec_from_file_location("legacy_services", spec_path)
legacy_module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(legacy_module)
AssessmentService = legacy_module.AssessmentService
else:
raise ImportError("Legacy services.py not found")
except ImportError:
# Fallback minimal
class AssessmentService:
"""Fallback pour AssessmentService"""
pass
"""Fallback pour AssessmentService - migration required"""
@staticmethod
def process_assessment_with_exercises(*args, **kwargs):
raise NotImplementedError("Legacy service not available")
@staticmethod
def create_assessment(*args, **kwargs):
raise NotImplementedError("Legacy service not available")
@staticmethod
def update_assessment_basic_info(*args, **kwargs):
raise NotImplementedError("Legacy service not available")
__all__ = [
'AssessmentService', # Service legacy

View File

@@ -528,8 +528,6 @@ class ClassDashboard {
if (domKey === 'assessments_count') {
// Format spécial pour le nombre d'évaluations
const count = resultsData[apiKey];
console.log('DEBUG assessments_count:', count, 'type:', typeof count);
console.log('DEBUG full resultsData:', resultsData);
// Vérification de sécurité
const safeCount = (count !== undefined && count !== null && !isNaN(count)) ? count : 0;

View File

@@ -125,18 +125,15 @@
<!-- Modals et JavaScript -->
<script>
function editGeneralConfig() {
// TODO: Implémenter modal d'édition
alert('Fonctionnalité en cours de développement');
alert('Édition de configuration générale - Fonctionnalité en développement');
}
function exportConfig() {
// TODO: Implémenter export
alert('Fonctionnalité en cours de développement');
alert('Export de configuration - Fonctionnalité en développement');
}
function importConfig() {
// TODO: Implémenter import
alert('Fonctionnalité en cours de développement');
alert('Import de configuration - Fonctionnalité en développement');
}
function resetConfig() {