json编辑题目后在汇入题库前进行编译测试
This commit is contained in:
parent
c0a5963e50
commit
ed7a7ed5a1
|
|
@ -1,4 +1,4 @@
|
|||
id_string = "21370"
|
||||
id_string = "21370:21371"
|
||||
prodictpath = "../题库0.3/Problems.json"
|
||||
editor = "王伟叶"
|
||||
|
||||
|
|
@ -6,8 +6,20 @@ editor = "王伟叶"
|
|||
from database_tools import *
|
||||
|
||||
|
||||
|
||||
pro_dict = load_dict(prodictpath)
|
||||
obj_dict = load_dict("../题库0.3/LessonObj.json")
|
||||
pro_dict_raw_string = ReadTextFile(prodictpath)
|
||||
configjson = load_dict("文本文件/config.json")["默认完整编译题目模式"]
|
||||
|
||||
|
||||
editedid_list = jsonEditProblemMetadata(id_string,pro_dict,editor)
|
||||
save_dict(pro_dict,prodictpath)
|
||||
print("题号 %s 已编辑."%editedid_list)
|
||||
|
||||
|
||||
if not XeLaTeXTest(editedid_list,pro_dict,obj_dict,configjson,templatepath="模板文件/讲义模板.txt",outdir = "临时文件",outfile = "problems_test.tex"):
|
||||
SaveTextFile(pro_dict_raw_string,"../题库0.3/Problems.json")
|
||||
print("编译失败, 题库文件退回原状")
|
||||
else:
|
||||
print("编译成功, 已汇入题库")
|
||||
Reference in New Issue