t
APP_NAME: Ô Cửa Bí Mật – Bài 7 (Tin học 4)
THEME:
font: Baloo 2
vibe: vui nhộn, thân thiện tiểu học
bg_color: "#F9F3D4"
ASSETS:
- id: bg_board
type: image
src: (dùng ảnh nền lớp học/bảng gỗ của bạn; nếu không có, dùng màu nền)
- id: sfx_click
type: sound
src: ui/click.mp3
- id: sfx_correct
type: sound
src: ui/success.mp3
- id: sfx_wrong
type: sound
src: ui/wrong.mp3
- id: fx_fireworks
type: particle
preset: fireworks
LAYOUT:
- screen: main
components:
- id: title
type: text
text: "Ô Cửa Bí Mật – Ôn tập Bài 7"
x: 50% y: 6% anchor: center size: 40 weight: 800
- id: guide
type: text
text: "Cách chơi: Chọn một ô (1–4) ► đọc câu hỏi ► trả lời A/B/C/D. Đúng thì mở cửa!"
x: 50% y: 12% anchor: center size: 20 weight: 600
# 4 ô cửa (mặc định đóng)
- group:
id: doors
children:
- { id: door1, type: door, label: "1", x: 30%, y: 35%, w: 28%, h: 25% }
- { id: door2, type: door, label: "2", x: 70%, y: 35%, w: 28%, h: 25% }
- { id: door3, type: door, label: "3", x: 30%, y: 68%, w: 28%, h: 25% }
- { id: door4, type: door, label: "4", x: 70%, y: 68%, w: 28%, h: 25% }
# Hộp hỏi – hiện khi chọn ô
- id: quiz_modal
type: modal
visible: false
width: 72%
height: 58%
header_text: "Câu hỏi ô cửa bí mật"
body_slots:
- id: question_text
type: text
text: ""
size: 22
align: left
- id: choices
type: choice-list
style: ABCD
spacing: 10
footer_slots:
- id: submit_btn
type: button
label: "Trả lời"
style: primary
- id: progress
type: text
text: "Ô đã mở: 0/4"
x: 50% y: 95% anchor: center size: 18
STATE:
opened_doors: 0
current_door: null
answered: { d1: false, d2: false, d3: false, d4: false }
QUESTIONS:
# 4 câu bám Bài 7
- id: q1
door: door1
text: "Cây thư mục có cấu trúc hợp lí giúp gì?"
options:
A: "Làm máy chạy nhanh hơn"
B: "Sắp xếp, tìm kiếm dữ liệu dễ dàng, khoa học"
C: "Tạo thêm nhiều tệp hơn"
D: "Làm thư mục đổi màu"
correct: "B"
reward_text: "Chuẩn rồi! Mở ô số 1!"
- id: q2
door: door2
text: "Thư mục con được tạo ra để:"
options:
A: "Trang trí cho thư mục chính"
B: "Chứa các tệp cùng loại nội dung"
C: "Tăng dung lượng ổ đĩa"
D: "Làm thư mục chính nhỏ hơn"
correct: "B"
reward_text: "Tuyệt! Mở ô số 2!"
- id: q3
door: door3
text: "Đặt tên thư mục/tệp thế nào để dễ tìm?"
options:
A: "Tên ngắn, vô nghĩa"
B: "Chỉ dùng số ngẫu nhiên"
C: "Thể hiện nội dung, dễ hiểu, dễ nhớ"
D: "Đặt trùng nhau cho dễ nhớ"
correct: "C"
reward_text: "Giỏi lắm! Mở ô số 3!"
- id: q4
door: door4
text: "Để mở một tệp/thư mục, cần biết gì?"
options:
A: "Kích thước tệp/thư mục"
B: "Tên và vị trí lưu trữ của tệp/thư mục"
C: "Màu biểu tượng thư mục"
D: "Số lần đã mở"
correct: "B"
reward_text: "Xuất sắc! Mở ô số 4!"
INTERACTIONS:
# Hiệu ứng chọn ô
- on: click door1,door2,door3,door4
do:
- play: sfx_click
- animate: pulse target=$event.target duration=300ms
- set: state.current_door = $event.target.id
- open: quiz_modal
- load_question: by door = $event.target.id into (question_text, choices)
# Nộp đáp án
- on: click submit_btn
do:
- if: choices.selected == current_question.correct
then:
- play: sfx_correct
- animate: celebrate target=quiz_modal
- spawn: fx_fireworks at=screen.center duration=1200ms
- close: quiz_modal
- open_door: target = state.current_door # hoạt ảnh mở cửa
- mark_answered: state.current_door
- inc: state.opened_doors by 1
- set_text: progress = "Ô đã mở: {{state.opened_doors}}/4"
- if: state.opened_doors == 4
then:
- show_toast: "Hoàn thành! Tất cả ô cửa đã mở 🎉"
else:
- play: sfx_wrong
- shake: quiz_modal
- show_hint: "Chưa đúng, thử lại nhé!"
# Chặn làm lại câu đã mở
- on: click door1,door2,door3,door4
guard:
- if: answered[currentDoor] == true
then:
- show_toast: "Ô này đã mở rồi!"
- stop
ACCESSIBILITY:
narration_on: true
focus_order: [door1, door2, door3, door4, quiz_modal, submit_btn]
EXPORT:
mode: webapp
responsive: true
keep_ratio: 16:9
Nhận xét
Đăng nhận xét