Removed the used words check from fillBlanks since allow repetition wasn't implemented and messes up imports

This commit is contained in:
Carlos-Mesquita
2024-11-26 17:19:01 +00:00
parent 4e94773861
commit 48d3cfe5f8
2 changed files with 0 additions and 10 deletions

View File

@@ -4,7 +4,6 @@ interface Props {
letter: string;
word: string;
isSelected: boolean;
isUsed: boolean;
onClick: () => void;
onRemove?: () => void;
onEdit?: (newWord: string) => void;
@@ -15,7 +14,6 @@ const FillBlanksWord: React.FC<Props> = ({
letter,
word,
isSelected,
isUsed,
onClick,
onRemove,
onEdit,
@@ -36,10 +34,8 @@ const FillBlanksWord: React.FC<Props> = ({
) : (
<button
onClick={onClick}
disabled={isUsed}
className={`
min-w-0 flex-1 flex items-center gap-2 p-2 rounded-md border text-left transition-colors
${isUsed ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer hover:bg-blue-50'}
${isSelected ? 'border-blue-500 bg-blue-100' : 'border-gray-200'}
`}
>

View File

@@ -195,11 +195,6 @@ const FillBlanksLetters: React.FC<{ exercise: FillBlanksExercise; sectionId: num
});
};
const isWordUsed = (word: string): boolean => {
if (local.allowRepetition) return false;
return Array.from(answers.values()).includes(word);
};
const handleEditWord = (index: number, newWord: string) => {
if (!editing) setEditing(true);
@@ -299,7 +294,6 @@ const FillBlanksLetters: React.FC<{ exercise: FillBlanksExercise; sectionId: num
letter={wordItem.letter}
word={wordItem.word}
isSelected={answers.get(selectedBlankId || '') === wordItem.word}
isUsed={isWordUsed(wordItem.word)}
onClick={() => handleWordSelect(wordItem.word)}
onRemove={isEditMode ? () => handleRemoveWord(index) : undefined}
onEdit={isEditMode ? (newWord) => handleEditWord(index, newWord) : undefined}