1 #1

Closed
hnu202326010216 wants to merge 0 commits from develop into main

29
.gitignore vendored

@ -0,0 +1,29 @@
### IntelliJ IDEA ###
out/
!**/src/main/**/out/
!**/src/test/**/out/
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

8
.idea/.gitignore vendored

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

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

@ -0,0 +1,8 @@
<component name="ArtifactManager">
<artifact type="jar" name="untitled:jar">
<output-path>$PROJECT_DIR$/out/artifacts/untitled_jar</output-path>
<root id="archive" name="untitled.jar">
<element id="module-output" name="untitled" />
</root>
</artifact>
</component>

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CheckStyle-IDEA" serialisationVersion="2">
<checkstyleVersion>10.26.1</checkstyleVersion>
<scanScope>AllSourcesWithTests</scanScope>
<suppressErrors>true</suppressErrors>
<copyLibs>true</copyLibs>
<option name="thirdPartyClasspath" />
<option name="activeLocationIds">
<option value="bundled-google-checks" />
</option>
<option name="locations">
<list>
<ConfigurationLocation id="bundled-sun-checks" type="BUNDLED" scope="All" description="Sun Checks">(bundled)</ConfigurationLocation>
<ConfigurationLocation id="bundled-google-checks" type="BUNDLED" scope="All" description="Google Checks">(bundled)</ConfigurationLocation>
</list>
</option>
</component>
</project>

@ -0,0 +1,6 @@
This folder contains libraries copied from the "Main.java" project.
It is managed by the CheckStyle-IDEA IDE plugin.
Do not modify this folder while the IDE is running.
When the IDE is stopped, you may delete this folder at any time. It will be recreated as needed.
In order to prevent the CheckStyle-IDEA IDE plugin from creating this folder,
uncheck the "Copy libraries from project directory" option in the CheckStyle-IDEA settings dialog.

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="GoogleStyle" />
</state>
</component>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_22" project-jdk-name="openjdk-23" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/untitled.iml" filepath="$PROJECT_DIR$/untitled.iml" />
</modules>
</component>
</project>

@ -1,16 +1,9 @@
# 中小学数学卷子自动生成系统文档
## 注意事项(已经经过终端测试)
## 注意事项
为了方便助教检查,将此注意事项放在最前面:
- 有关功能中的查重:
实现了双重查重机制:
内存级查重 - 当前会话中生成的题目查重
文件级查重 - 历史生成的所有题目查重
主要代码在 AbstractQuestionGenerator 类和FileServiceImpl中
- 测试时的java-version; java version "23" 2024-09-17
Java(TM) SE Runtime Environment (build 23+37-2369)
Java HotSpot(TM) 64-Bit Server VM (build 23+37-2369, mixed mode, sharing)
@ -154,6 +147,42 @@ src/
</project>
```
## 扩展指南
### 添加新的难度级别
1. 在`DifficultyLevel`枚举中添加新级别
2. 在`QuestionFactory`中实现对应的题目生成逻辑
3. 在`AuthServiceImpl`中添加测试用户
### 自定义题目类型
继承`AbstractQuestionGenerator`并实现:
```java
@Override
protected String generateQuestionContent(DifficultyLevel level) {
// 自定义题目生成逻辑
}
@Override
protected String generateFallbackQuestion(DifficultyLevel level) {
// 自定义备用题目
}
```
## 注意事项
1. **文件权限**:确保程序有写入`exam_papers`目录的权限
2. **题目数量**每次生成10-30道题目
3. **查重范围**:查重仅限于同一用户的题目历史
4. **会话管理**:退出程序后内存中的查重记录会清空
## 故障排除
### 常见问题
1. **文件保存失败**:检查磁盘空间和目录权限
2. **登录失败**:确认用户名密码正确(注意空格分隔)
3. **题目重复**:系统会自动尝试生成不重复的题目
### 日志查看
程序运行日志和错误信息会直接输出到控制台。
---

@ -0,0 +1,50 @@
1. (79 * 47) * 97
2. 75 - (55 * 35)
3. 12 - 30 + 75
4. 73 / 74
5. 13 - 95 - 16 - 59 + 28
6. 49 + 46
7. 7 * 68 + 50 / 35
8. (18 * 67) - 4 - 85
9. (64 / 47) * 39
10. 38 / 41
11. 8 / 10
12. (51 / 91) - 35 - 64
13. 60 + (22 * 49)
14. 76 - 52 + 76
15. (29 * 10) * 100 * 70
16. (36 * 50) / 79 - 23
17. 32 / 70
18. 22 * 63
19. 55 * 44
20. 53 - 74 - (27 * 22) / 80
21. (2 * 26) + 86 - 58 + 12
22. 95 * 29
23. 12 + 72 + 98
24. 42 + 97 / 73 * (69 * 68)
25. 69 / (46 * 13)

@ -0,0 +1,50 @@
1. tan(1 - 33 - 39)
2. cos(21 * 32 - 23 / 63 - 93)
3. cos(85 * 13 - 81 + 87 + 96)
4. sin(88 * 72 - 10 + 57)
5. sin(64 * 12 + 22 * 81 / 17)
6. cos(93 + 13 + 62 / 50 + 60)
7. cos(68 + 91 * 68)
8. tan(76 - 16)
9. tan(22 * 92 / 75 * 95)
10. sin(75)
11. cos(79 * 68 + 77 + 69)
12. sin(25)
13. cos(33 - 97 * 91 + 60 - 22)
14. sin(2 * 45 * 20)
15. cos(85 / 69)
16. sin(47 * 3)
17. cos(81 / 54)
18. tan(96 * 21 / 8 / 20)
19. cos(43 + 19 / 16 / 33 + 71)
20. cos(79)
21. sin(33 * 39 + 85)
22. tan(36 + 11 - 84 * 64 + 22)
23. tan(30 + 27 + 24 - 23)
24. tan(18 - 67 / 56 - 26 / 97)
25. tan(42 - 24 + 99 - 96)

@ -0,0 +1,24 @@
1. 98 * 32 - 57 + 44 + 73²
2. 8 / 16 - 26²
3. 62² - 96
4. 82 + 87² + 28 - 20
5. 13 / 92²
6. √(85 - 13 - 37 / 56)
7. 52 * 71 - 19 * 84²
8. 34²
9. 28 * 97² - 52 * 57
10. √(25 * 3)
11. √(87 - 90 * 80 * 44)
12. √(79 + 65 * 45 + 99)

@ -0,0 +1,50 @@
1. (50 * 97) - 27 - 38 + 31
2. 97 * 41
3. 4 + 74 / 37 + 58
4. 65 - 2
5. 89 * 24
6. 71 / 35
7. 77 - 19 - 46
8. 77 - 81
9. 99 - (48 * 36)
10. 10 * 5
11. 90 - 87
12. (10 / 97) - 89
13. 29 * 63
14. 11 + 20 + 63 + 52 - 3
15. 38 * 60 + 89 - 12
16. 32 / 56 + 19 * 60
17. 9 / 16 - 28
18. 98 + 88 + 89 + 5
19. 49 / 69
20. 78 * (72 / 88) * 14
21. (90 * 49) / 98 / 71
22. 74 * 97 - 75
23. 65 + 57 - 46
24. 25 / 91
25. 87 + 82 / 33 - 45

@ -0,0 +1,50 @@
1. √(62 + 7)
2. 76² + 56 / 96 - 51
3. 68 - 94 * 79 / 4²
4. 58² - 3 + 66 + 99 + 70
5. 95² / 6 * 22
6. 26 + 43 - 37²
7. √(44 * 67 / 4)
8. 42 * 46 + 38² / 15
9. 59 - 15 + 6² - 43 - 66
10. 48 + 68²
11. 45 + 80²
12. 89²
13. 56² * 33 * 52
14. 43 - 68 * 100 + 88 * 41²
15. 32 - 49 / 61²
16. 25²
17. 68 / 90 * 28 / 12²
18. √(61 + 20 / 78 / 43 * 19)
19. 94 * 46²
20. √(99 * 61)
21. √(97 / 49)
22. 64²
23. √(51)
24. √(80 + 36 * 22)
25. √(75)

@ -0,0 +1,50 @@
1. tan(68 * 17)
2. tan(23 - 45 - 40 + 96)
3. tan(26 - 91 / 20 + 69)
4. cos(53 / 18 * 8 - 52)
5. cos(72 + 37 + 48 + 15 + 85)
6. sin(10 + 50 / 74 * 66)
7. tan(92 - 66)
8. tan(91 + 83)
9. tan(40 * 21 * 99)
10. tan(27 + 75 + 17 + 37 * 76)
11. sin(99)
12. sin(50)
13. tan(39 + 97 * 88 - 91 - 1)
14. sin(30)
15. tan(81 - 6 - 78 * 12)
16. sin(26 - 71 * 95 + 17)
17. cos(60 - 68 / 82 * 15 - 96)
18. tan(15 - 86 + 81 / 94 * 4)
19. cos(85 * 36 / 51)
20. sin(48 * 35 / 11 - 20)
21. cos(66)
22. tan(93 + 11 - 94 + 35 * 44)
23. sin(29 + 16 + 54 + 9)
24. cos(26 + 28 - 48)
25. tan(89 * 52 + 55 - 29)

@ -0,0 +1,50 @@
1. 61 - 21 - 36 * 31
2. (16 * 58) + 53 * 54 / 43
3. 72 - (72 * 34)
4. 92 + 1
5. 57 - 14
6. (88 / 88) + 96 + 57 / 57
7. 89 / 97 + 77 / 59 + 48
8. 93 * 100
9. 98 - 63 + 35
10. 33 + 17 - 31 + (70 * 16)
11. (87 / 46) - 21 - 54
12. (35 * 54) + 60 * 48
13. 47 - 20
14. 69 + 31
15. 47 - (29 * 46)
16. 75 + 95
17. (98 * 37) - 75 / 21
18. 76 + 17
19. 15 - 45
20. 37 + (70 * 73) * 68
21. (89 / 95) - 34 * 63
22. 34 * (38 * 92) - 26 - 2
23. (44 / 72) + 8
24. 9 - 17 / (54 / 18) - 59
25. 99 - 93

@ -0,0 +1,44 @@
1. 3 * 22 - 2
2. 69 / 61
3. 73 + 9
4. 21 + 7
5. 19 / 40
6. 41 + 72
7. (14 * 55) + 43
8. (95 * 18) / 53 - 2 + 6
9. (6 / 100) + 34 * 84
10. 97 - 77 * 21
11. 49 - 80
12. 61 + 18 - 45 * 89
13. 3 * (37 * 11) + 6 - 47
14. 92 * (42 * 99)
15. 35 + (74 * 62) + 33
16. 63 - 39
17. 79 * 52 + 92 - 28
18. 70 * (63 / 42) - 46
19. 90 + 38 + 47
20. 91 * 35
21. 88 / 56 - 70 * 7
22. 82 + 68 / 55

@ -0,0 +1,44 @@
1. sin(4)
2. cos(66 * 12 * 18)
3. tan(48 * 100 + 24)
4. sin(55 * 90 / 58)
5. tan(79 + 48 * 60)
6. sin(55 - 1)
7. sin(94 / 77 / 66)
8. tan(100 / 55 - 39)
9. sin(52 - 15 - 88 - 22)
10. cos(12 + 4 / 32 - 88)
11. cos(64)
12. sin(68 - 95 - 97 - 53)
13. cos(97 / 91)
14. sin(48 - 1)
15. sin(51 + 12 / 15)
16. cos(41 * 68)
17. cos(97)
18. cos(52 * 89 / 92 + 66)
19. cos(42 - 73)
20. tan(68 - 66 * 1 / 38)
21. tan(16 / 72)
22. sin(65)

@ -0,0 +1,44 @@
1. √(29 + 61 * 11 - 21)
2. 18 + 99² * 1
3. 60 - 67²
4. √(42 - 25 - 55 / 79 + 31)
5. 89 + 100 - 81 * 64²
6. 4 * 21 + 91 + 39 + 87²
7. √(47 * 78 - 73 / 32 * 85)
8. √(23 - 88 - 1 + 34 + 81)
9. √(8)
10. 100 + 17²
11. 49²
12. 41 / 24 * 43 - 94²
13. √(31 / 74 + 54 / 93)
14. 17 / 69 - 40 + 100 / 13²
15. √(59 + 52 / 94 - 50)
16. 73 - 50²
17. √(65)
18. 72 * 22 - 98²
19. √(39)
20. √(41 - 61 - 100)
21. √(29 - 88 / 26)
22. 81 * 43 / 55²

@ -0,0 +1,50 @@
1. 17 - 43
2. 54 - 59 / 30 + 16
3. 8 + 28 + 38 - 43
4. 55 - 85 - (98 * 1) * 88
5. 16 + 65 + 36 - 84
6. 81 * 21
7. 79 + 33
8. 13 / 45 - 23 + 23 + 42
9. 63 * (62 * 4)
10. 66 + 29 * 90
11. 35 * 36
12. (83 / 67) / 9 + 61 - 49
13. 77 / 68 * 51
14. 66 + (5 * 92)
15. 42 - 19 * 81
16. (1 * 37) * 92 - 53 / 10
17. 30 + 72
18. 75 / (50 * 29) / 85
19. (72 * 84) + 97 + 32
20. 4 / 67
21. 81 + 16 / 85
22. 73 / 7 - (99 / 12) / 85
23. 27 / 83
24. 3 - 64
25. 49 + (91 / 4)

@ -104,4 +104,4 @@ public abstract class AbstractQuestionGenerator implements QuestionGenerator {
protected int getOperandCount() {
return random.nextInt(5) + 1;
}
}
}

@ -119,7 +119,8 @@ public class Main {
private void printGenerationPrompt() {
String levelName = currentUser.getLevel().getChineseName();
System.out.println("准备生成" + levelName + "数学题目,请输入生成题目数量(输入-1将退出当前用户重新登录");
System.out.println("准备生成" + levelName
+ "数学题目,请输入生成题目数量(输入-1将退出当前用户重新登录");
}
private boolean handleSpecialCommands(String input) {

@ -55,4 +55,4 @@ public class User {
public void setLevel(DifficultyLevel level) {
this.level = level;
}
}
}

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="CheckStyle-IDEA-Module" serialisationVersion="2">
<option name="activeLocationsIds" />
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
Loading…
Cancel
Save