This repository has been archived on 2024-06-23. You can view files and clone it, but cannot push or open issues or pull requests.
mathdeptv2/工具v2/latex编辑题目答案及提示.py

23 lines
814 B
Python

id_string = "24488:24499"
editor = "王伟叶"
from database_tools import *
pro_dict = load_dict("../题库0.3/Problems.json")
obj_dict = load_dict("../题库0.3/LessonObj.json")
tempfilepath = "临时文件/problem_edit.tex"
pro_dict_raw_string = ReadTextFile("../题库0.3/Problems.json")
configjson = load_dict("文本文件/config.json")["默认完整编译题目模式"]
edited = ModifyProblembyTeX(id_string,pro_dict,tempfilepath,editor)
print("编辑过的题号: %s"%edited)
if not XeLaTeXTest(edited,pro_dict,obj_dict,configjson,templatepath="模板文件/讲义模板.txt",outdir = "临时文件",outfile = "problems_test.tex"):
SaveTextFile(pro_dict_raw_string,"../题库0.3/Problems.json")
print("编译失败, 题库文件退回原状")
else:
print("编译成功, 已汇入题库")