diff --git a/data.py b/data.py new file mode 100644 index 0000000..ec828b0 --- /dev/null +++ b/data.py @@ -0,0 +1,232 @@ +# 英语学习数据(Python版本) + +english_data = { + "scenes": [ + { + "id": 0, + "title": "餐厅点餐", + "description": "在餐厅点餐的日常对话练习", + "image": "", + "conversation": [ + { + "speaker": "服务员", + "text": "Good afternoon! Welcome to our restaurant. May I take your order?", + "type": "other" + }, + { + "speaker": "我", + "text": "I'd like to see the menu first, please.", + "type": "user" + }, + { + "speaker": "服务员", + "text": "Sure, here you are. Take your time.", + "type": "other" + }, + { + "speaker": "服务员", + "text": "Are you ready to order now?", + "type": "other" + }, + { + "speaker": "我", + "question": "请选择合适的回答:", + "options": [ + "Yes, I'll have the steak, please.", + "No, I don't like this restaurant.", + "I want to go home.", + "The menu is too expensive." + ], + "correctAnswer": 0, + "type": "user_question" + }, + { + "speaker": "服务员", + "text": "How would you like your steak cooked?", + "type": "other" + }, + { + "speaker": "我", + "question": "请选择合适的回答:", + "options": [ + "Medium rare, please.", + "With fries and salad.", + "I want a drink.", + "That's all." + ], + "correctAnswer": 0, + "type": "user_question" + }, + { + "speaker": "服务员", + "text": "Would you like anything to drink?", + "type": "other" + }, + { + "speaker": "我", + "question": "请选择合适的回答:", + "options": [ + "A glass of water, please.", + "No, I'm not hungry.", + "I'll pay now.", + "Thank you." + ], + "correctAnswer": 0, + "type": "user_question" + }, + { + "speaker": "服务员", + "text": "Okay, your order will be ready in 15 minutes.", + "type": "other" + }, + { + "speaker": "我", + "question": "请选择合适的回答:", + "options": [ + "Thank you very much.", + "Hurry up!", + "I want it now.", + "That's too long." + ], + "correctAnswer": 0, + "type": "user_question" + } + ] + }, + { + "id": 1, + "title": "超市购物", + "description": "在超市购物的日常对话练习", + "image": "", + "conversation": [ + { + "speaker": "顾客", + "text": "Excuse me, where can I find the milk?", + "type": "user" + }, + { + "speaker": "超市员工", + "text": "It's in aisle 5, next to the bread.", + "type": "other" + }, + { + "speaker": "顾客", + "question": "请选择合适的回答:", + "options": [ + "Thank you very much.", + "I don't like milk.", + "Where is aisle 5?", + "This store is too big." + ], + "correctAnswer": 0, + "type": "user_question" + }, + { + "speaker": "超市员工", + "text": "You're welcome. Let me know if you need anything else.", + "type": "other" + }, + { + "speaker": "顾客", + "text": "Actually, do you have any organic vegetables?", + "type": "user" + }, + { + "speaker": "超市员工", + "text": "Yes, they're in the fresh produce section at the back of the store.", + "type": "other" + }, + { + "speaker": "顾客", + "question": "请选择合适的回答:", + "options": [ + "Great, thank you.", + "I don't want organic.", + "That's too far.", + "Why are they there?" + ], + "correctAnswer": 0, + "type": "user_question" + } + ] + }, + { + "id": 2, + "title": "问路", + "description": "向陌生人问路的日常对话练习", + "image": "", + "conversation": [ + { + "speaker": "我", + "text": "Excuse me, could you tell me how to get to the nearest subway station?", + "type": "user" + }, + { + "speaker": "路人", + "text": "Sure! Go straight for two blocks, then turn left at the traffic light. You'll see it on your right.", + "type": "other" + }, + { + "speaker": "我", + "question": "请选择合适的回答:", + "options": [ + "Is it far from here?", + "I don't want to go there.", + "That's too complicated.", + "I'll take a taxi instead." + ], + "correctAnswer": 0, + "type": "user_question" + }, + { + "speaker": "路人", + "text": "No, it's only about a 5-minute walk.", + "type": "other" + } + ] + }, + { + "id": 5, + "title": "机场值机", + "description": "在机场办理值机手续的日常对话练习", + "image": "", + "conversation": [ + { + "speaker": "值机人员", + "text": "Good morning! How can I help you today?", + "type": "other" + }, + { + "speaker": "我", + "text": "I need to check in for my flight, please.", + "type": "user" + }, + { + "speaker": "值机人员", + "text": "Certainly! What's your flight number and destination?", + "type": "other" + }, + { + "speaker": "我", + "question": "请输入您的航班号和目的地(例如:CA1234 to Beijing):", + "type": "user_question" + }, + { + "speaker": "值机人员", + "text": "Thank you! Do you have any baggage to check?", + "type": "other" + }, + { + "speaker": "我", + "question": "请回答是否有行李要托运(例如:Yes, one suitcase please. 或 No, just carry-on.):", + "type": "user_question" + }, + { + "speaker": "值机人员", + "text": "Perfect! Here's your boarding pass...", + "type": "other" + } + ] + } + ] +} diff --git a/html_python_guide.md b/html_python_guide.md new file mode 100644 index 0000000..476653b --- /dev/null +++ b/html_python_guide.md @@ -0,0 +1,66 @@ +# HTML与Python集成指南 + +## 技术限制说明 + +HTML文件**不能直接引用或执行Python文件**,这是因为: + +1. **运行环境不同**: + - HTML/JavaScript 运行在浏览器端(客户端) + - Python 运行在服务器端或本地命令行环境 + +2. **执行方式不同**: + - JavaScript 是解释型语言,浏览器内置了JavaScript引擎 + - Python 需要安装Python解释器才能执行 + +3. **语法和API完全不同**: + - HTML只能识别并加载JavaScript文件(通过` + +
+ +