添加9.0的模板功能
This commit is contained in:
@@ -48,6 +48,7 @@ class ExcelReader:
|
|||||||
question_data: dict[str, list[tuple[str, int]]]
|
question_data: dict[str, list[tuple[str, int]]]
|
||||||
ignore_version_check: bool
|
ignore_version_check: bool
|
||||||
pic_list: list
|
pic_list: list
|
||||||
|
suggestion_template_list: list[Optional[str]]
|
||||||
|
|
||||||
def __init__(self, file_path: str, version_check: bool = False,
|
def __init__(self, file_path: str, version_check: bool = False,
|
||||||
signal: Callable[[str, str], None] = lambda x, y: print(x)):
|
signal: Callable[[str, str], None] = lambda x, y: print(x)):
|
||||||
@@ -73,6 +74,7 @@ class ExcelReader:
|
|||||||
self.ignore_version_check = version_check
|
self.ignore_version_check = version_check
|
||||||
self.pic_list = []
|
self.pic_list = []
|
||||||
self.signal = signal
|
self.signal = signal
|
||||||
|
self.suggestion_template_list = []
|
||||||
|
|
||||||
def parse_excel(self):
|
def parse_excel(self):
|
||||||
try:
|
try:
|
||||||
@@ -80,6 +82,7 @@ class ExcelReader:
|
|||||||
sheet: Worksheet = wb['初始录入']
|
sheet: Worksheet = wb['初始录入']
|
||||||
# 读取版本号
|
# 读取版本号
|
||||||
e_version = sheet['V4'].value if sheet['V4'].value is not None else sheet['U4'].value
|
e_version = sheet['V4'].value if sheet['V4'].value is not None else sheet['U4'].value
|
||||||
|
e_version = sheet['H1'].value if e_version is None else e_version
|
||||||
if e_version is None:
|
if e_version is None:
|
||||||
e_version = "0"
|
e_version = "0"
|
||||||
status, _ = check_version(e_version, COMPATIBLE_VERSION)
|
status, _ = check_version(e_version, COMPATIBLE_VERSION)
|
||||||
@@ -225,6 +228,17 @@ class ExcelReader:
|
|||||||
else:
|
else:
|
||||||
self.question_data[key] = [values]
|
self.question_data[key] = [values]
|
||||||
|
|
||||||
|
# 读取建议模板
|
||||||
|
if CUR_VERSION >= version.parse("9.0"):
|
||||||
|
sheet = wb['初始录入']
|
||||||
|
|
||||||
|
for i in range(29, 34):
|
||||||
|
self.suggestion_template_list.append(sheet[f'I{i}'].value)
|
||||||
|
|
||||||
|
if len(self.suggestion_template_list) != 5:
|
||||||
|
for i in range(len(self.suggestion_template_list), 5):
|
||||||
|
self.suggestion_template_list.append(None)
|
||||||
|
|
||||||
self.validate_data()
|
self.validate_data()
|
||||||
self.gen_picture()
|
self.gen_picture()
|
||||||
|
|
||||||
@@ -471,7 +485,7 @@ class ExcelReader:
|
|||||||
yield analysis_results
|
yield analysis_results
|
||||||
yield "改进措施"
|
yield "改进措施"
|
||||||
yield ("注:改进措施,包括课时分配、教材选用、教学方式、教学方法、教学内容、评分标准、过程评价及帮扶\n"
|
yield ("注:改进措施,包括课时分配、教材选用、教学方式、教学方法、教学内容、评分标准、过程评价及帮扶\n"
|
||||||
"\n\n\n在这填入您的改进措施\n\n\n")
|
f"{self.suggestion_template_list[0] if self.suggestion_template_list[0] is not None else '\n\n\n在这填入您的改进措施\n\n\n'}")
|
||||||
for i in range(88888):
|
for i in range(88888):
|
||||||
yield "如果您看到了本段文字,请联系开发者"
|
yield "如果您看到了本段文字,请联系开发者"
|
||||||
|
|
||||||
@@ -561,15 +575,16 @@ class ExcelReader:
|
|||||||
f"达成值为{self.achievement_level[i][min_p_rate_index].achievement},"
|
f"达成值为{self.achievement_level[i][min_p_rate_index].achievement},"
|
||||||
f"{'、'.join(o_c_str)}的达成情况较好;")
|
f"{'、'.join(o_c_str)}的达成情况较好;")
|
||||||
analysis_results = analysis_results[:-1] + "。"
|
analysis_results = analysis_results[:-1] + "。"
|
||||||
analysis_results += "\n3.结果分析: \n在此填写您的结果分析\n\n"
|
analysis_results += ("\n3.结果分析: \n"
|
||||||
|
f"{self.suggestion_template_list[2] if self.suggestion_template_list[2] is not None else '\n\n\n在此填写您的结果分析\n\n\n'}")
|
||||||
yield analysis_results
|
yield analysis_results
|
||||||
yield "改进措施"
|
yield "改进措施"
|
||||||
yield "注:改进措施,包括课时分配、教材选用、教学方式、教学方法、教学内容、评分标准、过程评价及帮扶\n\n\n\n"
|
yield ("注:改进措施,包括课时分配、教材选用、教学方式、教学方法、教学内容、评分标准、过程评价及帮扶\n"
|
||||||
|
f"{self.suggestion_template_list[1] if self.suggestion_template_list[1] is not None else '\n\n\n在这填入您的改进措施\n\n\n'}")
|
||||||
for i in range(88888):
|
for i in range(88888):
|
||||||
yield "如果您看到了本段文字,请联系开发者"
|
yield "如果您看到了本段文字,请联系开发者"
|
||||||
|
|
||||||
@staticmethod
|
def get_word_template_part_3(self):
|
||||||
def get_word_template_part_3():
|
|
||||||
yield "课程目标达成情况合理性评价"
|
yield "课程目标达成情况合理性评价"
|
||||||
yield "评价样本的合理性"
|
yield "评价样本的合理性"
|
||||||
yield "R全体样本 £抽样样本"
|
yield "R全体样本 £抽样样本"
|
||||||
@@ -587,16 +602,14 @@ class ExcelReader:
|
|||||||
yield "R合理 £基本合理 £不合理"
|
yield "R合理 £基本合理 £不合理"
|
||||||
yield "专业负责人/系主任(签字)"
|
yield "专业负责人/系主任(签字)"
|
||||||
yield ("整改意见:\n"
|
yield ("整改意见:\n"
|
||||||
"\n\n\n\n\n"
|
|
||||||
"\n\n\n"
|
"\n\n\n"
|
||||||
"\n\t\t\t\t\t\t\t\t\t签字:\t\t\t日期:{}\n".
|
f"{self.suggestion_template_list[3] if self.suggestion_template_list[3] is not None else '\n\n\n'}"
|
||||||
format(datetime.datetime.now().strftime("%Y-%m-%d")))
|
f"\n\n\n\t\t\t\t\t\t\t\t\t签字:\t\t\t日期:{datetime.datetime.now().strftime("%Y-%m-%d")}\n")
|
||||||
yield "课程负责人(签字)"
|
yield "课程负责人(签字)"
|
||||||
yield ("拟整改计划与措施:\n"
|
yield ("拟整改计划与措施:\n"
|
||||||
"\n\n\n\n\n"
|
|
||||||
"\n\n\n"
|
"\n\n\n"
|
||||||
"\n\t\t\t\t\t\t\t\t\t签字:\t\t\t日期:{}\n".
|
f"{self.suggestion_template_list[4] if self.suggestion_template_list[4] is not None else '\n\n\n'}"
|
||||||
format(datetime.datetime.now().strftime("%Y-%m-%d")))
|
f"\n\n\n\t\t\t\t\t\t\t\t\t签字:\t\t\t日期:{datetime.datetime.now().strftime("%Y-%m-%d")}\n")
|
||||||
for i in range(88888):
|
for i in range(88888):
|
||||||
yield "如果您看到了本段文字,请联系开发者"
|
yield "如果您看到了本段文字,请联系开发者"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user