{"id":15344712,"url":"https://github.com/moremind/autoaddproblem","last_synced_at":"2025-10-07T11:21:39.371Z","repository":{"id":108635506,"uuid":"134797290","full_name":"moremind/AutoAddProblem","owner":"moremind","description":"qduoj自动化加题-该项目已经停止更新","archived":false,"fork":false,"pushed_at":"2022-03-07T06:18:08.000Z","size":70890,"stargazers_count":34,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T03:35:17.533Z","etag":null,"topics":["autocomplete","python","qduoj"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moremind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-25T03:14:44.000Z","updated_at":"2025-03-05T14:50:32.000Z","dependencies_parsed_at":"2023-04-15T16:03:49.456Z","dependency_job_id":null,"html_url":"https://github.com/moremind/AutoAddProblem","commit_stats":{"total_commits":25,"total_committers":1,"mean_commits":25.0,"dds":0.0,"last_synced_commit":"39a949dd8608162972350c08a3920113dfbe595b"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/moremind/AutoAddProblem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moremind%2FAutoAddProblem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moremind%2FAutoAddProblem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moremind%2FAutoAddProblem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moremind%2FAutoAddProblem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moremind","download_url":"https://codeload.github.com/moremind/AutoAddProblem/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moremind%2FAutoAddProblem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278763198,"owners_count":26041515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autocomplete","python","qduoj"],"created_at":"2024-10-01T11:02:14.170Z","updated_at":"2025-10-07T11:21:39.366Z","avatar_url":"https://github.com/moremind.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"BZOJ数据：链接: https://pan.baidu.com/s/1ug7XIaOKxHPyZHV4iNxS8Q?pwd=uyj9 提取码: uyj9 复制这段内容后打开百度网盘手机App，操作更方便哦\n\n## 缘由 \n\nQDUOJ的开发以及众多OJ的题库，使得我们自动化添加题目更加轻松。前提是您需要获得各OJ的测试数据。**请注意本方法只用在您的机器上运行即可，不用再OJ服务器运行！**\n\n## 概况\n\n目前主要模块分为\n\n* 爬虫部分-WebSpider\n* 自动化加题部分-AddProblem\n\n用了爬虫scrapy,并且爬虫获取到的数据相对而言文档更容易解析与添加。如果您能够通过pandoc转文件后，将文本提取出来也可以。\n\n## 需要安装的软件\n\n* Python3.6\n* MongoDB(V3.4)\n* MongoDB 客户端工具-推荐使用RoBo 3T\n\nMongo安装教程：[mongo安装](https://blog.csdn.net/heshushun/article/details/77776706)（教程源于-李子园的梦想）\n\n\n## 数据（某OJ数据\u0026已经解压完成的）\n1000-1999-Testcase数据链接：https://pan.baidu.com/s/1SvCgulQt8rn8m7w0cbMExQ 密码：jg7m\n\n2000-2499-Testcase数据链接：https://pan.baidu.com/s/1tgr1M-VsRrzaEjXPmA3NCA 密码：4mpf\n\n2500-2999-Testcase数据链接：https://pan.baidu.com/s/1X3HVJTGCFhHo-p6R_G0sSw 密码：scgq\n\n3000-3499-Testcase数据链接：https://pan.baidu.com/s/1KjosY3Sr7XbSqbZo4Cdfkg 密码：rdr4\n\n3500-3999-Testcase数据链接：https://pan.baidu.com/s/16eJWeheUgKJeuQDGVSKHuw 密码：goii\n\n4000-4499-Testcase数据连接：https://pan.baidu.com/s/1Yt-MZHvDPGtQooUgt9yJ1Q 密码：1pu0\n\n4500-4999-Testcase数据连接：https://pan.baidu.com/s/1Dz9bDHzkpsx9jOxHSp2IeQ 密码：tv9g\n\n## 题目数据\n\nhttps://finen-1251602255.cos.ap-shanghai.myqcloud.com/file/bzoj_problem.zip\n\n您可以直接通过MongoDB将将该数据导入到您的Mongo中。\n导入命令如下：\n```\nlinux下可以使用：mongorestore -d \u003cdb_name\u003e \u003cbson_folder\u003e\nwindows下可以使用：mongorestore.exe -d \u003cdb_name\u003e \u003cbson_folder\u003e\n\nwindows下： mongorestore.exe -d bzoj D:\\Mongo\\bin\\dump\\bzoj_problem\\problem.bson\nlinux下： mongorestore -d bzoj /usr/DB/bzoj_problem/problem.bson\n```\n\n\u003e 如果您对爬虫有兴趣可以参看1.0版本进行对题目数据进行爬取。\nhttps://github.com/hirCodd/AutoAddProblem/blob/master/README_1.0.md\n\n## 图片位置\n在本项目中已经提供BZOJ，所以您可以直接在BZOJ解压包中看到JudgeOnline找到upload以及images两个图片目录，你只需要将这个两个目录复制到已经部署好的qduoj的public目录下即可。\n![dir][2]\n\n## 安装自动加题所需要的库\n1. webdriver\n2. selenium\n3. pymongo\n\n安装方法：\n```\npip install selenium\npip install pymongo\n```\n\nwebdriver下载地址：[chromedriver](https://finen-1251602255.cos.ap-shanghai.myqcloud.com/file/chromedriver.exe)\nwebdriver放置位置如下：\n\n![webdriver][4]\n\n\n* 执行自动加题\n\u003e 也需要修改您的url以及mongoDB配置，以及OJ的管理员的用户名、密码。\n\n1. url在add_problem.py\n2. MongoDB配置在settings.py\n3. OJ用户名以及密码在config.py\n4. 修改zip_dir = \"E:\\\\Problem\\\\Testcase\\\\ok\"为您重新压缩后的目录。\n\n* 执行：python add_problem.py\n\n\n## 某些bug\n* 因为BZOJ数据问题，可能导致添加题目突然中止，你可能需要执行删除数据库文档的命令，然后重新执行：python add_problem.py即可再次添加题目。\n\u003e 在delete.py中，你需要修改count的值以及for循环的值，删除已经添加得文档。示例如下：\n\n    # 删除编号自1200开始，至1245的所有文档数据\n    for i in range(0, 46):\n        count = 1200\n        count = count+i\n        print(count)\n        db.problem.delete_one({\"problem_no\": str(count)})\n\n\n![oj][1]\n![oj1][3]\n\n\n  [1]: https://s1.ax2x.com/2018/06/02/71uIJ.png\n  [2]: https://finen-1251602255.cos.ap-shanghai.myqcloud.com/images/github/autoaddproblem/dir.png\n  [3]: https://finen-1251602255.cos.ap-shanghai.myqcloud.com/images/github/autoaddproblem/p.png\n  [4]: https://finen-1251602255.cos.ap-shanghai.myqcloud.com/images/github/autoaddproblem/webdriver.png\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoremind%2Fautoaddproblem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoremind%2Fautoaddproblem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoremind%2Fautoaddproblem/lists"}