nonono #6

Closed
hnu202326010225 wants to merge 0 commits from develop into main

38
.gitignore vendored

@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

3
.idea/.gitignore vendored

@ -0,0 +1,3 @@
# 默认忽略的文件
/shelf/
/workspace.xml

@ -0,0 +1 @@
UserService.java

@ -0,0 +1,19 @@
<component name="ArtifactManager">
<artifact type="jar" name="MathLearningApp:jar">
<output-path>$PROJECT_DIR$/out/artifacts/MathLearningApp_jar</output-path>
<root id="archive" name="MathLearningApp.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/out/META-INF/MANIFEST.MF" />
</element>
<element id="module-output" name="MathLearningApp" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/sun/mail/javax.mail/1.6.2/javax.mail-1.6.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/at/favre/lib/bcrypt/0.9.0/bcrypt-0.9.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/at/favre/lib/bytes/1.3.0/bytes-1.3.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.15.2/jackson-datatype-jsr310-2.15.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.15.2/jackson-core-2.15.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/javax/activation/activation/1.1/activation-1.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-databind/2.15.2/jackson-databind-2.15.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-annotations/2.15.2/jackson-annotations-2.15.2.jar" path-in-jar="/" />
</root>
</artifact>
</component>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_23" default="true" project-jdk-name="23" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

@ -0,0 +1,17 @@
[ {
"username" : "LXR",
"email" : "2759462569@qq.com",
"passwordHash" : "$2a$12$AiupZKqpZMXvstX6XYNGUuBDZOMdzqXy/ADaYzurUYatM293Lbxii",
"registrationDate" : [ 2025, 10, 11, 19, 40, 59, 177105400 ],
"verificationCode" : "371978",
"verified" : true,
"type" : "高中"
}, {
"username" : "小鱼",
"email" : "1280556515@qq.com",
"passwordHash" : "$2a$12$dbNwBK6NBj7mXU6YzNMAweTMhD9NOxsjPGzW2SfIM.QvGdWt7Lyvy",
"registrationDate" : [ 2025, 10, 10, 11, 7, 5, 853200500 ],
"verificationCode" : "688201",
"verified" : true,
"type" : "高中"
} ]

@ -39,11 +39,6 @@
- Java 8或更高版本
- 网络连接(用于邮件验证)
### 运行环境
程序可以通过可执行文件 math-learning-app-1.0.0.jar执行
运行环境: window PowerShell UTF-8 编码
### 安装与运行
1. 克隆或下载项目源代码
2. 使用IDE导入项目

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mathlearning</groupId>
<artifactId>math-learning-app</artifactId>
<version>1.0.0</version>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- JavaMail for email verification -->
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.6.2</version>
</dependency>
<!-- JSON processing -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.15.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.15.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.15.2</version>
</dependency>
<!-- Password hashing -->
<dependency>
<groupId>at.favre.lib</groupId>
<artifactId>bcrypt</artifactId>
<version>0.9.0</version>
</dependency>
</dependencies>
</project>

@ -0,0 +1,37 @@
package mathlearning.service.MultipleChoiceGenerator;
import mathlearning.model.User;
public class MultipleChoiceGeneratorTest {
public static void main(String[] args) {
// 创建一个模拟用户
User testUser = new User();
testUser.setType("小学"); // 可以分别测试"小学"、"初中"、"高中"
// 测试生成10道题目
int questionCount = 10;
MultipleChoiceGenerator generator = new MultipleChoiceGenerator(questionCount, testUser);
// 获取生成的题目、答案和选项
String[] questions = generator.GetQuestionList();
String[] answers = generator.GetAnswerList();
String[] choices = generator.GetChoiceList();
// 输出测试结果
System.out.println("=== 数学题目生成测试 ===");
System.out.println("用户类型: " + testUser.getType());
System.out.println("生成题目数量: " + questionCount);
System.out.println();
for (int i = 0; i < questions.length; i++) {
System.out.println("题目 " + (i + 1) + ": " + questions[i]);
System.out.println("答案: " + answers[i]);
System.out.println("选项:");
String[] choiceArray = choices[i].split("\n");
for (int j = 0; j < choiceArray.length; j++) {
System.out.println(" " + (char)('A' + j) + ". " + choiceArray[j]);
}
System.out.println("----------------------------------------");
}
}
}

@ -65,7 +65,7 @@ public class ChangeCodeFrame extends JFrame {
//表单面板
JPanel formPanel = new JPanel(new GridLayout(5, 2, 10, 10));
JLabel emailLabel = new JLabel("邮箱:");
JLabel emailLabel = new JLabel("QQ邮箱:");
emailLabel.setFont(new Font("微软雅黑", Font.PLAIN, 14));
emailField = new JTextField();
@ -80,7 +80,7 @@ public class ChangeCodeFrame extends JFrame {
codePanel.add(codeField, BorderLayout.CENTER);
codePanel.add(sendCodeButton, BorderLayout.EAST);
JLabel passwordLabel = new JLabel("新密码:");
JLabel passwordLabel = new JLabel("新密码(大小写字母+数字):");
passwordLabel.setFont(new Font("微软雅黑", Font.PLAIN, 14));
passwordField = new JPasswordField();

@ -46,7 +46,7 @@ public class ChangePasswordFrame extends JFrame {
mainPanel.add(titleLabel, BorderLayout.NORTH);
//表单
JPanel infoPanel = new JPanel(new GridLayout(4, 2, 10, 10));
JPanel infoPanel = new JPanel(new GridLayout(3, 2, 10, 10));
JLabel oldPasswordLabel = new JLabel("请输入旧密码:");
oldPasswordLabel.setFont(new Font("微软雅黑", Font.PLAIN, 14));
oldPasswordField = new JPasswordField();
@ -62,7 +62,12 @@ public class ChangePasswordFrame extends JFrame {
confirmPasswordField = new JPasswordField();
infoPanel.add(confirmPasswordLabel);
infoPanel.add(confirmPasswordField);
mainPanel.add(infoPanel, BorderLayout.CENTER);
JLabel infoLabel = new JLabel("密码需要包含大小写字母以及数字6-10位。");
infoLabel.setFont(new Font("微软雅黑", Font.PLAIN, 14));
JPanel centerPanel = new JPanel(new BorderLayout());
centerPanel.add(infoPanel, BorderLayout.CENTER);
centerPanel.add(infoLabel, BorderLayout.SOUTH);
mainPanel.add(centerPanel, BorderLayout.CENTER);
//按钮
JPanel buttonPanel = new JPanel(new FlowLayout());

@ -37,7 +37,7 @@ public class LoginFrame extends JFrame{
// 表单面板
JPanel formPanel = new JPanel(new GridLayout(3, 2, 10, 10));
JLabel emailLabel = new JLabel("邮箱:");
JLabel emailLabel = new JLabel("QQ邮箱:");
emailLabel.setFont(new Font("微软雅黑", Font.PLAIN, 14));
emailField = new JTextField();

@ -64,13 +64,13 @@ public class RegisterFrame extends JFrame{
mainPanel.add(titleLabel, BorderLayout.NORTH);
// 表单面板
JPanel formPanel = new JPanel(new GridLayout(5, 2, 10, 10));
JPanel formPanel = new JPanel(new GridLayout(6, 2, 10, 10));
JLabel nameLabel = new JLabel("用户名:");
nameLabel.setFont(new Font("微软雅黑", Font.PLAIN, 14));
nameField = new JTextField();
JLabel emailLabel = new JLabel("邮箱:");
JLabel emailLabel = new JLabel("QQ邮箱:");
emailLabel.setFont(new Font("微软雅黑", Font.PLAIN, 14));
emailField = new JTextField();
@ -93,6 +93,9 @@ public class RegisterFrame extends JFrame{
confirmPasswordLabel.setFont(new Font("微软雅黑", Font.PLAIN, 14));
confirmPasswordField = new JPasswordField();
JLabel infoLabel = new JLabel("提示密码需要包含大小写字母以及数字6-10位。");
infoLabel.setFont(new Font("微软雅黑", Font.PLAIN, 14));
formPanel.add(nameLabel);
formPanel.add(nameField);
formPanel.add(emailLabel);
@ -104,7 +107,11 @@ public class RegisterFrame extends JFrame{
formPanel.add(confirmPasswordLabel);
formPanel.add(confirmPasswordField);
mainPanel.add(formPanel, BorderLayout.CENTER);
JPanel centerPanel = new JPanel(new BorderLayout());
centerPanel.add(formPanel, BorderLayout.CENTER);
centerPanel.add(infoLabel, BorderLayout.SOUTH);
mainPanel.add(centerPanel, BorderLayout.CENTER);
// 按钮面板
JPanel buttonPanel = new JPanel(new FlowLayout());

Loading…
Cancel
Save