Binary file not shown.
@ -0,0 +1,11 @@
|
||||
public class Assign {
|
||||
|
||||
public static void assign(){
|
||||
while (true) {
|
||||
Login.Account user = Login.loginLoop();
|
||||
Login.Level currentLevel = user.level;
|
||||
System.out.println("当前选择为 " + LanguageSwitch.levelToChinese(currentLevel) + "出题");
|
||||
Function.function(currentLevel, user);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
import java.util.List;
|
||||
|
||||
public class Create {
|
||||
|
||||
public static void create(int n,Login.Level currentLevel,Login.Account user) {
|
||||
List<String> existing = LoadFile.loadExistingQuestions(user.username);
|
||||
Generator.QuestionGenerator qg = new Generator.QuestionGenerator(currentLevel, existing);
|
||||
List<String> paper = qg.generatePaper(n);
|
||||
if (paper.isEmpty()) {
|
||||
System.out.println("未能生成题目(可能因去重约束导致)。");
|
||||
} else {
|
||||
// 保存文件
|
||||
String savedPath = Save.savePaper(user.username, paper);
|
||||
System.out.println("已生成 " + paper.size() + " 道题,保存为: " + savedPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue