Description
The `submitQuizResult` handler adds Pokemon to the pokedex without checking if the same Pokemon was already caught in the same topic/course. While this may be intentional (catch duplicates), there's no clear documentation of this behavior.
Location
`src/mcp-server/src/tools/quiz.ts` - `submitQuizResultHandler` (lines 278-312)
Current Behavior
```typescript
// Add Pokemon to pokedex if caught
if (passed) {
const pokedexResult = await readYaml("pokedex.yaml");
if (pokedexResult.success && pokedexResult.data) {
const pokedex = pokedexResult.data;
const newPokemon: PokemonEntry = {
id: \`\${session.pokemon.name.toLowerCase()}-\${Date.now()}\`, // Unique ID by timestamp
// ...
};
pokedex.pokemon.push(newPokemon); // Always adds, no duplicate check
// ...
}
}
```
Design Questions
- Should users be able to catch multiple of the same Pokemon species?
- If yes, is this intentional or a missing feature?
- Should there be a "shiny" variant for repeat catches?
Potential UX Issues
- User catches Pikachu for docker/basics
- User catches another Pikachu for docker/basics (same quiz retaken)
- Pokedex now shows two identical Pikachus
Expected Behavior Options
Option A: Allow duplicates (current, but document it)
Document that retaking quizzes gives new Pokemon, like Pokemon GO.
Option B: Prevent duplicates per topic/course
```typescript
const existingPokemon = pokedex.pokemon.find(
p => p.pokedex_number === session.pokemon.pokedexNumber
&& p.topic === session.topic
&& p.course === session.course
);
if (existingPokemon) {
// Award points but no duplicate Pokemon
}
```
Option C: "Candy" system like Pokemon GO
Duplicate catches give "evolution candy" instead.
Suggested Action
Document the intended duplicate behavior in user-guide.md and CLAUDE.md.
Description
The `submitQuizResult` handler adds Pokemon to the pokedex without checking if the same Pokemon was already caught in the same topic/course. While this may be intentional (catch duplicates), there's no clear documentation of this behavior.
Location
`src/mcp-server/src/tools/quiz.ts` - `submitQuizResultHandler` (lines 278-312)
Current Behavior
```typescript
// Add Pokemon to pokedex if caught
if (passed) {
const pokedexResult = await readYaml("pokedex.yaml");
if (pokedexResult.success && pokedexResult.data) {
const pokedex = pokedexResult.data;
}
}
```
Design Questions
Potential UX Issues
Expected Behavior Options
Option A: Allow duplicates (current, but document it)
Document that retaking quizzes gives new Pokemon, like Pokemon GO.
Option B: Prevent duplicates per topic/course
```typescript
const existingPokemon = pokedex.pokemon.find(
p => p.pokedex_number === session.pokemon.pokedexNumber
&& p.topic === session.topic
&& p.course === session.course
);
if (existingPokemon) {
// Award points but no duplicate Pokemon
}
```
Option C: "Candy" system like Pokemon GO
Duplicate catches give "evolution candy" instead.
Suggested Action
Document the intended duplicate behavior in user-guide.md and CLAUDE.md.