刘欣睿 20251011 2056 #4

Closed
hnu202326010225 wants to merge 0 commits from liuxinrui_branch into develop

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,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_25" 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,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="3b1bb474-3d43-47ea-b452-37db5e702367" name="更改" comment="1" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 8
}</component>
<component name="ProjectId" id="33v4xVg7CMc104IhcpHMl9ks5xm" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"ModuleVcsDetector.initialDetectionPerformed": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
"RunOnceActivity.git.unshallow": "true",
"git-widget-placeholder": "liuxinrui__branch",
"kotlin-language-version-configured": "true",
"last_opened_file_path": "D:/filee/软导/java/结对/project/MathLearningApp/git",
"应用程序.App.executor": "Run"
}
}]]></component>
<component name="RunManager">
<configuration default="true" type="JetRunConfigurationType">
<module name="git" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="KotlinStandaloneScriptRunConfigurationType">
<module name="git" />
<option name="filePath" />
<method v="2" />
</configuration>
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="默认任务">
<changelist id="3b1bb474-3d43-47ea-b452-37db5e702367" name="更改" comment="" />
<created>1760184458384</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1760184458384</updated>
</task>
<task id="LOCAL-00001" summary="1">
<option name="closed" value="true" />
<created>1760186790252</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1760186790252</updated>
</task>
<task id="LOCAL-00002" summary="1">
<option name="closed" value="true" />
<created>1760186802794</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1760186802794</updated>
</task>
<option name="localTasksCounter" value="3" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="1" />
<option name="LAST_COMMIT_MESSAGE" value="1" />
</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,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -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("----------------------------------------");
}
}
}

@ -1,3 +0,0 @@
Manifest-Version: 1.0
Main-Class: mathlearning.App
Loading…
Cancel
Save