Mind-Quest: The Quiz Builder That Makes AI Behave Like a Backend Feature
Inside a teacher-first LMS workflow that turns raw model output into structured questions, auto-grades them, and feeds student mistakes back into analytics.
- Mind-Quest treats the schema as the product boundary, so the model can draft content without deciding what counts as a valid quiz.
- Its hybrid authoring flow keeps teachers in control, which makes the AI feel like an assistant instead of an automation black box.
- The most important backend move is the conversion from flat language model output into nested quiz records the database can trust.
- Scoring becomes useful because the app stores detailed answer data, not just a final percentage, which turns grading into diagnosis.
AI, but only inside the lines
Most AI quiz tools stop at generation. Mind-Quest does the harder thing: it confines generation to a schema the rest of the app can rely on. That changes the role of the model from author to draft engine.
The implementation pattern is straightforward and smart. A system prompt asks Gemini for JSON, then the backend strips common code-fence noise before parsing. The model can wander a little. The application does not.
A teacher can draft, edit, and ship without prompt engineering
The frontend workflow is deliberately humane. In CreateQuiz.js, a teacher can write questions manually or ask AI to pre-fill the form, then edit the result before publishing. That matters because it keeps human judgment in the loop at the exact point where most AI tools try to remove it.
This is the difference between a generator and a collaborator. The teacher is not forced to trust the first answer. They can inspect it, fix it, and ship only what survives review.
What the backend is actually doing
The backend looks like a clean MERN-style split. Express controllers handle the quiz and result logic, Mongoose models define the data shape, JWT protects sessions, and role checks keep student and teacher permissions separate. The AI service sits off to the side as one module, not as the whole architecture.
// aiService.js: request raw JSON, then clean common fence noise
const response = await model.generateContent(prompt);
let text = response.response.text();
text = text.replace(/```json/g, '').replace(/```/g, '');
const parsed = JSON.parse(text);
That cleanup step is small but revealing. It acknowledges the messy reality of LLMs and treats resilience as part of product design, not an afterthought.
The smartest part is the conversion from text to structure
The most interesting code path is the one that takes flat AI output and turns it into nested quiz data. That is where the system stops being a text tool and starts acting like an application.
const formattedQuestions = aiQuestions.map((q) => ({
text: q.question,
options: q.options.map((opt) => ({
text: opt,
isCorrect: opt === q.correctAnswer,
})),
}));
This is the heart of the repo. The model can brainstorm, but only the app decides what becomes a question, what becomes an option, and what gets marked correct.
Scoring is not just scoring
The result controller does more than total correct answers. It persists detailed answers, which means the system can later show students what they missed and let teachers inspect patterns without recomputing the whole grading flow.
That design choice is easy to miss and easy to undervalue. Stored explanations turn grading into a reusable data asset.
Teachers do not just get quizzes. They get diagnosis
| Mode | Control | Speed | Reliability | Editability | Teacher confidence |
|---|---|---|---|---|---|
| Manual LMS authoring | High | Low | High | High | High |
| Prompt-first AI quiz generator | Low | High | Medium | Low | Low |
| Mind-Quest hybrid workflow | High | High | High | High | High |




