From 37410ec6ee58d5961faf37b5ac88fd19c43cb827 Mon Sep 17 00:00:00 2001 From: luoyuehang <2830398107@qq.com> Date: Fri, 26 Sep 2025 15:31:02 +0800 Subject: [PATCH 1/3] v1.0 --- ...模型后人工修改代码一览表.docx | Bin 0 -> 11382 bytes src/新建 文本文档.c | 454 ++++++++++++++++++ 2 files changed, 454 insertions(+) create mode 100644 doc/个人项目使用大模型后人工修改代码一览表.docx create mode 100644 src/新建 文本文档.c diff --git a/doc/个人项目使用大模型后人工修改代码一览表.docx b/doc/个人项目使用大模型后人工修改代码一览表.docx new file mode 100644 index 0000000000000000000000000000000000000000..3227cf298b0f8940e040189118ad8d7197772a35 GIT binary patch literal 11382 zcmb7q1yo#1v-RNagS!NW;E+HFF2P-cySrN;KyY`5;O_43?(P;mxIMV??oIyhz4iWH ziy1i7KGnVJOifqUmKFm8hXuS2f5{D=*Z02%%*!u&mb%h5mR7cJrC-c|FBhQyFhlH1 zocRm_09bmkqiZdY98+Q$>g-(%^4dSoy2Gu$a?Y! zPk9eI!lAP~+EgT1^=FpznW11?ZPzv4R}!j6=EUR_v?PG}+8P^2U0{eDw6wrA=~jIi zT91rmgJf{Q`g~VAU#MQfd9(VcY1`(oR033X?=w(v5kvxMn4hsAh#0S0b>TI+cu*st^TJW?KX z3Oy#A612SXhp{ONXM}m815~e0r!xnnWTGFDav9$93HxfQ=&tK$0nReX7;=6)0cmid zXxRh_zhk8!CqI(i`iLe<1id`~;_$^qrM$d&G=_z_%9l%6b)ZNOql~`Mp?f!jgAQC` zql{HNQHfY#JyQ1aT40c23rI3DQ#TG*+>-4QV6%WC6Ol?VtVqLb9Q1pev=`(iehz71 zYcoNSgQtd3%ojNt&%BPLhC2Qlpm4e4NyD9DvshyknVZb=hUtjG}J@x_a zSMJf{J{42HaF6oBJ=!na+uPb%n!mE29U&p*!-MR1LjL4GyrTUP76K z(puyLpSvS}S{I9I&K{@uc=vi5TTsxjMExUUDmX;(APJ%oGDKYmgf2R9RU3%5jC`db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eJ-|kK290Y=BKc+3JBg!h&^|b?H9+|)^H@uEAD=F!@Y4#E}Q=(O_w-}U&Bj2X5k@>3+O!a?r3B&JK_`KTpa}q2u zB6ki4!q~Kg_lIP;+0!CtRq?bP;m`Jn-2il(BFd5Y_c{=z#Ms8%P=(&`Hi-uI+`}hv zpM--Uv9l2aFc@Q!Q5PeBuuE$@(~jPLW`wHZA~bS)kms_~JNFynLha!Yw!2IdxC?(* z=bVZ(j2VgNKD2}Ie>g*%$X%#~Ja2IaOb>}hK3|7^W`FM%aBSMqhDlLYiS>%T}ci`Tv-(Vv}2X0&Y!0!xHdn? zh>yt|#NBmRd0*fO@@t{w)-URz^CIT~z6efU7U5?L8#Mek*o zp8_m;7ON^s(tvNN1Ldus^yz>D;)r+`?hNudQ3m!ccA3g`&or4FFPmb3MvN|k3d9FV z;!M4a4W|K+Vd+^RFvB5yC25|@ZP)@X8!|GcGJEcU8RGWa(~>NM%lWQ%vR1pyj%-DX z@tPg2dOSHz!AL;f4{$LHjKbM~sA{ByiY zBwxqB)Rez2@^?MutMQ-yDEED9D-{HTj*#3djgZ&%+ z-q61!9ZGS1ZUKjkIgYuf%{~WK7$~V7crr#&~dlGvE{>jwRufYE& zrTu=V-;YK9xziN(UsL$^J${G(zFqqV?n?X@{Flw!@A%(4k^kV=5dXseyD#}W{CDx& zKk%ZzIsZor_b2%O!oI~z-uok9e|I5%eNKPxL;T}4?pNSHT?uJ1h}ZA;7nv|JVC?02 K3a5Pi>%Rc7R0A*o literal 0 HcmV?d00001 diff --git a/src/新建 文本文档.c b/src/新建 文本文档.c new file mode 100644 index 0000000..0b7f2f6 --- /dev/null +++ b/src/新建 文本文档.c @@ -0,0 +1,454 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +// 用户账户结构 +class User { +public: + string username; + string password; + string userType; // "小学", "初中", "高中" +}; + +// 题目生成接口 +class QuestionGenerator { +public: + virtual string generateQuestion() = 0; + virtual bool meetsRequirements(const string& question) = 0; + virtual ~QuestionGenerator() {} +}; + +// 小学题目生成器 +class PrimaryQuestionGenerator : public QuestionGenerator { +public: + string generateQuestion() override; + bool meetsRequirements(const string& question) override; +}; + +// 初中题目生成器 +class JuniorQuestionGenerator : public QuestionGenerator { +public: + string generateQuestion() override; + bool meetsRequirements(const string& question) override; +}; + +// 高中题目生成器 +class SeniorQuestionGenerator : public QuestionGenerator { +public: + string generateQuestion() override; + bool meetsRequirements(const string& question) override; +}; + +// 文件管理器类 +class FileManager { +public: + static bool createUserFolder(const string& username); + static string generateFileName(const string& username); + static void saveQuestionsToFile(const string& filename, const vector& questions); + static set loadExistingQuestions(const string& username); +}; + +// 用户认证类 +class UserAuthenticator { +private: + vector presetUsers; + +public: + UserAuthenticator(); + bool authenticate(const string& username, const string& password, User& user); +}; + +// 应用程序主类 +class MathTestGeneratorApp { +private: + User currentUser; + bool isLoggedIn; + set generatedQuestions; + map generators; + + QuestionGenerator* currentGenerator; + +public: + MathTestGeneratorApp(); + ~MathTestGeneratorApp(); + + void run(); + void login(); + void generatePaper(); + void switchUserType(const string& newType); + bool isQuestionDuplicate(const string& question); + void addQuestionToHistory(const string& question); + string getCurrentTimeString(); +}; + +// 预设账户 +UserAuthenticator::UserAuthenticator() { + presetUsers = { + {"张三1", "123", "小学"}, + {"张三2", "123", "小学"}, + {"张三3", "123", "小学"}, + {"李四1", "123", "初中"}, + {"李四2", "123", "初中"}, + {"李四3", "123", "初中"}, + {"王五1", "123", "高中"}, + {"王五2", "123", "高中"}, + {"王五3", "123", "高中"} + }; +} + +bool UserAuthenticator::authenticate(const string& username, const string& password, User& user) { + for (const auto& u : presetUsers) { + if (u.username == username && u.password == password) { + user = u; + return true; + } + } + return false; +} + +// 小学题目生成实现 +string PrimaryQuestionGenerator::generateQuestion() { + int numOperands = rand() % 4 + 2; // 2-5个操作数 + stringstream question; + vector operators = {"+", "-", "*", "/"}; + + bool hasParentheses = (rand() % 2 == 0); + + for (int i = 0; i < numOperands; i++) { + int operand = rand() % 100 + 1; + + if (i == 0) { + if (hasParentheses && numOperands > 2 && rand() % 2 == 0) { + question << "("; + } + question << operand; + } else { + string op = operators[rand() % operators.size()]; + question << " " << op << " " << operand; + + if (hasParentheses && i == 1 && rand() % 2 == 0) { + question << ")"; + } + } + } + + question << " = "; + return question.str(); +} + +bool PrimaryQuestionGenerator::meetsRequirements(const string& question) { + // 小学题目只能包含 + - * / 和括号 + for (char c : question) { + if (isalpha(c) && c != 's' && c != 'i' && c != 'n' && c != 'c' && c != 'o' && c != 't' && c != 'a') { + // 简单检查,实际需要更复杂的逻辑 + continue; + } + } + return true; +} + +// 初中题目生成实现 +string JuniorQuestionGenerator::generateQuestion() { + int numOperands = rand() % 4 + 2; // 2-5个操作数 + stringstream question; + vector operators = {"+", "-", "*", "/", "²", "√"}; + + bool hasSquareOrRoot = false; + + for (int i = 0; i < numOperands; i++) { + int operand = rand() % 100 + 1; + + if (i == 0) { + question << operand; + } else { + string op = operators[rand() % operators.size()]; + + if (op == "²") { + question << "² " << operators[rand() % 4] << " " << operand; + hasSquareOrRoot = true; + } else if (op == "√") { + question << "√" << operand << " " << operators[rand() % 4] << " " << operand; + hasSquareOrRoot = true; + } else { + question << " " << op << " " << operand; + } + } + } + + // 确保至少有一个平方或开根号 + if (!hasSquareOrRoot) { + int pos = rand() % numOperands; + // 简化处理,在实际应用中需要更复杂的逻辑 + string temp = question.str(); + size_t found = temp.find_last_of(" "); + if (found != string::npos) { + question.str(""); + question << temp.substr(0, found) << "²" << temp.substr(found); + } + } + + question << " = "; + return question.str(); +} + +bool JuniorQuestionGenerator::meetsRequirements(const string& question) { + // 检查是否包含平方或开根号 + return question.find("²") != string::npos || question.find("√") != string::npos; +} + +// 高中题目生成实现 +string SeniorQuestionGenerator::generateQuestion() { + int numOperands = rand() % 4 + 2; // 2-5个操作数 + stringstream question; + vector operators = {"+", "-", "*", "/", "sin", "cos", "tan"}; + + bool hasTrigonometry = false; + + for (int i = 0; i < numOperands; i++) { + int operand = rand() % 100 + 1; + + if (i == 0) { + if (rand() % 2 == 0) { + string trig = operators[4 + rand() % 3]; // sin, cos, tan + question << trig << "(" << operand << ")"; + hasTrigonometry = true; + } else { + question << operand; + } + } else { + string op = operators[rand() % operators.size()]; + + if (op == "sin" || op == "cos" || op == "tan") { + question << " " << op << "(" << operand << ")"; + hasTrigonometry = true; + } else { + question << " " << op << " " << operand; + } + } + } + + // 确保至少有一个三角函数 + if (!hasTrigonometry) { + string trig = operators[4 + rand() % 3]; + int operand = rand() % 100 + 1; + question << " " << trig << "(" << operand << ")"; + } + + question << " = "; + return question.str(); +} + +bool SeniorQuestionGenerator::meetsRequirements(const string& question) { + // 检查是否包含三角函数 + return question.find("sin") != string::npos || + question.find("cos") != string::npos || + question.find("tan") != string::npos; +} + +// 文件管理实现 +bool FileManager::createUserFolder(const string& username) { + try { + filesystem::create_directory(username); + return true; + } catch (...) { + return false; + } +} + +string FileManager::generateFileName(const string& username) { + time_t now = time(0); + tm* localTime = localtime(&now); + + stringstream ss; + ss << username << "/" + << localTime->tm_year + 1900 << "-" + << setw(2) << setfill('0') << localTime->tm_mon + 1 << "-" + << setw(2) << setfill('0') << localTime->tm_mday << "-" + << setw(2) << setfill('0') << localTime->tm_hour << "-" + << setw(2) << setfill('0') << localTime->tm_min << "-" + << setw(2) << setfill('0') << localTime->tm_sec << ".txt"; + + return ss.str(); +} + +void FileManager::saveQuestionsToFile(const string& filename, const vector& questions) { + ofstream file(filename); + if (file.is_open()) { + for (size_t i = 0; i < questions.size(); i++) { + file << i + 1 << ". " << questions[i] << endl; + if (i < questions.size() - 1) { + file << endl; // 题目之间空一行 + } + } + file.close(); + } +} + +set FileManager::loadExistingQuestions(const string& username) { + set questions; + // 简化实现,实际需要读取所有文件并提取题目 + return questions; +} + +// 应用程序实现 +MathTestGeneratorApp::MathTestGeneratorApp() : isLoggedIn(false) { + generators["小学"] = new PrimaryQuestionGenerator(); + generators["初中"] = new JuniorQuestionGenerator(); + generators["高中"] = new SeniorQuestionGenerator(); + currentGenerator = nullptr; +} + +MathTestGeneratorApp::~MathTestGeneratorApp() { + for (auto& pair : generators) { + delete pair.second; + } +} + +void MathTestGeneratorApp::run() { + srand(time(0)); + + while (true) { + if (!isLoggedIn) { + login(); + } else { + cout << "准备生成" << currentUser.userType << "数学题目,请输入生成题目数量(输入-1将退出当前用户,重新登录):"; + string input; + cin >> input; + + if (input == "-1") { + isLoggedIn = false; + cout << "退出当前用户,重新登录..." << endl; + continue; + } + + if (input.find("切换为") == 0) { + string newType = input.substr(3); // 跳过"切换为" + switchUserType(newType); + continue; + } + + try { + int questionCount = stoi(input); + if (questionCount >= 10 && questionCount <= 30) { + generatePaper(); + } else { + cout << "题目数量应在10-30之间" << endl; + } + } catch (const exception& e) { + cout << "请输入有效的数字" << endl; + } + } + } +} + +void MathTestGeneratorApp::login() { + cout << "请输入用户名和密码(用空格隔开):"; + string username, password; + cin >> username >> password; + + UserAuthenticator authenticator; + if (authenticator.authenticate(username, password, currentUser)) { + isLoggedIn = true; + currentGenerator = generators[currentUser.userType]; + cout << "当前选择为" << currentUser.userType << "出题" << endl; + + // 加载已存在的题目用于查重 + generatedQuestions = FileManager::loadExistingQuestions(currentUser.username); + } else { + cout << "请输入正确的用户名、密码" << endl; + } +} + +void MathTestGeneratorApp::generatePaper() { + cout << "准备生成" << currentUser.userType << "数学题目,请输入生成题目数量:"; + string input; + cin >> input; + + try { + int questionCount = stoi(input); + if (questionCount < 10 || questionCount > 30) { + cout << "题目数量应在10-30之间" << endl; + return; + } + + // 创建用户文件夹 + FileManager::createUserFolder(currentUser.username); + + // 生成题目 + vector questions; + for (int i = 0; i < questionCount; i++) { + string question; + int attempts = 0; + do { + question = currentGenerator->generateQuestion(); + attempts++; + } while ((isQuestionDuplicate(question) || !currentGenerator->meetsRequirements(question)) && attempts < 100); + + if (attempts >= 100) { + cout << "警告:无法生成符合要求的不重复题目" << endl; + } + + questions.push_back(question); + addQuestionToHistory(question); + } + + // 保存到文件 + string filename = FileManager::generateFileName(currentUser.username); + FileManager::saveQuestionsToFile(filename, questions); + cout << "题目已生成到文件:" << filename << endl; + + } catch (const exception& e) { + cout << "请输入有效的数字" << endl; + } +} + +void MathTestGeneratorApp::switchUserType(const string& newType) { + if (newType == "小学" || newType == "初中" || newType == "高中") { + currentUser.userType = newType; + currentGenerator = generators[newType]; + cout << "准备生成" << currentUser.userType << "数学题目,请输入生成题目数量:"; + } else { + cout << "请输入小学、初中和高中三个选项中的一个" << endl; + } +} + +bool MathTestGeneratorApp::isQuestionDuplicate(const string& question) { + return generatedQuestions.find(question) != generatedQuestions.end(); +} + +void MathTestGeneratorApp::addQuestionToHistory(const string& question) { + generatedQuestions.insert(question); +} + +string MathTestGeneratorApp::getCurrentTimeString() { + time_t now = time(0); + tm* localTime = localtime(&now); + + stringstream ss; + ss << localTime->tm_year + 1900 << "-" + << setw(2) << setfill('0') << localTime->tm_mon + 1 << "-" + << setw(2) << setfill('0') << localTime->tm_mday << "-" + << setw(2) << setfill('0') << localTime->tm_hour << "-" + << setw(2) << setfill('0') << localTime->tm_min << "-" + << setw(2) << setfill('0') << localTime->tm_sec; + + return ss.str(); +} + +int main() { + MathTestGeneratorApp app; + app.run(); + return 0; +} \ No newline at end of file -- 2.34.1 From 4278246bd5e2a66b7381a576ebe7e30c42b9ca66 Mon Sep 17 00:00:00 2001 From: luoyuehang <2830398107@qq.com> Date: Sat, 27 Sep 2025 13:02:27 +0800 Subject: [PATCH 2/3] v2.0 --- src/AuthenticationManager.class | Bin 0 -> 1386 bytes src/FileManager.class | Bin 0 -> 3324 bytes src/JuniorQuestionGenerator.class | Bin 0 -> 1020 bytes src/MathExamGenerator.class | Bin 0 -> 4673 bytes src/MathExamGenerator.java | 396 +++++++++++++++++++ src/PrimaryQuestionGenerator.class | Bin 0 -> 907 bytes src/QuestionGenerator.class | Bin 0 -> 596 bytes src/SeniorQuestionGenerator.class | Bin 0 -> 1096 bytes src/User.class | Bin 0 -> 580 bytes src/exams/李四1/2025-09-27-12-54-51.txt | 21 + src/exams/李四1/2025-09-27-12-55-25.txt | 21 + src/exams/李四2/2025-09-27-12-55-39.txt | 21 + src/新建 文本文档.c | 454 ---------------------- 13 files changed, 459 insertions(+), 454 deletions(-) create mode 100644 src/AuthenticationManager.class create mode 100644 src/FileManager.class create mode 100644 src/JuniorQuestionGenerator.class create mode 100644 src/MathExamGenerator.class create mode 100644 src/MathExamGenerator.java create mode 100644 src/PrimaryQuestionGenerator.class create mode 100644 src/QuestionGenerator.class create mode 100644 src/SeniorQuestionGenerator.class create mode 100644 src/User.class create mode 100644 src/exams/李四1/2025-09-27-12-54-51.txt create mode 100644 src/exams/李四1/2025-09-27-12-55-25.txt create mode 100644 src/exams/李四2/2025-09-27-12-55-39.txt delete mode 100644 src/新建 文本文档.c diff --git a/src/AuthenticationManager.class b/src/AuthenticationManager.class new file mode 100644 index 0000000000000000000000000000000000000000..e252e1de2805301c7ca524546347fb888f93d08e GIT binary patch literal 1386 zcma)5Sx*yD6#i~0%ut4{EGjCC3qskXpn^pdkwq;_QkUS{rA*3TnPNLtW8%BU1Yd9q zlAwubf&@&I)fk_Q@n2}D#{Xc9=gu^grabs^XYTpF`<-*Xd+xWt>z@ELW6*&TxFpm# zV1p|Ydr<43rA|h@ga#Q$Wi&bR~YP_p%GHZ^=i7>9~~c7!|nTbUWMeFpbmr`k<@@`u6U3q`|zwObSUiu<@R+I5?c z_o%uW=0+%7FT@m-p`0N<(S9$FjFOCkz1XMVpg^VA$Jx!*`;F9&sFiwabT?6}v89Kx zg*hS7C81kE4|=!A?yWy!Ns4Q1nu|yQ;TMW z1kL(uQg9v@6kLQ?LZ5I*fJy?DI|%GZ&m#IDk3?>T!XpfYRohANK}_n| zijkY@jVKS&h!yRW=^D!ERh7__WAx7G*6F*Sb~cnEjs9ssXsw_~i@661T`OR&4cLZO zkoEy~+NQrV&mW-G2|KM*v_3*E9-{zHNQ(x^Qema^3K=nexZcC=%-Dc5VKw&CSWCBG= zK*AFj9MthN`TQJi%+U1CVgxU67ca@7S6IXxzT!2$;|+Op2#4d2`^Y)rW`(e%W(~zQ ze1_Ct_XT-%%h*-BjNQ+WUbn=Sh-5>;{(0o!EnVXRUEd-q36;VApiIIMlCCn@)&Bsm C{!>H% literal 0 HcmV?d00001 diff --git a/src/FileManager.class b/src/FileManager.class new file mode 100644 index 0000000000000000000000000000000000000000..3f9e6017b401cc666a932d243b93f49a41749bd4 GIT binary patch literal 3324 zcmai0eQ*?K8UO9&?sji)F9}HwSSSb0JxnD+B#d_odaFADUSj7=>?7@hPqbeHlfFK_gtH14_C>laZhnaVqMqPfS;Ijs%*SyLIG zaN9s-%9ITRqV{0Qbn;n7ddoW-+qy8$ZFC@^GB#wzhTHR*gdJo05^lP#vAOkc z7?ANvwvpXpV9|6w8*@u1VQH`F40Vi{$(^N&rn8$w_cXNNW(k_xNju#v>MS8BmR>Vu z4q8mmXHhLDBtNC$VI0%&X&jTV!qsuC5vMt7Co>7FUGyoPO`48`+N1mz>Ftfgr8orFL zh$tSB;MufB!=reNn7lR#4JSlpPT*z@Ulr9Xh2{2T-%vJvL?B$l*YLQEuWLAoQ$+D! zM^9dS^1By`r~fqh^o8%7ym0(^V~va_G(3r?BrKUNM>J-pI0GW4r!_ny%Kr^fif8fM zv?r$8y?X|Q^CH}R@Q@W_Kjzd|fS40_X9;@co^x`;iy%xu(Ql1VgWcl<4-gH>;kcMF z|9$0FuPf`#G_Q5hQS+ObjFpN@h%Dx3!5oy4!MGGBUAkQ)1ael!-} zz>+&pwX@PCB)D8}&VGP!XJXwFZm92G82D@$6}(_Xk>&}N%F7_-j6h%_#rnh&=^TxQ z%y>MS&t$SzE@v_A<#W@XfrT5!TtpqsIaZP(rSrnuOpjcEmyk?v^KoBdvpNa(Nx+)D zT2kMzpusoJ)<8&Ir&7ToGq;OFEpBKQKQ;RpOQ#&u7T4s;xw-5ZGP6@fP9hX)M711Qagv zffroGTS%8u87R`o_fUy52;)VXe+dS;Rgk8*@yKYEv6T!-+zw?g?Nkw7>L;M|*93}C zdnORH)FJ2R0TEHhg6tkr@}d zujIq=&Nf<@DE|(331KxWJSY7ij zT4@Rg&R~s)>8&l zpyLXB{DSKY?j-5rZwj>t{vR!Zpc9hN@J=xSc~Md3vy(qB@$+7E@yUa3K7SaukqRt5 z%rlYomFr;1S1~Tow9)YCzE>f3KEtp3&$h@FElOAk%cFQ%_lK3uMqmPs{dz!PsL4AuhL9jB`GZ;6Xe@JUokU z;@e#JBFU>^J>STWyQ|p$kW~_UvHqOhKhN`*@T$9S!z1_yD|`ZPx@!qfck`L3>zriFX4^cmf%dWi>_$U2crk6|fa+y;9 z;^}2_-@se^6Ia*wQTH}hlrZ&QgkAc$xa+Rz<9 z4|-L^0+0}OgHr*5``qxfhBNNoui>nQb1oit^pq5L`bkGOks0JEL6l3$FNL>D7rb1oBqJUK7)XOBTs;XZ^+|-?&*Lwd_HcNJl$DI#L)=F{mSr3k)59SD308 zrGl_^T*M_ELm1XEf>8$F3WXyWqfUOj*kWKY9hVW&aRm{gnW>nDWgkAiUYDW$ADCiu zvtVs7glY{|9HW%Zc^EYq^q%ww#-N&F)5(|)2^h~LG7QZwFlAXK!AU97_8vp)p@cPI zJ(yAzUM>r>z!0UY4T2uDOJxV*4Tt0Z%dbytzU&UpvKchTs*MRT`UpY#M}UtO$qt5N zz{PNE&@j- z|EL_6ySA|&mc!CJjCF5e$UUt>d4otQS%q4K7HX;@up~|Hpf?q2CjS8UApJ0FiI}9q zHeCzpwVW2(Jb&q#%y#x)6Z>49y}vQ-NVy&KHD(;Co~oktJvHg`WXO3ogJ#T-1hXVY z7QL899JlEwF5nt+xP?4Lcd>#+tYH}?+=qh)cusjQ!SM>KcuOarA@B_bI*2_AZ6AG5 bRGeTcPBKO#7zk;dKOv`kNbXMW1zo=ZwHV$p literal 0 HcmV?d00001 diff --git a/src/MathExamGenerator.class b/src/MathExamGenerator.class new file mode 100644 index 0000000000000000000000000000000000000000..2531c09848c1831328a64386eb4a26666fd4b384 GIT binary patch literal 4673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CqF{neIitA5Wwp2S*iU*W8kSb6Dm)^4^CzPnt0-u>2XX7(!iZa))- z>7Z8XUZ26wD|GY|oSx5nk&q>Lw_ZWF6MXsxV<3mv9$YsJdW(i|qUM>mG_@2OJ|CMh zM%d}8s5I~E|Ka@5yr%OCi?fx;Gb0VpFVnrnB*Sn!jl9Tq#X1-L*+00Sz}b9}pqNsx zCr~M!ALw!}@8xVh*TV!%VKR|)WqU;aoF2EI{RtJ0ATHvABu_I*r9y z$ePx#{tm*C>aTtUnj;~I5gDhE_y+8>meh3VLk=UGF1<&AC{v|_XuztjiV;+qh%sU$ z9^k4CQECEZ*bDV5{)BThj~!C6!%`d{#Hb)f7i2n;gBWuVN_0EMW;(_NF}^VCT+9(@ zQurzgw`N7pD9WEr9ya>aGHRZKyl zNW)5zj{8Lh9v4}t7gJ5Y$H8_HsS3(2B3Xg!V-)b+{2wJ-LW>J=H=<20P7%le*lQ!e zUKa*S_=6-}AHcvB_#0)QjM+m9i0w6s*69IFY1Y!dTc8lyjD8Tme4Z z6N!gyVSmQelVxTn@*Ov}V^(2SW)L?O(bdl$#Pp18x_0yB=@J=%+_2aE>5?aj3#ZFO zHe(R05G(G2CRQ_L?qSNT!ENF`EEe~hpfyB&jN24EsKBcb82d#&d4$Dy0#m8$Fi+F$ z!cNR#w%$_IiCa0|mTQ}kWG|Z)6Fn<7`z+=POgM(c$+5{X$1pc5h(0^QI2_{0(S~Ge_(hR4=>gWAKW5+FwX6~AOjTHshhcX^t52;w_&2iYoU zaTG?*6>)B9i(^^j+;YyXXc>?Xdu4_25r*$kj22Zq?bR%XTlgoQ$1q!LH4(=kdi1DK uh{G3{@K*WFCYUHHN$5l|6|XE{R^2&RVn;Bv5Ou60+o`#pn;tPOKKd!^e2KsS literal 0 HcmV?d00001 diff --git a/src/MathExamGenerator.java b/src/MathExamGenerator.java new file mode 100644 index 0000000..bed486e --- /dev/null +++ b/src/MathExamGenerator.java @@ -0,0 +1,396 @@ +import java.io.*; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.regex.Pattern; + +// û +class User { + private String username; + private String password; + private String type; + + public User(String username, String password, String type) { + this.username = username; + this.password = password; + this.type = type; + } + + public String getUsername() { return username; } + public String getPassword() { return password; } + public String getType() { return type; } +} + +// Ŀ +abstract class QuestionGenerator { + protected Random random = new Random(); + + public abstract String generateQuestion(); + + protected int generateNumber() { + return random.nextInt(100) + 1; + } + + protected String generateOperator() { + String[] operators = {"+", "-", "*", "/"}; + return operators[random.nextInt(operators.length)]; + } +} + +// СѧĿ +class PrimaryQuestionGenerator extends QuestionGenerator { + @Override + public String generateQuestion() { + int operandCount = random.nextInt(3) + 2; + StringBuilder question = new StringBuilder(); + + boolean hasParentheses = random.nextBoolean() && operandCount >= 3; + int parenthesesPosition = random.nextInt(operandCount - 1); + + for (int i = 0; i < operandCount; i++) { + if (hasParentheses && i == parenthesesPosition) { + question.append("("); + } + + question.append(generateNumber()); + + if (hasParentheses && i == parenthesesPosition + 1) { + question.append(")"); + } + + if (i < operandCount - 1) { + question.append(" ").append(generateOperator()).append(" "); + } + } + + return question.toString(); + } +} + +// Ŀ +class JuniorQuestionGenerator extends QuestionGenerator { + @Override + public String generateQuestion() { + int operandCount = random.nextInt(3) + 2; + StringBuilder question = new StringBuilder(); + + boolean hasSpecialOperator = false; + int specialOperatorPosition = random.nextInt(operandCount); + + for (int i = 0; i < operandCount; i++) { + if (i == specialOperatorPosition && !hasSpecialOperator) { + if (random.nextBoolean()) { + question.append(generateNumber()).append("^2"); // Ϊ^2ʾƽ + hasSpecialOperator = true; + } else { + question.append("").append(generateNumber()); + hasSpecialOperator = true; + } + } else { + question.append(generateNumber()); + } + + if (i < operandCount - 1) { + question.append(" ").append(generateOperator()).append(" "); + } + } + + if (!hasSpecialOperator) { + if (random.nextBoolean()) { + question.append(" ").append(generateOperator()).append(" ").append(generateNumber()).append("^2"); + } else { + question.append(" ").append(generateOperator()).append(" ").append("").append(generateNumber()); + } + } + + return question.toString(); + } +} + +// Ŀ +class SeniorQuestionGenerator extends QuestionGenerator { + private final String[] trigFunctions = {"sin", "cos", "tan"}; + + @Override + public String generateQuestion() { + int operandCount = random.nextInt(3) + 2; + StringBuilder question = new StringBuilder(); + + boolean hasTrigFunction = false; + int trigPosition = random.nextInt(operandCount); + + for (int i = 0; i < operandCount; i++) { + if (i == trigPosition && !hasTrigFunction) { + String trigFunction = trigFunctions[random.nextInt(trigFunctions.length)]; + question.append(trigFunction).append("(").append(generateNumber()).append(")"); + hasTrigFunction = true; + } else { + question.append(generateNumber()); + } + + if (i < operandCount - 1) { + question.append(" ").append(generateOperator()).append(" "); + } + } + + if (!hasTrigFunction) { + String trigFunction = trigFunctions[random.nextInt(trigFunctions.length)]; + question.append(" ").append(generateOperator()).append(" ").append(trigFunction).append("(").append(generateNumber()).append(")"); + } + + return question.toString(); + } +} + +// û֤ +class AuthenticationManager { + private Map users; + + public AuthenticationManager() { + users = new HashMap(); + initializeUsers(); + } + + private void initializeUsers() { + // Сѧ˻ + users.put("1", new User("1", "123", "Сѧ")); + users.put("2", new User("2", "123", "Сѧ")); + users.put("3", new User("3", "123", "Сѧ")); + + // ˻ + users.put("1", new User("1", "123", "")); + users.put("2", new User("2", "123", "")); + users.put("3", new User("3", "123", "")); + + // ˻ + users.put("1", new User("1", "123", "")); + users.put("2", new User("2", "123", "")); + users.put("3", new User("3", "123", "")); + } + + public User authenticate(String username, String password) { + User user = users.get(username); + if (user != null && user.getPassword().equals(password)) { + return user; + } + return null; + } +} + +// ļ +class FileManager { + private static final String BASE_DIR = "exams"; + + public FileManager() { + File baseDir = new File(BASE_DIR); + if (!baseDir.exists()) { + baseDir.mkdir(); + } + } + + public String generateFilename() { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); + return sdf.format(new Date()) + ".txt"; + } + + public String getUserDir(String username) { + return BASE_DIR + File.separator + username; + } + + public void saveQuestions(String username, List questions) throws IOException { + String userDir = getUserDir(username); + File dir = new File(userDir); + if (!dir.exists()) { + dir.mkdir(); + } + + String filename = generateFilename(); + String filepath = userDir + File.separator + filename; + + // ʹGBK뱣ļ + try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(filepath), "GBK"))) { + for (int i = 0; i < questions.size(); i++) { + writer.println((i + 1) + ". " + questions.get(i)); + if (i < questions.size() - 1) { + writer.println(); + } + } + } + + System.out.println("Ŀѱ浽: " + filepath); + } + + public boolean checkDuplicate(String username, String question) { + String userDir = getUserDir(username); + File dir = new File(userDir); + + if (!dir.exists()) { + return false; + } + + File[] files = dir.listFiles(); + if (files == null) { + return false; + } + + for (File file : files) { + try (Scanner scanner = new Scanner(file, "GBK")) { + while (scanner.hasNextLine()) { + String line = scanner.nextLine(); + if (line.contains(question)) { + return true; + } + } + } catch (IOException e) { + // Զȡ + } + } + + return false; + } +} + +// +public class MathExamGenerator { + private AuthenticationManager authManager; + private FileManager fileManager; + private User currentUser; + private String currentType; + private Scanner scanner; + + public MathExamGenerator() { + authManager = new AuthenticationManager(); + fileManager = new FileManager(); + scanner = new Scanner(System.in); + } + + public void start() { + System.out.println("===== СѧѧԶɳ ====="); + + while (true) { + if (currentUser == null) { + login(); + } else { + generateExam(); + } + } + } + + private void login() { + System.out.println("û루ÿո:"); + String input = scanner.nextLine().trim(); + + if (input.equalsIgnoreCase("exit")) { + System.exit(0); + } + + String[] parts = input.split(" "); + if (parts.length != 2) { + System.out.println("ȷû"); + return; + } + + String username = parts[0]; + String password = parts[1]; + + currentUser = authManager.authenticate(username, password); + if (currentUser != null) { + currentType = currentUser.getType(); + System.out.println("ǰѡΪ" + currentType + ""); + } else { + System.out.println("ȷû"); + } + } + + private void generateExam() { + System.out.println("׼" + currentType + "ѧĿĿ-1˳ǰûµ¼:"); + + String input = scanner.nextLine().trim(); + + if (input.equals("-1")) { + currentUser = null; + return; + } + + if (input.startsWith("лΪ")) { + handleTypeSwitch(input); + return; + } + + int questionCount; + try { + questionCount = Integer.parseInt(input); + } catch (NumberFormatException e) { + System.out.println("Ч֣10-30-1˳"); + return; + } + + if (questionCount != -1 && (questionCount < 10 || questionCount > 30)) { + System.out.println("ĿӦ10-30֮"); + return; + } + + List questions = generateQuestions(questionCount); + + try { + fileManager.saveQuestions(currentUser.getUsername(), questions); + } catch (IOException e) { + System.out.println("ļʱ: " + e.getMessage()); + } + } + + private void handleTypeSwitch(String input) { + Pattern pattern = Pattern.compile("лΪ(Сѧ||)"); + java.util.regex.Matcher matcher = pattern.matcher(input); + + if (matcher.matches()) { + currentType = matcher.group(1); + System.out.println("׼" + currentType + "ѧĿĿ"); + } else { + System.out.println("Сѧк͸ѡеһ"); + } + } + + private List generateQuestions(int count) { + QuestionGenerator generator = getQuestionGenerator(); + List questions = new ArrayList(); + Set generatedQuestions = new HashSet(); + + int maxAttempts = count * 10; + int attempts = 0; + + while (questions.size() < count && attempts < maxAttempts) { + String question = generator.generateQuestion(); + + if (!generatedQuestions.contains(question)) { + if (!fileManager.checkDuplicate(currentUser.getUsername(), question)) { + questions.add(question); + generatedQuestions.add(question); + } + } + attempts++; + } + + if (questions.size() < count) { + System.out.println("棺Ŀظֻ " + questions.size() + " Ŀ"); + } + + return questions; + } + + private QuestionGenerator getQuestionGenerator() { + if ("Сѧ".equals(currentType)) { + return new PrimaryQuestionGenerator(); + } else if ("".equals(currentType)) { + return new JuniorQuestionGenerator(); + } else if ("".equals(currentType)) { + return new SeniorQuestionGenerator(); + } else { + return new PrimaryQuestionGenerator(); + } + } + + public static void main(String[] args) { + MathExamGenerator generator = new MathExamGenerator(); + generator.start(); + } +} \ No newline at end of file diff --git a/src/PrimaryQuestionGenerator.class b/src/PrimaryQuestionGenerator.class new file mode 100644 index 0000000000000000000000000000000000000000..7cf3edc65015e8840927cab9c3c77da16c6eb928 GIT binary patch literal 907 zcmZuvOHUI~6#fpK>6BrBQf!M96kj+kg^FkutpqVXnt-S^qOQ2m8yszCnsI7yZ{o_0 zJ9f&3m5C;%B%1gG{7D+obEkqvT-7-2rHF~p_zCHfP!H>|~mnwjSlVu9D55Jq?h;=DpY2OlOKgnpKW`6Yh!+&1U~ z3p`=IqakSXokWUn<@y~F#(~$lkLZZD5Yd-QpP@b2hQ6Sn7NQ%lGSRm%v@K|n83ksv zDti{SNKsGfnN3uNH_(^VliC}Y`GnCzY$=~>p|b^ZiB0{=q%DWWE@k8(t-6U+K4G!S zp56R}^3n^Pwtl|Lx6t#RyXpx0zJMN<$Iyj5_dEd`1>TcMT;fH!fhjDai2J-E64R)m ngn%tC+5QTbk>!0|T?PgI*#^4-I~U&J-LBiwyn(oMXc# literal 0 HcmV?d00001 diff --git a/src/QuestionGenerator.class b/src/QuestionGenerator.class new file mode 100644 index 0000000000000000000000000000000000000000..9baa1e983c80fff6473106886b635fd0a656b53b GIT binary patch literal 596 zcmZ9J*-FDe6o&t4$0pWjYusAbx_40v;+-Ohs1&NA5g~V`cBqkdA~6*o$_oV-Q0xQv zP~w@!ih6N|v*iEI&&kKMoEVKAEuiFHTTidNvevPQ(d&X=LSO)mWc99}7o=QG4Duj!wQT~{p_ z-gknFom;1|7cTPr6=l~z0!dQ;w{D;peFo;S&>8-6!N3X>%M^KvB13=2_7DA!?67hv z&I1Nbirb(hDdX8vuEaBRT!W5Iwc1A+ryxhv>8ET7QOba1{)JY(A!5HE`UL(!JvunO z>dycv(xo}W00ybz7{c&3VUFgCVB{aclhtQ*@v}RsLv^e@n%(zu9C|03GtkwG;RA^)dY0MHRMg0iUUwf8uyZ`_I literal 0 HcmV?d00001 diff --git a/src/SeniorQuestionGenerator.class b/src/SeniorQuestionGenerator.class new file mode 100644 index 0000000000000000000000000000000000000000..98688e217b2ce04dd3dba09bf0a4bff3cc0c9c15 GIT binary patch literal 1096 zcmZuvTTc^F5dIE(r7X9Ff>|RwHRl3`@Hyt7W&@ZV~T^ny86B z_-1@E#DrH(v?Ln&0Vclqb2Jg>w19^4u(NahX6Bpo{m+*T00Wrxp%GmQ4yrh$;;@P% zm1w|GE`mOU5LVFbLnXSnh^XlCQKXj}Q5DBj9Orf)xBC?gC^*4T?YUNZDsLw}%dv9| z4cBLG8p}pBW7z3voPu_GltCV|Y|D!=2*J=b2JwuOG8t-TEZe-0Us^ETtHwfxJauW) zHeJIrFXzo1M`UOWhW0|Nj(bM()~t~&Ru-q}X7I(Gyqh$qEDqK*Yj}%iSB#}|B~Zuh z<)dk6#y)DbdrTTGXHi2T>Chg6XV@D2Xwooq96A#h5NXH2bjl0B=HCtJf_Sict$y|NWR8%yvGatz)Q3fQULNMx*#jq&lGep UMrZhq3AObXq;cZ4v)K8-Uy6eBi2wiq literal 0 HcmV?d00001 diff --git a/src/User.class b/src/User.class new file mode 100644 index 0000000000000000000000000000000000000000..744daeb9ab1c802f840f4ec55fb6ef34add5feed GIT binary patch literal 580 zcma)2$xZ@66s(>Zb_4{(J@E+R!o`b`croe)mjvYAKnI7wK!(BPuQZXEc<=-KC}Z`I zU;-Sx)a$NSRsH&X|9pM{IL1yKVXVavLP5j2hK&d|BiIs%jz`LKWnT$ot6ljh%RT9K z$~E6}+|DWcLpd5f4ZOC1<-ZIm3s)T1@y`TKii?K-Fr@~w&IfH~rK^ssZpQtl^6IkL zBa`ST|9&=7zF1mJoQm#db46&W2cyMngR$3AmyS*|QQdLu88A{LkmdMtWkWKu{YhYY*v0CmzXZ-O;szr%RtVQLKr bWR|$PRBFykbChP6O09Wmp3)p&GLZiTsHbOB literal 0 HcmV?d00001 diff --git a/src/exams/李四1/2025-09-27-12-54-51.txt b/src/exams/李四1/2025-09-27-12-54-51.txt new file mode 100644 index 0000000..698915d --- /dev/null +++ b/src/exams/李四1/2025-09-27-12-54-51.txt @@ -0,0 +1,21 @@ +1. 87 + 84^2 + +2. 87 * 78 - 10 + +3. 14 * 25 + +4. 37 / 4 / 25 / 19 + +5. 34 / 69^2 * 90 + +6. 56 * 45 + 81^2 * 99 + +7. 59 / 44 / 70 / 47 + +8. 17^2 + 77 - 49 + +9. 48 / 95 * 98 + +10. 47 / 20 + 49 / 34 + +11. 62^2 + 5 diff --git a/src/exams/李四1/2025-09-27-12-55-25.txt b/src/exams/李四1/2025-09-27-12-55-25.txt new file mode 100644 index 0000000..7dd8ed9 --- /dev/null +++ b/src/exams/李四1/2025-09-27-12-55-25.txt @@ -0,0 +1,21 @@ +1. 40 / (46 * 2) * 92 + +2. 93 * 71 + +3. (56 / 61) / 64 + 10 + +4. (34 / 70) / 88 + +5. 18 - 96 - 53 + +6. 88 + 55 + 50 + +7. (42 * 21) * 64 + +8. 41 / 35 + +9. (15 - 29) + 85 + +10. 10 - 8 - 5 / 76 + +11. 72 - 1 * 58 + 92 diff --git a/src/exams/李四2/2025-09-27-12-55-39.txt b/src/exams/李四2/2025-09-27-12-55-39.txt new file mode 100644 index 0000000..ec24670 --- /dev/null +++ b/src/exams/李四2/2025-09-27-12-55-39.txt @@ -0,0 +1,21 @@ +1. 71 * 100 * 96 - 86 + +2. 50 * 86^2 * 71 * 15 + +3. 84 + 95^2 + 66 - 60 + +4. 23 / 32 + 21^2 - 31 + +5. 85 + 93 + 30 + +6. 31 + 58 / 96 + +7. 16 / 13 - 87 + +8. 93 / 92 + +9. 26 / 86 * 85 - 33 + +10. 83 / 95 + 53 * 30 + +11. 95^2 * 60 diff --git a/src/新建 文本文档.c b/src/新建 文本文档.c deleted file mode 100644 index 0b7f2f6..0000000 --- a/src/新建 文本文档.c +++ /dev/null @@ -1,454 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; - -// 用户账户结构 -class User { -public: - string username; - string password; - string userType; // "小学", "初中", "高中" -}; - -// 题目生成接口 -class QuestionGenerator { -public: - virtual string generateQuestion() = 0; - virtual bool meetsRequirements(const string& question) = 0; - virtual ~QuestionGenerator() {} -}; - -// 小学题目生成器 -class PrimaryQuestionGenerator : public QuestionGenerator { -public: - string generateQuestion() override; - bool meetsRequirements(const string& question) override; -}; - -// 初中题目生成器 -class JuniorQuestionGenerator : public QuestionGenerator { -public: - string generateQuestion() override; - bool meetsRequirements(const string& question) override; -}; - -// 高中题目生成器 -class SeniorQuestionGenerator : public QuestionGenerator { -public: - string generateQuestion() override; - bool meetsRequirements(const string& question) override; -}; - -// 文件管理器类 -class FileManager { -public: - static bool createUserFolder(const string& username); - static string generateFileName(const string& username); - static void saveQuestionsToFile(const string& filename, const vector& questions); - static set loadExistingQuestions(const string& username); -}; - -// 用户认证类 -class UserAuthenticator { -private: - vector presetUsers; - -public: - UserAuthenticator(); - bool authenticate(const string& username, const string& password, User& user); -}; - -// 应用程序主类 -class MathTestGeneratorApp { -private: - User currentUser; - bool isLoggedIn; - set generatedQuestions; - map generators; - - QuestionGenerator* currentGenerator; - -public: - MathTestGeneratorApp(); - ~MathTestGeneratorApp(); - - void run(); - void login(); - void generatePaper(); - void switchUserType(const string& newType); - bool isQuestionDuplicate(const string& question); - void addQuestionToHistory(const string& question); - string getCurrentTimeString(); -}; - -// 预设账户 -UserAuthenticator::UserAuthenticator() { - presetUsers = { - {"张三1", "123", "小学"}, - {"张三2", "123", "小学"}, - {"张三3", "123", "小学"}, - {"李四1", "123", "初中"}, - {"李四2", "123", "初中"}, - {"李四3", "123", "初中"}, - {"王五1", "123", "高中"}, - {"王五2", "123", "高中"}, - {"王五3", "123", "高中"} - }; -} - -bool UserAuthenticator::authenticate(const string& username, const string& password, User& user) { - for (const auto& u : presetUsers) { - if (u.username == username && u.password == password) { - user = u; - return true; - } - } - return false; -} - -// 小学题目生成实现 -string PrimaryQuestionGenerator::generateQuestion() { - int numOperands = rand() % 4 + 2; // 2-5个操作数 - stringstream question; - vector operators = {"+", "-", "*", "/"}; - - bool hasParentheses = (rand() % 2 == 0); - - for (int i = 0; i < numOperands; i++) { - int operand = rand() % 100 + 1; - - if (i == 0) { - if (hasParentheses && numOperands > 2 && rand() % 2 == 0) { - question << "("; - } - question << operand; - } else { - string op = operators[rand() % operators.size()]; - question << " " << op << " " << operand; - - if (hasParentheses && i == 1 && rand() % 2 == 0) { - question << ")"; - } - } - } - - question << " = "; - return question.str(); -} - -bool PrimaryQuestionGenerator::meetsRequirements(const string& question) { - // 小学题目只能包含 + - * / 和括号 - for (char c : question) { - if (isalpha(c) && c != 's' && c != 'i' && c != 'n' && c != 'c' && c != 'o' && c != 't' && c != 'a') { - // 简单检查,实际需要更复杂的逻辑 - continue; - } - } - return true; -} - -// 初中题目生成实现 -string JuniorQuestionGenerator::generateQuestion() { - int numOperands = rand() % 4 + 2; // 2-5个操作数 - stringstream question; - vector operators = {"+", "-", "*", "/", "²", "√"}; - - bool hasSquareOrRoot = false; - - for (int i = 0; i < numOperands; i++) { - int operand = rand() % 100 + 1; - - if (i == 0) { - question << operand; - } else { - string op = operators[rand() % operators.size()]; - - if (op == "²") { - question << "² " << operators[rand() % 4] << " " << operand; - hasSquareOrRoot = true; - } else if (op == "√") { - question << "√" << operand << " " << operators[rand() % 4] << " " << operand; - hasSquareOrRoot = true; - } else { - question << " " << op << " " << operand; - } - } - } - - // 确保至少有一个平方或开根号 - if (!hasSquareOrRoot) { - int pos = rand() % numOperands; - // 简化处理,在实际应用中需要更复杂的逻辑 - string temp = question.str(); - size_t found = temp.find_last_of(" "); - if (found != string::npos) { - question.str(""); - question << temp.substr(0, found) << "²" << temp.substr(found); - } - } - - question << " = "; - return question.str(); -} - -bool JuniorQuestionGenerator::meetsRequirements(const string& question) { - // 检查是否包含平方或开根号 - return question.find("²") != string::npos || question.find("√") != string::npos; -} - -// 高中题目生成实现 -string SeniorQuestionGenerator::generateQuestion() { - int numOperands = rand() % 4 + 2; // 2-5个操作数 - stringstream question; - vector operators = {"+", "-", "*", "/", "sin", "cos", "tan"}; - - bool hasTrigonometry = false; - - for (int i = 0; i < numOperands; i++) { - int operand = rand() % 100 + 1; - - if (i == 0) { - if (rand() % 2 == 0) { - string trig = operators[4 + rand() % 3]; // sin, cos, tan - question << trig << "(" << operand << ")"; - hasTrigonometry = true; - } else { - question << operand; - } - } else { - string op = operators[rand() % operators.size()]; - - if (op == "sin" || op == "cos" || op == "tan") { - question << " " << op << "(" << operand << ")"; - hasTrigonometry = true; - } else { - question << " " << op << " " << operand; - } - } - } - - // 确保至少有一个三角函数 - if (!hasTrigonometry) { - string trig = operators[4 + rand() % 3]; - int operand = rand() % 100 + 1; - question << " " << trig << "(" << operand << ")"; - } - - question << " = "; - return question.str(); -} - -bool SeniorQuestionGenerator::meetsRequirements(const string& question) { - // 检查是否包含三角函数 - return question.find("sin") != string::npos || - question.find("cos") != string::npos || - question.find("tan") != string::npos; -} - -// 文件管理实现 -bool FileManager::createUserFolder(const string& username) { - try { - filesystem::create_directory(username); - return true; - } catch (...) { - return false; - } -} - -string FileManager::generateFileName(const string& username) { - time_t now = time(0); - tm* localTime = localtime(&now); - - stringstream ss; - ss << username << "/" - << localTime->tm_year + 1900 << "-" - << setw(2) << setfill('0') << localTime->tm_mon + 1 << "-" - << setw(2) << setfill('0') << localTime->tm_mday << "-" - << setw(2) << setfill('0') << localTime->tm_hour << "-" - << setw(2) << setfill('0') << localTime->tm_min << "-" - << setw(2) << setfill('0') << localTime->tm_sec << ".txt"; - - return ss.str(); -} - -void FileManager::saveQuestionsToFile(const string& filename, const vector& questions) { - ofstream file(filename); - if (file.is_open()) { - for (size_t i = 0; i < questions.size(); i++) { - file << i + 1 << ". " << questions[i] << endl; - if (i < questions.size() - 1) { - file << endl; // 题目之间空一行 - } - } - file.close(); - } -} - -set FileManager::loadExistingQuestions(const string& username) { - set questions; - // 简化实现,实际需要读取所有文件并提取题目 - return questions; -} - -// 应用程序实现 -MathTestGeneratorApp::MathTestGeneratorApp() : isLoggedIn(false) { - generators["小学"] = new PrimaryQuestionGenerator(); - generators["初中"] = new JuniorQuestionGenerator(); - generators["高中"] = new SeniorQuestionGenerator(); - currentGenerator = nullptr; -} - -MathTestGeneratorApp::~MathTestGeneratorApp() { - for (auto& pair : generators) { - delete pair.second; - } -} - -void MathTestGeneratorApp::run() { - srand(time(0)); - - while (true) { - if (!isLoggedIn) { - login(); - } else { - cout << "准备生成" << currentUser.userType << "数学题目,请输入生成题目数量(输入-1将退出当前用户,重新登录):"; - string input; - cin >> input; - - if (input == "-1") { - isLoggedIn = false; - cout << "退出当前用户,重新登录..." << endl; - continue; - } - - if (input.find("切换为") == 0) { - string newType = input.substr(3); // 跳过"切换为" - switchUserType(newType); - continue; - } - - try { - int questionCount = stoi(input); - if (questionCount >= 10 && questionCount <= 30) { - generatePaper(); - } else { - cout << "题目数量应在10-30之间" << endl; - } - } catch (const exception& e) { - cout << "请输入有效的数字" << endl; - } - } - } -} - -void MathTestGeneratorApp::login() { - cout << "请输入用户名和密码(用空格隔开):"; - string username, password; - cin >> username >> password; - - UserAuthenticator authenticator; - if (authenticator.authenticate(username, password, currentUser)) { - isLoggedIn = true; - currentGenerator = generators[currentUser.userType]; - cout << "当前选择为" << currentUser.userType << "出题" << endl; - - // 加载已存在的题目用于查重 - generatedQuestions = FileManager::loadExistingQuestions(currentUser.username); - } else { - cout << "请输入正确的用户名、密码" << endl; - } -} - -void MathTestGeneratorApp::generatePaper() { - cout << "准备生成" << currentUser.userType << "数学题目,请输入生成题目数量:"; - string input; - cin >> input; - - try { - int questionCount = stoi(input); - if (questionCount < 10 || questionCount > 30) { - cout << "题目数量应在10-30之间" << endl; - return; - } - - // 创建用户文件夹 - FileManager::createUserFolder(currentUser.username); - - // 生成题目 - vector questions; - for (int i = 0; i < questionCount; i++) { - string question; - int attempts = 0; - do { - question = currentGenerator->generateQuestion(); - attempts++; - } while ((isQuestionDuplicate(question) || !currentGenerator->meetsRequirements(question)) && attempts < 100); - - if (attempts >= 100) { - cout << "警告:无法生成符合要求的不重复题目" << endl; - } - - questions.push_back(question); - addQuestionToHistory(question); - } - - // 保存到文件 - string filename = FileManager::generateFileName(currentUser.username); - FileManager::saveQuestionsToFile(filename, questions); - cout << "题目已生成到文件:" << filename << endl; - - } catch (const exception& e) { - cout << "请输入有效的数字" << endl; - } -} - -void MathTestGeneratorApp::switchUserType(const string& newType) { - if (newType == "小学" || newType == "初中" || newType == "高中") { - currentUser.userType = newType; - currentGenerator = generators[newType]; - cout << "准备生成" << currentUser.userType << "数学题目,请输入生成题目数量:"; - } else { - cout << "请输入小学、初中和高中三个选项中的一个" << endl; - } -} - -bool MathTestGeneratorApp::isQuestionDuplicate(const string& question) { - return generatedQuestions.find(question) != generatedQuestions.end(); -} - -void MathTestGeneratorApp::addQuestionToHistory(const string& question) { - generatedQuestions.insert(question); -} - -string MathTestGeneratorApp::getCurrentTimeString() { - time_t now = time(0); - tm* localTime = localtime(&now); - - stringstream ss; - ss << localTime->tm_year + 1900 << "-" - << setw(2) << setfill('0') << localTime->tm_mon + 1 << "-" - << setw(2) << setfill('0') << localTime->tm_mday << "-" - << setw(2) << setfill('0') << localTime->tm_hour << "-" - << setw(2) << setfill('0') << localTime->tm_min << "-" - << setw(2) << setfill('0') << localTime->tm_sec; - - return ss.str(); -} - -int main() { - MathTestGeneratorApp app; - app.run(); - return 0; -} \ No newline at end of file -- 2.34.1 From ca3a65ceee862c400378af5c90268d7a70d378fd Mon Sep 17 00:00:00 2001 From: luoyuehang <2830398107@qq.com> Date: Sat, 27 Sep 2025 13:30:28 +0800 Subject: [PATCH 3/3] v3.0 --- src/exams/张三1/2025-09-27-13-13-52.txt | 21 +++++++++++++++++++++ src/exams/王五1/2025-09-27-13-14-25.txt | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/exams/张三1/2025-09-27-13-13-52.txt create mode 100644 src/exams/王五1/2025-09-27-13-14-25.txt diff --git a/src/exams/张三1/2025-09-27-13-13-52.txt b/src/exams/张三1/2025-09-27-13-13-52.txt new file mode 100644 index 0000000..74575d8 --- /dev/null +++ b/src/exams/张三1/2025-09-27-13-13-52.txt @@ -0,0 +1,21 @@ +1. 71 / 95 + 37 - 82 + +2. 64 / 83 + +3. 50 * 54 / 54 + +4. (27 - 93) - 95 + +5. 20 - (78 * 27) - 38 + +6. 37 * 75 + (50 + 30) + +7. 23 / 1 * 78 + +8. 54 - 25 / 76 + +9. 90 * (79 / 42) + 41 + +10. 78 + 15 * 6 + 96 + +11. 74 + 63 - 97 - 34 diff --git a/src/exams/王五1/2025-09-27-13-14-25.txt b/src/exams/王五1/2025-09-27-13-14-25.txt new file mode 100644 index 0000000..53897fd --- /dev/null +++ b/src/exams/王五1/2025-09-27-13-14-25.txt @@ -0,0 +1,21 @@ +1. 55 - 17 * sin(100) + 44 + +2. sin(97) - 23 / 44 + 40 + +3. 62 + tan(16) + 74 - 6 + +4. sin(53) - 31 * 58 / 75 + +5. 52 + cos(93) + +6. 70 - tan(12) + 28 + +7. 55 + tan(7) * 80 + +8. 93 / cos(61) + +9. 89 - tan(75) + +10. 47 + 50 * 72 + sin(25) + +11. tan(50) - 13 -- 2.34.1