From ace470661ab3a6ed53a9c348c4fa2a3aed1a21c0 Mon Sep 17 00:00:00 2001 From: "weiye.wang" Date: Mon, 28 Aug 2023 10:42:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E8=AF=BE=E5=A4=87=E8=AF=BE=E7=A8=BF?= =?UTF-8?q?=E7=94=9F=E6=88=90=E4=B8=AD=E5=8A=A0=E5=85=A5=E4=BA=86=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E6=98=AF=E5=90=A6=E8=AE=BE=E7=BD=AE=E7=A9=BA=E9=97=B4?= =?UTF-8?q?=E7=9A=84=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具v2/database_tools.py | 10 ++++++---- 工具v2/新课备课稿生成.py | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/工具v2/database_tools.py b/工具v2/database_tools.py index 69d56e07..a00b7845 100644 --- a/工具v2/database_tools.py +++ b/工具v2/database_tools.py @@ -892,7 +892,7 @@ def GenerateLessonPreparationDraft(notetitle, outputdir, adict, prodict, objdict print("编译失败") return latex_data # 返回有错误的latex源代码 -def GenerateLessonPreparation(notetitle, outputdir, adict, prodict, objdict, basicknowledgedict): #根据adict生成每一课时的教案 +def GenerateLessonPreparation(notetitle, outputdir, adict, prodict, objdict, basicknowledgedict, homeworkspaces = False): #根据adict生成每一课时的教案 output = "\\tableofcontents\n\\newpage\n\n" outputfilepath = os.path.join(outputdir,notetitle+".tex") @@ -933,13 +933,15 @@ def GenerateLessonPreparation(notetitle, outputdir, adict, prodict, objdict, bas if not remarks == "": output += "\\subsection{备注}\n\n" output += remarks + "\n\n" - output += "\\newpage\n\n\\subsection{课后作业}\n\n" - output += GenerateStudentBodyString(homeworklist,[],prodict,consecutivenumbering=False,answered=False) + if homeworkspaces: + output += "\\newpage\n\n" + output += "\\subsection{课后作业}\n\n" + output += GenerateStudentBodyString(homeworklist,[],prodict,consecutivenumbering=False,answered=False,spaceflag=homeworkspaces) output += "\\newpage\n\n" else: output += "\\section{%s \ %s}\n\n"%(lessonid,lessonname) output += "\\subsection{复习题}\n\n" - output += GenerateStudentBodyString(homeworklist,[],prodict,consecutivenumbering=False,answered = False) + output += GenerateStudentBodyString(homeworklist,[],prodict,consecutivenumbering=False,answered = False,spaceflag=homeworkspaces) output += "\\newpage\n\n" diff --git a/工具v2/新课备课稿生成.py b/工具v2/新课备课稿生成.py index ae623f6f..7826843d 100644 --- a/工具v2/新课备课稿生成.py +++ b/工具v2/新课备课稿生成.py @@ -1,4 +1,4 @@ -notetitle = "高一上学期教案截至20230728" # 文件名, 也是文件标题 +notetitle = "高一上学期教案截至20230828" # 文件名, 也是文件标题 outputdir = "临时文件" # 输出文件夹, 不建议修改 from database_tools import * @@ -9,4 +9,4 @@ obj_dict = load_dict("../题库0.3/LessonObj.json") lessons_dict = load_dict("../题库0.3/LessonsCut.json") basicknowledge_dict = load_dict("../题库0.3/BasicKnowledge.json") -GenerateLessonPreparation(notetitle, outputdir, preparationdict, pro_dict, obj_dict, basicknowledge_dict) \ No newline at end of file +GenerateLessonPreparation(notetitle, outputdir, preparationdict, pro_dict, obj_dict, basicknowledge_dict, homeworkspaces= False) \ No newline at end of file