diff --git a/src/components/admin/TestManager.jsx b/src/components/admin/TestManager.jsx index b6ba18b..d4619ee 100644 --- a/src/components/admin/TestManager.jsx +++ b/src/components/admin/TestManager.jsx @@ -34,7 +34,7 @@ const TestManager = () => { loadData(); }, [selectedTopic]); - const handleGenerate = async (topic, count = 10) => { + const handleGenerate = async (topic, count = 5) => { setLoadingTopicId(topic.id); setError(null); try { @@ -97,8 +97,8 @@ const TestManager = () => { {questions.length === 0 ? (

No questions generated for this topic yet.

-
) : ( diff --git a/src/lib/testService.js b/src/lib/testService.js index b6daa36..1329e98 100644 --- a/src/lib/testService.js +++ b/src/lib/testService.js @@ -7,7 +7,7 @@ const QUIZ_SYSTEM = `You are a quiz generator for Respellion, an internal IT com You generate multiple-choice questions to test employee knowledge on specific topics. Always write in clear, professional English. -Emit questions through the emit_quiz_questions tool. Each question has exactly four options; correctIndex is 0-based; mix difficulty roughly 4 easy / 4 medium / 2 hard.`; +Emit questions through the emit_quiz_questions tool. Each question has exactly four options; correctIndex is 0-based. For a typical 5-question batch, mix difficulty roughly 2 easy / 2 medium / 1 hard; scale the ratio proportionally for larger batches.`; const cachedSystem = (text) => [{ type: 'text', text, cache_control: { type: 'ephemeral' } }]; @@ -67,7 +67,7 @@ export async function getCachedQuiz(userId, weekNumber) { return db.getCachedQuiz(userId, weekNumber); } -export async function forceGenerateTopicQuestions(topic, count = 10) { +export async function forceGenerateTopicQuestions(topic, count = 5) { let bank = await db.getQuizBank(topic.id); const prompt = `Generate exactly ${count} multiple-choice quiz questions for this knowledge topic and emit them via the emit_quiz_questions tool: @@ -105,7 +105,9 @@ async function getOrGenerateTopicQuestions(topic, count) { let bank = await db.getQuizBank(topic.id); if (bank.length < count) { - await forceGenerateTopicQuestions(topic, 10); + // Seed an empty/low bank with a small initial batch; admins can grow it + // explicitly via TestManager when they want more depth per topic. + await forceGenerateTopicQuestions(topic, 5); bank = await db.getQuizBank(topic.id); }