fixed a bug
This commit is contained in:
@@ -642,13 +642,17 @@ const VocabularyStudy: React.FC = () => {
|
|||||||
answerSubmittingRef.current = false;
|
answerSubmittingRef.current = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (testType === 'multiple-choice' && options.length > 0 && options.every(option => option.token !== userAnswer)) {
|
const normalizedUserAnswer = userAnswer.trim();
|
||||||
|
if (!normalizedUserAnswer) {
|
||||||
|
answerSubmittingRef.current = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (testType === 'multiple-choice' && options.length > 0 && options.every(option => option.token !== normalizedUserAnswer)) {
|
||||||
answerSubmittingRef.current = false;
|
answerSubmittingRef.current = false;
|
||||||
message.warning('请选择一个选项后再提交');
|
message.warning('请选择一个选项后再提交');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const submittedAt = Date.now();
|
const submittedAt = Date.now();
|
||||||
const normalizedUserAnswer = userAnswer.trim();
|
|
||||||
const answerProof = buildAnswerProof(
|
const answerProof = buildAnswerProof(
|
||||||
testAttemptId,
|
testAttemptId,
|
||||||
currentQuestion.questionToken,
|
currentQuestion.questionToken,
|
||||||
@@ -1411,6 +1415,7 @@ const VocabularyStudy: React.FC = () => {
|
|||||||
style={{ marginBottom: 15, userSelect: 'none', WebkitUserSelect: 'none' }}
|
style={{ marginBottom: 15, userSelect: 'none', WebkitUserSelect: 'none' }}
|
||||||
onPressEnter={e => {
|
onPressEnter={e => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
if (!userAnswer.trim() || showAnswer) return;
|
||||||
submitAnswer();
|
submitAnswer();
|
||||||
}}
|
}}
|
||||||
autoFocus
|
autoFocus
|
||||||
@@ -1444,7 +1449,7 @@ const VocabularyStudy: React.FC = () => {
|
|||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
onClick={submitAnswer}
|
onClick={submitAnswer}
|
||||||
disabled={!userAnswer || showAnswer}
|
disabled={!userAnswer.trim() || showAnswer}
|
||||||
style={{ width: '100%' }}
|
style={{ width: '100%' }}
|
||||||
>
|
>
|
||||||
提交答案
|
提交答案
|
||||||
|
|||||||
Reference in New Issue
Block a user