学习模式自动提交,正确1秒/错误3秒后自动刷新
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -190,6 +190,13 @@ final class QuizViewController: UIViewController {
|
|||||||
if isSpelling {
|
if isSpelling {
|
||||||
spellingHintLabel.text = "\(question.word.word.count) 个字母,补全空缺部分"
|
spellingHintLabel.text = "\(question.word.word.count) 个字母,补全空缺部分"
|
||||||
spellingView.configure(blankedWord: question.blankedWord, blankPositions: question.blankPositions)
|
spellingView.configure(blankedWord: question.blankedWord, blankPositions: question.blankPositions)
|
||||||
|
if config.isStudyMode {
|
||||||
|
nextButton.isHidden = true
|
||||||
|
spellingView.onChange = { [weak self] in
|
||||||
|
guard let self, spellingView.isComplete else { return }
|
||||||
|
submitSpelling(spellingView.typedWord(), for: question)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
spellingView.onChange = { [weak self] in
|
spellingView.onChange = { [weak self] in
|
||||||
guard let self else { return }
|
guard let self else { return }
|
||||||
nextButton.isEnabled = spellingView.isComplete
|
nextButton.isEnabled = spellingView.isComplete
|
||||||
@@ -197,6 +204,7 @@ final class QuizViewController: UIViewController {
|
|||||||
nextButton.configuration?.title = "确认"
|
nextButton.configuration?.title = "确认"
|
||||||
nextButton.isEnabled = false
|
nextButton.isEnabled = false
|
||||||
nextButton.isHidden = false
|
nextButton.isHidden = false
|
||||||
|
}
|
||||||
spellingView.activate()
|
spellingView.activate()
|
||||||
} else if isDictation {
|
} else if isDictation {
|
||||||
dictationView.reset()
|
dictationView.reset()
|
||||||
@@ -348,16 +356,11 @@ final class QuizViewController: UIViewController {
|
|||||||
resultLabel.isHidden = false
|
resultLabel.isHidden = false
|
||||||
|
|
||||||
if config.isStudyMode {
|
if config.isStudyMode {
|
||||||
if correct {
|
|
||||||
nextButton.isHidden = true
|
nextButton.isHidden = true
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.8) { [weak self] in
|
let delay: TimeInterval = correct ? 1.0 : 3.0
|
||||||
|
DispatchQueue.main.asyncAfter(deadline: .now() + delay) { [weak self] in
|
||||||
self?.restart()
|
self?.restart()
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
nextButton.configuration?.title = "继续学习"
|
|
||||||
nextButton.isEnabled = true
|
|
||||||
nextButton.isHidden = false
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
nextButton.configuration?.title = currentIndex + 1 < questions.count ? "下一题" : "查看成绩"
|
nextButton.configuration?.title = currentIndex + 1 < questions.count ? "下一题" : "查看成绩"
|
||||||
nextButton.isEnabled = true
|
nextButton.isEnabled = true
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ final class WordDetailViewController: UIViewController {
|
|||||||
|
|
||||||
@objc private func startSpelling() {
|
@objc private func startSpelling() {
|
||||||
Haptics.selection()
|
Haptics.selection()
|
||||||
let config = QuizConfig(mode: .spelling, words: [word])
|
let config = QuizConfig(mode: .spelling, words: [word], isStudyMode: true)
|
||||||
navigationController?.pushViewController(QuizViewController(config: config), animated: true)
|
navigationController?.pushViewController(QuizViewController(config: config), animated: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user