diff --git a/src/pages/review.tsx b/src/pages/review.tsx index ad0d7a0..7c2ddcc 100644 --- a/src/pages/review.tsx +++ b/src/pages/review.tsx @@ -89,7 +89,7 @@ export default class ReviewPage extends React.Component { }; } - currentVocab = (id: number) => { + vocabFromId = (id: number) => { return this.vocab.find((el) => el.id === this.state.current.id); } @@ -124,6 +124,16 @@ export default class ReviewPage extends React.Component { // TODO: Show a hint console.log("Partially correct"); } else { + // Find the IVocab item + const vocab = this.vocabFromId(this.state.current.id); + if (vocab) { + // Re-Add the vocabulary item to the review queue + // TODO: Only re-add when it when it's not re-queued + vocabToReviewCard(vocab).forEach(this.reviewQueue.enqueue); + } else { + console.log("[ReviewPage::checkInput] Could not find IVocab item for wrong IReviewCard"); + } + this.setState({ popoverOpen: true, popoverText: "Das war nicht richtig", @@ -139,6 +149,7 @@ export default class ReviewPage extends React.Component { render() { const { question, qtype } = this.state.current; const questionTitle = `${question} (${reviewQTypeToStr(qtype)})`; + return
{ this.state.toSummary ? (