fixed a bug
This commit is contained in:
@@ -619,7 +619,7 @@ const VocabularyStudy: React.FC = () => {
|
||||
));
|
||||
setUserAnswer(response.optionToken);
|
||||
} catch (error) {
|
||||
message.error(INVALID_CREDENTIAL_MESSAGE);
|
||||
setUserAnswer(option.text);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -647,7 +647,10 @@ const VocabularyStudy: React.FC = () => {
|
||||
answerSubmittingRef.current = false;
|
||||
return;
|
||||
}
|
||||
if (testType === 'multiple-choice' && options.length > 0 && options.every(option => option.token !== normalizedUserAnswer)) {
|
||||
const isKnownMultipleChoiceAnswer = options.some(option =>
|
||||
option.token === normalizedUserAnswer || option.text === normalizedUserAnswer
|
||||
);
|
||||
if (testType === 'multiple-choice' && options.length > 0 && !isKnownMultipleChoiceAnswer) {
|
||||
answerSubmittingRef.current = false;
|
||||
message.warning('请选择一个选项后再提交');
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user