database_tools中的目标字段使用蓝色tcolorbox
This commit is contained in:
parent
c9fc029c9a
commit
9c3a666e4d
|
|
@ -745,7 +745,7 @@ 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 = ("目标:\n\n%s\n\n"%GenerateObjTexCode(id,prodict,objdict)) if showobjs else ""
|
||||
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 ""
|
||||
|
|
@ -756,13 +756,17 @@ def TeachersGetAfterContent(id,prodict,objdict,topandbottomusagestuple = (3,3),
|
|||
return string #生成教师版讲义后的答案及空格
|
||||
|
||||
def GenerateObjTexCode(id,prodict,objdict): #生成目标代号对应的学习目标字符串(含蓝色编码)
|
||||
string = ""
|
||||
if prodict[id]["objs"] != []:
|
||||
# string = ""
|
||||
# if prodict[id]["objs"] != []:
|
||||
string = "\n\\begin{tcolorbox}[colback = blue!10!white, colframe = blue!50!black, breakable]\n目标:"
|
||||
for objid in prodict[id]["objs"]:
|
||||
if objid.upper() == "KNONE":
|
||||
string += "\\textcolor{blue}{%s\t%s}\n\n"%(objid,"无当前有效关联目标")
|
||||
string += "\n\n%s\t%s"%(objid,"无当前有效关联目标")
|
||||
else:
|
||||
string += "\\textcolor{blue}{%s\t%s}\n\n"%(objid,objdict[objid]["content"])
|
||||
string += "\n\n%s\t%s"%(objid,objdict[objid]["content"])
|
||||
if prodict[id]["objs"] == []:
|
||||
string += "暂未关联\n"
|
||||
string += "\n\n\\end{tcolorbox}\n"
|
||||
return string #返回目标代码字符串
|
||||
|
||||
def ChooseUsage(usages,topandbottomusagestuple): #生成题号对应的题目的使用记录, topandbottomusagestuple表示保留得分率最高的使用记录与最低的使用记录的个数, 有负数表示不排列, 两数之和大于记录数则从高到低排列后全部展示
|
||||
|
|
|
|||
Reference in New Issue