From ec3dba93f66fa543a55013ee0bed660be3792a10 Mon Sep 17 00:00:00 2001 From: "weiye.wang" Date: Mon, 14 Aug 2023 13:58:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E5=B8=88=E8=AE=B2=E4=B9=89=E5=88=B6?= =?UTF-8?q?=E4=BD=9C.py=E4=B8=AD=E6=B7=BB=E5=8A=A0=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=80=BB=E5=A4=84=E7=90=86=E6=97=B6=E9=97=B4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具v2/教师讲义制作.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/工具v2/教师讲义制作.py b/工具v2/教师讲义制作.py index c102ee64..519d67a0 100644 --- a/工具v2/教师讲义制作.py +++ b/工具v2/教师讲义制作.py @@ -1,6 +1,6 @@ -problems = ["1:5","10:15"] #题号列表, 每个字符串表示一个分块的题目 -notetitle = "测试讲义教师版" #讲义标题, 也是文件标题 -sectiontitles = ["课前","课后"] #小节标题列表, 如果与题号列表长度不符则作为不设小节处理 +problems = ["20001:60000"] #题号列表, 每个字符串表示一个分块的题目 +notetitle = "测试讲义教师版20001toend" #讲义标题, 也是文件标题 +sectiontitles = ["课前","课后","测试"] #小节标题列表, 如果与题号列表长度不符则作为不设小节处理 consecutivenumbering = True #不同小节是否连续编号, True表示连续编号, False表示每小节从1开始编号 topandbottomusagestuple = (3,3) #表示保留得分率最高的使用记录与最低的使用记录的个数, 有负数表示不排列 @@ -15,6 +15,7 @@ sectionname = "section" #按何种名称分组, 可选section, subsection, chapt from database_tools import * +import time prodictpath = "../题库0.3/problems.json" objdictpath = "../题库0.3/lessonobj.json" @@ -32,7 +33,7 @@ if sys.platform != "win32": #非win系统用默认字体 latex_raw = re.sub(r"fontset[\s]*=[\s]*none","fontset = fandol",latex_raw) latex_raw = re.sub(r"\\setCJKmainfont",r"% \\setCJKmainfont",latex_raw) - +starttime = time.time() bodystring = GenerateTeacherBodyString(problems,sectiontitles,pro_dict,obj_dict,sectionname=sectionname, consecutivenumbering=consecutivenumbering, topandbottomusagestuple = topandbottomusagestuple, showobjs = showobjs, showtags = showtags, showans = showans, showsolution = showsolution, showusages = showusages, showorigin = showorigin, showremark = showremark) #生成.tex中的内容主体字符串, 用于替换模板中的相应部分 @@ -44,5 +45,9 @@ if XeLaTeXCompile(outputdir,notetitle+".tex"): else: print("编译失败") +endtime = time.time() + +print("总处理时间: %.3f秒"%endtime-starttime) +