feat: 移除不再使用的配置文件和更新组件,提升代码整洁性
- 删除 .claude/settings.local.json 配置文件,清理不必要的代码。 - 更新多个组件以引入音频资源,增强用户互动体验。 - 调整引导对话文本,确保信息准确性和一致性。 - 更新图像资源,提升视觉内容的准确性和一致性。
This commit is contained in:
1 parent
cf64e7ec50
commit
8ba36a4a1a
132 files changed
+546
-454
No files matched your search
@@ -39,7 +39,7 @@ const LetterToSunzhongshan = ({
|
||||
const BLANK_1_ANSWER = "天下为公";
|
||||
const BLANK_2_ANSWER = "与时俱进";
|
||||
// 最后一个空的正确答案
|
||||
const LAST_BLANK_ANSWER = "仍须努力";
|
||||
const LAST_BLANK_ANSWER = "仍需努力";
|
||||
|
||||
// 前三个空的选项(所有空都用这三个选项)
|
||||
const SELECT_OPTIONS = [
|
||||
@@ -48,7 +48,7 @@ const LetterToSunzhongshan = ({
|
||||
{ value: "与时俱进", label: "与时俱进" },
|
||||
];
|
||||
|
||||
// 校验输入:前三个空必须选择正确答案,最后一个空必须是"仍须努力",其他空不能为空且不超过 10 个字符
|
||||
// 校验输入:前三个空必须选择正确答案,最后一个空必须是"仍需努力",其他空不能为空且不超过 10 个字符
|
||||
const validateBlanks = () => {
|
||||
// 计算占位总数,防止有些没被输入过而是 undefined
|
||||
const placeholderCount = (letterContent.match(/____/g) || []).length;
|
||||
@@ -69,7 +69,7 @@ const LetterToSunzhongshan = ({
|
||||
hasError = true;
|
||||
}
|
||||
} else if (i === placeholderCount - 1) {
|
||||
// 最后一个空:必须是"仍须努力"
|
||||
// 最后一个空:必须是"仍需努力"
|
||||
if (!v || v !== LAST_BLANK_ANSWER) {
|
||||
nextValues[i] = "";
|
||||
nextErrors[i] = true;
|
||||
@@ -251,31 +251,31 @@ const LetterToSunzhongshan = ({
|
||||
}
|
||||
|
||||
// 立即验证选择是否正确
|
||||
let correctAnswer = "";
|
||||
if (currentIndex === 0) {
|
||||
correctAnswer = BLANK_0_ANSWER;
|
||||
} else if (currentIndex === 1) {
|
||||
correctAnswer = BLANK_1_ANSWER;
|
||||
} else if (currentIndex === 2) {
|
||||
correctAnswer = BLANK_2_ANSWER;
|
||||
}
|
||||
// let correctAnswer = "";
|
||||
// if (currentIndex === 0) {
|
||||
// correctAnswer = BLANK_0_ANSWER;
|
||||
// } else if (currentIndex === 1) {
|
||||
// correctAnswer = BLANK_1_ANSWER;
|
||||
// } else if (currentIndex === 2) {
|
||||
// correctAnswer = BLANK_2_ANSWER;
|
||||
// }
|
||||
|
||||
if (
|
||||
correctAnswer &&
|
||||
selectedValue !== correctAnswer
|
||||
) {
|
||||
// 选择错误,显示错误提示
|
||||
setErrorAlertText(
|
||||
"请选择正确答案"
|
||||
);
|
||||
setShowErrorAlert(true);
|
||||
// 清空选择
|
||||
next[currentIndex] = "";
|
||||
setBlankValues(next);
|
||||
const nextErrs = [...blankErrors];
|
||||
nextErrs[currentIndex] = true;
|
||||
setBlankErrors(nextErrs);
|
||||
}
|
||||
// if (
|
||||
// correctAnswer &&
|
||||
// selectedValue !== correctAnswer
|
||||
// ) {
|
||||
// // 选择错误,显示错误提示
|
||||
// setErrorAlertText(
|
||||
// "请选择正确答案"
|
||||
// );
|
||||
// setShowErrorAlert(true);
|
||||
// // 清空选择
|
||||
// next[currentIndex] = "";
|
||||
// setBlankValues(next);
|
||||
// const nextErrs = [...blankErrors];
|
||||
// nextErrs[currentIndex] = true;
|
||||
// setBlankErrors(nextErrs);
|
||||
// }
|
||||
}}
|
||||
placeholder="请选择"
|
||||
error={blankErrors[currentIndex]}
|
||||
@@ -286,7 +286,7 @@ const LetterToSunzhongshan = ({
|
||||
// 其他空:文本输入
|
||||
<input
|
||||
name={`blank-${currentIndex}`}
|
||||
className={`inline-block w-[110px] h-[36px] mx-2 mb-2 align-middle bg-transparent border-b-2 border-dashed [font-size:26px_!important] text-center outline-none ${
|
||||
className={`inline-block w-[110px] h-[36px] mx-2 bg-transparent border-b-2 border-dashed [font-size:26px_!important] text-center outline-none ${
|
||||
blankErrors[currentIndex]
|
||||
? "border-red-500"
|
||||
: "border-[#4e402e]"
|
||||
|
||||
Reference in new issue
Block a user