@@ -72,10 +72,17 @@ struct QuizView: View {
|
|||||||
Button {
|
Button {
|
||||||
select(option, for: question)
|
select(option, for: question)
|
||||||
} label: {
|
} label: {
|
||||||
Text(option)
|
VStack(spacing: 4) {
|
||||||
.font(.headline)
|
Text(option)
|
||||||
.frame(maxWidth: .infinity)
|
.font(.headline)
|
||||||
.padding(.vertical, 14)
|
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)
|
.buttonStyle(.bordered)
|
||||||
.tint(optionColor(option, for: question))
|
.tint(optionColor(option, for: question))
|
||||||
@@ -88,11 +95,6 @@ struct QuizView: View {
|
|||||||
Text(selectedOption == question.answer ? "回答正确" : "正确答案:\(question.answer)")
|
Text(selectedOption == question.answer ? "回答正确" : "正确答案:\(question.answer)")
|
||||||
.font(.headline)
|
.font(.headline)
|
||||||
.foregroundStyle(selectedOption == question.answer ? .green : .red)
|
.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 ? "下一题" : "查看成绩") {
|
Button(currentIndex + 1 < questions.count ? "下一题" : "查看成绩") {
|
||||||
next()
|
next()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user