Skip to content

Duplicate Pokemon catches allowed - unclear if intentional or missing validation #81

@tomblancdev

Description

@tomblancdev

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

  1. Should users be able to catch multiple of the same Pokemon species?
  2. If yes, is this intentional or a missing feature?
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:mcp-serverMCP Server areaenhancementNew feature or requestpriority:lowLow priority - nice to have, cosmeticqaQuality Assurance issues

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions