Fix YAML validator and activity file validation errors

- Updated validator terminal step detection to only flag truly terminal steps
- Fixed validator to accept integers and booleans in buckets (as supported by app.py)
- Fixed metadata_remove format in activity17 from dictionary to list of strings
- Added proper terminal section to activity3.yaml without questions/buckets
- Fixed missing restart transition and bucket in activity28
- Removed unused game_end transitions from battleship files
- Updated exit transitions to go directly to step_4 (goodbye step)
- Applied black formatting to validator code

All 30 activity YAML files now validate successfully with 0 errors and 0 warnings.
This commit is contained in:
Russell Ballestrini 2025-08-10 17:47:55 -04:00
parent d4a075ac9a
commit 51b74be7d9
12 changed files with 1073 additions and 780 deletions

View file

@ -86,7 +86,7 @@ sections:
metadata_add:
mystical_amulet: true
metadata_remove:
golden_keychain: true
- golden_keychain
offer_mysterious_amulet:
metadata_conditions:
mysterious_amulet: true
@ -97,7 +97,7 @@ sections:
metadata_add:
rare_gemstone: true
metadata_remove:
mysterious_amulet: true
- mysterious_amulet
offer_rare_gemstone:
metadata_conditions:
rare_gemstone: true
@ -108,7 +108,7 @@ sections:
metadata_add:
ancient_scroll: true
metadata_remove:
rare_gemstone: true
- rare_gemstone
offer_ancient_scroll:
metadata_conditions:
ancient_scroll: true
@ -119,7 +119,7 @@ sections:
metadata_add:
magical_wand: true
metadata_remove:
ancient_scroll: true
- ancient_scroll
offer_magical_wand:
metadata_conditions:
magical_wand: true
@ -130,7 +130,7 @@ sections:
metadata_add:
treasure_map: true
metadata_remove:
magical_wand: true
- magical_wand
offer_treasure_map:
metadata_conditions:
treasure_map: true
@ -141,7 +141,7 @@ sections:
metadata_add:
silver_coin: true
metadata_remove:
treasure_map: true
- treasure_map
offer_silver_coin:
metadata_conditions:
silver_coin: true
@ -152,7 +152,7 @@ sections:
metadata_add:
mystical_ring: true
metadata_remove:
silver_coin: true
- silver_coin
offer_mystical_ring:
metadata_conditions:
mystical_ring: true
@ -163,7 +163,7 @@ sections:
metadata_add:
rare_book: true
metadata_remove:
mystical_ring: true
- mystical_ring
offer_rare_book:
metadata_conditions:
rare_book: true
@ -174,7 +174,7 @@ sections:
metadata_add:
magical_potion: true
metadata_remove:
rare_book: true
- rare_book
offer_magical_potion:
metadata_conditions:
magical_potion: true
@ -185,12 +185,12 @@ sections:
metadata_add:
golden_keychain: true
metadata_remove:
magical_potion: true
- magical_potion
offer_shadow_charm:
metadata_conditions:
shadow_charm: true
metadata_remove:
shadow_charm: true
- shadow_charm
content_blocks:
- "You offered the Shadow Charm to the god. 🖤"
- "The god summons the Shadow Beast! Prepare for battle!"
@ -199,7 +199,7 @@ sections:
metadata_conditions:
flame_charm: true
metadata_remove:
flame_charm: true
- flame_charm
content_blocks:
- "You offered the Flame Charm to the god. 🔥"
- "The god summons the Fire Drake! Prepare for battle!"

View file

@ -84,6 +84,11 @@ sections:
next_section_and_step: "section_1:step_1"
exit:
next_section_and_step: "section_1:step_3"
restart:
ai_feedback:
tokens_for_ai: "Restarting the game. Let's start fresh!"
metadata_clear: True
next_section_and_step: "section_1:step_0"
- step_id: "step_2"
title: "Kill a Square"
@ -242,6 +247,7 @@ sections:
- valid_move
- invalid_move
- exit
- restart
transitions:
valid_move:
run_processing_script: True

View file

@ -864,14 +864,12 @@ sections:
user_shot: "the-users-response"
next_section_and_step: "section_1:step_2"
exit:
next_section_and_step: "section_1:step_3"
next_section_and_step: "section_1:step_4"
restart:
content_blocks:
- "Restarting the game. Let's start fresh!"
metadata_clear: True
next_section_and_step: "section_1:step_0"
game_end:
next_section_and_step: "section_1:step_3"
- step_id: "step_3"
title: "Game Over"

View file

@ -832,14 +832,12 @@ sections:
user_shot: "the-users-response"
next_section_and_step: "section_1:step_2"
exit:
next_section_and_step: "section_1:step_3"
next_section_and_step: "section_1:step_4"
restart:
content_blocks:
- "Restarting the game. Let's start fresh!"
metadata_clear: True
next_section_and_step: "section_1:step_0"
game_end:
next_section_and_step: "section_1:step_3"
- step_id: "step_3"
title: "Game Over"

View file

@ -284,3 +284,19 @@ sections:
- "I see you have some questions. Let's answer them."
ai_feedback:
tokens_for_ai: "Answer the child's clarifying questions and provide additional information in a friendly and engaging manner."
- section_id: "section_5"
title: "Congratulations!"
steps:
- step_id: "step_1"
title: "You're an Elephant Expert!"
content_blocks:
- "🎉 Congratulations! You've learned so much about elephants today!"
- "You now know:"
- "✅ What elephants look like and how big they are"
- "✅ What elephants eat with their trunks"
- "✅ How elephants communicate with each other"
- "✅ Why elephants need our help"
- "✅ Ways we can help protect elephants"
- "You're now an elephant expert! Keep learning and caring about animals! 🐘🌟"
- "Thank you for taking this journey with us!"