diff --git a/memento-note/app/api/ai/generate-exercises/route.ts b/memento-note/app/api/ai/generate-exercises/route.ts index 17c0bb6..426db77 100644 --- a/memento-note/app/api/ai/generate-exercises/route.ts +++ b/memento-note/app/api/ai/generate-exercises/route.ts @@ -3,7 +3,6 @@ import { auth } from '@/auth' import prisma from '@/lib/prisma' import { exerciseGeneratorService } from '@/lib/ai/services/exercise-generator.service' import { checkEntitlementOrThrow, QuotaExceededError, incrementUsageAsync } from '@/lib/entitlements' -import { useLanguage } from '@/lib/i18n' export async function POST(request: NextRequest) { try { diff --git a/memento-note/components/contextual-ai-chat.tsx b/memento-note/components/contextual-ai-chat.tsx index bf0ccc8..c900bd0 100644 --- a/memento-note/components/contextual-ai-chat.tsx +++ b/memento-note/components/contextual-ai-chat.tsx @@ -218,7 +218,7 @@ export function ContextualAIChat({ const [translateTarget, setTranslateTarget] = useState('') // Generate slides / diagram state - const [generateLoading, setGenerateLoading] = useState<'slides' | 'diagram' | null>(null) + const [generateLoading, setGenerateLoading] = useState<'slides' | 'diagram' | 'exercises' | null>(null) const [generateProgress, setGenerateProgress] = useState(0) const [generateResult, setGenerateResult] = useState(null) const [customLangInput, setCustomLangInput] = useState('') @@ -1228,6 +1228,54 @@ export function ContextualAIChat({ + {/* ── Générateur d'exercices ── */} + {noteId && ( +
+
+ +
+
+
+
+
+
{t('ai.generate.exercises') || 'Générer des exercices'}
+

{t('ai.generate.exercisesHint') || '5 exercices avec corrigés'}

+
+
+

+ {t('ai.generate.exercisesDesc') || "L'IA crée 5 exercices basés sur cette note, avec des niveaux de difficulté variés et des corrigés détaillés."} +

+ +
+
+ )} + {/* ── Personas IA ── */} diff --git a/memento-note/components/note-editor/note-editor-toolbar.tsx b/memento-note/components/note-editor/note-editor-toolbar.tsx index 7be4617..d5073f6 100644 --- a/memento-note/components/note-editor/note-editor-toolbar.tsx +++ b/memento-note/components/note-editor/note-editor-toolbar.tsx @@ -479,17 +479,6 @@ export function NoteEditorToolbar({ mode, onClose, onToggleAttachments, attachme {t('richTextEditor.exportPdf') || 'Exporter en PDF'} - - - {generatingExercises - ? - : - } - {generatingExercises - ? (t('richTextEditor.exercisesLoading') || 'Génération...') - : (t('richTextEditor.generateExercises') || 'Générer des exercices') - } - {t('richTextEditor.importMarkdown')} diff --git a/memento-note/locales/en.json b/memento-note/locales/en.json index abb5f05..3576bc2 100644 --- a/memento-note/locales/en.json +++ b/memento-note/locales/en.json @@ -2561,6 +2561,11 @@ "generateExercises": "Generate exercises", "exercisesLoading": "Generating exercises...", "exercisesGenerated": "exercises created!", + "aiGenerateExercises": "Generate exercises", + "aiGenerateExercisesHint": "5 exercises with answers", + "aiGenerateExercisesDesc": "AI creates 5 exercises based on this note, with varied difficulty levels and detailed answers.", + "aiGenerateExercisesCreated": "exercises created!", + "aiGenerateGenerateExercises": "Generate", "wizardStudyPlanner": "Study Plan", "wizardStudyPlannerDesc": "AI creates a revision plan based on spaced repetition.", "wizardExamDate": "Exam date", diff --git a/memento-note/locales/fr.json b/memento-note/locales/fr.json index e4fb740..9ebade7 100644 --- a/memento-note/locales/fr.json +++ b/memento-note/locales/fr.json @@ -2565,6 +2565,11 @@ "generateExercises": "Générer des exercices", "exercisesLoading": "Génération des exercices...", "exercisesGenerated": "exercices créés !", + "aiGenerateExercises": "Générer des exercices", + "aiGenerateExercisesHint": "5 exercices avec corrigés", + "aiGenerateExercisesDesc": "L'IA crée 5 exercices basés sur cette note, avec des niveaux de difficulté variés et des corrigés détaillés.", + "aiGenerateExercisesCreated": "exercices créés !", + "aiGenerateGenerateExercises": "Générer", "wizardStudyPlanner": "Planning de révision", "wizardStudyPlannerDesc": "L'IA crée un planning de révision basé sur la répétition espacée.", "wizardExamDate": "Date de l'examen",