From 2f85a10320ffd533e1621a02cdabed6810bc50a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=8D=9A=E6=96=87?= <15549487+FX_YBW@user.noreply.gitee.com> Date: Fri, 10 Oct 2025 11:25:52 +0800 Subject: [PATCH 1/6] =?UTF-8?q?v1.5=20=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- users.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 users.txt diff --git a/users.txt b/users.txt new file mode 100644 index 0000000..a8b1249 --- /dev/null +++ b/users.txt @@ -0,0 +1 @@ +张三,1798231811@qq.com,123456 -- 2.34.1 From 8a477d5d690bb0ee57e2ce5144dd1a23f82b2588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=96=E5=85=AE=E5=86=89?= <15550273+wang-shengfa-11@user.noreply.gitee.com> Date: Fri, 10 Oct 2025 10:57:33 +0800 Subject: [PATCH 2/6] =?UTF-8?q?v2.1=20=E6=B7=BB=E5=8A=A0=E4=BA=86=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=90=8D=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=B9=B6=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E5=9F=BA=E6=9C=AC=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- images/default-avatar.png | Bin 0 -> 2204 bytes .../wsf/mathapp/controller/SceneManager.java | 32 +++-- .../wsf/mathapp/view/LevelSelectionView.java | 8 +- .../com/wsf/mathapp/view/MainMenuView.java | 10 +- .../java/com/wsf/mathapp/view/ResultView.java | 2 +- .../com/ybw/mathapp/LoginAndRegister.java | 132 ------------------ 6 files changed, 36 insertions(+), 148 deletions(-) create mode 100644 images/default-avatar.png delete mode 100644 src/main/java/com/ybw/mathapp/LoginAndRegister.java diff --git a/images/default-avatar.png b/images/default-avatar.png new file mode 100644 index 0000000000000000000000000000000000000000..e7fe7f48ec60ab024aeb904a5747326dad994e82 GIT binary patch literal 2204 zcmchXc|4R`7{|~1&Ss6tk|hygT>YrQpkNbPibKd9kp65O1`JVH94)PRv1r+UV z*V+OI0$>gL0Hh17r-l0M2Ef4q%m)BS0VviFU{MbZ0UD?QfZ;#@gT5ijHx4{C%Hd$9 zeMulP2q=!e%wT4aFY{L&vjvL)Wz|{-tYkJ+lfM3>tJtcQ@GKEr$MRUxX9h&8B9U8w zCrI6Og0T1FNPC{hG4gu%dA3=St*28uw( z0hWlHIhSmWS90MS*N4SfSclF@u~i^WSQ zOD$L1&}{A2thL|dym`ykZH(=nUf#QXeEs}`g7<~&4?Pfe__yeo*duZACzDU5oK8J+ z_FP70)}`#rSFZkXy`Zq@M)A#((wf_~ckXiU)zvq*v_5{)_Vn5FuI|@8y>I&Zd2aM3f80Vlh~PgbRZAOTdX(+*~q#rnM8nBS1;llr5#a zDk=S1wX~kuM!w3fz$O{hdFEaE0twnA+4q4R`cGt2VAEXfU^QA;62WN0z%Y7L7*tpk z0Tm99n-uLI?3b=FpNc;G#-ba8vAYs=|Ia;26+zTFc4Zy7$TqoaW^R= z9(<1>jXx0E^mVL}sagDX&(b^U2c&GQlhdpxq5(xQYzqwmN6bx3CMxWQG=q40(c*o> z3u_-G%+ff;rSTKqYn2M-tZo>vY?z0Zs)Nf`e0aaetM*O_|BUxmtB?a6qq+Ih94Yg?^jUg4hcC5xxU$YSy$#5 z$YpsE8x#E_fU*;9%A%0wuhTZZx6({>(p9!5&&NkxDm-F${h|v3wD1*?m5!g%4N^b) z--SlQ6U1}Rk2?|?p2-h~HQA}D2{TwSqzu-|r=o@3hHd2rH&Us8571La93grm+pYTd ziN`}x10&|0?OXp!E9vPIyr^ofyheFz=?FW~l))E+kd|+9>0>@8*q(GXXlEp5ZO~)x z45XgT&)B0`t0A8j7wlKK?A7uzb}_X>$gE*eDGCntixhO@I|Oss5nUB-4)Z@PE)5nM z4{mct7hr}4S+y>w=g_ivx89|`_Y^sYq4_s!7koG&@LOWpb6D0`t*xK@$=0|(mstH; zC9Z35#-rQYZ8S{cyD82_)R!yT1$pJ~`qVgZJZZ`lkk+p=CW)i6SCDe^+_$zAt}|@4 zFtQ=*^rZF11A%+ubBFSCxEt4^mAH$JhFInt3J~qhPl_Q=R9TKZir1bQdo26--5N8M zlrkn%IXru3twKF+RM zUjH~J#>MFPoAzqEezM4s&|dj;f|T1~$Y?1l(=Tt)XY8WZQuF+PozvHak362vpU~?> z4`BLe(nGo_je!qYvtE4Myw_GNZ%jY$T-t3MY`S=bvR7M;m?Aos7uw(x!+gQW={4bc zw684TD1-=#xmwHCcX)UGyyJo8JzG!r%j*#^e=Le2m{HJeoO~dsp@rPz!x7%c@AOSBl&gT}RBh%Z)>NkPw{qppoOSQt zS+>`k_lA9>Zd9i$%6?4K|6*%qg34sV}kU47EP!PX0PJ9bsd z@|V=QdRC_z&8Aiq{Ul2pe374?Un0E!F~Wr&yQxUK?1Cz7d{F}l9#KZKKusHYGQA_c z;X#@YUp?GHY74T+;*j1C%`qN+5Tm}kA button.setStyle(String.format( "-fx-background-color: %s; -fx-text-fill: white; -fx-font-size: 16px; -fx-font-weight: bold; " + - "-fx-background-radius: 12; -fx-padding: 12 30; -fx-effect: drop shadow(gaussian, rgba(0,0,0,0.3), 10, 0.4, 3, 3);", + "-fx-background-radius: 12; -fx-padding: 12 30; -fx-effect: dropshadow(gaussian, rgba(0,0,0,0.3), 10, 0.4, 3, 3);", hoverColor ))); button.setOnMouseExited(e -> button.setStyle(String.format( "-fx-background-color: %s; -fx-text-fill: white; -fx-font-size: 16px; -fx-font-weight: bold; " + - "-fx-background-radius: 12; -fx-padding: 12 30; -fx-effect: drop shadow(gaussian, rgba(0,0,0,0.2), 8, 0.3, 2, 2);", + "-fx-background-radius: 12; -fx-padding: 12 30; -fx-effect: dropshadow(gaussian, rgba(0,0,0,0.2), 8, 0.3, 2, 2);", color ))); return button; diff --git a/src/main/java/com/wsf/mathapp/view/MainMenuView.java b/src/main/java/com/wsf/mathapp/view/MainMenuView.java index 2734eee..8953009 100644 --- a/src/main/java/com/wsf/mathapp/view/MainMenuView.java +++ b/src/main/java/com/wsf/mathapp/view/MainMenuView.java @@ -69,7 +69,7 @@ public class MainMenuView { avatarCircle.setStrokeWidth(2); // 添加阴影效果 - avatarCircle.setStyle("-fx-effect: drop shadow(gaussian, rgba(0,0,0,0.2), 5, 0.3, 2, 2);"); + avatarCircle.setStyle("-fx-effect: dropshadow(gaussian, rgba(0,0,0,0.2), 5, 0.3, 2, 2);"); // 添加首字母文本 avatarText = new Text(getFirstLetter()); @@ -230,8 +230,12 @@ public class MainMenuView { } // 调用修改密码的后端逻辑 - ChangePassword.changePassword(currentUsername, confirmPwd); - showAlert("成功", "密码修改成功!"); + if(!ChangePassword.changePassword(currentUsername, confirmPwd)){ + showAlert("错误", "密码修改失败"); + } + else{ + showAlert("成功", "密码修改成功!"); + } } return null; }); diff --git a/src/main/java/com/wsf/mathapp/view/ResultView.java b/src/main/java/com/wsf/mathapp/view/ResultView.java index a1bb0c8..5276044 100644 --- a/src/main/java/com/wsf/mathapp/view/ResultView.java +++ b/src/main/java/com/wsf/mathapp/view/ResultView.java @@ -95,7 +95,7 @@ public class ResultView { private Image createTextAvatar() { // 创建一个简单的文本头像(使用首字母) - String firstLetter = currentUsername.length() > 0 ? + String firstLetter = !currentUsername.isEmpty() ? currentUsername.substring(0, 1).toUpperCase() : "U"; // 这里可以创建一个包含文本的图像,但为了简单起见,我们使用CSS样式 diff --git a/src/main/java/com/ybw/mathapp/LoginAndRegister.java b/src/main/java/com/ybw/mathapp/LoginAndRegister.java deleted file mode 100644 index d71d548..0000000 --- a/src/main/java/com/ybw/mathapp/LoginAndRegister.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.ybw.mathapp; - -// UserService.java -import com.ybw.mathapp.entity.User; -import com.ybw.mathapp.service.EmailService; -import com.ybw.mathapp.util.LoginFileUtils; -import java.util.Scanner; -import java.util.regex.Pattern; - -public class LoginAndRegister { - private static Scanner scanner = new Scanner(System.in); - - // UserService.java 中的注册方法更新 - public static boolean register() { - System.out.println("\n=== 用户注册 ==="); - - // 输入邮箱 - System.out.print("请输入邮箱地址: "); - String email = scanner.nextLine().trim(); - - if (!isValidEmail(email)) { - return false; - } - - if (LoginFileUtils.isEmailRegistered(email)) { - System.out.println("该邮箱已注册,请直接登录!"); - return false; - } - - // 发送、验证验证码 - if (!sendAndVerifyCode(email)) { - return false; - } - - // 设置密码(其余代码保持不变) - System.out.print("请输入密码: "); - String password1 = scanner.nextLine(); - System.out.print("请再次输入密码: "); - String password2 = scanner.nextLine(); - if(!isVaildPassword(password1, password2)) { - return false; - } - - User user = new User(email, password1); - LoginFileUtils.saveUser(user); - System.out.println("注册成功!您可以使用邮箱和密码登录了。"); - return true; - } - - // 登录流程 - public static boolean login() { - System.out.println("\n=== 用户登录 ==="); - - System.out.print("请输入邮箱: "); - String email = scanner.nextLine().trim(); - - System.out.print("请输入密码: "); - String password = scanner.nextLine(); - - if (LoginFileUtils.validateUser(email, password)) { - System.out.println("登录成功!欢迎回来," + email); - return true; - } else { - System.out.println("邮箱或密码错误!"); - return false; - } - } - - // - /** - * 邮箱格式验证 - * @param email 待验证的邮箱地址 - * @return true表示邮箱格式正确,false表示邮箱格式错误 - */ - private static boolean isValidEmail(String email) { - if (email.isEmpty()) { - System.out.println("邮箱地址不能为空!"); - return false; - } - if (!(email.contains("@") && email.contains("."))) { - System.out.println("邮箱格式不正确!"); - return false; - } - return true; - } - - /** - * 密码格式验证 - * @param password1 第一次输入的密码 - * @param password2 第二次输入的密码 - * @return true表示符合要求,false表示不符合 - */ - public static boolean isVaildPassword(String password1, String password2) { - if (password1 == null || password1.length() < 6 || password1.length() > 10) { - return false; - } - - // 使用正则表达式验证:长度6-10,只包含字母数字,且包含大小写字母和数字 - String regex = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[a-zA-Z\\d]{6,10}$"; - if (!Pattern.matches(regex, password1)) { - return false; - } - - System.out.print("请再次输入密码: "); - if (!password1.equals(password2)) { - System.out.println("两次输入的密码不一致!"); - return false; - } - return true; - } - - public static boolean sendAndVerifyCode(String email) { - // 发送真实邮件验证码 - String verificationCode = EmailService.generateVerificationCode(); - System.out.println("正在发送验证码邮件,请稍候..."); - - if (!EmailService.sendVerificationCode(email, verificationCode)) { - System.out.println("发送验证码失败,请检查邮箱配置或稍后重试!"); - return false; - } - - // 验证验证码 - System.out.print("请输入收到的验证码: "); - String inputCode = scanner.nextLine().trim(); - - if (!EmailService.verifyCode(email, inputCode)) { - System.out.println("验证码错误或已过期!"); - return false; - } - return true; - } -} -- 2.34.1 From 3457e64dcc12c9d30dc81211a4b9d1d498cf677d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=8D=9A=E6=96=87?= <15549487+FX_YBW@user.noreply.gitee.com> Date: Fri, 10 Oct 2025 22:36:55 +0800 Subject: [PATCH 3/6] =?UTF-8?q?v1.6=20=E5=B0=8F=E5=AD=A6=E9=A2=98=E7=9B=AE?= =?UTF-8?q?=E6=8E=92=E9=99=A4=E9=99=A4=E9=9B=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ybw/mathapp/service/PrimarySchoolGenerator.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/ybw/mathapp/service/PrimarySchoolGenerator.java b/src/main/java/com/ybw/mathapp/service/PrimarySchoolGenerator.java index 9374b69..3b2bb81 100644 --- a/src/main/java/com/ybw/mathapp/service/PrimarySchoolGenerator.java +++ b/src/main/java/com/ybw/mathapp/service/PrimarySchoolGenerator.java @@ -72,9 +72,13 @@ public class PrimarySchoolGenerator implements QuestionGenerator { } } } - if (AdvancedCaculate.calculate(parts) >= 0) { - return String.join(" ", parts) + " ="; - } else { + try { + if (AdvancedCaculate.calculate(parts) >= 0) { + return String.join(" ", parts) + " ="; + } else { + parts.clear(); + } + } catch (ArithmeticException | IllegalArgumentException e) { parts.clear(); } } -- 2.34.1 From 4b62d84ecaa8669073085df8c5e1450d52295573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=96=E5=85=AE=E5=86=89?= <15550273+wang-shengfa-11@user.noreply.gitee.com> Date: Fri, 10 Oct 2025 22:48:24 +0800 Subject: [PATCH 4/6] =?UTF-8?q?v2.2=20=E6=B7=BB=E5=8A=A0=E4=BA=86=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=90=8D=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=B9=B6=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E5=9F=BA=E6=9C=AC=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wsf/mathapp/controller/SceneManager.java | 8 +-- .../wsf/mathapp/view/QuestionCountView.java | 5 +- .../java/com/wsf/mathapp/view/QuizView.java | 49 +++++++++++++++++-- src/main/java/com/ybw/mathapp/Main.java | 3 +- users.txt | 1 + 5 files changed, 56 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/wsf/mathapp/controller/SceneManager.java b/src/main/java/com/wsf/mathapp/controller/SceneManager.java index 5bbfda7..39c166a 100644 --- a/src/main/java/com/wsf/mathapp/controller/SceneManager.java +++ b/src/main/java/com/wsf/mathapp/controller/SceneManager.java @@ -67,10 +67,12 @@ public class SceneManager { primaryStage.show(); // 添加这行 } - public void showQuizView() { - System.out.println("切换到答题界面"); + public void showQuizView(String level, int count) { + System.out.println("切换到答题界面 - 级别: " + level + ", 题目数量: " + count); + // 设置测验参数 + quizView.setQuizParameters(level, count); primaryStage.setScene(quizView.getScene()); - primaryStage.show(); // 添加这行 + primaryStage.show(); } public void showResultView(double score) { diff --git a/src/main/java/com/wsf/mathapp/view/QuestionCountView.java b/src/main/java/com/wsf/mathapp/view/QuestionCountView.java index 5e100a4..902476e 100644 --- a/src/main/java/com/wsf/mathapp/view/QuestionCountView.java +++ b/src/main/java/com/wsf/mathapp/view/QuestionCountView.java @@ -58,9 +58,8 @@ public class QuestionCountView { return; } - // 设置题目数量和级别,然后开始答题 - sceneManager.getQuizView().setQuizParameters(level, count); - sceneManager.showQuizView(); + // 直接调用 showQuizView 并传递参数 + sceneManager.showQuizView(level, count); } catch (NumberFormatException ex) { showError(statusLabel, "请输入有效的数字!"); diff --git a/src/main/java/com/wsf/mathapp/view/QuizView.java b/src/main/java/com/wsf/mathapp/view/QuizView.java index 8ad1ecd..529b0a9 100644 --- a/src/main/java/com/wsf/mathapp/view/QuizView.java +++ b/src/main/java/com/wsf/mathapp/view/QuizView.java @@ -67,19 +67,62 @@ public class QuizView { } public void setQuizParameters(String level, int count) { + System.out.println("设置测验参数 - 级别: " + level + ", 题目数量: " + count); + this.currentLevel = level; this.questionCount = count; this.correctAnswers = 0; // 生成题目 generateQuestions(); + + // 检查是否成功生成题目 + if (questions == null || questions.isEmpty()) { + System.out.println("题目生成失败,显示空状态"); + showEmptyState(); + return; + } + + System.out.println("成功生成 " + questions.size() + " 道题目,开始显示第一题"); showQuestion(0); } private void generateQuestions() { - QuestionGenerator questionGenerator = QuestionService.createGenerator(currentLevel); - multipleChoiceGenerator = new MultipleChoiceGenerator(questionGenerator,currentLevel); - questions = multipleChoiceGenerator.generateMultipleChoiceQuestions(questionCount); + try { + System.out.println("开始生成题目,级别: " + currentLevel + ", 数量: " + questionCount); + + QuestionGenerator questionGenerator = QuestionService.createGenerator(currentLevel); + if (questionGenerator == null) { + System.err.println("题目生成器创建失败,级别: " + currentLevel); + questions = java.util.Collections.emptyList(); + return; + } + + System.out.println("题目生成器创建成功: " + questionGenerator.getClass().getSimpleName()); + + multipleChoiceGenerator = new MultipleChoiceGenerator(questionGenerator, currentLevel); + questions = multipleChoiceGenerator.generateMultipleChoiceQuestions(questionCount); + + System.out.println("题目生成完成,数量: " + (questions != null ? questions.size() : "null")); + + } catch (Exception e) { + System.err.println("生成题目时出现异常: " + e.getMessage()); + e.printStackTrace(); + questions = java.util.Collections.emptyList(); + } + } + + private void showEmptyState() { + VBox root = (VBox) scene.getRoot(); + root.getChildren().clear(); + + Label emptyLabel = new Label("无法生成题目,请返回重试"); + emptyLabel.setFont(Font.font(16)); + + Button backButton = new Button("返回"); + backButton.setOnAction(e -> sceneManager.showLevelSelectionView()); + + root.getChildren().addAll(emptyLabel, backButton); } private void showQuestion(int index) { diff --git a/src/main/java/com/ybw/mathapp/Main.java b/src/main/java/com/ybw/mathapp/Main.java index 3e360f8..1f21836 100644 --- a/src/main/java/com/ybw/mathapp/Main.java +++ b/src/main/java/com/ybw/mathapp/Main.java @@ -9,12 +9,13 @@ import java.util.List; public class Main { public static void main(String[] args) { // 生成小学选择题 + /* System.out.println("--- Primary School MCQs ---"); PrimarySchoolGenerator primaryGen = new PrimarySchoolGenerator(); MultipleChoiceGenerator primaryMC = new MultipleChoiceGenerator(primaryGen, "小学"); // 传入级别 List primaryMCQs = primaryMC.generateMultipleChoiceQuestions(10); primaryMCQs.forEach(q -> System.out.println(q + "\n")); - + */ // 生成初中选择题 System.out.println("--- Junior High MCQs ---"); JuniorHighGenerator juniorGen = new JuniorHighGenerator(); diff --git a/users.txt b/users.txt index a8b1249..10d2534 100644 --- a/users.txt +++ b/users.txt @@ -1 +1,2 @@ 张三,1798231811@qq.com,123456 +wsf,3310207578@qq.com,Wsf1234 -- 2.34.1 From bc34de13cefcb13d9268192211fece03b2d7eb26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=8D=9A=E6=96=87?= <15549487+FX_YBW@user.noreply.gitee.com> Date: Fri, 10 Oct 2025 23:44:58 +0800 Subject: [PATCH 5/6] =?UTF-8?q?v1.6=20=E9=A2=98=E7=9B=AE=E7=94=9F=E6=88=90?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9=E5=AE=8C=E6=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ybw/mathapp/Main.java | 9 +++++---- .../com/ybw/mathapp/service/MultipleChoiceGenerator.java | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/ybw/mathapp/Main.java b/src/main/java/com/ybw/mathapp/Main.java index 3e360f8..637d836 100644 --- a/src/main/java/com/ybw/mathapp/Main.java +++ b/src/main/java/com/ybw/mathapp/Main.java @@ -4,11 +4,13 @@ import com.ybw.mathapp.entity.QuestionWithOptions; import com.ybw.mathapp.service.JuniorHighGenerator; import com.ybw.mathapp.service.MultipleChoiceGenerator; import com.ybw.mathapp.service.PrimarySchoolGenerator; +import com.ybw.mathapp.service.SeniorHighGenerator; import java.util.List; public class Main { public static void main(String[] args) { // 生成小学选择题 + System.out.println("--- Primary School MCQs ---"); PrimarySchoolGenerator primaryGen = new PrimarySchoolGenerator(); MultipleChoiceGenerator primaryMC = new MultipleChoiceGenerator(primaryGen, "小学"); // 传入级别 @@ -21,16 +23,15 @@ public class Main { MultipleChoiceGenerator juniorMC = new MultipleChoiceGenerator(juniorGen, "初中"); // 传入级别 List juniorMCQs = juniorMC.generateMultipleChoiceQuestions(10); juniorMCQs.forEach(q -> System.out.println(q + "\n")); - System.out.println(); - /* + // 生成高中选择题 System.out.println("--- Senior High MCQs ---"); SeniorHighGenerator seniorGen = new SeniorHighGenerator(); MultipleChoiceGenerator seniorMC = new MultipleChoiceGenerator(seniorGen, "高中"); // 传入级别 - List seniorMCQs = seniorMC.generateMultipleChoiceQuestions(2, 4); + List seniorMCQs = seniorMC.generateMultipleChoiceQuestions(10); seniorMCQs.forEach(q -> System.out.println(q + "\n")); - */ + } } \ No newline at end of file diff --git a/src/main/java/com/ybw/mathapp/service/MultipleChoiceGenerator.java b/src/main/java/com/ybw/mathapp/service/MultipleChoiceGenerator.java index 8c5c6ff..d616ac5 100644 --- a/src/main/java/com/ybw/mathapp/service/MultipleChoiceGenerator.java +++ b/src/main/java/com/ybw/mathapp/service/MultipleChoiceGenerator.java @@ -46,7 +46,6 @@ public class MultipleChoiceGenerator { // 例如,如果基础生成器的可能组合用尽了 break; // 或者抛出异常 } - QuestionWithOptions mcq = generateSingleMCQ(baseQuestion); if (mcq != null) { mcQuestions.add(mcq); @@ -153,10 +152,13 @@ public class MultipleChoiceGenerator { tokens.add(token); i += token.length(); } else { + i++; + } /* else { // 如果找不到匹配的 token,可能是单个字符或未知格式 tokens.add(String.valueOf(expression.charAt(i))); i++; } + */ } return tokens; } -- 2.34.1 From 74de280d6164349dbe7ebc0d1fd36d554daf947c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=96=E5=85=AE=E5=86=89?= <15550273+wang-shengfa-11@user.noreply.gitee.com> Date: Fri, 10 Oct 2025 23:45:53 +0800 Subject: [PATCH 6/6] =?UTF-8?q?v3.0=20=E6=89=80=E6=9C=89=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=B7=B2=E6=B5=8B=E8=AF=95=E5=AE=8C=E6=AF=95=EF=BC=8C=E6=9C=80?= =?UTF-8?q?=E7=BB=88=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- users.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users.txt b/users.txt index 10d2534..d41caa3 100644 --- a/users.txt +++ b/users.txt @@ -1,2 +1,2 @@ -张三,1798231811@qq.com,123456 wsf,3310207578@qq.com,Wsf1234 +ybw,1798231811@qq.com,Ybw1234 -- 2.34.1