修改database_tools使教师讲义制作非题目部分都以色块为背景
This commit is contained in:
parent
9c3a666e4d
commit
c1630561a0
|
|
@ -746,19 +746,20 @@ def GenerateStudentBodyString(problems,sectiontitles,pro_dict,consecutivenumberi
|
|||
def TeachersGetAfterContent(id,prodict,objdict,topandbottomusagestuple = (3,3), showobjs = True, showtags = True, showans = True, showsolution = True, showusages = True, showorigin = True, showremark = True): #生成教师版讲义后的答案及空格, topandbottomusagestuple表示保留得分率最高的使用记录与最低的使用记录的个数, 有负数表示不排列
|
||||
string = ""
|
||||
objs = GenerateObjTexCode(id,prodict,objdict) if showobjs else ""
|
||||
tags = ("标签: \\textcolor[rgb]{0.5,0.6,0.8}{%s}\n\n"%("; ".join(prodict[id]["tags"])) if not prodict[id]["tags"] == [] else "标签: \n\n") if showtags else ""
|
||||
ans = ("答案: \\textcolor{red}{%s}\n\n"%(prodict[id]["ans"] if prodict[id]["ans"] != "" else "暂无答案")) if showans else ""
|
||||
solution = ("解答或提示: \\textcolor{magenta}{%s}\n\n"%(prodict[id]["solution"] if prodict[id]["solution"] != "" else "暂无解答")) if showsolution else ""
|
||||
origin = ("来源: %s\n\n"%prodict[id]["origin"]) if showorigin else ""
|
||||
remark = ("备注: \\textcolor[rgb]{0,0.5,0.2}{%s}\n\n"%(prodict[id]["remark"] if prodict[id]["remark"] != "" else "暂无备注")) if showremark else ""
|
||||
usages = ("使用记录:\n\n%s\n\n"%GenerateUsageTexCode(id,prodict,topandbottomusagestuple)) if showusages else ""
|
||||
tags = ("\\begin{tcolorbox}[colback = orange!10!white, colframe = orange!10!white, breakable]\n标签: %s\n\n\\end{tcolorbox}\n"%("; ".join(prodict[id]["tags"]))) if showtags else ""
|
||||
ans = ("\\begin{tcolorbox}[colback = red!10!white, colframe = red!10!white, breakable]\n答案: %s\n\n\\end{tcolorbox}\n"%(prodict[id]["ans"] if prodict[id]["ans"] != "" else "暂无答案")) if showans else ""
|
||||
solution = ("\\begin{tcolorbox}[colback = green!10!white, colframe = green!10!white, breakable]\n解答或提示: %s\n\n\\end{tcolorbox}\n"%(prodict[id]["solution"] if prodict[id]["solution"] != "" else "暂无解答")) if showsolution else ""
|
||||
# solution = ("解答或提示: \\textcolor{magenta}{%s}\n\n"%(prodict[id]["solution"] if prodict[id]["solution"] != "" else "暂无解答")) if showsolution else ""
|
||||
origin = ("\\begin{tcolorbox}[colback = yellow!30!white, colframe = yellow!30!white, breakable]\n来源: %s\n\n\\end{tcolorbox}\n"%prodict[id]["origin"]) if showorigin else ""
|
||||
remark = ("\\begin{tcolorbox}[colback = cyan!30!white, colframe = cyan!30!white, breakable]\n备注: %s\n\n\\end{tcolorbox}\n"%(prodict[id]["remark"] if prodict[id]["remark"] != "" else "暂无备注")) if showremark else ""
|
||||
usages = ("\\begin{tcolorbox}[colback = lime!10!white, colframe = lime!10!white, breakable]\n使用记录(%s):\n\n%s\n\n\\end{tcolorbox}\n"%(str(topandbottomusagestuple),GenerateUsageTexCode(id,prodict,topandbottomusagestuple))) if showusages else ""
|
||||
string += objs + tags + ans + solution + usages + origin + remark
|
||||
return string #生成教师版讲义后的答案及空格
|
||||
|
||||
def GenerateObjTexCode(id,prodict,objdict): #生成目标代号对应的学习目标字符串(含蓝色编码)
|
||||
# string = ""
|
||||
# if prodict[id]["objs"] != []:
|
||||
string = "\n\\begin{tcolorbox}[colback = blue!10!white, colframe = blue!50!black, breakable]\n目标:"
|
||||
string = "\n\\begin{tcolorbox}[colback = blue!10!white, colframe = blue!10!white, breakable]\n目标:"
|
||||
for objid in prodict[id]["objs"]:
|
||||
if objid.upper() == "KNONE":
|
||||
string += "\n\n%s\t%s"%(objid,"无当前有效关联目标")
|
||||
|
|
|
|||
Reference in New Issue