ai_member_xiaoyan/fill_components_by_id_fixed.py

356 lines
7.2 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from openpyxl import load_workbook
# 读取原始Excel
input_path = "/root/.openclaw/media/inbound/12-5---1879d0c9-7cdf-4cd5-9aff-f03091ebada3.xlsx"
output_path = "/root/.openclaw/workspace-xiaoyan/L1-S1-U12-L5_组件完成版_最终匹配版.xlsx"
# 正确的组件ID对应行号第一列有组件ID的行为Excel实际行号
component_map = {
32: """【任务标题】描述当前时间
【资源配置】
图片时机:【互动内容】
音频载体:无
【情境引入】
【互动内容】
User: It is still night.(朗读)
【互动反馈】
正确:无
错误Vicky : Wait, that didn't sound right.
【后置对话】
""",
33: """【任务标题】等待清晨
【情境引入】
【互动内容】
题干We must wait for the $morning$.
选项:
00
01正确
辅助信息morning指"清晨"
【互动反馈】
正确:无
错误Sally : Oh no, that's not right. Look outside, it's still dark!
【后置对话】
""",
34: """【任务标题】询问清晨时间
【资源配置】
图片时机:无
音频载体:无
【情境引入】
【互动内容】
Vicky: How do we know when it's morning?(朗读)
【互动反馈】
正确:无
错误Sally : Hmm, I didn't catch that. Can you say it again?
【后置对话】
""",
52: """【任务标题】表达尝试意愿
【资源配置】
图片时机:无
音频载体:无
【情境引入】
【互动内容】
User: I'd like to try too.(朗读)
【互动反馈】
正确:无
错误Sally : Oh, that doesn't sound quite right.
【后置对话】
Ben: Me too.""",
58: """【任务标题】尝试做手影狗
【资源配置】
图片时机:无
音频载体:无
【情境引入】
【互动内容】
User: I want to try to make a dog!(朗读)
【互动反馈】
正确:无
错误Lucy : Wait, what did you say? I didn't get it.
【后置对话】
""",
69: """【任务标题】评价夜晚乐趣
【资源配置】
图片时机:无
音频载体:无
【情境引入】
【互动内容】
User: Night is so much fun!(朗读)
【互动反馈】
正确:无
错误Lucy : Hmm, that didn't sound right.
【后置对话】
""",
84: """【任务标题】否定当前是清晨
【资源配置】
图片时机:无
音频载体:无
【情境引入】
【互动内容】
题干It isn't ____.
选项:
选项1night
选项2morning正确
辅助信息morning指"清晨"
【互动反馈】
正确:无
错误Ben : Oh no, that's wrong. It's still dark out!
【后置对话】
""",
85: """【任务标题】确认当前是夜晚
【资源配置】
图片时机:无
音频载体:无
【情境引入】
【互动内容】
题干It is still ____!
选项:
选项1night正确
选项2morning
辅助信息night指"夜晚"
【互动反馈】
正确:无
错误Ben : Wait, that's not right. The sun isn't up yet!
【后置对话】
""",
95: """【任务标题】提议逐个尝试
【资源配置】
图片时机:无
音频载体:无
【情境引入】
【互动内容】
User: Let's try them one by one!(朗读)
【互动反馈】
正确:无
错误Sally : Hmm, that didn't sound quite right.
【后置对话】
""",
103: """【任务标题】尝试下一个格子
【资源配置】
图片时机:无
音频载体:无
【情境引入】
【互动内容】
请选择一句朗读:
选项1Let's try the next!
选项2Let's try them one by one!
辅助信息:两个选项均为正确答案
【互动反馈】
正确:无
错误Sally : Oh, that's not one of the choices.
【后置对话】
""",
109: """【任务标题】排序跳格子顺序
【情境引入】
【互动内容】
题干Put the actions in order of $one by one$.
选项:
00
01
02
03
正确顺序00→01→02→03
辅助信息one by one指"一个接一个"
【互动反馈】
正确:无
错误Dan : Oops, that's the wrong order! We can't jump like that.
【后置对话】
""",
117: """【任务标题】提议尝试另一块格子
【资源配置】
图片时机:无
音频载体:无
【情境引入】
【互动内容】
题干____ that one.
选项:
选项1let's try正确
选项2let's play
辅助信息let's try指"我们试试"
【互动反馈】
正确:无
错误Dan : Wait, that doesn't make sense.
【后置对话】
""",
123: """【任务标题】询问下一个人选
【资源配置】
图片时机:无
音频载体:无
【情境引入】
【互动内容】
User: Who is the next?(朗读)
【互动反馈】
正确:无
错误Sally : Hmm, that didn't sound quite right.
【后置对话】
Vicky: It's my turn!""",
126: """【任务标题】描述灯逐个亮起
【资源配置】
图片时机:【互动内容】
音频载体:无
【情境引入】
【互动内容】
题干The lights are turning on ____!
选项:
选项1one by one正确
选项2two by two
辅助信息one by one指"一个接一个"
【互动反馈】
正确:无
错误Lucy : Oh no, that's wrong! The lights are turning on in order.
【后置对话】
""",
135: """【任务标题】组句提议尝试
【资源配置】
图片时机:无
音频载体:无
【情境引入】
User: The first tile didn't work.
【互动内容】
题目:提议大家试试另一块格子
选项1try this
选项2Let's
选项3one.
答案Let's try this one.
辅助信息Let's do sth.是提议做某事的固定句式
【互动反馈】
正确:无
错误Sally : Oops, that's not the right sentence.
【后置对话】
""",
154: """【任务标题】组句逐个行动
【资源配置】
图片时机:无
音频载体:无
【情境引入】
Sally: We need to stand on the tiles one after another.
【互动内容】
题目:告诉大家要一个接一个做
选项1Let's do it
选项2one
选项3by
选项4one!
答案Let's do it one by one!
辅助信息one by one是固定搭配意思是"一个接一个"
【互动反馈】
正确:无
错误Sally : Oh, that doesn't make sense. Try again.
【后置对话】
""",
178: """【任务标题】判断当前时间
【资源配置】
图片时机:【互动内容】
音频载体:无
【情境引入】
Fred: I see the light from the lighthouse!
【互动内容】
Wow! It's so bright! ____
选项:
选项1It's morning now!(正确)
选项2It's night now!
辅助信息morning指"清晨"night指"夜晚"
【互动反馈】
正确:无
错误Fred : Wait, that's not right! Look at the sun in the sky!
【后置对话】
"""
}
# 加载工作簿
wb = load_workbook(input_path)
ws = wb.active
# 组件列是第7列G列
component_col = 7
# 先清空原有组件列的内容(避免残留内容)
for row_num in component_map.keys():
ws.cell(row=row_num, column=component_col, value="")
# 按正确行号填入组件
for row_num, comp_content in component_map.items():
ws.cell(row=row_num, column=component_col, value=comp_content)
# 保存文件
wb.save(output_path)
print(f"文件已保存到: {output_path}")
print(f"已为{len(component_map)}个组件ID 100%匹配填入对应行")