批量收录新题.py中所用的函数更新为2024版, 同时最后会显示收录的题号列表

This commit is contained in:
wangweiye7840 2024-01-23 13:55:01 +08:00
parent 6367c617e7
commit 440d111eef
1 changed files with 11 additions and 7 deletions

View File

@ -1,16 +1,20 @@
#修改起始id,出处,文件名
starting_id = 19940 #起始id设置, 来自"寻找空闲题号"功能
raworigin = "自拟题目" #题目来源的前缀(中缀在.tex文件中)
filename = r"C:\Users\wangweiye\Documents\wwy sync\临时工作区\test5.tex" #题目的来源.tex文件
editor = "毛培菁" #编辑者姓名
starting_id = 23638 #起始id设置, 来自"寻找空闲题号"功能
raworigin = "测试题目" #题目来源的前缀(中缀在.tex文件中)
filename = r"临时文件\新题比对.tex" #题目的来源.tex文件
editor = "王伟叶" #编辑者姓名
IndexDescription = "" #设置是否使用后缀, 留空("")则不用后缀, 不留空则以所设字符串作为后缀起始词, 按.tex文件中的顺序编号
idlistpath = r"文本文件\新题收录列表.txt"
from database_tools import *
problems = GenerateProblemListFromString(ReadTextFile(filename))
problems = GenerateProblemListFromString2024(ReadTextFile(filename))
pro_dict = load_dict(r"../题库0.3/Problems.json")
AddProblemstoDict(starting_id,raworigin,problems,editor,IndexDescription,pro_dict)
idlist = AddProblemstoDict2024(starting_id,raworigin,problems,editor,IndexDescription,pro_dict)
save_dict(SortDict(pro_dict),r"../题库0.3/Problems.json")
AppendTextFile(f"{GetDate()}-{GetTime()}\n{generate_exp(idlist)}",idlistpath)
os.system(f"code {idlistpath}")