@@ -72,10 +72,17 @@ struct QuizView: View {
|
||||
Button {
|
||||
select(option, for: question)
|
||||
} label: {
|
||||
Text(option)
|
||||
.font(.headline)
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding(.vertical, 14)
|
||||
VStack(spacing: 4) {
|
||||
Text(option)
|
||||
.font(.headline)
|
||||
if config.mode == .zhToEn, let w = config.words.first(where: { $0.word == option }) {
|
||||
Text(w.phonetic)
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding(.vertical, 10)
|
||||
}
|
||||
.buttonStyle(.bordered)
|
||||
.tint(optionColor(option, for: question))
|
||||
@@ -88,11 +95,6 @@ struct QuizView: View {
|
||||
Text(selectedOption == question.answer ? "回答正确" : "正确答案:\(question.answer)")
|
||||
.font(.headline)
|
||||
.foregroundStyle(selectedOption == question.answer ? .green : .red)
|
||||
if config.mode == .zhToEn, selectedOption != nil {
|
||||
Text(question.word.phonetic)
|
||||
.font(.subheadline)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
Button(currentIndex + 1 < questions.count ? "下一题" : "查看成绩") {
|
||||
next()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user