|
@@ -23,12 +23,11 @@ num_dict = {1: "❶", 2: "❷", 3: "❸", 4: "❹", 5: "❺", 6: "❻", 7: "❼"
|
|
|
10: "❿", 11: "⓫", 12: "⓬", 13: "⓭", 14: "⓮", 15: "⓯", 16: "⓰", 17: "⓱", 18: "⓲", 19: "⓳", 20: "⓴"}
|
|
|
|
|
|
|
|
|
-
|
|
|
@time_use
|
|
|
def header_maker(docx: Word, json_data):
|
|
|
- exercise_id = str(json_data.get("ExerciseId", "")).rjust(11, "0")
|
|
|
- exercise_title = json_data.get("ExerciseTitle", "")
|
|
|
- exercise_level = json_data['StudentInfo']['StudentStudy']['ReadingLevel']
|
|
|
+ exercise_id = str(json_data.get("ExerciseId", "")).rjust(11, "0")
|
|
|
+ exercise_title = json_data.get("ExerciseTitle", "")
|
|
|
+ exercise_level = json_data['StudentInfo']['StudentStudy']['ReadingLevel']
|
|
|
|
|
|
student_name = json_data.get("StudentInfo").get("StudentName", '')
|
|
|
class_name = json_data.get("StudentInfo").get("ClassName", '').replace("词汇突击", "")
|
|
@@ -46,15 +45,12 @@ def header_maker(docx: Word, json_data):
|
|
|
tb_header.set_cell_text(0, 4, f"{t_date}\n{t_weekday}\n{t_time}", size=8, border=False, color=(220, 220, 220))
|
|
|
|
|
|
tb_header.set_tb_colum_width(width=[100, 70, 70, 150, 80])
|
|
|
-
|
|
|
|
|
|
- target_section = docx.doc.sections[-1]
|
|
|
+ target_section = docx.doc.sections[-1]
|
|
|
target_section.header.is_linked_to_previous = False
|
|
|
-
|
|
|
+
|
|
|
for paragraph in target_section.header.paragraphs:
|
|
|
- paragraph.clear()
|
|
|
-
|
|
|
-
|
|
|
+ paragraph.clear()
|
|
|
|
|
|
target_section.header_distance = 0
|
|
|
target_section.footer_distance = 280000
|
|
@@ -65,9 +61,9 @@ def sub_title_maker(docx: Word, main_title, sub_title_name1, sub_title_name2='
|
|
|
p = docx.add_blank_paragraph()
|
|
|
line_width = 200
|
|
|
main_rect_x = line_width + 10
|
|
|
- main_rect_width = 150
|
|
|
+ main_rect_width = 150
|
|
|
|
|
|
- right_line_x = main_rect_x + main_rect_width + 10
|
|
|
+ right_line_x = main_rect_x + main_rect_width + 10
|
|
|
|
|
|
p.add_rectangle(main_title, x=main_rect_x, y=4, fill_color="000000", width=main_rect_width, height=48, font_color="ffffff",
|
|
|
font_size=18)
|
|
@@ -84,32 +80,25 @@ def sub_title_maker(docx: Word, main_title, sub_title_name1, sub_title_name2='
|
|
|
|
|
|
@time_use
|
|
|
def section_1(docx: Word, json_data, *args, **kwargs):
|
|
|
-
|
|
|
- exercise_id_int = json_data.get("ExerciseId", "")
|
|
|
- student_name = json_data.get("StudentInfo").get("StudentName", '')
|
|
|
- student_stage = json_data.get("StudentInfo").get("StudentStage")
|
|
|
+ exercise_id_int = json_data.get("ExerciseId", "")
|
|
|
+ student_name = json_data.get("StudentInfo").get("StudentName", '')
|
|
|
+ student_stage = json_data.get("StudentInfo").get("StudentStage")
|
|
|
grade_name = {1: "小学", 2: "初中", 3: "高中"}.get(student_stage)
|
|
|
- t_date_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
|
|
|
+ t_date_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
|
|
|
|
|
|
-
|
|
|
totalVocabulary, readingAccuracy, readingLevel, readingSpeed = get_standard_data(student_stage)
|
|
|
|
|
|
- FirstVocabulary = json_data['StudentInfo']['StudentStudy']['FirstVocabulary']
|
|
|
- Vocabulary = json_data['StudentInfo']['StudentStudy']['Vocabulary']
|
|
|
- ReadingVolume = json_data['StudentInfo']['StudentStudy']['ReadingVolume']
|
|
|
+ FirstVocabulary = json_data['StudentInfo']['StudentStudy']['FirstVocabulary']
|
|
|
+ Vocabulary = json_data['StudentInfo']['StudentStudy']['Vocabulary']
|
|
|
+ ReadingVolume = json_data['StudentInfo']['StudentStudy']['ReadingVolume']
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- r6 = json_data['StudentInfo']['StudentStudy']['ReadingLevel']
|
|
|
+ r6 = json_data['StudentInfo']['StudentStudy']['ReadingLevel']
|
|
|
|
|
|
-
|
|
|
- r7 = len([strange_words for exercise in json_data['WordAndArticleContents'] for strange_words in exercise['StrangeWords']])
|
|
|
- r8 = r6
|
|
|
- multi_article_difficulty = [article_obj['Score'] for article_obj in json_data['WordAndArticleContents'][0]['Articles']]
|
|
|
- difficulty_value = sum(multi_article_difficulty) // len(multi_article_difficulty) if multi_article_difficulty else 0
|
|
|
+ r7 = len([strange_words for exercise in json_data['WordAndArticleContents'] for strange_words in exercise['StrangeWords']])
|
|
|
+ r8 = r6
|
|
|
+ multi_article_difficulty = [article_obj['Score'] for article_obj in json_data['WordAndArticleContents'][0]['Articles']]
|
|
|
+ difficulty_value = sum(multi_article_difficulty) // len(multi_article_difficulty) if multi_article_difficulty else 0
|
|
|
|
|
|
-
|
|
|
InspirationalMessage = json_data.get('InspirationalMessage')
|
|
|
"开始版面-------------------------------------------------"
|
|
|
|
|
@@ -156,12 +145,10 @@ def section_1(docx: Word, json_data, *args, **kwargs):
|
|
|
t5.set_row_height(row_height=50)
|
|
|
t5.set_tb_colum_width(0, 500)
|
|
|
|
|
|
-
|
|
|
docx.add_paragraph(text="多媒体辅助", size=16, align="left", bold=True, dq=10, dh=5)
|
|
|
docx.add_paragraph(text="需要示范的的学员,扫以下二维码获取音频、视频示范:", size=12, align="left", dq=5, dh=5)
|
|
|
p = docx.add_blank_paragraph()
|
|
|
|
|
|
-
|
|
|
img_io = qrcode_maker(full_url=f"{address}/link?type=exercise&id={exercise_id_int}&from=bltf")
|
|
|
p.add_pic(img_io, width=2)
|
|
|
img_io.close()
|
|
@@ -197,17 +184,13 @@ def section_4_1(docx: Word, json_data, *args, **kwargs):
|
|
|
cell_outside = tb_outside.get_cell(row, col, delete_default_para=True)
|
|
|
tb_inside = Table(cell_outside, rows=5, cols=3, tb_name="内部内容")
|
|
|
|
|
|
-
|
|
|
tb_inside.merge_cell(0, 0, 0, 2)
|
|
|
- tb_inside.merge_cell(1, 0, 1, 2)
|
|
|
-
|
|
|
- tb_inside.merge_cell(2, 0, 2, 2)
|
|
|
- tb_inside.merge_cell(3, 0, 3, 2)
|
|
|
- tb_inside.merge_cell(4, 0, 4, 2)
|
|
|
+ tb_inside.merge_cell(1, 0, 1, 2)
|
|
|
|
|
|
-
|
|
|
+ tb_inside.merge_cell(2, 0, 2, 2)
|
|
|
+ tb_inside.merge_cell(3, 0, 3, 2)
|
|
|
+ tb_inside.merge_cell(4, 0, 4, 2)
|
|
|
|
|
|
-
|
|
|
num_calucate = 2 * row + 1 if col == 0 else 2 * row + 2
|
|
|
p = ParagraphBase(tb_inside.get_cell_paragraph(0, 0, align="left"))
|
|
|
p.add_run_to_p(num_dict[num_calucate], bold=True, size=22, font_name="MS Gothic")
|
|
@@ -215,19 +198,10 @@ def section_4_1(docx: Word, json_data, *args, **kwargs):
|
|
|
tb_inside.set_cell_text(row=1, column=0, cell_text=data[1] + " " + data[2], border=False, size=10, align="left",
|
|
|
bk_color=(240, 240, 240))
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
cell_p = tb_inside.get_cell_paragraph(2, 0, align="left")
|
|
|
cell_p_1 = ParagraphBase(cell_p)
|
|
|
- cell_p_1.add_run_to_p(data[3], size=10, bold=True)
|
|
|
- cell_p_1.add_run_to_p(" " + data[4], size=8)
|
|
|
+ cell_p_1.add_run_to_p(data[3], size=10, bold=True)
|
|
|
+ cell_p_1.add_run_to_p(" " + data[4], size=8)
|
|
|
|
|
|
cell_p = tb_inside.get_cell_paragraph(3, 0, align="left")
|
|
|
cell_p_1 = ParagraphBase(cell_p)
|
|
@@ -241,31 +215,25 @@ def section_4_1(docx: Word, json_data, *args, **kwargs):
|
|
|
|
|
|
properties_chinese_map = {"adj": "形容词", "n": "名词", "interj": "感叹词", "conj": "连词", "num": "数字", "art": "冠词",
|
|
|
"pron": "代词", "adv": "副词", "prep": "介词", "v": "动词"}
|
|
|
- strange_words_data = []
|
|
|
+ strange_words_data = []
|
|
|
strange_words = json_data.get('StrangeWords')
|
|
|
- qrcode_thread = []
|
|
|
+ qrcode_thread = []
|
|
|
qrcode_result = {}
|
|
|
|
|
|
for item in strange_words:
|
|
|
- spell = item['Spell']
|
|
|
- word_id = item['WordId']
|
|
|
+ spell = item['Spell']
|
|
|
+ word_id = item['WordId']
|
|
|
en = "" if not item.get("SymbolsEn", "") else item.get("SymbolsEn")
|
|
|
am = "" if not item.get("SymbolsAm", "") else item.get("SymbolsAm")
|
|
|
|
|
|
- symbols_en = "英" + f'[{en}]'
|
|
|
- symbols_am = "美" + f'[{am}]'
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ symbols_en = "英" + f'[{en}]'
|
|
|
+ symbols_am = "美" + f'[{am}]'
|
|
|
|
|
|
- word_properties = " ".join([properties_chinese_map.get(i, "") for i in item['WordProperties']])
|
|
|
- word_meanings = item.get('Meaning', "")
|
|
|
+ word_properties = " ".join([properties_chinese_map.get(i, "") for i in item['WordProperties']])
|
|
|
+ word_meanings = item.get('Meaning', "")
|
|
|
word_changes_list = []
|
|
|
- for idx, s in enumerate(item["WordChanges"],start=1):
|
|
|
- s_type,s_spell = s['Type'], s['Spell']
|
|
|
+ for idx, s in enumerate(item["WordChanges"], start=1):
|
|
|
+ s_type, s_spell = s['Type'], s['Spell']
|
|
|
if "原型" in s_type or "大小写" in s_type:
|
|
|
continue
|
|
|
tail = '\n' if idx != len(item["WordChanges"]) else ''
|
|
@@ -276,12 +244,12 @@ def section_4_1(docx: Word, json_data, *args, **kwargs):
|
|
|
sentences = item['Sentences'][0]['English'] + '\n' + item['Sentences'][0]['Chinese']
|
|
|
else:
|
|
|
sentences = ""
|
|
|
-
|
|
|
+
|
|
|
single_word_tuple = (spell, symbols_en, symbols_am, word_properties, word_meanings,
|
|
|
"词汇变形", word_changes, "例句", sentences)
|
|
|
strange_words_data.append(single_word_tuple)
|
|
|
|
|
|
- rows = math.ceil(len(strange_words_data) / 2)
|
|
|
+ rows = math.ceil(len(strange_words_data) / 2)
|
|
|
tb_outside = Table(docx, rows=rows, cols=2, tb_name="外层框架")
|
|
|
tb_outside.set_tb_colum_width(width=[230, 230])
|
|
|
|
|
@@ -301,12 +269,10 @@ def section_4_1(docx: Word, json_data, *args, **kwargs):
|
|
|
|
|
|
@time_use
|
|
|
def section_5(docx: Word, json_data, *args, **kwargs):
|
|
|
-
|
|
|
copy_word_list = [i['Meaning'] for i in json_data.get('StrangeWords')]
|
|
|
- random_copy_word_list = copy_word_list * 3
|
|
|
+ random_copy_word_list = copy_word_list * 3
|
|
|
shuffle(random_copy_word_list)
|
|
|
|
|
|
-
|
|
|
first_copy_word_list = copy_word_list.copy()
|
|
|
copy_word_list_add_num = [f"{i} ({idx})" for idx, i in enumerate(first_copy_word_list, start=1)]
|
|
|
shuffle(copy_word_list_add_num)
|
|
@@ -369,22 +335,20 @@ def section_6(docx: Word, json_data, *args, **kwargs):
|
|
|
|
|
|
@time_use
|
|
|
def section_7(docx: Word, json_data, *args, **kwargs):
|
|
|
-
|
|
|
def wanxing(index, article_single):
|
|
|
article_id = article_single['Id']
|
|
|
article_length = article_single['AllWordAmount']
|
|
|
-
|
|
|
+
|
|
|
strange_words_ids = [i['MeanId'] for i in json_data['StrangeWords']]
|
|
|
-
|
|
|
+
|
|
|
explanatory_words_ids = [i['MeaningId'] for i in article_single['ExplanatoryWords']]
|
|
|
|
|
|
-
|
|
|
select_text = []
|
|
|
for ques_index, candidates in enumerate(article_single['Questions'], start=1):
|
|
|
single_select_text = ''
|
|
|
for s in candidates['Candidates']:
|
|
|
single_select_text += s['Label'] + '. '
|
|
|
- participle = s['Participle']
|
|
|
+ participle = s['Participle']
|
|
|
if participle:
|
|
|
single_select_text += participle + ' \n'
|
|
|
else:
|
|
@@ -393,14 +357,11 @@ def section_7(docx: Word, json_data, *args, **kwargs):
|
|
|
|
|
|
select_text.append(f"{ques_index}. {single_select_text}")
|
|
|
|
|
|
-
|
|
|
all_select_text = "\n".join(select_text)
|
|
|
|
|
|
-
|
|
|
article_main: str = article_single['English'] + "\n\n郑重提示:认真看完全文再看问题。\n\n" + all_select_text
|
|
|
article_main_list = article_main.split(" ")
|
|
|
|
|
|
-
|
|
|
explanatory_words = "\n\n".join(
|
|
|
[f"{index}. {i['Spell']} [{i['SymbolsEn']}] [{i['SymbolsAm']}] {i['Meaning']}" for index, i in
|
|
|
enumerate(article_single['ExplanatoryWords'], start=1)])
|
|
@@ -442,8 +403,6 @@ def section_7(docx: Word, json_data, *args, **kwargs):
|
|
|
tb2 = Table(docx, rows=1, cols=2, border=True, tb_name="完形填空")
|
|
|
tb2.set_tb_colum_width(width=[320, 140])
|
|
|
|
|
|
-
|
|
|
-
|
|
|
tb2_p = ParagraphBase(tb2.get_cell_paragraph(0, 0, align="left"))
|
|
|
for w in article_main_list:
|
|
|
word = re.search(r"\[(\d+)]", w)
|
|
@@ -454,7 +413,7 @@ def section_7(docx: Word, json_data, *args, **kwargs):
|
|
|
tb2_p.add_run_to_p(w + ' ', size=10.5, bold=True)
|
|
|
elif meaning_id in explanatory_words_ids:
|
|
|
tb2_p.add_run_to_p(w + ' ', size=10.5, italic=True)
|
|
|
- else:
|
|
|
+ else:
|
|
|
tb2_p.add_run_to_p(w + ' ', size=10.5)
|
|
|
else:
|
|
|
tb2_p.add_run_to_p(w + ' ', size=10.5)
|
|
@@ -470,42 +429,40 @@ def section_7(docx: Word, json_data, *args, **kwargs):
|
|
|
docx.add_paragraph(tail_zhushi, size=10.5)
|
|
|
docx.add_blank_paragraph()
|
|
|
|
|
|
-
|
|
|
def reading(index, article_single):
|
|
|
|
|
|
def single_yuedu(index, a):
|
|
|
article_id = a['Id']
|
|
|
- article_length = a['AllWordAmount']
|
|
|
+ article_length = a['AllWordAmount']
|
|
|
|
|
|
- strange_words_ids = set()
|
|
|
- explanatory_words_ids = set()
|
|
|
- bold_word = set()
|
|
|
- italics_word = set()
|
|
|
- italics_index_dict = {}
|
|
|
+ strange_words_ids = set()
|
|
|
+ explanatory_words_ids = set()
|
|
|
+ bold_word = set()
|
|
|
+ italics_word = set()
|
|
|
+ italics_index_dict = {}
|
|
|
|
|
|
for i in json_data['StrangeWords']:
|
|
|
strange_words_ids.add(i['MeanId'])
|
|
|
bold_word.add(i['Spell'])
|
|
|
bold_word.update([change_word['Spell'] for change_word in i['WordChanges']])
|
|
|
- for italics_index,ii in enumerate(a['ExplanatoryWords'], start=1):
|
|
|
+ for italics_index, ii in enumerate(a['ExplanatoryWords'], start=1):
|
|
|
explanatory_words_ids.add(ii['MeaningId'])
|
|
|
italics_word.add(ii['Spell'])
|
|
|
if 'WordChanges' in ii:
|
|
|
italics_word.update([change_word['Spell'] for change_word in ii['WordChanges']])
|
|
|
- italics_index_dict.update({change_word['Spell']:f"[{italics_index}]" for change_word in ii['WordChanges']})
|
|
|
-
|
|
|
+ italics_index_dict.update({change_word['Spell']: f"[{italics_index}]" for change_word in ii['WordChanges']})
|
|
|
+
|
|
|
italics_index_dict[ii['MeaningId']] = f"[{italics_index}]"
|
|
|
italics_index_dict[ii['Spell']] = f"[{italics_index}]"
|
|
|
|
|
|
-
|
|
|
select_text = []
|
|
|
for ques_index, candidates in enumerate(a['Questions'], start=1):
|
|
|
single_select_text = ''
|
|
|
-
|
|
|
- subject = candidates['Subject'] + '\n'
|
|
|
+
|
|
|
+ subject = candidates['Subject'] + '\n'
|
|
|
for s in candidates['Candidates']:
|
|
|
- single_select_text += s['Label'] + '. '
|
|
|
- participle = s['Participle']
|
|
|
+ single_select_text += s['Label'] + '. '
|
|
|
+ participle = s['Participle']
|
|
|
if participle:
|
|
|
single_select_text += participle + ' \n'
|
|
|
else:
|
|
@@ -513,14 +470,11 @@ def section_7(docx: Word, json_data, *args, **kwargs):
|
|
|
single_select_text += text + ' \n'
|
|
|
select_text.append(str(ques_index) + ". " + subject + single_select_text)
|
|
|
|
|
|
-
|
|
|
all_select_text = "\n".join(select_text)
|
|
|
|
|
|
-
|
|
|
article_main: str = a['English'] + "\n\n郑重提示:认真看完全文再看问题。\n" + all_select_text
|
|
|
article_main_list = split_text_to_word_punctuation(article_main)
|
|
|
|
|
|
-
|
|
|
explanatory_words = "\n\n".join(
|
|
|
[f"{index}. {i['Spell']}\n [{i['SymbolsEn']}] [{i['SymbolsAm']}]\n {i['Meaning']}" for index, i in
|
|
|
enumerate(a['ExplanatoryWords'], start=1)])
|
|
@@ -536,7 +490,6 @@ def section_7(docx: Word, json_data, *args, **kwargs):
|
|
|
tb2 = Table(docx, rows=1, cols=2, border=True, tb_name="阅读")
|
|
|
tb2.set_tb_colum_width(width=[320, 140])
|
|
|
|
|
|
-
|
|
|
tb2_p = ParagraphBase(tb2.get_cell_paragraph(0, 0, align="left"))
|
|
|
for w in article_main_list:
|
|
|
word = re.search(r"\[(\d+)]", w)
|
|
@@ -551,7 +504,7 @@ def section_7(docx: Word, json_data, *args, **kwargs):
|
|
|
else:
|
|
|
tb2_p.add_run_to_p(w + ' ', size=10.5)
|
|
|
|
|
|
- else:
|
|
|
+ else:
|
|
|
if w in bold_word:
|
|
|
tb2_p.add_run_to_p(w + ' ', size=10.5, bold=True)
|
|
|
elif w in italics_word:
|
|
@@ -560,7 +513,7 @@ def section_7(docx: Word, json_data, *args, **kwargs):
|
|
|
else:
|
|
|
tb2_p.add_run_to_p(w + ' ', size=10.5)
|
|
|
|
|
|
- tb2.set_cell_text(0, 1, explanatory_words, size=10.5, font_color=(80, 80, 80), align="left", centre=False,line_spacing=300)
|
|
|
+ tb2.set_cell_text(0, 1, explanatory_words, size=10.5, font_color=(80, 80, 80), align="left", centre=False, line_spacing=300)
|
|
|
|
|
|
docx.add_blank_paragraph()
|
|
|
tail_zhushi = """完成时间:_____点_____分_____秒,本篇用时:_____秒。"""
|
|
@@ -569,7 +522,7 @@ def section_7(docx: Word, json_data, *args, **kwargs):
|
|
|
|
|
|
def top_header():
|
|
|
sub_title_maker(docx, "阅读提升练", "智能匹配难度,轻松提升阅读", "鲍利提分, 高效学习专家")
|
|
|
-
|
|
|
+
|
|
|
tb = Table(docx, 1, 1, tb_name="真题强化练", border=True)
|
|
|
tb.set_tb_colum_width(0, 460)
|
|
|
text = ["阅读中不认识的单词,尽量猜测词义,并用斜线划掉,以便拍照报告给我们。\n",
|
|
@@ -590,27 +543,25 @@ def section_7(docx: Word, json_data, *args, **kwargs):
|
|
|
pp.add_run_to_p(t, size=10)
|
|
|
|
|
|
docx.add_blank_paragraph()
|
|
|
+
|
|
|
"---------------------开始单篇运行---------------------"
|
|
|
- if index == 1:
|
|
|
+ if index == 1:
|
|
|
top_header()
|
|
|
single_yuedu(index, article_single)
|
|
|
|
|
|
-
|
|
|
-
|
|
|
def seven_to_five(index, article_single):
|
|
|
article_id = article_single['Id']
|
|
|
article_length = article_single['AllWordAmount']
|
|
|
-
|
|
|
+
|
|
|
strange_words_ids = [i['MeanId'] for i in json_data['StrangeWords']]
|
|
|
-
|
|
|
+
|
|
|
explanatory_words_ids = [i['MeaningId'] for i in article_single['ExplanatoryWords']]
|
|
|
|
|
|
-
|
|
|
select_text = []
|
|
|
for ques_index, s_candidates in enumerate(article_single['Candidates'], start=1):
|
|
|
single_select_text = ''
|
|
|
single_select_text += s_candidates['Label'] + '. '
|
|
|
- participle = s_candidates['Participle']
|
|
|
+ participle = s_candidates['Participle']
|
|
|
if participle:
|
|
|
single_select_text += participle
|
|
|
else:
|
|
@@ -619,14 +570,11 @@ def section_7(docx: Word, json_data, *args, **kwargs):
|
|
|
|
|
|
select_text.append(f"{single_select_text}")
|
|
|
|
|
|
-
|
|
|
all_select_text = "\n".join(select_text)
|
|
|
|
|
|
-
|
|
|
article_main: str = article_single['English'] + "\n\n郑重提示:认真看完全文再看问题。\n\n" + all_select_text
|
|
|
article_main_list = article_main.split(" ")
|
|
|
|
|
|
-
|
|
|
explanatory_words = "\n\n".join(
|
|
|
[f"{index}. {i['Spell']} [{i['SymbolsEn']}] [{i['SymbolsAm']}] {i['Meaning']}" for index, i in
|
|
|
enumerate(article_single['ExplanatoryWords'], start=1)])
|
|
@@ -657,7 +605,6 @@ def section_7(docx: Word, json_data, *args, **kwargs):
|
|
|
tb2 = Table(docx, rows=1, cols=2, border=True, tb_name="七选五")
|
|
|
tb2.set_tb_colum_width(width=[320, 140])
|
|
|
|
|
|
-
|
|
|
tb2_p = ParagraphBase(tb2.get_cell_paragraph(0, 0, align="left"))
|
|
|
for w in article_main_list:
|
|
|
word = re.search(r"\[(\d+)]", w)
|
|
@@ -668,7 +615,7 @@ def section_7(docx: Word, json_data, *args, **kwargs):
|
|
|
tb2_p.add_run_to_p(w + ' ', size=10.5, bold=True)
|
|
|
elif meaning_id in explanatory_words_ids:
|
|
|
tb2_p.add_run_to_p(w + ' ', size=10.5, italic=True)
|
|
|
- else:
|
|
|
+ else:
|
|
|
tb2_p.add_run_to_p(w + ' ', size=10.5)
|
|
|
else:
|
|
|
tb2_p.add_run_to_p(w + ' ', size=10.5)
|
|
@@ -678,18 +625,17 @@ def section_7(docx: Word, json_data, *args, **kwargs):
|
|
|
docx.add_blank_paragraph()
|
|
|
|
|
|
"判断题型;根据题型选择----------------------------"
|
|
|
-
|
|
|
+
|
|
|
all_article_length = 0
|
|
|
|
|
|
for index, article_single in enumerate(json_data['Articles'], start=1):
|
|
|
- article_type = article_single['Category']
|
|
|
+ article_type = article_single['Category']
|
|
|
|
|
|
article_type_select = {1: reading, 2: wanxing, 3: seven_to_five}
|
|
|
|
|
|
assert article_type in article_type_select
|
|
|
- article_type_select[article_type](index, article_single)
|
|
|
+ article_type_select[article_type](index, article_single)
|
|
|
|
|
|
-
|
|
|
article_length = article_single['AllWordAmount']
|
|
|
all_article_length += article_length
|
|
|
|
|
@@ -703,53 +649,49 @@ def section_7(docx: Word, json_data, *args, **kwargs):
|
|
|
|
|
|
@time_use
|
|
|
def section_9(docx: Word, json_data, *args, **kwargs):
|
|
|
- def wanxing(index,article_count, article_single):
|
|
|
+ def wanxing(index, article_count, article_single):
|
|
|
chinese_article = article_single['Chinese']
|
|
|
- all_analysis = ''
|
|
|
+ all_analysis = ''
|
|
|
docx.add_paragraph("答案和解析", chinese_font_name="微软雅黑", dq=5, dh=5, bold=True)
|
|
|
|
|
|
-
|
|
|
for ques_index, question_item in enumerate(article_single['Questions'], start=1):
|
|
|
- analysis = question_item['Analysis'].strip()
|
|
|
- abcd_label = ''
|
|
|
+ analysis = question_item['Analysis'].strip()
|
|
|
+ abcd_label = ''
|
|
|
|
|
|
candidates = question_item['Candidates']
|
|
|
for abcd_selected in candidates:
|
|
|
- if abcd_selected['IsRight']:
|
|
|
+ if abcd_selected['IsRight']:
|
|
|
abcd_label += abcd_selected['Label'].strip()
|
|
|
|
|
|
- all_analysis += f"{ques_index}.\n{abcd_label} {analysis}\n"
|
|
|
+ all_analysis += f"{ques_index}.\n{abcd_label} {analysis}\n"
|
|
|
|
|
|
docx.add_paragraph(all_analysis, size=9)
|
|
|
docx.add_paragraph("全文参考译文", chinese_font_name="微软雅黑", dq=15, dh=5, bold=True)
|
|
|
docx.add_paragraph(chinese_article, size=9, dq=5, dh=5, line_spacing=300)
|
|
|
|
|
|
-
|
|
|
- def reading(index,article_count, article_single):
|
|
|
+ def reading(index, article_count, article_single):
|
|
|
"""
|
|
|
index : 外面传入,从1开始。如果只有
|
|
|
"""
|
|
|
- all_analysis = ''
|
|
|
- all_difficult_sentences = []
|
|
|
+ all_analysis = ''
|
|
|
+ all_difficult_sentences = []
|
|
|
|
|
|
chinese_article = article_single['Chinese']
|
|
|
|
|
|
-
|
|
|
questions = article_single['Questions']
|
|
|
for ques_index, question_item in enumerate(questions, start=1):
|
|
|
- analysis = question_item['Analysis'].strip("\n")
|
|
|
- abcd_label = ''
|
|
|
+ analysis = question_item['Analysis'].strip("\n")
|
|
|
+ abcd_label = ''
|
|
|
|
|
|
candidates = question_item['Candidates']
|
|
|
for abcd_selected in candidates:
|
|
|
- if abcd_selected['IsRight']:
|
|
|
+ if abcd_selected['IsRight']:
|
|
|
abcd_label += abcd_selected['Label'].strip("\n")
|
|
|
|
|
|
- new_line = "" if ques_index==len(questions) else "\n"
|
|
|
+ new_line = "" if ques_index == len(questions) else "\n"
|
|
|
all_analysis += f"{ques_index}.{abcd_label} {analysis}{new_line}"
|
|
|
|
|
|
-
|
|
|
- if index!=article_count:
|
|
|
+ if index != article_count:
|
|
|
all_analysis += '\n'
|
|
|
|
|
|
docx.add_paragraph(f"Passage {index}", chinese_font_name="微软雅黑", dq=5, dh=5, bold=True, size=16)
|
|
@@ -759,20 +701,19 @@ def section_9(docx: Word, json_data, *args, **kwargs):
|
|
|
docx.add_paragraph("答案和解析", chinese_font_name="微软雅黑", dq=5, dh=5, bold=True)
|
|
|
docx.add_paragraph(all_analysis, size=9)
|
|
|
|
|
|
-
|
|
|
- def seven_to_five(index,article_count, article_single):
|
|
|
+ def seven_to_five(index, article_count, article_single):
|
|
|
chinese_article = article_single['Chinese']
|
|
|
- all_analysis = ''
|
|
|
+ all_analysis = ''
|
|
|
|
|
|
docx.add_paragraph("答案和解析", chinese_font_name="微软雅黑", dq=5, dh=5, bold=True)
|
|
|
-
|
|
|
+
|
|
|
for q_index, question_item in enumerate(article_single['Questions'], start=1):
|
|
|
- analysis = question_item['Analysis']
|
|
|
- abcd_label = ''
|
|
|
+ analysis = question_item['Analysis']
|
|
|
+ abcd_label = ''
|
|
|
|
|
|
candidates = question_item['Candidates']
|
|
|
for abcd_selected in candidates:
|
|
|
- if abcd_selected['IsRight']:
|
|
|
+ if abcd_selected['IsRight']:
|
|
|
abcd_label += abcd_selected['Label']
|
|
|
all_analysis += f"{q_index}.{abcd_label} {analysis}\n"
|
|
|
|
|
@@ -782,14 +723,14 @@ def section_9(docx: Word, json_data, *args, **kwargs):
|
|
|
docx.add_paragraph(chinese_article, size=9, dq=5, dh=5, line_spacing=300)
|
|
|
|
|
|
"判断题型;根据题型选择----------------------------"
|
|
|
- sub_title_maker(docx, "解题自主纠", "自主学习,逐步养成良好学习习惯","鲍利提分,你的智能教练")
|
|
|
+ sub_title_maker(docx, "解题自主纠", "自主学习,逐步养成良好学习习惯", "鲍利提分,你的智能教练")
|
|
|
articles = json_data['Articles']
|
|
|
article_count = len(articles)
|
|
|
for index, article_single in enumerate(articles, start=1):
|
|
|
- article_type = article_single['Category']
|
|
|
+ article_type = article_single['Category']
|
|
|
article_type_select = {1: reading, 2: wanxing, 3: seven_to_five}
|
|
|
assert article_type in article_type_select
|
|
|
- article_type_select[article_type](index,article_count, article_single)
|
|
|
+ article_type_select[article_type](index, article_count, article_single)
|
|
|
|
|
|
docx.add_docx_component("make_docx_demo/word_component/blank.docx")
|
|
|
docx.add_page_section()
|
|
@@ -837,20 +778,15 @@ def section_10(docx: Word, json_data, scanpage_format, *args, **kwargs):
|
|
|
|
|
|
@time_use
|
|
|
def two_check_page(docx: Word, json_data, *args, **kwargs):
|
|
|
-
|
|
|
def empty_filter_page(class_name, student_name, page_title, page_sub_title, t_datetime, word_data_list):
|
|
|
- page_sub_title = "词汇训练"
|
|
|
+ page_sub_title = "词汇训练"
|
|
|
|
|
|
if len(word_data_list) % 2 != 0:
|
|
|
- word_data_list.append("")
|
|
|
+ word_data_list.append("")
|
|
|
|
|
|
tb = Table(docx, 1, 3, tb_name="头部三元素")
|
|
|
tb.set_tb_colum_width(width=[40, 100, 100])
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
tb.set_tb_colum_width(0, 100)
|
|
|
tb.set_cell_text(0, 0, f"鲍利提分", border=False, size=16, bold=True, chinese_font_name="黑体")
|
|
|
tb.set_cell_text(0, 1, f"{class_name}\n{student_name}", border=False, size=8, dh=2)
|
|
@@ -862,7 +798,7 @@ def two_check_page(docx: Word, json_data, *args, **kwargs):
|
|
|
|
|
|
tb.set_all_border_fastly(xml=True, outside_side_border=True, outside_side_border_size=5)
|
|
|
|
|
|
- half_count = int(len(word_data_list) / 2)
|
|
|
+ half_count = int(len(word_data_list) / 2)
|
|
|
for index, row in enumerate(range(half_count)):
|
|
|
first_word, second_word = word_data_list[row], word_data_list[row + half_count]
|
|
|
cell3 = f"{index + 1 + half_count}. {second_word}" if second_word else ""
|
|
@@ -875,14 +811,13 @@ def two_check_page(docx: Word, json_data, *args, **kwargs):
|
|
|
blank_count = " " * 80
|
|
|
p = docx.add_blank_paragraph(dq=5)
|
|
|
p.add_run_to_p(f"{t_datetime} {page_title}-{page_sub_title}{blank_count}", size=8, chinese_font_name="仿宋", font_name="仿宋")
|
|
|
- docx.add_page_break()
|
|
|
+ docx.add_page_break()
|
|
|
|
|
|
-
|
|
|
def filter_table_page(page_id, class_name, student_name, page_title, page_sub_title, t_datetime,
|
|
|
foot_description, foot_description2, article_type, word_data_list2):
|
|
|
- page_sub_title = "词汇训练"
|
|
|
+ page_sub_title = "词汇训练"
|
|
|
if len(word_data_list2) % 2 != 0:
|
|
|
- word_data_list2.append(["", ""])
|
|
|
+ word_data_list2.append(["", ""])
|
|
|
|
|
|
tb = Table(docx, 1, 5, tb_name="头部五元素")
|
|
|
tb.set_tb_colum_width(width=[80, 100, 120, 150, 70])
|
|
@@ -914,73 +849,56 @@ def two_check_page(docx: Word, json_data, *args, **kwargs):
|
|
|
cell3 = f"{spell2}" if spell2 else ""
|
|
|
cell4 = f"{total_row + row + 1}. {meaning2}" if meaning2 else ""
|
|
|
|
|
|
- data = [f"{spell1}", f"{row + 1}. {meaning1}", cell3, cell4]
|
|
|
+ data = [f"{spell1}", f"{row + 1}. {meaning1}", cell3, cell4]
|
|
|
tb.add_table_row_data_xml_fastly(data, font_size=[10.5, 9, 10.5, 9], alignment=['right', 'left', 'right', 'left'])
|
|
|
|
|
|
-
|
|
|
tb.set_row_height(13.8)
|
|
|
tb.set_table_width_xml([2124, 3257, 2140, 3257])
|
|
|
|
|
|
docx.add_paragraph(f"{t_datetime} {page_title}-{page_sub_title}{foot_description}", size=8, chinese_font_name="仿宋",
|
|
|
font_name="仿宋", dq=5)
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- student_name = json_data.get("StudentInfo").get("StudentName", '')
|
|
|
- class_name = json_data.get("StudentInfo").get("ClassName", '').replace("词汇突击", "")
|
|
|
- t_datetime = time.strftime("%Y-%m-%d %H:%M", time.localtime())
|
|
|
+ student_name = json_data.get("StudentInfo").get("StudentName", '')
|
|
|
+ class_name = json_data.get("StudentInfo").get("ClassName", '').replace("词汇突击", "")
|
|
|
+ t_datetime = time.strftime("%Y-%m-%d %H:%M", time.localtime())
|
|
|
article_type = 1
|
|
|
try:
|
|
|
- article_type = json_data['WordAndArticleContents'][0]['Articles'][0]['Category']
|
|
|
+ article_type = json_data['WordAndArticleContents'][0]['Articles'][0]['Category']
|
|
|
except Exception as e:
|
|
|
log_err_e(e, "学案类型不存在就取1,词汇突击里面只有阅读理解")
|
|
|
|
|
|
-
|
|
|
-
|
|
|
"""---------------------------------------------------------------------------------"""
|
|
|
screening_scanPages = json_data['ScreeningScanPages']
|
|
|
for index, page in enumerate(screening_scanPages, start=1):
|
|
|
page_id = str(page['PageId']).rjust(11, "0")
|
|
|
|
|
|
- page_title = page['Title']
|
|
|
- page_sub_title = page['SubTitle']
|
|
|
- foot_description = page['FootDescription']
|
|
|
- foot_description2 = page['FootDescription2']
|
|
|
-
|
|
|
+ page_title = page['Title']
|
|
|
+ page_sub_title = page['SubTitle']
|
|
|
+ foot_description = page['FootDescription']
|
|
|
+ foot_description2 = page['FootDescription2']
|
|
|
|
|
|
word_data_list1 = []
|
|
|
word_data_list2 = []
|
|
|
- for i in page['FilterTable']['Items']:
|
|
|
+ for i in page['FilterTable']['Items']:
|
|
|
word_data_list1.append(i['Spell'])
|
|
|
word_data_list2.append([i['Spell'], i['Meaning']])
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
filter_table_page(page_id, class_name, student_name, page_title, page_sub_title, t_datetime,
|
|
|
foot_description, foot_description2, article_type, word_data_list2)
|
|
|
-
|
|
|
- if index!=len(screening_scanPages):
|
|
|
- pass
|
|
|
- docx.add_page_break()
|
|
|
|
|
|
+ if index != len(screening_scanPages):
|
|
|
+ pass
|
|
|
+ docx.add_page_break()
|
|
|
|
|
|
|
|
|
def old_two_check_page(docx: Word, json_data, **kwargs):
|
|
|
-
|
|
|
def empty_filter_page(class_name, student_name, page_title, page_sub_title, t_datetime, word_data_list):
|
|
|
if len(word_data_list) % 2 != 0:
|
|
|
- word_data_list.append("")
|
|
|
+ word_data_list.append("")
|
|
|
|
|
|
tb = Table(docx, 1, 3, tb_name="头部三元素")
|
|
|
tb.set_tb_colum_width(width=[140, 100, 100])
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
tb.set_cell_text(0, 0, f"鲍利提分", border=False, size=16, bold=True, chinese_font_name="黑体")
|
|
|
tb.set_cell_text(0, 1, f"{class_name}\n{student_name}", border=False, size=8, dh=2)
|
|
|
tb.set_cell_text(0, 2, f"{page_title}\n{page_sub_title}", border=False, size=8, dh=2)
|
|
@@ -991,7 +909,7 @@ def old_two_check_page(docx: Word, json_data, **kwargs):
|
|
|
|
|
|
tb.set_all_border_fastly(xml=True, outside_side_border=True, outside_side_border_size=5)
|
|
|
|
|
|
- half_count = int(len(word_data_list) / 2)
|
|
|
+ half_count = int(len(word_data_list) / 2)
|
|
|
for index, row in enumerate(range(half_count)):
|
|
|
first_word, second_word = word_data_list[row], word_data_list[row + half_count]
|
|
|
cell3 = f"{index + 1 + half_count}. {second_word}" if second_word else ""
|
|
@@ -1004,21 +922,16 @@ def old_two_check_page(docx: Word, json_data, **kwargs):
|
|
|
blank_count = " " * 80
|
|
|
p = docx.add_blank_paragraph(dq=5)
|
|
|
p.add_run_to_p(f"{t_datetime} {page_title}-{page_sub_title}{blank_count}", size=8, chinese_font_name="仿宋", font_name="仿宋")
|
|
|
- docx.add_page_break()
|
|
|
+ docx.add_page_break()
|
|
|
|
|
|
-
|
|
|
def filter_table_page(page_id, class_name, student_name, page_title, page_sub_title, t_datetime,
|
|
|
foot_description, foot_description2, article_type, word_data_list2):
|
|
|
if len(word_data_list2) % 2 != 0:
|
|
|
- word_data_list2.append(["", ""])
|
|
|
+ word_data_list2.append(["", ""])
|
|
|
|
|
|
tb = Table(docx, 1, 5, tb_name="头部五元素")
|
|
|
tb.set_tb_colum_width(width=[80, 100, 120, 150, 70])
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
tb.set_cell_text(0, 0, f"鲍利提分", border=False, size=16, bold=True, chinese_font_name="黑体")
|
|
|
tb.set_cell_text(0, 1, f"{class_name}\n{student_name}", border=False, size=8)
|
|
|
tb.set_cell_text(0, 2, f"{page_id}", border=False, size=16, dh=2, bold=True, font_name="黑体")
|
|
@@ -1051,13 +964,13 @@ def old_two_check_page(docx: Word, json_data, **kwargs):
|
|
|
cell3 = f"{total_row + row + 1}. {spell2}" if spell2 else ""
|
|
|
cell4 = f"□ {meaning2}" if meaning2 else ""
|
|
|
|
|
|
- data = [cell1,cell2, cell3, cell4]
|
|
|
+ data = [cell1, cell2, cell3, cell4]
|
|
|
tb.add_table_row_data_xml_fastly(data, font_size=[10.5, 9, 10.5, 9])
|
|
|
|
|
|
tb.set_all_border_fastly(xml=True, outside_side_border=True, outside_side_border_size=5)
|
|
|
tb.set_row_height(13.6, first_row_h=6)
|
|
|
tb.set_table_width_xml([2124, 3257, 2140, 3257])
|
|
|
- if article_type == 1:
|
|
|
+ if article_type == 1:
|
|
|
docx.add_paragraph(f"{t_datetime} {page_title}-{page_sub_title}{foot_description}", size=8, chinese_font_name="仿宋",
|
|
|
font_name="仿宋", dq=5)
|
|
|
docx.add_paragraph(foot_description2, align="right", size=8, chinese_font_name="仿宋")
|
|
@@ -1065,51 +978,45 @@ def old_two_check_page(docx: Word, json_data, **kwargs):
|
|
|
docx.add_paragraph(f"{t_datetime} {page_title}-{page_sub_title}{foot_description}", size=8, chinese_font_name="仿宋",
|
|
|
font_name="仿宋", dq=5)
|
|
|
|
|
|
-
|
|
|
- student_name = json_data.get("StudentInfo").get("StudentName", '')
|
|
|
- class_name = json_data.get("StudentInfo").get("ClassName", '')
|
|
|
- t_datetime = time.strftime("%Y-%m-%d %H:%M", time.localtime())
|
|
|
- article_type = json_data['WordAndArticleContents'][0]['Articles'][0]['Category']
|
|
|
- is_add_empty_filter_page = json_data['Config']['AddEmptyFilterPage']
|
|
|
+ student_name = json_data.get("StudentInfo").get("StudentName", '')
|
|
|
+ class_name = json_data.get("StudentInfo").get("ClassName", '')
|
|
|
+ t_datetime = time.strftime("%Y-%m-%d %H:%M", time.localtime())
|
|
|
+ article_type = json_data['WordAndArticleContents'][0]['Articles'][0]['Category']
|
|
|
+ is_add_empty_filter_page = json_data['Config']['AddEmptyFilterPage']
|
|
|
|
|
|
"""---------------------------------------------------------------------------------"""
|
|
|
for index, page in enumerate(json_data['ScreeningScanPages'], start=1):
|
|
|
page_id = str(page['PageId']).rjust(11, "0")
|
|
|
|
|
|
-
|
|
|
if index >= 2:
|
|
|
docx.add_page_break()
|
|
|
|
|
|
- page_title = page['Title']
|
|
|
- page_sub_title = page['SubTitle']
|
|
|
- foot_description = page['FootDescription']
|
|
|
- foot_description2 = page['FootDescription2']
|
|
|
+ page_title = page['Title']
|
|
|
+ page_sub_title = page['SubTitle']
|
|
|
+ foot_description = page['FootDescription']
|
|
|
+ foot_description2 = page['FootDescription2']
|
|
|
|
|
|
word_data_list1 = []
|
|
|
word_data_list2 = []
|
|
|
|
|
|
-
|
|
|
- item_list:list = page['FilterTable']['Items']
|
|
|
+ item_list: list = page['FilterTable']['Items']
|
|
|
item_count = len(item_list)
|
|
|
- if item_count<100:
|
|
|
- item_list.extend([{"Spell":"","Meaning":""} for _ in range(100-item_count)])
|
|
|
+ if item_count < 100:
|
|
|
+ item_list.extend([{"Spell": "", "Meaning": ""} for _ in range(100 - item_count)])
|
|
|
|
|
|
- for i in page['FilterTable']['Items']:
|
|
|
+ for i in page['FilterTable']['Items']:
|
|
|
word_data_list1.append(i['Spell'])
|
|
|
word_data_list2.append([i['Spell'], i['Meaning']])
|
|
|
|
|
|
-
|
|
|
if is_add_empty_filter_page:
|
|
|
empty_filter_page(class_name, student_name, page_title, page_sub_title, t_datetime, word_data_list1)
|
|
|
|
|
|
-
|
|
|
filter_table_page(page_id, class_name, student_name, page_title, page_sub_title, t_datetime,
|
|
|
foot_description, foot_description2, article_type, word_data_list2)
|
|
|
|
|
|
|
|
|
@time_use
|
|
|
def other(docx, json_data, *args, **kwargs):
|
|
|
-
|
|
|
sections = docx.doc.sections
|
|
|
for section in sections[:-1]:
|
|
|
section.top_margin = Inches(0.3)
|
|
@@ -1127,21 +1034,20 @@ def other(docx, json_data, *args, **kwargs):
|
|
|
|
|
|
|
|
|
def start_make_word(json_data, document_format, scanpage_format):
|
|
|
- parent_path = "make_docx_demo/file_result/"
|
|
|
+ parent_path = "make_docx_demo/file_result/"
|
|
|
if not os.path.exists(parent_path):
|
|
|
os.makedirs(parent_path)
|
|
|
try:
|
|
|
- exercise_id = json_data['ExerciseId']
|
|
|
+ exercise_id = json_data['ExerciseId']
|
|
|
|
|
|
-
|
|
|
docx = Word(save_file_name=f"{parent_path}{exercise_id}.docx",
|
|
|
start_template_name="make_docx_demo/word_component/start_template.docx")
|
|
|
-
|
|
|
+
|
|
|
section_1(docx=docx, json_data=json_data, scanpage_format=scanpage_format)
|
|
|
-
|
|
|
+
|
|
|
section_4(docx=docx, json_data=json_data, scanpage_format=scanpage_format)
|
|
|
-
|
|
|
- for exercise_json in json_data['WordAndArticleContents']:
|
|
|
+
|
|
|
+ for exercise_json in json_data['WordAndArticleContents']:
|
|
|
section_4_1(docx=docx, json_data=exercise_json, scanpage_format=scanpage_format)
|
|
|
section_5(docx=docx, json_data=exercise_json, scanpage_format=scanpage_format)
|
|
|
section_6(docx=docx, json_data=exercise_json, scanpage_format=scanpage_format)
|
|
@@ -1149,9 +1055,9 @@ def start_make_word(json_data, document_format, scanpage_format):
|
|
|
section_9(docx=docx, json_data=exercise_json, scanpage_format=scanpage_format)
|
|
|
|
|
|
if scanpage_format == 1:
|
|
|
-
|
|
|
+
|
|
|
two_check_page(docx=docx, json_data=json_data, scanpage_format=scanpage_format)
|
|
|
-
|
|
|
+
|
|
|
old_two_check_page(docx=docx, json_data=json_data, scanpage_format=scanpage_format)
|
|
|
elif scanpage_format == 2:
|
|
|
section_10(docx=docx, json_data=json_data, scanpage_format=scanpage_format)
|
|
@@ -1178,6 +1084,5 @@ if __name__ == '__main__':
|
|
|
t = time.time()
|
|
|
os.chdir("..")
|
|
|
|
|
|
-
|
|
|
start_make_word(test_json1, 1, 1)
|
|
|
print(time.time() - t)
|