|
|
@ -17,11 +17,11 @@ public class Main {
|
|
|
|
public static void main(String[] args) {
|
|
|
|
public static void main(String[] args) {
|
|
|
|
System.out.println("=== 中小学数学卷子自动生成程序 ===");
|
|
|
|
System.out.println("=== 中小学数学卷子自动生成程序 ===");
|
|
|
|
while (true) {
|
|
|
|
while (true) {
|
|
|
|
// 1. 登录流程(完全不变)
|
|
|
|
// 1. 登录流程
|
|
|
|
String username = login();
|
|
|
|
String username = login();
|
|
|
|
if (username == null) continue;
|
|
|
|
if (username == null) continue;
|
|
|
|
|
|
|
|
|
|
|
|
// 2. 登录后操作:初始学段为账号对应的学段(完全不变)
|
|
|
|
// 2. 登录后操作:初始学段为账号对应的学段
|
|
|
|
String currentType = AccountManager.getAccountType(username);
|
|
|
|
String currentType = AccountManager.getAccountType(username);
|
|
|
|
while (true) {
|
|
|
|
while (true) {
|
|
|
|
// 提示信息:始终使用当前有效的 currentType(无效切换后不变)
|
|
|
|
// 提示信息:始终使用当前有效的 currentType(无效切换后不变)
|
|
|
@ -35,7 +35,7 @@ public class Main {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 处理题目数量输入(完全不变)
|
|
|
|
// 处理题目数量输入
|
|
|
|
int count = parseCount(input);
|
|
|
|
int count = parseCount(input);
|
|
|
|
if (count == -1) {
|
|
|
|
if (count == -1) {
|
|
|
|
System.out.println("退出当前用户,返回登录界面...");
|
|
|
|
System.out.println("退出当前用户,返回登录界面...");
|
|
|
@ -79,8 +79,7 @@ public class Main {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 关键修改:新增 currentType 参数,无效输入时返回原学段(保持修改前)
|
|
|
|
* 新增 currentType 参数,无效输入时返回原学段
|
|
|
|
* 其他逻辑(提示文字、有效学段判断)完全不变
|
|
|
|
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private static String handleTypeSwitch(String input, String currentType) {
|
|
|
|
private static String handleTypeSwitch(String input, String currentType) {
|
|
|
|
String targetType = input.substring(3).trim();
|
|
|
|
String targetType = input.substring(3).trim();
|
|
|
|