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

View File

@@ -9,22 +9,40 @@ from .assessment_services import (
GradingStrategyFactory GradingStrategyFactory
) )
# Import de l'ancien service pour rétrocompatibilité # Legacy service - TODO: Migrer vers architecture moderne
import importlib.util # Import via path absolu pour éviter circularité
import os import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent.parent))
# Charger AssessmentService depuis services.py
try: try:
services_file_path = os.path.join(os.path.dirname(__file__), '..', 'services.py') # Import direct pour éviter la circularité
spec = importlib.util.spec_from_file_location("legacy_services", services_file_path) from importlib import import_module
legacy_services = importlib.util.module_from_spec(spec) spec_path = Path(__file__).parent.parent / 'services.py'
spec.loader.exec_module(legacy_services) if spec_path.exists():
AssessmentService = legacy_services.AssessmentService # Import dynamique du module legacy
except Exception: import importlib.util
# Fallback en cas d'erreur 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: class AssessmentService:
"""Fallback pour AssessmentService""" """Fallback pour AssessmentService - migration required"""
pass @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__ = [ __all__ = [
'AssessmentService', # Service legacy 'AssessmentService', # Service legacy

View File

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

View File

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