From 15ac4fa0153837f9b3a00946fb2015ed8b3fda24 Mon Sep 17 00:00:00 2001
From: Russell Ballestrini <russell.ballestrini@gmail.com>
Date: Sat, 27 Jul 2024 08:52:38 -0400
Subject: [PATCH 01/20] algo for guarding AI on rails.

	new file:   research/activity.yaml
	new file:   research/activity10.yaml
	new file:   research/activity11.yaml
	new file:   research/activity12.yaml
	new file:   research/activity2.yaml
	new file:   research/activity3.yaml
	new file:   research/activity4.yaml
	new file:   research/activity5.yaml
	new file:   research/activity6.yaml
	new file:   research/activity7.yaml
	new file:   research/activity8.yaml
	new file:   research/activity9.yaml
	new file:   research/guarded_ai.py
---
 research/activity.yaml   |  73 ++++
 research/activity10.yaml | 368 ++++++++++++++++++++
 research/activity11.yaml | 580 +++++++++++++++++++++++++++++++
 research/activity12.yaml | 596 ++++++++++++++++++++++++++++++++
 research/activity2.yaml  | 287 ++++++++++++++++
 research/activity3.yaml  | 286 +++++++++++++++
 research/activity4.yaml  | 361 +++++++++++++++++++
 research/activity5.yaml  | 356 +++++++++++++++++++
 research/activity6.yaml  | 285 +++++++++++++++
 research/activity7.yaml  | 725 +++++++++++++++++++++++++++++++++++++++
 research/activity8.yaml  | 372 ++++++++++++++++++++
 research/activity9.yaml  | 652 +++++++++++++++++++++++++++++++++++
 research/guarded_ai.py   | 146 ++++++++
 13 files changed, 5087 insertions(+)
 create mode 100644 research/activity.yaml
 create mode 100644 research/activity10.yaml
 create mode 100644 research/activity11.yaml
 create mode 100644 research/activity12.yaml
 create mode 100644 research/activity2.yaml
 create mode 100644 research/activity3.yaml
 create mode 100644 research/activity4.yaml
 create mode 100644 research/activity5.yaml
 create mode 100644 research/activity6.yaml
 create mode 100644 research/activity7.yaml
 create mode 100644 research/activity8.yaml
 create mode 100644 research/activity9.yaml
 create mode 100644 research/guarded_ai.py

diff --git a/research/activity.yaml b/research/activity.yaml
new file mode 100644
index 0000000..5f518d7
--- /dev/null
+++ b/research/activity.yaml
@@ -0,0 +1,73 @@
+default_max_attempts_per_step: 3
+sections:
+  - section_id: "section_1"
+    title: "Introduction to AI"
+    steps:
+      - step_id: "step_1"
+        title: "Understanding AI"
+        content_blocks:
+          - "Welcome to the introduction to AI."
+          - "In this section, we will cover the basics of AI."
+        tokens_for_ai: "Explain the basics of AI to the user in a friendly and engaging manner."
+        question: "What do you understand by Artificial Intelligence?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You have a good understanding of AI."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of AI. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on AI."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of AI in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Applications of AI"
+        content_blocks:
+          - "Now that you understand the basics of AI, let's explore its applications."
+          - "AI is used in various fields such as healthcare, finance, and transportation."
+        tokens_for_ai: "Explain the applications of AI in different fields in a friendly and engaging manner."
+        question: "Can you name a few applications of AI?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You have identified some key applications of AI."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of AI applications. Let's explore more."
+            ai_feedback:
+              tokens_for_ai: "Provide additional examples to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on AI applications."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of AI applications in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
diff --git a/research/activity10.yaml b/research/activity10.yaml
new file mode 100644
index 0000000..cd8be71
--- /dev/null
+++ b/research/activity10.yaml
@@ -0,0 +1,368 @@
+default_max_attempts_per_step: 3
+sections:
+  - section_id: "section_1"
+    title: "Introduction to the Miracles of Jesus"
+    steps:
+      - step_id: "step_1"
+        title: "Who is Jesus?"
+        content_blocks:
+          - "Welcome to the Miracles of Jesus course!"
+          - "Jesus is a central figure in Christianity, known for his teachings, compassion, and miraculous acts."
+        tokens_for_ai: "Explain who Jesus is in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What do you know about Jesus?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You have a good understanding of who Jesus is."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of who Jesus is. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on who Jesus is."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of who Jesus is in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Importance of Miracles"
+        content_blocks:
+          - "Miracles are extraordinary events that demonstrate divine intervention in the world."
+          - "The miracles performed by Jesus are significant because they reveal his divine nature and compassion for humanity."
+        tokens_for_ai: "Explain the importance of miracles in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why are the miracles of Jesus important?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the importance of the miracles of Jesus."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the importance. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the importance of the miracles of Jesus."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the importance of the miracles of Jesus in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_2"
+    title: "Miracles of Healing"
+    steps:
+      - step_id: "step_1"
+        title: "Healing the Blind Man"
+        content_blocks:
+          - "One of Jesus' miracles was healing a man who was born blind."
+          - "Jesus made mud with his saliva, put it on the man's eyes, and told him to wash in the Pool of Siloam. The man washed and was able to see."
+        tokens_for_ai: "Explain the miracle of healing the blind man in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you describe the miracle of healing the blind man?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know about the miracle of healing the blind man."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the miracle. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the miracle of healing the blind man."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of healing the blind man in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Healing the Leper"
+        content_blocks:
+          - "Another miracle of Jesus was healing a man with leprosy."
+          - "Jesus touched the man and said, 'Be clean!' Immediately, the leprosy left him, and he was healed."
+        tokens_for_ai: "Explain the miracle of healing the leper in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you describe the miracle of healing the leper?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know about the miracle of healing the leper."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the miracle. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the miracle of healing the leper."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of healing the leper in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_3"
+    title: "Miracles of Provision"
+    steps:
+      - step_id: "step_1"
+        title: "Feeding the 5,000"
+        content_blocks:
+          - "One of Jesus' most famous miracles is feeding 5,000 people with just five loaves of bread and two fish."
+          - "Jesus blessed the food, broke it, and distributed it to the crowd. Everyone ate and was satisfied, and there were twelve baskets of leftovers."
+        tokens_for_ai: "Explain the miracle of feeding the 5,000 in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you describe the miracle of feeding the 5,000?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know about the miracle of feeding the 5,000."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the miracle. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the miracle of feeding the 5,000."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of feeding the 5,000 in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Turning Water into Wine"
+        content_blocks:
+          - "Jesus' first recorded miracle was turning water into wine at a wedding in Cana."
+          - "When the wine ran out, Jesus instructed the servants to fill six stone jars with water. He then turned the water into wine, which was of the highest quality."
+        tokens_for_ai: "Explain the miracle of turning water into wine in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you describe the miracle of turning water into wine?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know about the miracle of turning water into wine."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the miracle. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the miracle of turning water into wine."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of turning water into wine in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_4"
+    title: "Miracles of Nature"
+    steps:
+      - step_id: "step_1"
+        title: "Calming the Storm"
+        content_blocks:
+          - "One of Jesus' miracles involved calming a storm while he and his disciples were on a boat."
+          - "Jesus rebuked the wind and said to the waves, 'Quiet! Be still!' The wind died down, and it was completely calm."
+        tokens_for_ai: "Explain the miracle of calming the storm in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you describe the miracle of calming the storm?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know about the miracle of calming the storm."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the miracle. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the miracle of calming the storm."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of calming the storm in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Walking on Water"
+        content_blocks:
+          - "Another miracle of Jesus was walking on water."
+          - "Jesus walked on the Sea of Galilee to reach his disciples who were in a boat. When they saw him, they were terrified, but Jesus said, 'Take courage! It is I. Don't be afraid.'"
+        tokens_for_ai: "Explain the miracle of walking on water in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you describe the miracle of walking on water?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know about the miracle of walking on water."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the miracle. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the miracle of walking on water."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of walking on water in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_5"
+    title: "Miracles of Resurrection"
+    steps:
+      - step_id: "step_1"
+        title: "Raising Lazarus"
+        content_blocks:
+          - "One of Jesus' most powerful miracles was raising Lazarus from the dead."
+          - "Lazarus had been dead for four days when Jesus arrived. Jesus called out, 'Lazarus, come out!' and Lazarus came out of the tomb, alive."
+        tokens_for_ai: "Explain the miracle of raising Lazarus in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you describe the miracle of raising Lazarus?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know about the miracle of raising Lazarus."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the miracle. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the miracle of raising Lazarus."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of raising Lazarus in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Resurrection of Jesus"
+        content_blocks:
+          - "The most significant miracle in Christianity is the resurrection of Jesus."
+          - "After being crucified and buried, Jesus rose from the dead on the third day. His resurrection is celebrated as Easter and is the foundation of Christian faith."
+        tokens_for_ai: "Explain the miracle of the resurrection of Jesus in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you describe the miracle of the resurrection of Jesus?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know about the miracle of the resurrection of Jesus."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the miracle. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the miracle of the resurrection of Jesus."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the resurrection of Jesus in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_6"
+    title: "Congratulations!"
+    steps:
+      - step_id: "step_1"
+        title: "Well Done!"
+        content_blocks:
+          - "Congratulations on completing the Miracles of Jesus course!"
+          - "You have learned about the various miracles performed by Jesus, including healing, provision, nature, and resurrection."
+          - "These miracles demonstrate Jesus' divine power and compassion for humanity."
+          - "We are proud of your dedication and hard work. Well done!"
+
diff --git a/research/activity11.yaml b/research/activity11.yaml
new file mode 100644
index 0000000..db828ce
--- /dev/null
+++ b/research/activity11.yaml
@@ -0,0 +1,580 @@
+default_max_attempts_per_step: 3
+sections:
+  - section_id: "section_1"
+    title: "Introduction to the Revolutionary War"
+    steps:
+      - step_id: "step_1"
+        title: "What is the Revolutionary War?"
+        content_blocks:
+          - "Welcome to the American Revolutionary War course!"
+          - "The American Revolutionary War, also known as the American War of Independence, was a conflict between Great Britain and its thirteen colonies in North America."
+        tokens_for_ai: "Explain what the American Revolutionary War is in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What do you know about the American Revolutionary War?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You have a good understanding of the American Revolutionary War."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the Revolutionary War. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the Revolutionary War."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the Revolutionary War in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Importance of the Revolutionary War"
+        content_blocks:
+          - "The Revolutionary War was important because it led to the independence of the United States from British rule."
+          - "It also established the principles of liberty, democracy, and self-governance."
+        tokens_for_ai: "Explain the importance of the American Revolutionary War in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why is the American Revolutionary War important?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the importance of the American Revolutionary War."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the importance. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the importance of the Revolutionary War."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the importance of the Revolutionary War in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_2"
+    title: "Causes of the Revolutionary War"
+    steps:
+      - step_id: "step_1"
+        title: "Taxation Without Representation"
+        content_blocks:
+          - "One of the main causes of the Revolutionary War was the issue of 'taxation without representation.'"
+          - "The British government imposed taxes on the American colonies without giving them representation in Parliament."
+        tokens_for_ai: "Explain the concept of 'taxation without representation' and its role in causing the Revolutionary War in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is 'taxation without representation' and how did it contribute to the Revolutionary War?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand the concept of 'taxation without representation' and its role in the Revolutionary War."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of 'taxation without representation.' Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on 'taxation without representation.'"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of 'taxation without representation' in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "The Intolerable Acts"
+        content_blocks:
+          - "The Intolerable Acts were a series of punitive laws passed by the British Parliament in response to the Boston Tea Party."
+          - "These acts further angered the American colonists and contributed to the outbreak of the Revolutionary War."
+        tokens_for_ai: "Explain what the Intolerable Acts were and their role in causing the Revolutionary War in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What were the Intolerable Acts and how did they contribute to the Revolutionary War?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand what the Intolerable Acts were and their role in the Revolutionary War."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the Intolerable Acts. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the Intolerable Acts."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the Intolerable Acts in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_3"
+    title: "Key Events of the Revolutionary War"
+    steps:
+      - step_id: "step_1"
+        title: "The Boston Tea Party"
+        content_blocks:
+          - "The Boston Tea Party was a political protest by the Sons of Liberty in Boston, Massachusetts, on December 16, 1773."
+          - "American colonists, frustrated with British taxation, dumped 342 chests of British tea into the harbor."
+        tokens_for_ai: "Explain the Boston Tea Party and its significance in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What was the Boston Tea Party and why was it significant?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand what the Boston Tea Party was and its significance."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the Boston Tea Party. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the Boston Tea Party."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the Boston Tea Party in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "The Battles of Lexington and Concord"
+        content_blocks:
+          - "The Battles of Lexington and Concord were the first military engagements of the American Revolutionary War."
+          - "They were fought on April 19, 1775, in Middlesex County, Province of Massachusetts Bay."
+        tokens_for_ai: "Explain the Battles of Lexington and Concord and their significance in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What were the Battles of Lexington and Concord and why were they significant?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand what the Battles of Lexington and Concord were and their significance."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the Battles of Lexington and Concord. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the Battles of Lexington and Concord."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the Battles of Lexington and Concord in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_4"
+    title: "Key Figures of the Revolutionary War"
+    steps:
+      - step_id: "step_1"
+        title: "George Washington"
+        content_blocks:
+          - "George Washington was the commander-in-chief of the Continental Army during the American Revolutionary War."
+          - "He later became the first President of the United States."
+        tokens_for_ai: "Explain who George Washington was and his role in the Revolutionary War in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Who was George Washington and what was his role in the Revolutionary War?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand who George Washington was and his role in the Revolutionary War."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of George Washington. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on George Washington."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of George Washington in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Thomas Jefferson"
+        content_blocks:
+          - "Thomas Jefferson was the principal author of the Declaration of Independence."
+          - "He later became the third President of the United States."
+        tokens_for_ai: "Explain who Thomas Jefferson was and his role in the Revolutionary War in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Who was Thomas Jefferson and what was his role in the Revolutionary War?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand who Thomas Jefferson was and his role in the Revolutionary War."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of Thomas Jefferson. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on Thomas Jefferson."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of Thomas Jefferson in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_5"
+    title: "Major Battles of the Revolutionary War"
+    steps:
+      - step_id: "step_1"
+        title: "The Battle of Bunker Hill"
+        content_blocks:
+          - "The Battle of Bunker Hill was fought on June 17, 1775, during the early stages of the American Revolutionary War."
+          - "Despite being a British victory, the battle demonstrated that the American forces could stand up to the British army."
+        tokens_for_ai: "Explain the Battle of Bunker Hill and its significance in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What was the Battle of Bunker Hill and why was it significant?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand what the Battle of Bunker Hill was and its significance."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the Battle of Bunker Hill. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the Battle of Bunker Hill."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the Battle of Bunker Hill in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "The Battle of Saratoga"
+        content_blocks:
+          - "The Battle of Saratoga was a turning point in the American Revolutionary War."
+          - "Fought in 1777, it resulted in a decisive victory for the American forces and convinced France to join the war on the side of the Americans."
+        tokens_for_ai: "Explain the Battle of Saratoga and its significance in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What was the Battle of Saratoga and why was it significant?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand what the Battle of Saratoga was and its significance."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the Battle of Saratoga. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the Battle of Saratoga."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the Battle of Saratoga in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_6"
+    title: "The Declaration of Independence"
+    steps:
+      - step_id: "step_1"
+        title: "Drafting the Declaration"
+        content_blocks:
+          - "The Declaration of Independence was drafted by Thomas Jefferson and adopted by the Continental Congress on July 4, 1776."
+          - "It declared the thirteen American colonies as independent states, free from British rule."
+        tokens_for_ai: "Explain the drafting of the Declaration of Independence and its significance in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What was the Declaration of Independence and why was it significant?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand what the Declaration of Independence was and its significance."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the Declaration of Independence. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the Declaration of Independence."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the Declaration of Independence in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Key Principles of the Declaration"
+        content_blocks:
+          - "The Declaration of Independence outlined key principles such as equality, unalienable rights, and the right to alter or abolish government."
+          - "It emphasized that all men are created equal and have the right to life, liberty, and the pursuit of happiness."
+        tokens_for_ai: "Explain the key principles of the Declaration of Independence in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What are the key principles of the Declaration of Independence?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the key principles of the Declaration of Independence."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the key principles. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the key principles of the Declaration of Independence."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the key principles of the Declaration of Independence in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_7"
+    title: "The End of the Revolutionary War"
+    steps:
+      - step_id: "step_1"
+        title: "The Siege of Yorktown"
+        content_blocks:
+          - "The Siege of Yorktown was the last major battle of the American Revolutionary War."
+          - "Fought in 1781, it resulted in the surrender of British General Cornwallis and effectively ended the war."
+        tokens_for_ai: "Explain the Siege of Yorktown and its significance in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What was the Siege of Yorktown and why was it significant?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand what the Siege of Yorktown was and its significance."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the Siege of Yorktown. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the Siege of Yorktown."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the Siege of Yorktown in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "The Treaty of Paris"
+        content_blocks:
+          - "The Treaty of Paris was signed on September 3, 1783, and officially ended the American Revolutionary War."
+          - "The treaty recognized the independence of the United States and established its borders."
+        tokens_for_ai: "Explain the Treaty of Paris and its significance in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What was the Treaty of Paris and why was it significant?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand what the Treaty of Paris was and its significance."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the Treaty of Paris. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the Treaty of Paris."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the Treaty of Paris in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_8"
+    title: "Legacy of the Revolutionary War"
+    steps:
+      - step_id: "step_1"
+        title: "Impact on the United States"
+        content_blocks:
+          - "The American Revolutionary War had a profound impact on the United States."
+          - "It led to the establishment of a new nation based on principles of liberty, democracy, and self-governance."
+        tokens_for_ai: "Explain the impact of the Revolutionary War on the United States in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What was the impact of the Revolutionary War on the United States?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand the impact of the Revolutionary War on the United States."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the impact. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the impact of the Revolutionary War."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the impact of the Revolutionary War in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Influence on Other Nations"
+        content_blocks:
+          - "The American Revolutionary War inspired other nations to fight for their independence and adopt democratic principles."
+          - "It had a significant influence on the French Revolution and other independence movements around the world."
+        tokens_for_ai: "Explain the influence of the Revolutionary War on other nations in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How did the Revolutionary War influence other nations?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the influence of the Revolutionary War on other nations."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the influence. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the influence of the Revolutionary War."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the influence of the Revolutionary War in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_9"
+    title: "Congratulations!"
+    steps:
+      - step_id: "step_1"
+        title: "Well Done!"
+        content_blocks:
+          - "Congratulations on completing the American Revolutionary War course!"
+          - "You have learned about the causes, key events, major battles, important figures, and the legacy of the Revolutionary War."
+          - "This knowledge will help you understand the foundations of the United States and the principles of liberty and democracy."
+          - "We are proud of your dedication and hard work. Well done!"
diff --git a/research/activity12.yaml b/research/activity12.yaml
new file mode 100644
index 0000000..2f009e3
--- /dev/null
+++ b/research/activity12.yaml
@@ -0,0 +1,596 @@
+default_max_attempts_per_step: 3
+sections:
+  - section_id: "section_1"
+    title: "Introduction to the Revolutionary War"
+    steps:
+      - step_id: "step_1"
+        title: "What is the Revolutionary War?"
+        content_blocks:
+          - "Welcome to the American Revolutionary War course!"
+          - "The American Revolutionary War, also known as the American War of Independence, was a conflict between Great Britain and its thirteen colonies in North America."
+          - "Think about why the colonies might have wanted to break away from British rule. Consider issues like governance, taxes, and representation."
+        tokens_for_ai: "Guide the student to think about the reasons for the colonies wanting independence. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why do you think the American colonies wanted to break away from British rule?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You have a good understanding of why the colonies wanted independence."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the reasons for independence."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of the reasons for independence in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Importance of the Revolutionary War"
+        content_blocks:
+          - "The Revolutionary War was important because it led to the independence of the United States from British rule."
+          - "It also established the principles of liberty, democracy, and self-governance."
+          - "Think about how gaining independence might have changed the lives of the colonists. Consider aspects like freedom, governance, and rights."
+        tokens_for_ai: "Guide the student to think about the impact of independence on the colonists' lives. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How do you think gaining independence changed the lives of the colonists?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the impact of gaining independence."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the impact of independence."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of the impact of independence in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_2"
+    title: "Causes of the Revolutionary War"
+    steps:
+      - step_id: "step_1"
+        title: "Taxation Without Representation"
+        content_blocks:
+          - "One of the main causes of the Revolutionary War was the issue of 'taxation without representation.'"
+          - "The British government imposed taxes on the American colonies without giving them representation in Parliament."
+          - "Think about how you would feel if you had to pay taxes but had no say in how the money was spent. How might this lead to frustration and anger?"
+        tokens_for_ai: "Guide the student to think about the feelings of the colonists regarding taxation without representation. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How do you think the colonists felt about 'taxation without representation' and why?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand the colonists' feelings about 'taxation without representation.'"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on 'taxation without representation.'"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of 'taxation without representation' in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "The Intolerable Acts"
+        content_blocks:
+          - "The Intolerable Acts were a series of punitive laws passed by the British Parliament in response to the Boston Tea Party."
+          - "These acts further angered the American colonists and contributed to the outbreak of the Revolutionary War."
+          - "Think about how you would feel if you were punished for protesting against something you believed was unfair. How might this lead to a desire for change?"
+        tokens_for_ai: "Guide the student to think about the feelings of the colonists regarding the Intolerable Acts. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How do you think the colonists felt about the Intolerable Acts and why?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the colonists' feelings about the Intolerable Acts."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the Intolerable Acts."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of the Intolerable Acts in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_3"
+    title: "Key Events of the Revolutionary War"
+    steps:
+      - step_id: "step_1"
+        title: "The Boston Tea Party"
+        content_blocks:
+          - "The Boston Tea Party was a political protest by the Sons of Liberty in Boston, Massachusetts, on December 16, 1773."
+          - "American colonists, frustrated with British taxation, dumped 342 chests of British tea into the harbor."
+          - "Think about why the colonists chose to protest in this way. What message were they trying to send to the British government?"
+        tokens_for_ai: "Guide the student to think about the reasons behind the Boston Tea Party. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why do you think the colonists chose to protest by dumping tea into the harbor?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand the reasons behind the Boston Tea Party."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the Boston Tea Party."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of the Boston Tea Party in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "The Battles of Lexington and Concord"
+        content_blocks:
+          - "The Battles of Lexington and Concord were the first military engagements of the American Revolutionary War."
+          - "They were fought on April 19, 1775, in Middlesex County, Province of Massachusetts Bay."
+          - "Think about why these battles were significant. How did they change the relationship between the colonies and Great Britain?"
+        tokens_for_ai: "Guide the student to think about the significance of the Battles of Lexington and Concord. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why do you think the Battles of Lexington and Concord were significant?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the significance of the Battles of Lexington and Concord."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the Battles of Lexington and Concord."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of the Battles of Lexington and Concord in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_4"
+    title: "Key Figures of the Revolutionary War"
+    steps:
+      - step_id: "step_1"
+        title: "George Washington"
+        content_blocks:
+          - "George Washington was the commander-in-chief of the Continental Army during the American Revolutionary War."
+          - "He later became the first President of the United States."
+          - "Think about the qualities that made George Washington a good leader. How did his leadership contribute to the success of the American forces?"
+        tokens_for_ai: "Guide the student to think about the qualities of George Washington's leadership. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What qualities do you think made George Washington a good leader and how did his leadership contribute to the success of the American forces?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand the qualities that made George Washington a good leader."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on George Washington's leadership qualities."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of George Washington's leadership qualities in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Thomas Jefferson"
+        content_blocks:
+          - "Thomas Jefferson was the principal author of the Declaration of Independence."
+          - "He later became the third President of the United States."
+          - "Think about the impact of the Declaration of Independence. How did Thomas Jefferson's words inspire the colonists and shape the new nation?"
+        tokens_for_ai: "Guide the student to think about the impact of the Declaration of Independence and Thomas Jefferson's role. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How do you think Thomas Jefferson's words in the Declaration of Independence inspired the colonists and shaped the new nation?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the impact of Thomas Jefferson's words in the Declaration of Independence."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on Thomas Jefferson's role."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of Thomas Jefferson's role in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_5"
+    title: "Major Battles of the Revolutionary War"
+    steps:
+      - step_id: "step_1"
+        title: "The Battle of Bunker Hill"
+        content_blocks:
+          - "The Battle of Bunker Hill was fought on June 17, 1775, during the early stages of the American Revolutionary War."
+          - "Despite being a British victory, the battle demonstrated that the American forces could stand up to the British army."
+          - "Think about the significance of this battle. How might it have affected the morale and determination of the American forces?"
+        tokens_for_ai: "Guide the student to think about the significance of the Battle of Bunker Hill. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why do you think the Battle of Bunker Hill was significant for the American forces?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand the significance of the Battle of Bunker Hill for the American forces."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the Battle of Bunker Hill."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of the Battle of Bunker Hill in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "The Battle of Saratoga"
+        content_blocks:
+          - "The Battle of Saratoga was a turning point in the American Revolutionary War."
+          - "Fought in 1777, it resulted in a decisive victory for the American forces and convinced France to join the war on the side of the Americans."
+          - "Think about why this battle was a turning point. How did the involvement of France change the course of the war?"
+        tokens_for_ai: "Guide the student to think about the significance of the Battle of Saratoga. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why do you think the Battle of Saratoga was a turning point in the Revolutionary War?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the significance of the Battle of Saratoga."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the Battle of Saratoga."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of the Battle of Saratoga in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_6"
+    title: "The Declaration of Independence"
+    steps:
+      - step_id: "step_1"
+        title: "Drafting the Declaration"
+        content_blocks:
+          - "The Declaration of Independence was drafted by Thomas Jefferson and adopted by the Continental Congress on July 4, 1776."
+          - "It declared the thirteen American colonies as independent states, free from British rule."
+          - "Think about the significance of declaring independence. How might this document have inspired the colonists and affected their resolve to fight for freedom?"
+        tokens_for_ai: "Guide the student to think about the significance of the Declaration of Independence. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why do you think the Declaration of Independence was significant for the colonists?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand the significance of the Declaration of Independence for the colonists."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the Declaration of Independence."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of the Declaration of Independence in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Key Principles of the Declaration"
+        content_blocks:
+          - "The Declaration of Independence outlined key principles such as equality, unalienable rights, and the right to alter or abolish government."
+          - "It emphasized that all men are created equal and have the right to life, liberty, and the pursuit of happiness."
+          - "Think about how these principles might have influenced the new nation. How do you think they shaped the values and government of the United States?"
+        tokens_for_ai: "Guide the student to think about the key principles of the Declaration of Independence and their influence. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How do you think the key principles of the Declaration of Independence influenced the new nation?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the influence of the key principles of the Declaration of Independence."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the key principles of the Declaration of Independence."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of the key principles of the Declaration of Independence in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_7"
+    title: "The End of the Revolutionary War"
+    steps:
+      - step_id: "step_1"
+        title: "The Siege of Yorktown"
+        content_blocks:
+          - "The Siege of Yorktown was the last major battle of the American Revolutionary War."
+          - "Fought in 1781, it resulted in the surrender of British General Cornwallis and effectively ended the war."
+          - "Think about why this battle was significant. How did the surrender of Cornwallis impact the outcome of the war?"
+        tokens_for_ai: "Guide the student to think about the significance of the Siege of Yorktown. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why do you think the Siege of Yorktown was significant in ending the Revolutionary War?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand the significance of the Siege of Yorktown in ending the Revolutionary War."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the Siege of Yorktown."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of the Siege of Yorktown in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "The Treaty of Paris"
+        content_blocks:
+          - "The Treaty of Paris was signed on September 3, 1783, and officially ended the American Revolutionary War."
+          - "The treaty recognized the independence of the United States and established its borders."
+          - "Think about the significance of this treaty. How did it solidify the United States' status as an independent nation?"
+        tokens_for_ai: "Guide the student to think about the significance of the Treaty of Paris. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why do you think the Treaty of Paris was significant in solidifying the United States' independence?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the significance of the Treaty of Paris in solidifying the United States' independence."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the Treaty of Paris."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of the Treaty of Paris in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_8"
+    title: "Legacy of the Revolutionary War"
+    steps:
+      - step_id: "step_1"
+        title: "Impact on the United States"
+        content_blocks:
+          - "The American Revolutionary War had a profound impact on the United States."
+          - "It led to the establishment of a new nation based on principles of liberty, democracy, and self-governance."
+          - "Think about how these principles have shaped the United States. How do you see the influence of the Revolutionary War in the country's values and government today?"
+        tokens_for_ai: "Guide the student to think about the impact of the Revolutionary War on the United States. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How do you think the principles established during the Revolutionary War have shaped the United States today?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand the impact of the Revolutionary War on the United States today."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the impact of the Revolutionary War."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of the impact of the Revolutionary War in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Influence on Other Nations"
+        content_blocks:
+          - "The American Revolutionary War inspired other nations to fight for their independence and adopt democratic principles."
+          - "It had a significant influence on the French Revolution and other independence movements around the world."
+          - "Think about how the success of the American Revolution might have inspired other countries. How do you think it influenced global movements for independence and democracy?"
+        tokens_for_ai: "Guide the student to think about the influence of the American Revolutionary War on other nations. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How do you think the success of the American Revolution influenced other countries' movements for independence and democracy?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the influence of the American Revolution on other countries."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the influence of the American Revolution."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of the influence of the American Revolution in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_9"
+    title: "Congratulations!"
+    steps:
+      - step_id: "step_1"
+        title: "Well Done!"
+        content_blocks:
+          - "Congratulations on completing the American Revolutionary War course!"
+          - "You have learned about the causes, key events, major battles, important figures, and the legacy of the Revolutionary War."
+          - "This knowledge will help you understand the foundations of the United States and the principles of liberty and democracy."
+          - "We are proud of your dedication and hard work. Well done!"
diff --git a/research/activity2.yaml b/research/activity2.yaml
new file mode 100644
index 0000000..bb9e750
--- /dev/null
+++ b/research/activity2.yaml
@@ -0,0 +1,287 @@
+default_max_attempts_per_step: 3
+sections:
+  - section_id: "section_1"
+    title: "Introduction to Python"
+    steps:
+      - step_id: "step_1"
+        title: "What is Python?"
+        content_blocks:
+          - "Welcome to the Python programming course."
+          - "Python is a high-level, interpreted programming language known for its readability and versatility."
+        tokens_for_ai: "Explain what Python is and its key features in a friendly and engaging manner."
+        question: "What do you know about Python?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You have a good understanding of Python."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of Python. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on Python."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of Python in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Installing Python"
+        content_blocks:
+          - "To start coding in Python, you need to install it on your computer."
+          - "You can download Python from the official website: https://www.python.org/downloads/"
+        tokens_for_ai: "Explain how to install Python on different operating systems in a friendly and engaging manner."
+        question: "Have you installed Python on your computer?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You are ready to start coding in Python."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "It seems like you have some issues with the installation. Let's go over the steps again."
+            ai_feedback:
+              tokens_for_ai: "Provide detailed installation steps to help the user in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on installing Python."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of installing Python in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_2"
+    title: "Basic Python Syntax"
+    steps:
+      - step_id: "step_1"
+        title: "Writing Your First Python Program"
+        content_blocks:
+          - "Let's write your first Python program."
+          - "Open a text editor and type the following code:\n```python\nprint('Hello, World!')\n```"
+          - "Save the file with a `.py` extension and run it using the Python interpreter."
+        tokens_for_ai: "Explain how to write and run a simple Python program in a friendly and engaging manner."
+        question: "Were you able to run the 'Hello, World!' program?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You've written and run your first Python program."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "It seems like you had some issues. Let's go over the steps again."
+            ai_feedback:
+              tokens_for_ai: "Provide detailed steps to help the user run the program successfully in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on writing and running the Python program."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of writing and running the Python program in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Variables and Data Types"
+        content_blocks:
+          - "In Python, you can store data in variables."
+          - "Python supports various data types such as integers, floats, strings, and booleans."
+          - "Here's an example:\n```python\nx = 5\npi = 3.14\nname = 'Alice'\nis_student = True\n```"
+        tokens_for_ai: "Explain variables and data types in Python with examples in a friendly and engaging manner."
+        question: "Can you create a variable and assign a value to it?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You have successfully created a variable."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "It seems like you have a partial understanding. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional examples and explanations to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on variables and data types."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of variables and data types in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_3"
+    title: "Control Flow"
+    steps:
+      - step_id: "step_1"
+        title: "If Statements"
+        content_blocks:
+          - "If statements allow you to execute code based on certain conditions."
+          - "Here's an example:\n```python\nx = 10\nif x > 5:\n    print('x is greater than 5')\nelse:\n    print('x is 5 or less')\n```"
+        tokens_for_ai: "Explain if statements in Python with examples in a friendly and engaging manner."
+        question: "Can you write an if statement to check if a number is positive?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You've written a correct if statement."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "It seems like you have a partial understanding. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional examples and explanations to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on if statements."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of if statements in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "For Loops"
+        content_blocks:
+          - "For loops allow you to iterate over a sequence of elements."
+          - "Here's an example:\n```python\nfor i in range(5):\n    print(i)\n```"
+        tokens_for_ai: "Explain for loops in Python with examples in a friendly and engaging manner."
+        question: "Can you write a for loop to print the numbers from 1 to 10?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You've written a correct for loop."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "It seems like you have a partial understanding. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional examples and explanations to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on for loops."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of for loops in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_4"
+    title: "Functions"
+    steps:
+      - step_id: "step_1"
+        title: "Defining Functions"
+        content_blocks:
+          - "Functions allow you to encapsulate code into reusable blocks."
+          - "Here's an example:\n```python\ndef greet(name):\n    print(f'Hello, {name}!')\n\ngreet('Alice')\n```"
+        tokens_for_ai: "Explain how to define and use functions in Python with examples in a friendly and engaging manner."
+        question: "Can you define a function that takes two numbers and returns their sum?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You've defined a correct function."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "It seems like you have a partial understanding. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional examples and explanations to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on defining functions."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of defining functions in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Calling Functions"
+        content_blocks:
+          - "Once you've defined a function, you can call it to execute the code inside it."
+          - "Here's an example:\n```python\ndef add(a, b):\n    return a + b\n\nresult = add(3, 4)\nprint(result)\n```"
+        tokens_for_ai: "Explain how to call functions in Python with examples in a friendly and engaging manner."
+        question: "Can you call a function that you've defined and print the result?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You've called the function correctly."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "It seems like you have a partial understanding. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional examples and explanations to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on calling functions."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of calling functions in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
diff --git a/research/activity3.yaml b/research/activity3.yaml
new file mode 100644
index 0000000..6b51c47
--- /dev/null
+++ b/research/activity3.yaml
@@ -0,0 +1,286 @@
+default_max_attempts_per_step: 3
+sections:
+  - section_id: "section_1"
+    title: "Introduction to Elephants"
+    steps:
+      - step_id: "step_1"
+        title: "What is an Elephant?"
+        content_blocks:
+          - "Welcome to the world of elephants!"
+          - "Elephants are the largest land animals on Earth. They are known for their big ears, long trunks, and tusks."
+        tokens_for_ai: "Explain what an elephant is and its key features in a friendly and engaging manner suitable for a 7-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What do you know about elephants?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know a lot about elephants."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the child to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about elephants. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the child's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on elephants."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the child back to the topic of elephants in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "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."
+
+      - step_id: "step_2"
+        title: "Where Do Elephants Live?"
+        content_blocks:
+          - "Elephants live in different parts of the world."
+          - "There are two main types of elephants: African elephants and Asian elephants."
+          - "African elephants live in Africa, and Asian elephants live in Asia."
+        tokens_for_ai: "Explain where elephants live and the difference between African and Asian elephants in a friendly and engaging manner suitable for a 7-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you name the two types of elephants and where they live?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know where elephants live."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the child to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about where elephants live. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the child's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on where elephants live."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the child back to the topic of where elephants live in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "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_2"
+    title: "Elephant Anatomy"
+    steps:
+      - step_id: "step_1"
+        title: "Elephant Trunks"
+        content_blocks:
+          - "Elephants have long trunks that they use for many things."
+          - "They use their trunks to drink water, pick up food, and even to greet other elephants."
+        tokens_for_ai: "Explain the uses of an elephant's trunk in a friendly and engaging manner suitable for a 7-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What do elephants use their trunks for?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know how elephants use their trunks."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the child to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about how elephants use their trunks. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the child's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on elephant trunks."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the child back to the topic of elephant trunks in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "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."
+
+      - step_id: "step_2"
+        title: "Elephant Ears"
+        content_blocks:
+          - "Elephants have big ears that help them stay cool."
+          - "They flap their ears to fan themselves and keep their bodies cool."
+        tokens_for_ai: "Explain the purpose of an elephant's ears in a friendly and engaging manner suitable for a 7-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why do elephants have big ears?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know why elephants have big ears."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the child to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about why elephants have big ears. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the child's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on elephant ears."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the child back to the topic of elephant ears in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "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_3"
+    title: "Elephant Behavior"
+    steps:
+      - step_id: "step_1"
+        title: "Elephant Families"
+        content_blocks:
+          - "Elephants live in groups called herds."
+          - "A herd is usually led by the oldest female elephant, called the matriarch."
+        tokens_for_ai: "Explain the social structure of elephant herds in a friendly and engaging manner suitable for a 7-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is a group of elephants called and who leads it?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know about elephant families."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the child to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about elephant families. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the child's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on elephant families."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the child back to the topic of elephant families in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "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."
+
+      - step_id: "step_2"
+        title: "Elephant Communication"
+        content_blocks:
+          - "Elephants communicate with each other using sounds, touch, and even vibrations."
+          - "They can make loud trumpeting sounds and low rumbles that humans can't hear."
+        tokens_for_ai: "Explain how elephants communicate in a friendly and engaging manner suitable for a 7-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How do elephants communicate with each other?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know how elephants communicate."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the child to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about how elephants communicate. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the child's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on elephant communication."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the child back to the topic of elephant communication in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "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_4"
+    title: "Elephant Conservation"
+    steps:
+      - step_id: "step_1"
+        title: "Why Elephants Need Our Help"
+        content_blocks:
+          - "Elephants are amazing animals, but they need our help to survive."
+          - "Many elephants are in danger because of habitat loss and poaching."
+        tokens_for_ai: "Explain why elephants need our help and the threats they face in a friendly and engaging manner suitable for a 7-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why do elephants need our help?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand why elephants need our help."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the child to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about why elephants need our help. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the child's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on why elephants need our help."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the child back to the topic of why elephants need our help in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "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."
+
+      - step_id: "step_2"
+        title: "How We Can Help Elephants"
+        content_blocks:
+          - "There are many ways we can help elephants."
+          - "We can support organizations that protect elephants, learn more about them, and spread the word to others."
+        tokens_for_ai: "Explain how we can help elephants in a friendly and engaging manner suitable for a 7-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you think of ways to help elephants?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You have great ideas to help elephants."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the child to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have some good ideas. Let's think of more ways to help elephants."
+            ai_feedback:
+              tokens_for_ai: "Provide additional suggestions to help the child think of more ways to help elephants in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on how we can help elephants."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the child back to the topic of how we can help elephants in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "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."
diff --git a/research/activity4.yaml b/research/activity4.yaml
new file mode 100644
index 0000000..e0a1a1a
--- /dev/null
+++ b/research/activity4.yaml
@@ -0,0 +1,361 @@
+default_max_attempts_per_step: 3
+sections:
+  - section_id: "section_1"
+    title: "Introduction to Mario"
+    steps:
+      - step_id: "step_1"
+        title: "Who is Mario?"
+        content_blocks:
+          - "Welcome to the Mario trivia game!"
+          #- "Mario is a famous video game character created by Nintendo. He is known for his adventures in various games."
+        tokens_for_ai: "Explain who Mario is and his significance in video games in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Who is Mario?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know who Mario is."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about Mario. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on Mario."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of Mario in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Mario's First Game"
+        content_blocks: []
+        #content_blocks:
+        #  - "Mario first appeared in the game Donkey Kong in 1981."
+        #  - "In this game, Mario had to rescue a damsel in distress from a giant ape named Donkey Kong."
+        tokens_for_ai: "Explain Mario's first appearance in video games in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What was the first game Mario appeared in?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know about Mario's first game."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about Mario's first game. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on Mario's first game."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of Mario's first game in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_2"
+    title: "Mario's Friends and Foes"
+    steps:
+      - step_id: "step_1"
+        title: "Mario's Friends"
+        content_blocks:
+          - "Mario has many friends who help him on his adventures."
+          #- "Some of his friends include Luigi, Princess Peach, and Yoshi."
+        tokens_for_ai: "Explain who Mario's friends are in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you name some of Mario's friends?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know about Mario's friends."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about Mario's friends. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on Mario's friends."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of Mario's friends in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Mario's Foes"
+        content_blocks:
+          - "Mario also has many enemies that he has to defeat."
+          #- "Some of his foes include Bowser, Goombas, and Koopa Troopas."
+        tokens_for_ai: "Explain who Mario's foes are in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you name some of Mario's foes?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know about Mario's foes."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about Mario's foes. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on Mario's foes."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of Mario's foes in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_3"
+    title: "Mario's Adventures"
+    steps:
+      - step_id: "step_1"
+        title: "Super Mario Bros."
+        content_blocks:
+          - "One of the most famous Mario games is Super Mario Bros., released in 1985."
+          #- "In this game, Mario must rescue Princess Peach from Bowser."
+        tokens_for_ai: "Explain the game Super Mario Bros. in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is the main objective in Super Mario Bros.?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know the main objective in Super Mario Bros."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about Super Mario Bros. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on Super Mario Bros."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of Super Mario Bros. in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Mario Kart"
+        content_blocks:
+          - "Mario Kart is a popular racing game series featuring Mario and his friends."
+          #- "Players race against each other on various tracks and use items to gain an advantage."
+        tokens_for_ai: "Explain the game Mario Kart in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is the main objective in Mario Kart?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know the main objective in Mario Kart."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about Mario Kart. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on Mario Kart."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of Mario Kart in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_4"
+    title: "Mario's Power-Ups"
+    steps:
+      - step_id: "step_1"
+        title: "Super Mushroom"
+        content_blocks: []
+        #content_blocks:
+        #  - "The Super Mushroom is a power-up that makes Mario grow bigger."
+        #  - "It allows Mario to take an extra hit from enemies."
+        tokens_for_ai: "Explain the Super Mushroom power-up in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What does the Super Mushroom do?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know what the Super Mushroom does."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about the Super Mushroom. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the Super Mushroom."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the Super Mushroom in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Fire Flower"
+        content_blocks: []
+        #content_blocks:
+        #  - "The Fire Flower is a power-up that gives Mario the ability to throw fireballs."
+        #  - "It allows Mario to defeat enemies from a distance."
+        tokens_for_ai: "Explain the Fire Flower power-up in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What does the Fire Flower do?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know what the Fire Flower does."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about the Fire Flower. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the Fire Flower."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the Fire Flower in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_5"
+    title: "Mario's Worlds"
+    steps:
+      - step_id: "step_1"
+        title: "Mushroom Kingdom"
+        content_blocks: []
+        #content_blocks:
+        #  - "The Mushroom Kingdom is the main setting for many Mario games."
+        #  - "It is ruled by Princess Peach and is often threatened by Bowser."
+        tokens_for_ai: "Explain the Mushroom Kingdom in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is the Mushroom Kingdom?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know about the Mushroom Kingdom."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about the Mushroom Kingdom. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the Mushroom Kingdom."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the Mushroom Kingdom in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Bowser's Castle"
+        content_blocks: []
+        #content_blocks:
+        #  - "Bowser's Castle is the home of Mario's arch-enemy, Bowser."
+        #  - "It is often the final level in many Mario games, where Mario must defeat Bowser to rescue Princess Peach."
+        tokens_for_ai: "Explain Bowser's Castle in a friendly and engaging manner suitable for a 13-year-old. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is Bowser's Castle?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know about Bowser's Castle."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about Bowser's Castle. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on Bowser's Castle."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of Bowser's Castle in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
diff --git a/research/activity5.yaml b/research/activity5.yaml
new file mode 100644
index 0000000..499acb5
--- /dev/null
+++ b/research/activity5.yaml
@@ -0,0 +1,356 @@
+default_max_attempts_per_step: 3
+sections:
+  - section_id: "section_1"
+    title: "Introduction to Perimeter Security"
+    steps:
+      - step_id: "step_1"
+        title: "What is Perimeter Security?"
+        content_blocks:
+          - "Welcome to the perimeter security training for a presidential speech."
+          - "Perimeter security involves measures taken to protect the outer boundary of a location to prevent unauthorized access."
+        tokens_for_ai: "Explain what perimeter security is and its importance in a friendly and engaging manner suitable for a security professional. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What do you understand by perimeter security?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You have a good understanding of perimeter security."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of perimeter security. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on perimeter security."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of perimeter security in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Importance of Perimeter Security for a Presidential Speech"
+        content_blocks:
+          - "Perimeter security is crucial for a presidential speech to ensure the safety of the president and attendees."
+          - "It helps prevent unauthorized access, potential threats, and ensures a controlled environment."
+        tokens_for_ai: "Explain the importance of perimeter security for a presidential speech in a friendly and engaging manner suitable for a security professional. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why is perimeter security important for a presidential speech?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the importance of perimeter security for a presidential speech."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the importance. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the importance of perimeter security."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the importance of perimeter security in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_2"
+    title: "Planning and Preparation"
+    steps:
+      - step_id: "step_1"
+        title: "Site Assessment"
+        content_blocks:
+          - "The first step in hardening a perimeter is conducting a thorough site assessment."
+          - "Identify potential vulnerabilities, entry points, and areas that need reinforcement."
+        tokens_for_ai: "Explain the importance of site assessment and what it involves in a friendly and engaging manner suitable for a security professional. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is the purpose of a site assessment in perimeter security?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand the purpose of a site assessment."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the site assessment. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the site assessment."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the site assessment in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Security Plan Development"
+        content_blocks:
+          - "Develop a comprehensive security plan based on the site assessment."
+          - "The plan should include security measures, personnel deployment, and emergency response protocols."
+        tokens_for_ai: "Explain how to develop a security plan and what it should include in a friendly and engaging manner suitable for a security professional. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What should be included in a security plan for a presidential speech?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know what should be included in a security plan."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the security plan. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the security plan."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the security plan in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_3"
+    title: "Implementing Security Measures"
+    steps:
+      - step_id: "step_1"
+        title: "Physical Barriers"
+        content_blocks:
+          - "Physical barriers such as fences, bollards, and barricades are essential for perimeter security."
+          - "They help control access and prevent unauthorized entry."
+        tokens_for_ai: "Explain the role of physical barriers in perimeter security in a friendly and engaging manner suitable for a security professional. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is the role of physical barriers in perimeter security?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand the role of physical barriers."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of physical barriers. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on physical barriers."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of physical barriers in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Access Control"
+        content_blocks:
+          - "Access control measures include security checkpoints, ID verification, and controlled entry points."
+          - "These measures help ensure that only authorized personnel can enter the secured area."
+        tokens_for_ai: "Explain the importance of access control in perimeter security in a friendly and engaging manner suitable for a security professional. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why is access control important in perimeter security?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the importance of access control."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of access control. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on access control."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of access control in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_4"
+    title: "Monitoring and Surveillance"
+    steps:
+      - step_id: "step_1"
+        title: "Surveillance Cameras"
+        content_blocks:
+          - "Surveillance cameras are essential for monitoring the perimeter and detecting potential threats."
+          - "They provide real-time video feeds to security personnel."
+        tokens_for_ai: "Explain the role of surveillance cameras in perimeter security in a friendly and engaging manner suitable for a security professional. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is the role of surveillance cameras in perimeter security?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand the role of surveillance cameras."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of surveillance cameras. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on surveillance cameras."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of surveillance cameras in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Security Personnel"
+        content_blocks:
+          - "Security personnel play a crucial role in monitoring the perimeter and responding to incidents."
+          - "They should be strategically positioned and equipped with communication devices."
+        tokens_for_ai: "Explain the role of security personnel in perimeter security in a friendly and engaging manner suitable for a security professional. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is the role of security personnel in perimeter security?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the role of security personnel."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of security personnel. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on security personnel."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of security personnel in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_5"
+    title: "Emergency Response"
+    steps:
+      - step_id: "step_1"
+        title: "Emergency Protocols"
+        content_blocks:
+          - "Emergency protocols are essential for responding to incidents quickly and effectively."
+          - "They should include evacuation plans, communication procedures, and roles and responsibilities."
+        tokens_for_ai: "Explain the importance of emergency protocols in perimeter security in a friendly and engaging manner suitable for a security professional. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why are emergency protocols important in perimeter security?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand the importance of emergency protocols."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of emergency protocols. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on emergency protocols."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of emergency protocols in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Communication During Emergencies"
+        content_blocks:
+          - "Effective communication is crucial during emergencies to coordinate response efforts."
+          - "Use radios, phones, and other communication devices to stay in contact with security personnel."
+        tokens_for_ai: "Explain the importance of communication during emergencies in a friendly and engaging manner suitable for a security professional. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why is communication important during emergencies?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the importance of communication during emergencies."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of communication during emergencies. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on communication during emergencies."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of communication during emergencies in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
diff --git a/research/activity6.yaml b/research/activity6.yaml
new file mode 100644
index 0000000..31d9a96
--- /dev/null
+++ b/research/activity6.yaml
@@ -0,0 +1,285 @@
+default_max_attempts_per_step: 3
+sections:
+  - section_id: "section_1"
+    title: "Introduction to Cybersecurity"
+    steps:
+      - step_id: "step_1"
+        title: "What is Cybersecurity?"
+        content_blocks:
+          - "Welcome to the Cybersecurity Awareness Training."
+          - "Cybersecurity involves protecting computer systems, networks, and data from digital attacks."
+        tokens_for_ai: "Explain what cybersecurity is and its importance in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What do you understand by cybersecurity?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You have a good understanding of cybersecurity."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of cybersecurity. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on cybersecurity."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of cybersecurity in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Importance of Cybersecurity"
+        content_blocks:
+          - "Cybersecurity is crucial to protect sensitive information and maintain privacy."
+          - "It helps prevent data breaches, identity theft, and other cyber threats."
+        tokens_for_ai: "Explain the importance of cybersecurity in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why is cybersecurity important?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the importance of cybersecurity."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the importance. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the importance of cybersecurity."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the importance of cybersecurity in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_2"
+    title: "Common Cybersecurity Threats"
+    steps:
+      - step_id: "step_1"
+        title: "Phishing Attacks"
+        content_blocks:
+          - "Phishing attacks involve tricking individuals into providing sensitive information by pretending to be a trustworthy entity."
+          - "These attacks often come in the form of emails or messages that appear legitimate."
+        tokens_for_ai: "Explain what phishing attacks are and how to recognize them in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is a phishing attack and how can you recognize it?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand what phishing attacks are and how to recognize them."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of phishing attacks. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on phishing attacks."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of phishing attacks in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Malware"
+        content_blocks:
+          - "Malware is malicious software designed to harm or exploit computer systems."
+          - "Common types of malware include viruses, worms, and ransomware."
+        tokens_for_ai: "Explain what malware is and the different types in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is malware and what are some common types?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand what malware is and the different types."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of malware. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on malware."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of malware in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_3"
+    title: "Best Practices for Cybersecurity"
+    steps:
+      - step_id: "step_1"
+        title: "Strong Passwords"
+        content_blocks:
+          - "Using strong passwords is one of the simplest and most effective ways to protect your accounts."
+          - "A strong password should be at least 12 characters long and include a mix of letters, numbers, and special characters."
+        tokens_for_ai: "Explain the importance of strong passwords and how to create them in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why are strong passwords important and how can you create one?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand the importance of strong passwords and how to create them."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of strong passwords. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on strong passwords."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of strong passwords in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Two-Factor Authentication"
+        content_blocks:
+          - "Two-factor authentication (2FA) adds an extra layer of security to your accounts."
+          - "It requires you to provide two forms of identification before accessing your account."
+        tokens_for_ai: "Explain what two-factor authentication is and its benefits in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is two-factor authentication and why is it beneficial?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand what two-factor authentication is and its benefits."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of two-factor authentication. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on two-factor authentication."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of two-factor authentication in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_4"
+    title: "Recognizing and Responding to Threats"
+    steps:
+      - step_id: "step_1"
+        title: "Recognizing Phishing Emails"
+        content_blocks:
+          - "Phishing emails often have telltale signs such as poor grammar, urgent language, and suspicious links."
+          - "Always verify the sender's email address and avoid clicking on links or downloading attachments from unknown sources."
+        tokens_for_ai: "Explain how to recognize phishing emails in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How can you recognize a phishing email?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know how to recognize phishing emails."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of recognizing phishing emails. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on recognizing phishing emails."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of recognizing phishing emails in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Responding to a Cyber Attack"
+        content_blocks:
+          - "If you suspect a cyber attack, disconnect from the internet and report the incident to your IT department or a cybersecurity professional."
+          - "Do not attempt to fix the issue yourself as it may cause further damage."
+        tokens_for_ai: "Explain how to respond to a suspected cyber attack in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What should you do if you suspect a cyber attack?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know how to respond to a suspected cyber attack."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of responding to a cyber attack. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on responding to a cyber attack."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of responding to a cyber attack in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
diff --git a/research/activity7.yaml b/research/activity7.yaml
new file mode 100644
index 0000000..e06dbbe
--- /dev/null
+++ b/research/activity7.yaml
@@ -0,0 +1,725 @@
+default_max_attempts_per_step: 3
+sections:
+  - section_id: "section_1"
+    title: "Introduction to Financial Literacy"
+    steps:
+      - step_id: "step_1"
+        title: "What is Financial Literacy?"
+        content_blocks:
+          - "Welcome to the Financial Literacy for Teens course."
+          - "Financial literacy involves understanding how to manage money, including budgeting, saving, investing, and understanding credit."
+        tokens_for_ai: "Explain what financial literacy is and its importance in a friendly and engaging manner suitable for teens. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What do you understand by financial literacy?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You have a good understanding of financial literacy."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of financial literacy. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on financial literacy."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of financial literacy in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Importance of Financial Literacy"
+        content_blocks:
+          - "Financial literacy is crucial for making informed decisions about money."
+          - "It helps you manage your finances, avoid debt, and plan for the future."
+        tokens_for_ai: "Explain the importance of financial literacy in a friendly and engaging manner suitable for teens. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why is financial literacy important?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the importance of financial literacy."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the importance. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the importance of financial literacy."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the importance of financial literacy in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_2"
+    title: "Budgeting"
+    steps:
+      - step_id: "step_1"
+        title: "What is a Budget?"
+        content_blocks:
+          - "A budget is a plan for how you will spend and save your money."
+          - "It helps you track your income and expenses to ensure you are living within your means."
+        tokens_for_ai: "Explain what a budget is and its purpose in a friendly and engaging manner suitable for teens. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is a budget and why is it important?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand what a budget is and why it's important."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of a budget. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on what a budget is."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of what a budget is in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Creating a Budget"
+        content_blocks:
+          - "To create a budget, start by listing your income and expenses."
+          - "Categorize your expenses into needs (e.g., food, rent) and wants (e.g., entertainment, dining out)."
+        tokens_for_ai: "Explain how to create a budget in a friendly and engaging manner suitable for teens. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How do you create a budget?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know how to create a budget."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of creating a budget. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on creating a budget."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of creating a budget in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_3"
+    title: "Saving Money"
+    steps:
+      - step_id: "step_1"
+        title: "Why Save Money?"
+        content_blocks:
+          - "Saving money is important for achieving financial goals and being prepared for unexpected expenses."
+          - "It helps you build a financial cushion and avoid debt."
+        tokens_for_ai: "Explain the importance of saving money in a friendly and engaging manner suitable for teens. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why is it important to save money?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand the importance of saving money."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of saving money. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the importance of saving money."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of saving money in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "How to Save Money"
+        content_blocks:
+          - "To save money, set aside a portion of your income regularly."
+          - "Consider opening a savings account to keep your money safe and earn interest."
+        tokens_for_ai: "Explain how to save money in a friendly and engaging manner suitable for teens. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How can you save money effectively?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know how to save money effectively."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of saving money. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on how to save money."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of how to save money in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_4"
+    title: "Investing"
+    steps:
+      - step_id: "step_1"
+        title: "What is Investing?"
+        content_blocks:
+          - "Investing involves putting your money into assets like stocks, bonds, or real estate to grow your wealth over time."
+          - "It carries some risk, but it can also offer higher returns than saving alone."
+        tokens_for_ai: "Explain what investing is and its purpose in a friendly and engaging manner suitable for teens. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is investing and why is it important?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand what investing is and why it's important."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of investing. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on what investing is."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of what investing is in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Types of Investments"
+        content_blocks:
+          - "Common types of investments include stocks, bonds, mutual funds, and real estate."
+          - "Each type of investment has its own risk and return profile."
+        tokens_for_ai: "Explain the different types of investments in a friendly and engaging manner suitable for teens. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What are some common types of investments?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know the different types of investments."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the types of investments. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the types of investments."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the types of investments in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_5"
+    title: "Understanding Credit"
+    steps:
+      - step_id: "step_1"
+        title: "What is Credit?"
+        content_blocks:
+          - "Credit is the ability to borrow money with the promise to repay it later."
+          - "It allows you to make purchases or access funds that you may not have immediately available."
+        tokens_for_ai: "Explain what credit is and its purpose in a friendly and engaging manner suitable for teens. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is credit and why is it important?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand what credit is and why it's important."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of credit. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on what credit is."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of what credit is in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Credit Scores"
+        content_blocks:
+          - "A credit score is a numerical representation of your creditworthiness."
+          - "It is based on your credit history and helps lenders determine the risk of lending to you."
+        tokens_for_ai: "Explain what a credit score is and its importance in a friendly and engaging manner suitable for teens. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is a credit score and why is it important?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand what a credit score is and why it's important."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of credit scores. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on credit scores."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of credit scores in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_6"
+    title: "Avoiding Debt"
+    steps:
+      - step_id: "step_1"
+        title: "What is Debt?"
+        content_blocks:
+          - "Debt is money that you owe to others, typically as a result of borrowing."
+          - "It can come from loans, credit cards, or other forms of borrowing."
+        tokens_for_ai: "Explain what debt is and its implications in a friendly and engaging manner suitable for teens. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is debt and why is it important to manage it?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand what debt is and why it's important to manage it."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of debt. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on what debt is."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of what debt is in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Managing Debt"
+        content_blocks:
+          - "To manage debt, make sure to pay your bills on time and avoid taking on more debt than you can handle."
+          - "Create a plan to pay off existing debt and prioritize high-interest debt first."
+        tokens_for_ai: "Explain how to manage debt effectively in a friendly and engaging manner suitable for teens. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How can you manage debt effectively?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know how to manage debt effectively."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of managing debt. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on managing debt."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of managing debt in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_7"
+    title: "Planning for the Future"
+    steps:
+      - step_id: "step_1"
+        title: "Setting Financial Goals"
+        content_blocks:
+          - "Setting financial goals helps you plan for the future and stay motivated to save and invest."
+          - "Your goals can be short-term (e.g., saving for a new phone) or long-term (e.g., saving for college)."
+        tokens_for_ai: "Explain the importance of setting financial goals and how to set them in a friendly and engaging manner suitable for teens. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why is it important to set financial goals and how can you set them?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand the importance of setting financial goals and how to set them."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of setting financial goals. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on setting financial goals."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of setting financial goals in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Building an Emergency Fund"
+        content_blocks:
+          - "An emergency fund is money set aside to cover unexpected expenses, such as medical bills or car repairs."
+          - "Aim to save at least three to six months' worth of living expenses in your emergency fund."
+        tokens_for_ai: "Explain the importance of an emergency fund and how to build one in a friendly and engaging manner suitable for teens. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is an emergency fund and why is it important?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand what an emergency fund is and why it's important."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of an emergency fund. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the emergency fund."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the emergency fund in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_8"
+    title: "Understanding Taxes"
+    steps:
+      - step_id: "step_1"
+        title: "What are Taxes?"
+        content_blocks:
+          - "Taxes are mandatory contributions to government revenue, collected from individuals and businesses."
+          - "They fund public services such as education, healthcare, and infrastructure."
+        tokens_for_ai: "Explain what taxes are and their purpose in a friendly and engaging manner suitable for teens. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What are taxes and why are they important?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand what taxes are and why they're important."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of taxes. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on taxes."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of taxes in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Filing Taxes"
+        content_blocks:
+          - "Filing taxes involves submitting a tax return to report your income and calculate the taxes you owe."
+          - "It's important to file your taxes accurately and on time to avoid penalties."
+        tokens_for_ai: "Explain how to file taxes and the importance of doing so in a friendly and engaging manner suitable for teens. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How do you file taxes and why is it important?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand how to file taxes and why it's important."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of filing taxes. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on filing taxes."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of filing taxes in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_9"
+    title: "Smart Spending"
+    steps:
+      - step_id: "step_1"
+        title: "Needs vs. Wants"
+        content_blocks:
+          - "Understanding the difference between needs and wants is crucial for smart spending."
+          - "Needs are essential for living (e.g., food, shelter), while wants are things you desire but can live without (e.g., new gadgets, dining out)."
+        tokens_for_ai: "Explain the difference between needs and wants in a friendly and engaging manner suitable for teens. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is the difference between needs and wants?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand the difference between needs and wants."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of needs and wants. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on needs and wants."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of needs and wants in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Making Smart Purchases"
+        content_blocks:
+          - "To make smart purchases, compare prices, read reviews, and consider the long-term value of the item."
+          - "Avoid impulse buying and stick to your budget."
+        tokens_for_ai: "Explain how to make smart purchases in a friendly and engaging manner suitable for teens. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How can you make smart purchases?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know how to make smart purchases."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of making smart purchases. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on making smart purchases."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of making smart purchases in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_10"
+    title: "Protecting Your Finances"
+    steps:
+      - step_id: "step_1"
+        title: "Avoiding Scams"
+        content_blocks:
+          - "Scams are fraudulent schemes designed to steal your money or personal information."
+          - "Be cautious of unsolicited emails, phone calls, or messages asking for your financial information."
+        tokens_for_ai: "Explain how to recognize and avoid scams in a friendly and engaging manner suitable for teens. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How can you recognize and avoid scams?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know how to recognize and avoid scams."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of avoiding scams. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on avoiding scams."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of avoiding scams in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Identity Theft"
+        content_blocks:
+          - "Identity theft occurs when someone steals your personal information to commit fraud."
+          - "Protect your personal information by using strong passwords and being cautious about sharing your details online."
+        tokens_for_ai: "Explain what identity theft is and how to protect against it in a friendly and engaging manner suitable for teens. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is identity theft and how can you protect against it?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand what identity theft is and how to protect against it."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of identity theft. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on identity theft."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of identity theft in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+  - section_id: "section_11"
+    title: "Congratulations!"
+    steps:
+      - step_id: "step_1"
+        title: "Well Done!"
+        content_blocks:
+          - "Congratulations on completing the Financial Literacy for Teens course!"
+          - "You have learned valuable skills and knowledge that will help you manage your finances effectively."
+          - "Remember, financial literacy is a lifelong journey, and the skills you've gained here will serve you well in the future."
+          - "Keep practicing what you've learned, stay curious, and continue to build your financial knowledge."
+          - "We are proud of your dedication and hard work. Well done!"
+
+
+
diff --git a/research/activity8.yaml b/research/activity8.yaml
new file mode 100644
index 0000000..47632a2
--- /dev/null
+++ b/research/activity8.yaml
@@ -0,0 +1,372 @@
+default_max_attempts_per_step: 3
+sections:
+  - section_id: "section_1"
+    title: "Introduction to Cooking"
+    steps:
+      - step_id: "step_1"
+        title: "What is Cooking?"
+        content_blocks:
+          - "Welcome to the Basic Cooking Skills course."
+          - "Cooking is the process of preparing food by combining, mixing, and heating ingredients."
+        tokens_for_ai: "Explain what cooking is and its importance in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What do you understand by cooking?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You have a good understanding of cooking."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of cooking. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on cooking."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of cooking in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Importance of Cooking"
+        content_blocks:
+          - "Cooking is important because it allows you to control what goes into your food."
+          - "It helps you make healthier choices and can be a fun and creative activity."
+        tokens_for_ai: "Explain the importance of cooking in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why is cooking important?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the importance of cooking."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of the importance. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the importance of cooking."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of the importance of cooking in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_2"
+    title: "Basic Cooking Techniques"
+    steps:
+      - step_id: "step_1"
+        title: "Chopping and Slicing"
+        content_blocks:
+          - "Chopping and slicing are fundamental cooking techniques."
+          - "Use a sharp knife and a cutting board. Keep your fingers tucked in to avoid cuts."
+        tokens_for_ai: "Explain how to chop and slice ingredients safely in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How do you chop and slice ingredients safely?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know how to chop and slice ingredients safely."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of chopping and slicing. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on chopping and slicing."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of chopping and slicing in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Boiling and Simmering"
+        content_blocks:
+          - "Boiling and simmering are techniques used to cook food in water or broth."
+          - "Boiling involves cooking at a high temperature, while simmering is done at a lower temperature."
+        tokens_for_ai: "Explain the difference between boiling and simmering and how to do them in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is the difference between boiling and simmering, and how do you do them?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the difference between boiling and simmering and how to do them."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of boiling and simmering. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on boiling and simmering."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of boiling and simmering in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_3"
+    title: "Simple Recipes"
+    steps:
+      - step_id: "step_1"
+        title: "Scrambled Eggs"
+        content_blocks:
+          - "Scrambled eggs are a simple and nutritious breakfast option."
+          - "Ingredients: 2 eggs, salt, pepper, butter."
+          - "Instructions: Crack the eggs into a bowl, add a pinch of salt and pepper, and whisk. Melt butter in a pan over medium heat, pour in the eggs, and stir until cooked."
+        tokens_for_ai: "Explain how to make scrambled eggs in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How do you make scrambled eggs?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know how to make scrambled eggs."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of making scrambled eggs. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on making scrambled eggs."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of making scrambled eggs in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Pasta with Tomato Sauce"
+        content_blocks:
+          - "Pasta with tomato sauce is a simple and delicious meal."
+          - "Ingredients: 200g pasta, 1 can of tomato sauce, garlic, olive oil, salt, pepper, basil."
+          - "Instructions: Cook the pasta according to the package instructions. In a pan, heat olive oil, add minced garlic, and cook until fragrant. Add tomato sauce, salt, pepper, and basil. Simmer for 10 minutes. Mix with the cooked pasta."
+        tokens_for_ai: "Explain how to make pasta with tomato sauce in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How do you make pasta with tomato sauce?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know how to make pasta with tomato sauce."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of making pasta with tomato sauce. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on making pasta with tomato sauce."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of making pasta with tomato sauce in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_4"
+    title: "Baking Basics"
+    steps:
+      - step_id: "step_1"
+        title: "Baking Cookies"
+        content_blocks:
+          - "Baking cookies is a fun and rewarding activity."
+          - "Ingredients: 1 cup butter, 1 cup sugar, 2 cups flour, 1 egg, 1 tsp vanilla extract, 1 tsp baking soda, a pinch of salt."
+          - "Instructions: Preheat the oven to 350°F (175°C). Cream the butter and sugar together. Add the egg and vanilla extract. Mix in the flour, baking soda, and salt. Drop spoonfuls of dough onto a baking sheet and bake for 10-12 minutes."
+        tokens_for_ai: "Explain how to bake cookies in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How do you bake cookies?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know how to bake cookies."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of baking cookies. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on baking cookies."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of baking cookies in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Baking Bread"
+        content_blocks:
+          - "Baking bread is a rewarding and delicious skill to learn."
+          - "Ingredients: 3 cups flour, 1 packet yeast, 1 cup warm water, 1 tbsp sugar, 1 tsp salt."
+          - "Instructions: Dissolve the yeast and sugar in warm water and let it sit for 5 minutes. Mix in the flour and salt to form a dough. Knead the dough for 10 minutes, then let it rise for 1 hour. Preheat the oven to 375°F (190°C). Shape the dough into a loaf and bake for 25-30 minutes."
+        tokens_for_ai: "Explain how to bake bread in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How do you bake bread?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know how to bake bread."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of baking bread. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on baking bread."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of baking bread in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_5"
+    title: "Cooking Safety"
+    steps:
+      - step_id: "step_1"
+        title: "Kitchen Safety Tips"
+        content_blocks:
+          - "Safety in the kitchen is crucial to prevent accidents and injuries."
+          - "Always use oven mitts when handling hot items, keep knives sharp and handle them carefully, and clean up spills immediately to avoid slips."
+        tokens_for_ai: "Explain important kitchen safety tips in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What are some important kitchen safety tips?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand important kitchen safety tips."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of kitchen safety tips. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on kitchen safety tips."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of kitchen safety tips in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Food Safety"
+        content_blocks:
+          - "Food safety is essential to prevent foodborne illnesses."
+          - "Always wash your hands before handling food, cook meat to the proper temperature, and store leftovers in the refrigerator promptly."
+        tokens_for_ai: "Explain important food safety practices in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What are some important food safety practices?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand important food safety practices."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of food safety practices. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on food safety practices."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of food safety practices in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_6"
+    title: "Congratulations!"
+    steps:
+      - step_id: "step_1"
+        title: "Well Done!"
+        content_blocks:
+          - "Congratulations on completing the Basic Cooking Skills course!"
+          - "You have learned valuable skills and techniques that will help you in the kitchen."
+          - "Remember, cooking is a skill that improves with practice, so keep experimenting and trying new recipes."
+          - "We are proud of your dedication and hard work. Well done!"
+
diff --git a/research/activity9.yaml b/research/activity9.yaml
new file mode 100644
index 0000000..b4ba8fa
--- /dev/null
+++ b/research/activity9.yaml
@@ -0,0 +1,652 @@
+default_max_attempts_per_step: 3
+sections:
+  - section_id: "section_1"
+    title: "Introduction to Minecraft"
+    steps:
+      - step_id: "step_1"
+        title: "What is Minecraft?"
+        content_blocks:
+          - "Welcome to the Minecraft Trivia game!"
+          - "Minecraft is a popular sandbox video game where players can build, explore, and survive in a blocky, procedurally-generated 3D world."
+        tokens_for_ai: "Explain what Minecraft is in a friendly and engaging manner suitable for 7 to 13-year-olds. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What do you know about Minecraft?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know what Minecraft is."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about Minecraft. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on Minecraft."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of Minecraft in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Minecraft Gameplay"
+        content_blocks:
+          - "In Minecraft, players can explore a blocky world, gather resources, craft items, and build structures."
+          - "The game has different modes, including Survival, Creative, Adventure, and Spectator."
+        tokens_for_ai: "Explain the basic gameplay of Minecraft in a friendly and engaging manner suitable for 7 to 13-year-olds. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you describe the basic gameplay of Minecraft?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the basic gameplay of Minecraft."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about Minecraft gameplay. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on Minecraft gameplay."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of Minecraft gameplay in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_2"
+    title: "Minecraft Mobs"
+    steps:
+      - step_id: "step_1"
+        title: "Friendly Mobs"
+        content_blocks:
+          - "Minecraft has various friendly mobs, such as cows, pigs, and chickens."
+          - "These mobs can be found in different biomes and can be used for resources like food and materials."
+        tokens_for_ai: "Explain what friendly mobs are in Minecraft in a friendly and engaging manner suitable for 7 to 13-year-olds. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you name some friendly mobs in Minecraft?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know about friendly mobs in Minecraft."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about friendly mobs. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on friendly mobs."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of friendly mobs in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Hostile Mobs"
+        content_blocks:
+          - "Minecraft also has hostile mobs, such as zombies, skeletons, and creepers."
+          - "These mobs attack players and can be found in dark areas or at night."
+        tokens_for_ai: "Explain what hostile mobs are in Minecraft in a friendly and engaging manner suitable for 7 to 13-year-olds. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you name some hostile mobs in Minecraft?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know about hostile mobs in Minecraft."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about hostile mobs. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on hostile mobs."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of hostile mobs in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_3"
+    title: "Minecraft Biomes"
+    steps:
+      - step_id: "step_1"
+        title: "Overworld Biomes"
+        content_blocks:
+          - "The Overworld in Minecraft has various biomes, such as forests, deserts, and plains."
+          - "Each biome has unique features, resources, and mobs."
+        tokens_for_ai: "Explain what biomes are in Minecraft and describe some Overworld biomes in a friendly and engaging manner suitable for 7 to 13-year-olds. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you name some Overworld biomes in Minecraft?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know about Overworld biomes in Minecraft."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about Overworld biomes. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on Overworld biomes."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of Overworld biomes in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Nether Biomes"
+        content_blocks:
+          - "The Nether is a dangerous dimension in Minecraft with unique biomes, such as Nether Wastes, Crimson Forest, and Warped Forest."
+          - "These biomes have unique resources and hostile mobs."
+        tokens_for_ai: "Explain what Nether biomes are in Minecraft and describe some of them in a friendly and engaging manner suitable for 7 to 13-year-olds. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you name some Nether biomes in Minecraft?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know about Nether biomes in Minecraft."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about Nether biomes. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on Nether biomes."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of Nether biomes in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_4"
+    title: "Minecraft Items and Blocks"
+    steps:
+      - step_id: "step_1"
+        title: "Common Blocks"
+        content_blocks:
+          - "Minecraft has many common blocks, such as dirt, stone, and wood."
+          - "These blocks are used for building and crafting."
+        tokens_for_ai: "Explain what common blocks are in Minecraft and describe some of them in a friendly and engaging manner suitable for 7 to 13-year-olds. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you name some common blocks in Minecraft?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know about common blocks in Minecraft."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about common blocks. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on common blocks."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of common blocks in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Crafting Items"
+        content_blocks:
+          - "Crafting is an essential part of Minecraft, allowing players to create items like tools, weapons, and armor."
+          - "Common crafting items include sticks, planks, and ingots."
+        tokens_for_ai: "Explain what crafting items are in Minecraft and describe some of them in a friendly and engaging manner suitable for 7 to 13-year-olds. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you name some crafting items in Minecraft?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know about crafting items in Minecraft."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about crafting items. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on crafting items."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of crafting items in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_5"
+    title: "Minecraft Structures"
+    steps:
+      - step_id: "step_1"
+        title: "Villages"
+        content_blocks:
+          - "Villages are structures in Minecraft where villagers live and work."
+          - "They have houses, farms, and other buildings."
+        tokens_for_ai: "Explain what villages are in Minecraft and describe their features in a friendly and engaging manner suitable for 7 to 13-year-olds. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you describe what a village is in Minecraft?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know what a village is in Minecraft."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about villages. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on villages."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of villages in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Strongholds"
+        content_blocks:
+          - "Strongholds are underground structures in Minecraft that contain the End Portal."
+          - "They are made of stone bricks and have various rooms and corridors."
+        tokens_for_ai: "Explain what strongholds are in Minecraft and describe their features in a friendly and engaging manner suitable for 7 to 13-year-olds. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you describe what a stronghold is in Minecraft?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know what a stronghold is in Minecraft."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about strongholds. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on strongholds."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of strongholds in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_6"
+    title: "Minecraft Achievements"
+    steps:
+      - step_id: "step_1"
+        title: "Common Achievements"
+        content_blocks:
+          - "Minecraft has various achievements that players can earn by completing specific tasks."
+          - "Common achievements include 'Taking Inventory,' 'Getting Wood,' and 'Benchmarking.'"
+        tokens_for_ai: "Explain what achievements are in Minecraft and describe some common ones in a friendly and engaging manner suitable for 7 to 13-year-olds. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you name some common achievements in Minecraft?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know about common achievements in Minecraft."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about common achievements. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on common achievements."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of common achievements in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Rare Achievements"
+        content_blocks:
+          - "Minecraft also has rare achievements that are more challenging to earn."
+          - "Rare achievements include 'The End,' 'Beaconator,' and 'Adventuring Time.'"
+        tokens_for_ai: "Explain what rare achievements are in Minecraft and describe some of them in a friendly and engaging manner suitable for 7 to 13-year-olds. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you name some rare achievements in Minecraft?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know about rare achievements in Minecraft."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about rare achievements. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on rare achievements."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of rare achievements in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_7"
+    title: "Minecraft Redstone"
+    steps:
+      - step_id: "step_1"
+        title: "What is Redstone?"
+        content_blocks:
+          - "Redstone is a special material in Minecraft that can be used to create circuits and machines."
+          - "It allows players to build complex contraptions like doors, traps, and automated farms."
+        tokens_for_ai: "Explain what Redstone is in Minecraft and its uses in a friendly and engaging manner suitable for 7 to 13-year-olds. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "What is Redstone and what can you do with it in Minecraft?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand what Redstone is and its uses in Minecraft."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of Redstone. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on Redstone."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of Redstone in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Basic Redstone Contraptions"
+        content_blocks:
+          - "Some basic Redstone contraptions include pressure plates, levers, and buttons."
+          - "These can be used to create simple machines like doors that open automatically or lights that turn on with a switch."
+        tokens_for_ai: "Explain some basic Redstone contraptions in Minecraft and their uses in a friendly and engaging manner suitable for 7 to 13-year-olds. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you name some basic Redstone contraptions and their uses in Minecraft?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know about basic Redstone contraptions and their uses in Minecraft."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of basic Redstone contraptions. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on basic Redstone contraptions."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of basic Redstone contraptions in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_8"
+    title: "Minecraft Updates"
+    steps:
+      - step_id: "step_1"
+        title: "Major Updates"
+        content_blocks:
+          - "Minecraft receives regular updates that add new features, blocks, and mobs to the game."
+          - "Some major updates include the 'Nether Update,' 'Caves & Cliffs Update,' and 'Village & Pillage Update.'"
+        tokens_for_ai: "Explain what major updates are in Minecraft and describe some of them in a friendly and engaging manner suitable for 7 to 13-year-olds. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you name some major updates in Minecraft?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know about major updates in Minecraft."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about major updates. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on major updates."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of major updates in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "New Features"
+        content_blocks:
+          - "Each major update introduces new features to Minecraft, such as new biomes, mobs, and blocks."
+          - "These features enhance the gameplay experience and provide new challenges and opportunities for players."
+        tokens_for_ai: "Explain what new features are introduced in Minecraft updates and describe some of them in a friendly and engaging manner suitable for 7 to 13-year-olds. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you describe some new features introduced in Minecraft updates?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know about new features introduced in Minecraft updates."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of new features. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on new features."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of new features in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_9"
+    title: "Minecraft Community"
+    steps:
+      - step_id: "step_1"
+        title: "Minecraft Servers"
+        content_blocks:
+          - "Minecraft servers are online multiplayer worlds where players can join and play together."
+          - "Servers offer various game modes, mini-games, and custom content created by the community."
+        tokens_for_ai: "Explain what Minecraft servers are and their features in a friendly and engaging manner suitable for 7 to 13-year-olds. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you describe what Minecraft servers are and their features?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You know what Minecraft servers are and their features."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You know a little about Minecraft servers. Let's learn more!"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on Minecraft servers."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of Minecraft servers in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's answer them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+      - step_id: "step_2"
+        title: "Minecraft Mods"
+        content_blocks:
+          - "Minecraft mods are modifications made by the community that add new features, items, and gameplay mechanics to the game."
+          - "Mods can be downloaded and installed to enhance the Minecraft experience."
+        tokens_for_ai: "Explain what Minecraft mods are and their uses in a friendly and engaging manner suitable for 7 to 13-year-olds. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Can you describe what Minecraft mods are and their uses?"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You know what Minecraft mods are and their uses."
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the user to continue learning."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding of Minecraft mods. Let's clarify a few points."
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the user's understanding in a friendly and supportive manner."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on Minecraft mods."
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the topic of Minecraft mods in a supportive manner."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them."
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner."
+
+  - section_id: "section_10"
+    title: "Congratulations!"
+    steps:
+      - step_id: "step_1"
+        title: "Well Done!"
+        content_blocks:
+          - "Congratulations on completing the Minecraft Trivia game!"
+          - "You have learned a lot about Minecraft, including its gameplay, mobs, biomes, items, structures, achievements, Redstone, updates, and community."
+          - "Remember, Minecraft is a game of creativity and exploration, so keep playing, building, and discovering new things."
+          - "We are proud of your dedication and hard work. Well done!"
+
diff --git a/research/guarded_ai.py b/research/guarded_ai.py
new file mode 100644
index 0000000..3499cc9
--- /dev/null
+++ b/research/guarded_ai.py
@@ -0,0 +1,146 @@
+import yaml
+from openai import OpenAI
+
+client = OpenAI()
+
+
+# Load the YAML activity file
+def load_yaml_activity(file_path):
+    with open(file_path, "r") as file:
+        return yaml.safe_load(file)
+
+
+# Categorize the user's response using gpt-4o-mini
+def categorize_response(question, response, buckets, tokens_for_ai):
+    bucket_list = ", ".join(buckets)
+    messages = [
+        {
+            "role": "system",
+            "content": f"{tokens_for_ai} Categorize the following response into one of the following buckets: {bucket_list}.",
+        },
+        {
+            "role": "user",
+            "content": f"Question: {question}\nResponse: {response}\n\nCategory:",
+        },
+    ]
+
+    try:
+        completion = client.chat.completions.create(
+            model="gpt-4o-mini",
+            messages=messages,
+            max_tokens=10,
+            temperature=0,
+        )
+        category = (
+            completion.choices[0].message.content.strip().lower().replace(" ", "_")
+        )
+        return category
+    except Exception as e:
+        return f"Error: {e}"
+
+
+# Generate AI feedback using gpt-4o-mini
+def generate_ai_feedback(category, question, user_response, tokens_for_ai):
+    messages = [
+        {
+            "role": "system",
+            "content": "{tokens_for_ai} Generate a human-readable feedback message based on the following:",
+        },
+        {
+            "role": "user",
+            "content": f"Question: {question}\nResponse: {user_response}\nCategory: {category}",
+        },
+    ]
+
+    try:
+        completion = client.chat.completions.create(
+            model="gpt-4o-mini", messages=messages, max_tokens=250, temperature=0.7
+        )
+        feedback = completion.choices[0].message.content.strip()
+        return feedback
+    except Exception as e:
+        return f"Error: {e}"
+
+
+# Provide feedback based on the category
+def provide_feedback(
+    yaml_content, section_id, step_id, category, question, user_response
+):
+    section = next(
+        (s for s in yaml_content["sections"] if s["section_id"] == section_id), None
+    )
+    if not section:
+        return "Section not found."
+
+    step = next((s for s in section["steps"] if s["step_id"] == step_id), None)
+    if not step:
+        return "Step not found."
+
+    transition = step["transitions"].get(category, None)
+    if not transition:
+        return "Category not found."
+
+    feedback = "\n".join(transition["content_blocks"])
+    if "ai_feedback" in transition:
+        tokens_for_ai = (
+            step["tokens_for_ai"] + " " + transition["ai_feedback"]["tokens_for_ai"]
+        )
+        ai_feedback = generate_ai_feedback(
+            category, question, user_response, tokens_for_ai
+        )
+        feedback += f"\n\nAI Feedback: {ai_feedback}"
+
+    return feedback
+
+
+# Simulate the activity
+def simulate_activity(yaml_file_path):
+    yaml_content = load_yaml_activity(yaml_file_path)
+    max_attempts = yaml_content.get("default_max_attempts_per_step", 3)
+
+    for section in yaml_content["sections"]:
+        print(f"\nSection: {section['title']}\n")
+        for step in section["steps"]:
+            # Print all content blocks once per step
+            if "content_blocks" in step:
+                for block in step["content_blocks"]:
+                    print(block)
+            if "question" in step:
+                question = step["question"]
+            else:
+                # Skip classification and feedback if there's no question
+                continue
+
+            attempts = 0
+            while attempts < max_attempts:
+                if "question" in step:
+                    print(f"\nQuestion: {question}")
+
+                user_response = input("\nYour Response: ")
+
+                category = categorize_response(
+                    question, user_response, step["buckets"], step["tokens_for_ai"]
+                )
+                print(f"\nCategory: {category}")
+
+                feedback = provide_feedback(
+                    yaml_content,
+                    section["section_id"],
+                    step["step_id"],
+                    category,
+                    question,
+                    user_response,
+                )
+                print(f"\nFeedback: {feedback}")
+
+                if category == "correct":
+                    break
+
+                attempts += 1
+
+            if attempts == max_attempts:
+                print("\nMaximum attempts reached. Moving to the next step.")
+
+
+if __name__ == "__main__":
+    simulate_activity("activity12.yaml")
-- 
GitLab


From 6dff9dc6e91ea3cfcb4202d16a5fa87436e90602 Mon Sep 17 00:00:00 2001
From: Russell Ballestrini <russell.ballestrini@gmail.com>
Date: Sat, 27 Jul 2024 10:30:07 -0400
Subject: [PATCH 02/20] Integrated gaurded ai via websocket frontend.

	modified:   app.py
	new file:   migrations/versions/d04950c5a624_add_activitystate_table2.py
	new file:   migrations/versions/d3631b8bb652_add_activitystate_table.py
---
 app.py                                        | 352 ++++++++++++++++++
 .../d04950c5a624_add_activitystate_table2.py  |  34 ++
 .../d3631b8bb652_add_activitystate_table.py   |  41 ++
 3 files changed, 427 insertions(+)
 create mode 100644 migrations/versions/d04950c5a624_add_activitystate_table2.py
 create mode 100644 migrations/versions/d3631b8bb652_add_activitystate_table.py

diff --git a/app.py b/app.py
index 29066bc..fff1db6 100644
--- a/app.py
+++ b/app.py
@@ -8,6 +8,7 @@ monkey.patch_all()
 
 
 import json
+import yaml
 import os
 
 import boto3
@@ -98,6 +99,16 @@ class Message(db.Model):
         return self.content.startswith('<img src="data:image/jpeg;base64,')
 
 
+class ActivityState(db.Model):
+    id = db.Column(db.Integer, primary_key=True)
+    room_id = db.Column(db.Integer, db.ForeignKey("room.id"), nullable=False)
+    section_id = db.Column(db.String(128), nullable=False)
+    step_id = db.Column(db.String(128), nullable=False)
+    attempts = db.Column(db.Integer, default=0)
+    max_attempts = db.Column(db.Integer, default=3)
+    s3_file_path = db.Column(db.String(256), nullable=False)
+
+
 def get_room(room_name):
     """Utility function to get room from room name."""
     room = Room.query.filter_by(name=room_name).first()
@@ -297,6 +308,11 @@ def handle_message(data):
     commands = data["message"].splitlines()
 
     for command in commands:
+        if command.startswith("/activity"):
+            s3_file_path = command.split(" ", 1)[1].strip()
+            gevent.spawn(start_activity, room_name, s3_file_path, data["username"])
+            # Exit early since we're starting an activity
+            return
         if command.startswith("/s3 ls"):
             # Extract the S3 file path pattern
             s3_file_path_pattern = command.split(" ", 2)[2].strip()
@@ -322,6 +338,13 @@ def handle_message(data):
             # Cancel the most recent generation request
             gevent.spawn(cancel_generation, room_name)
 
+    # Check if the user is in activity mode
+    activity_state = ActivityState.query.filter_by(room_id=room.id).first()
+    if activity_state:
+        gevent.spawn(
+            handle_activity_response, room_name, data["message"], data["username"]
+        )
+
     if "dall-e-3" in data["message"]:
         # Use the entire message as the prompt for DALL-E 3
         # Generate the image and emit its URL
@@ -1655,6 +1678,335 @@ def cancel_generation(room_name):
         )
 
 
+def start_activity(room_name, s3_file_path, username):
+    s3_client = boto3.client("s3")
+    bucket_name = os.environ.get("S3_BUCKET_NAME")
+
+    response = s3_client.get_object(Bucket=bucket_name, Key=s3_file_path)
+    activity_yaml = response["Body"].read().decode("utf-8")
+    activity_content = yaml.safe_load(activity_yaml)
+
+    with app.app_context():
+        # Save the initial state to the database
+        room = get_room(room_name)
+        initial_section = activity_content["sections"][0]
+        initial_step = initial_section["steps"][0]
+
+        activity_state = ActivityState(
+            room_id=room.id,
+            section_id=initial_section["section_id"],
+            step_id=initial_step["step_id"],
+            max_attempts=activity_content.get("default_max_attempts_per_step", 3),
+            s3_file_path=s3_file_path,  # Save the S3 file path
+        )
+        db.session.add(activity_state)
+        db.session.commit()
+
+        # Store and emit the initial activity content
+        content = f"Starting Activity: {initial_section['title']}\n\n"
+        content += "\n\n".join(initial_step["content_blocks"])
+        new_message = Message(username="System", content=content, room_id=room.id)
+        db.session.add(new_message)
+        db.session.commit()
+
+        socketio.emit(
+            "message",
+            {
+                "id": new_message.id,
+                "username": "System",
+                "content": content,
+            },
+            room=room_name,
+        )
+
+        # Emit the initial question
+        question_content = f"Question: {initial_step['question']}"
+        new_message = Message(
+            username="System", content=question_content, room_id=room.id
+        )
+        db.session.add(new_message)
+        db.session.commit()
+
+        socketio.emit(
+            "message",
+            {
+                "id": new_message.id,
+                "username": "System",
+                "content": question_content,
+            },
+            room=room_name,
+        )
+
+
+def handle_activity_response(room_name, user_response, username):
+    with app.app_context():
+        room = get_room(room_name)
+        activity_state = ActivityState.query.filter_by(room_id=room.id).first()
+
+        if not activity_state:
+            return
+
+        # Load the activity YAML from S3
+        s3_client = boto3.client("s3")
+        bucket_name = os.environ.get("S3_BUCKET_NAME")
+        s3_file_path = activity_state.s3_file_path
+
+        try:
+            response = s3_client.get_object(Bucket=bucket_name, Key=s3_file_path)
+            activity_yaml = response["Body"].read().decode("utf-8")
+            activity_content = yaml.safe_load(activity_yaml)
+
+            # Find the current section and step
+            section = next(
+                s
+                for s in activity_content["sections"]
+                if s["section_id"] == activity_state.section_id
+            )
+            step = next(
+                s for s in section["steps"] if s["step_id"] == activity_state.step_id
+            )
+
+            # Categorize the user's response
+            category = categorize_response(
+                step["question"], user_response, step["buckets"], step["tokens_for_ai"]
+            )
+
+            # Emit the category to the frontend
+            socketio.emit(
+                "message",
+                {
+                    "id": None,
+                    "username": "System",
+                    "content": f"Category: {category}",
+                },
+                room=room_name,
+            )
+
+            # Provide feedback based on the category
+            feedback = provide_feedback(
+                activity_content,
+                section["section_id"],
+                step["step_id"],
+                category,
+                step["question"],
+                user_response,
+            )
+
+            # Store and emit the feedback
+            new_message = Message(username="System", content=feedback, room_id=room.id)
+            db.session.add(new_message)
+            db.session.commit()
+
+            socketio.emit(
+                "message",
+                {
+                    "id": new_message.id,
+                    "username": "System",
+                    "content": feedback,
+                },
+                room=room_name,
+            )
+
+            # Update the activity state
+            if (
+                category == "correct"
+                or activity_state.attempts >= activity_state.max_attempts
+            ):
+                print(
+                    f"Transitioning to next step. Category: {category}, Attempts: {activity_state.attempts}"
+                )
+                # Move to the next step or section
+                next_section, next_step = get_next_step(
+                    activity_content, section["section_id"], step["step_id"]
+                )
+                if next_step:
+                    activity_state.section_id = next_section["section_id"]
+                    activity_state.step_id = next_step["step_id"]
+                    activity_state.attempts = 0
+
+                    db.session.add(activity_state)
+                    db.session.commit()
+
+                    # Emit the new step content blocks
+                    content = "\n\n".join(next_step["content_blocks"])
+                    new_message = Message(
+                        username="System", content=content, room_id=room.id
+                    )
+                    db.session.add(new_message)
+                    db.session.commit()
+
+                    socketio.emit(
+                        "message",
+                        {
+                            "id": new_message.id,
+                            "username": "System",
+                            "content": content,
+                        },
+                        room=room_name,
+                    )
+
+                    # Emit the new question
+                    question_content = f"Question: {next_step['question']}"
+                    new_message = Message(
+                        username="System", content=question_content, room_id=room.id
+                    )
+                    db.session.add(new_message)
+                    db.session.commit()
+
+                    socketio.emit(
+                        "message",
+                        {
+                            "id": new_message.id,
+                            "username": "System",
+                            "content": question_content,
+                        },
+                        room=room_name,
+                    )
+                else:
+                    # Activity completed
+                    db.session.delete(activity_state)
+                    db.session.commit()
+                    socketio.emit(
+                        "message",
+                        {
+                            "id": None,
+                            "username": "System",
+                            "content": "Activity completed!",
+                        },
+                        room=room_name,
+                    )
+            else:
+                activity_state.attempts += 1
+                db.session.add(activity_state)
+                db.session.commit()
+
+        except Exception as e:
+            socketio.emit(
+                "message",
+                {
+                    "id": None,
+                    "username": "System",
+                    "content": f"Error processing activity response: {e}",
+                },
+                room=room_name,
+            )
+
+
+def get_next_step(activity_content, current_section_id, current_step_id):
+    for section in activity_content["sections"]:
+        if section["section_id"] == current_section_id:
+            for i, step in enumerate(section["steps"]):
+                if step["step_id"] == current_step_id:
+                    if i + 1 < len(section["steps"]):
+                        return section, section["steps"][i + 1]
+                    else:
+                        # Move to the next section
+                        next_section_index = (
+                            activity_content["sections"].index(section) + 1
+                        )
+                        if next_section_index < len(activity_content["sections"]):
+                            next_section = activity_content["sections"][
+                                next_section_index
+                            ]
+                            return next_section, next_section["steps"][0]
+    return None, None
+
+
+# Load the YAML activity file
+def load_yaml_activity(file_path):
+    with open(file_path, "r") as file:
+        return yaml.safe_load(file)
+
+
+# Categorize the user's response using gpt-4o-mini
+def categorize_response(question, response, buckets, tokens_for_ai):
+    openai_client = OpenAI()
+    bucket_list = ", ".join(buckets)
+    messages = [
+        {
+            "role": "system",
+            "content": f"{tokens_for_ai} Categorize the following response into one of the following buckets: {bucket_list}. Return ONLY a bucket label.",
+        },
+        {
+            "role": "user",
+            "content": f"Question: {question}\nResponse: {response}\n\nCategory:",
+        },
+    ]
+
+    try:
+        completion = openai_client.chat.completions.create(
+            model="gpt-4o-mini",
+            messages=messages,
+            max_tokens=5,
+            temperature=0,
+        )
+        category = (
+            completion.choices[0]
+            .message.content.strip()
+            .lower()
+            .replace(" ", "_")
+            .strip("_")
+        )
+        return category
+    except Exception as e:
+        return f"Error: {e}"
+
+
+# Generate AI feedback using gpt-4o-mini
+def generate_ai_feedback(category, question, user_response, tokens_for_ai):
+    openai_client = OpenAI()
+    messages = [
+        {
+            "role": "system",
+            "content": "{tokens_for_ai} Generate a human-readable feedback message based on the following:",
+        },
+        {
+            "role": "user",
+            "content": f"Question: {question}\nResponse: {user_response}\nCategory: {category}",
+        },
+    ]
+
+    try:
+        completion = openai_client.chat.completions.create(
+            model="gpt-4o-mini", messages=messages, max_tokens=250, temperature=0.7
+        )
+        feedback = completion.choices[0].message.content.strip()
+        return feedback
+    except Exception as e:
+        return f"Error: {e}"
+
+
+# Provide feedback based on the category
+def provide_feedback(
+    yaml_content, section_id, step_id, category, question, user_response
+):
+    section = next(
+        (s for s in yaml_content["sections"] if s["section_id"] == section_id), None
+    )
+    if not section:
+        return "Section not found."
+
+    step = next((s for s in section["steps"] if s["step_id"] == step_id), None)
+    if not step:
+        return "Step not found."
+
+    transition = step["transitions"].get(category, None)
+    if not transition:
+        return "Category not found."
+
+    feedback = "\n".join(transition["content_blocks"])
+    if "ai_feedback" in transition:
+        tokens_for_ai = (
+            step["tokens_for_ai"] + " " + transition["ai_feedback"]["tokens_for_ai"]
+        )
+        ai_feedback = generate_ai_feedback(
+            category, question, user_response, tokens_for_ai
+        )
+        feedback += f"\n\nAI Feedback: {ai_feedback}"
+
+    return feedback
+
+
 if __name__ == "__main__":
     import argparse
 
diff --git a/migrations/versions/d04950c5a624_add_activitystate_table2.py b/migrations/versions/d04950c5a624_add_activitystate_table2.py
new file mode 100644
index 0000000..8950a1e
--- /dev/null
+++ b/migrations/versions/d04950c5a624_add_activitystate_table2.py
@@ -0,0 +1,34 @@
+"""Add ActivityState table2
+
+Revision ID: d04950c5a624
+Revises: d3631b8bb652
+Create Date: 2024-07-27 09:36:50.422693
+
+"""
+from alembic import op
+import sqlalchemy as sa
+
+
+# revision identifiers, used by Alembic.
+revision = "d04950c5a624"
+down_revision = "d3631b8bb652"
+branch_labels = None
+depends_on = None
+
+
+def upgrade():
+    # ### commands auto generated by Alembic - please adjust! ###
+    with op.batch_alter_table("activity_state", schema=None) as batch_op:
+        batch_op.add_column(
+            sa.Column("s3_file_path", sa.String(length=256), nullable=False)
+        )
+
+    # ### end Alembic commands ###
+
+
+def downgrade():
+    # ### commands auto generated by Alembic - please adjust! ###
+    with op.batch_alter_table("activity_state", schema=None) as batch_op:
+        batch_op.drop_column("s3_file_path")
+
+    # ### end Alembic commands ###
diff --git a/migrations/versions/d3631b8bb652_add_activitystate_table.py b/migrations/versions/d3631b8bb652_add_activitystate_table.py
new file mode 100644
index 0000000..926eb3a
--- /dev/null
+++ b/migrations/versions/d3631b8bb652_add_activitystate_table.py
@@ -0,0 +1,41 @@
+"""Add ActivityState table
+
+Revision ID: d3631b8bb652
+Revises: 190d5ef26e20
+Create Date: 2024-07-27 09:33:52.544550
+
+"""
+from alembic import op
+import sqlalchemy as sa
+
+
+# revision identifiers, used by Alembic.
+revision = "d3631b8bb652"
+down_revision = "190d5ef26e20"
+branch_labels = None
+depends_on = None
+
+
+def upgrade():
+    # ### commands auto generated by Alembic - please adjust! ###
+    op.create_table(
+        "activity_state",
+        sa.Column("id", sa.Integer(), nullable=False),
+        sa.Column("room_id", sa.Integer(), nullable=False),
+        sa.Column("section_id", sa.String(length=128), nullable=False),
+        sa.Column("step_id", sa.String(length=128), nullable=False),
+        sa.Column("attempts", sa.Integer(), nullable=True),
+        sa.Column("max_attempts", sa.Integer(), nullable=True),
+        sa.ForeignKeyConstraint(
+            ["room_id"],
+            ["room.id"],
+        ),
+        sa.PrimaryKeyConstraint("id"),
+    )
+    # ### end Alembic commands ###
+
+
+def downgrade():
+    # ### commands auto generated by Alembic - please adjust! ###
+    op.drop_table("activity_state")
+    # ### end Alembic commands ###
-- 
GitLab


From 5583e34e519a682c0ce95d5eeb3c25a062dbbfec Mon Sep 17 00:00:00 2001
From: Russell Ballestrini <russell.ballestrini@gmail.com>
Date: Sat, 27 Jul 2024 12:22:51 -0400
Subject: [PATCH 03/20] prompt engineering. 	modified:  
 research/guarded_ai.py

---
 research/guarded_ai.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/research/guarded_ai.py b/research/guarded_ai.py
index 3499cc9..668f450 100644
--- a/research/guarded_ai.py
+++ b/research/guarded_ai.py
@@ -16,7 +16,7 @@ def categorize_response(question, response, buckets, tokens_for_ai):
     messages = [
         {
             "role": "system",
-            "content": f"{tokens_for_ai} Categorize the following response into one of the following buckets: {bucket_list}.",
+            "content": f"{tokens_for_ai} Categorize the following response into one of the following buckets: {bucket_list}. Return ONLY a bucket label.",
         },
         {
             "role": "user",
@@ -28,7 +28,7 @@ def categorize_response(question, response, buckets, tokens_for_ai):
         completion = client.chat.completions.create(
             model="gpt-4o-mini",
             messages=messages,
-            max_tokens=10,
+            max_tokens=5,
             temperature=0,
         )
         category = (
-- 
GitLab


From ee5721a1fb7327fe31ffad77df1737d56f0da6f8 Mon Sep 17 00:00:00 2001
From: Russell Ballestrini <russell.ballestrini@gmail.com>
Date: Sat, 27 Jul 2024 13:56:20 -0400
Subject: [PATCH 04/20] default rubric for grading and scoring trivia.

displays at the end of game or when running `/activity info`.

	modified:   app.py
---
 app.py | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 115 insertions(+), 2 deletions(-)

diff --git a/app.py b/app.py
index fff1db6..1f84ce5 100644
--- a/app.py
+++ b/app.py
@@ -308,6 +308,10 @@ def handle_message(data):
     commands = data["message"].splitlines()
 
     for command in commands:
+        if command.startswith("/activity info"):
+            gevent.spawn(display_activity_info, room_name, data["username"])
+            # Exit early since we're displaying activity info
+            return
         if command.startswith("/activity"):
             s3_file_path = command.split(" ", 1)[1].strip()
             gevent.spawn(start_activity, room_name, s3_file_path, data["username"])
@@ -1864,8 +1868,9 @@ def handle_activity_response(room_name, user_response, username):
                     )
                 else:
                     # Activity completed
-                    db.session.delete(activity_state)
-                    db.session.commit()
+                    # Display activity info before completing
+                    display_activity_info(room_name, username)
+
                     socketio.emit(
                         "message",
                         {
@@ -1875,6 +1880,9 @@ def handle_activity_response(room_name, user_response, username):
                         },
                         room=room_name,
                     )
+
+                    db.session.delete(activity_state)
+                    db.session.commit()
             else:
                 activity_state.attempts += 1
                 db.session.add(activity_state)
@@ -1892,6 +1900,111 @@ def handle_activity_response(room_name, user_response, username):
             )
 
 
+def display_activity_info(room_name, username):
+    with app.app_context():
+        room = get_room(room_name)
+        activity_state = ActivityState.query.filter_by(room_id=room.id).first()
+
+        if not activity_state:
+            socketio.emit(
+                "message",
+                {
+                    "id": None,
+                    "username": "System",
+                    "content": "No active activity found.",
+                },
+                room=room_name,
+            )
+            return
+
+        # Load the activity YAML from S3
+        s3_client = boto3.client("s3")
+        bucket_name = os.environ.get("S3_BUCKET_NAME")
+        s3_file_path = activity_state.s3_file_path
+
+        try:
+            response = s3_client.get_object(Bucket=bucket_name, Key=s3_file_path)
+            activity_yaml = response["Body"].read().decode("utf-8")
+            activity_content = yaml.safe_load(activity_yaml)
+
+            # Fetch the entire room history
+            all_messages = Message.query.filter_by(room_id=room.id).order_by(Message.id.asc()).all()
+            chat_history = [
+                {
+                    "role": "system" if msg.username in system_users else "user",
+                    "username": msg.username,
+                    "content": msg.content,
+                }
+                for msg in all_messages
+            ]
+
+            # Prepare the rubric for grading
+            rubric = activity_content.get("tokens_for_ai_rubric", """
+                Grade the responses of all users based on the following criteria:
+                - Accuracy: How correct is the response?
+                - Completeness: Does the response fully address the question?
+                - Clarity: Is the response clear and easy to understand?
+                - Engagement: Is the response engaging and interesting?
+                Provide a score out of 10 for each criterion and an overall grade for each user.
+                Finally order each user by who is winning. Number of correct answers and accuracy & include an enumeration of the feats!
+            """)
+
+            # Generate the grading using the AI
+            grading_message = generate_grading(chat_history, rubric)
+
+            # Store and emit the activity info
+            info_message = f"Activity Info:\nCurrent Section: {activity_state.section_id}\nCurrent Step: {activity_state.step_id}\nAttempts: {activity_state.attempts}\n\n{grading_message}"
+            new_message = Message(username="System", content=info_message, room_id=room.id)
+            db.session.add(new_message)
+            db.session.commit()
+
+            socketio.emit(
+                "message",
+                {
+                    "id": new_message.id,
+                    "username": "System",
+                    "content": info_message,
+                },
+                room=room_name,
+            )
+
+        except Exception as e:
+            socketio.emit(
+                "message",
+                {
+                    "id": None,
+                    "username": "System",
+                    "content": f"Error displaying activity info: {e}",
+                },
+                room=room_name,
+            )
+            # Debugging: Log exception
+            print(f"Exception: {e}")
+
+
+def generate_grading(chat_history, rubric):
+    openai_client = OpenAI()
+    messages = [
+        {
+            "role": "system",
+            "content": f"Using the following rubric, grade the responses in the chat history:\n\n{rubric}",
+        },
+        {
+            "role": "user",
+            "content": f"Chat History:\n\n{json.dumps(chat_history, indent=2)}",
+        },
+    ]
+
+    try:
+        completion = openai_client.chat.completions.create(
+            model="gpt-4o-mini", messages=messages, max_tokens=1000, temperature=0.7
+        )
+        grading = completion.choices[0].message.content.strip()
+        return grading
+    except Exception as e:
+        return f"Error generating grading: {e}"
+
+
 def get_next_step(activity_content, current_section_id, current_step_id):
     for section in activity_content["sections"]:
         if section["section_id"] == current_section_id:
-- 
GitLab


From 692e34d090c0145aab24d3d26d63c7638bde5aea Mon Sep 17 00:00:00 2001
From: Russell Ballestrini <russell.ballestrini@gmail.com>
Date: Sat, 27 Jul 2024 14:14:34 -0400
Subject: [PATCH 05/20] repeat the question if not correct, after AI feedback 
 modified:   app.py

---
 app.py | 38 +++++++++++++++++++++++++++++++++-----
 1 file changed, 33 insertions(+), 5 deletions(-)

diff --git a/app.py b/app.py
index 1f84ce5..e3449ac 100644
--- a/app.py
+++ b/app.py
@@ -1811,7 +1811,7 @@ def handle_activity_response(room_name, user_response, username):
                 room=room_name,
             )
 
-            # Update the activity state
+            # if correct or max_attempts reached.
             if (
                 category == "correct"
                 or activity_state.attempts >= activity_state.max_attempts
@@ -1884,10 +1884,29 @@ def handle_activity_response(room_name, user_response, username):
                     db.session.delete(activity_state)
                     db.session.commit()
             else:
+                # the user response is any bucket other than correct.
                 activity_state.attempts += 1
                 db.session.add(activity_state)
                 db.session.commit()
 
+                # Emit the question again
+                question_content = f"Question: {step['question']}"
+                new_message = Message(
+                    username="System", content=question_content, room_id=room.id
+                )
+                db.session.add(new_message)
+                db.session.commit()
+
+                socketio.emit(
+                    "message",
+                    {
+                        "id": new_message.id,
+                        "username": "System",
+                        "content": question_content,
+                    },
+                    room=room_name,
+                )
+
         except Exception as e:
             socketio.emit(
                 "message",
@@ -1928,7 +1947,11 @@ def display_activity_info(room_name, username):
             activity_content = yaml.safe_load(activity_yaml)
 
             # Fetch the entire room history
-            all_messages = Message.query.filter_by(room_id=room.id).order_by(Message.id.asc()).all()
+            all_messages = (
+                Message.query.filter_by(room_id=room.id)
+                .order_by(Message.id.asc())
+                .all()
+            )
             chat_history = [
                 {
                     "role": "system" if msg.username in system_users else "user",
@@ -1939,7 +1962,9 @@ def display_activity_info(room_name, username):
             ]
 
             # Prepare the rubric for grading
-            rubric = activity_content.get("tokens_for_ai_rubric", """
+            rubric = activity_content.get(
+                "tokens_for_ai_rubric",
+                """
                 Grade the responses of all users based on the following criteria:
                 - Accuracy: How correct is the response?
                 - Completeness: Does the response fully address the question?
@@ -1947,14 +1972,17 @@ def display_activity_info(room_name, username):
                 - Engagement: Is the response engaging and interesting?
                 Provide a score out of 10 for each criterion and an overall grade for each user.
                 Finally order each user by who is winning. Number of correct answers and accuracy & include an enumeration of the feats!
-            """)
+            """,
+            )
 
             # Generate the grading using the AI
             grading_message = generate_grading(chat_history, rubric)
 
             # Store and emit the activity info
             info_message = f"Activity Info:\nCurrent Section: {activity_state.section_id}\nCurrent Step: {activity_state.step_id}\nAttempts: {activity_state.attempts}\n\n{grading_message}"
-            new_message = Message(username="System", content=info_message, room_id=room.id)
+            new_message = Message(
+                username="System", content=info_message, room_id=room.id
+            )
             db.session.add(new_message)
             db.session.commit()
 
-- 
GitLab


From 93f274ef39b37b67dbc3a8e9a6524d3d2ee797cc Mon Sep 17 00:00:00 2001
From: Russell Ballestrini <russell.ballestrini@gmail.com>
Date: Sat, 27 Jul 2024 15:37:29 -0400
Subject: [PATCH 06/20] 	modified:   app.py

---
 app.py | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/app.py b/app.py
index e3449ac..6c637e3 100644
--- a/app.py
+++ b/app.py
@@ -1816,9 +1816,6 @@ def handle_activity_response(room_name, user_response, username):
                 category == "correct"
                 or activity_state.attempts >= activity_state.max_attempts
             ):
-                print(
-                    f"Transitioning to next step. Category: {category}, Attempts: {activity_state.attempts}"
-                )
                 # Move to the next step or section
                 next_section, next_step = get_next_step(
                     activity_content, section["section_id"], step["step_id"]
@@ -1972,6 +1969,7 @@ def display_activity_info(room_name, username):
                 - Engagement: Is the response engaging and interesting?
                 Provide a score out of 10 for each criterion and an overall grade for each user.
                 Finally order each user by who is winning. Number of correct answers and accuracy & include an enumeration of the feats!
+                Take into account how many attempts the user took to get a passing answer when ranking.
             """,
             )
 
@@ -2053,12 +2051,6 @@ def get_next_step(activity_content, current_section_id, current_step_id):
     return None, None
 
 
-# Load the YAML activity file
-def load_yaml_activity(file_path):
-    with open(file_path, "r") as file:
-        return yaml.safe_load(file)
-
-
 # Categorize the user's response using gpt-4o-mini
 def categorize_response(question, response, buckets, tokens_for_ai):
     openai_client = OpenAI()
-- 
GitLab


From 7e97acf477782bfd883b48cbab3754c9f0b3f2d6 Mon Sep 17 00:00:00 2001
From: Russell Ballestrini <russell.ballestrini@gmail.com>
Date: Sat, 27 Jul 2024 15:49:19 -0400
Subject: [PATCH 07/20] content_blocks and questions support markdown values.

	modified:   research/activity10.yaml
---
 research/activity10.yaml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/research/activity10.yaml b/research/activity10.yaml
index cd8be71..72f222e 100644
--- a/research/activity10.yaml
+++ b/research/activity10.yaml
@@ -6,10 +6,10 @@ sections:
       - step_id: "step_1"
         title: "Who is Jesus?"
         content_blocks:
-          - "Welcome to the Miracles of Jesus course!"
+          - "Welcome to the **Miracles of Jesus** course!"
           - "Jesus is a central figure in Christianity, known for his teachings, compassion, and miraculous acts."
         tokens_for_ai: "Explain who Jesus is in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
-        question: "What do you know about Jesus?"
+        question: "**What do you know about Jesus?**"
         buckets:
           - correct
           - partial_understanding
@@ -43,7 +43,7 @@ sections:
           - "Miracles are extraordinary events that demonstrate divine intervention in the world."
           - "The miracles performed by Jesus are significant because they reveal his divine nature and compassion for humanity."
         tokens_for_ai: "Explain the importance of miracles in a friendly and engaging manner. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
-        question: "Why are the miracles of Jesus important?"
+        question: "**Why are the miracles of Jesus important?**"
         buckets:
           - correct
           - partial_understanding
-- 
GitLab


From cfa5d77a42b4faccb6bf1409264064df307f3118 Mon Sep 17 00:00:00 2001
From: Russell Ballestrini <russell.ballestrini@gmail.com>
Date: Sun, 28 Jul 2024 10:36:09 -0400
Subject: [PATCH 08/20] Allowing for non-linear progression depending on
 buckets category

new field in the transitions is next_section_and_step which is optional
and defaults to None but also can be "section_3:step_1"

	modified:   app.py
	new file:   research/activity0.yaml
	new file:   research/activity13-choose-adventure.yaml
	modified:   research/guarded_ai.py
---
 app.py                                    |  45 ++-
 research/activity0.yaml                   | 302 ++++++++++++++++++
 research/activity13-choose-adventure.yaml | 367 ++++++++++++++++++++++
 research/guarded_ai.py                    | 123 +++++---
 4 files changed, 779 insertions(+), 58 deletions(-)
 create mode 100644 research/activity0.yaml
 create mode 100644 research/activity13-choose-adventure.yaml

diff --git a/app.py b/app.py
index 6c637e3..dca9ed1 100644
--- a/app.py
+++ b/app.py
@@ -1741,7 +1741,6 @@ def start_activity(room_name, s3_file_path, username):
             room=room_name,
         )
 
-
 def handle_activity_response(room_name, user_response, username):
     with app.app_context():
         room = get_room(room_name)
@@ -1787,7 +1786,7 @@ def handle_activity_response(room_name, user_response, username):
             )
 
             # Provide feedback based on the category
-            feedback = provide_feedback(
+            feedback, next_section_and_step = provide_feedback(
                 activity_content,
                 section["section_id"],
                 step["step_id"],
@@ -1811,15 +1810,30 @@ def handle_activity_response(room_name, user_response, username):
                 room=room_name,
             )
 
-            # if correct or max_attempts reached.
+            # if "correct" or max_attempts reached.
             if (
-                category == "correct"
+                category
+                not in [
+                    "off_topic",
+                    "asking_clarifying_questions",
+                    "partial_understanding",
+                ]
                 or activity_state.attempts >= activity_state.max_attempts
             ):
-                # Move to the next step or section
-                next_section, next_step = get_next_step(
-                    activity_content, section["section_id"], step["step_id"]
-                )
+                if next_section_and_step:
+                    current_section_id, current_step_id = next_section_and_step.split(":")
+                    next_section = next(
+                        s for s in activity_content["sections"] if s["section_id"] == current_section_id
+                    )
+                    next_step = next(
+                        s for s in next_section["steps"] if s["step_id"] == current_step_id
+                    )
+                else:
+                    # Move to the next step or section
+                    next_section, next_step = get_next_step(
+                        activity_content, section["section_id"], step["step_id"]
+                    )
+
                 if next_step:
                     activity_state.section_id = next_section["section_id"]
                     activity_state.step_id = next_step["step_id"]
@@ -1864,8 +1878,8 @@ def handle_activity_response(room_name, user_response, username):
                         room=room_name,
                     )
                 else:
-                    # Activity completed
-                    # Display activity info before completing
+                    # Activity completed!
+                    # Display activity info before deleting.
                     display_activity_info(room_name, username)
 
                     socketio.emit(
@@ -1970,6 +1984,7 @@ def display_activity_info(room_name, username):
                 Provide a score out of 10 for each criterion and an overall grade for each user.
                 Finally order each user by who is winning. Number of correct answers and accuracy & include an enumeration of the feats!
                 Take into account how many attempts the user took to get a passing answer when ranking.
+                Don't just try to give the user a "B" or 35/40, really figure out a good placement considering some people don't know how to type.
             """,
             )
 
@@ -2109,7 +2124,6 @@ def generate_ai_feedback(category, question, user_response, tokens_for_ai):
         return f"Error: {e}"
 
 
-# Provide feedback based on the category
 def provide_feedback(
     yaml_content, section_id, step_id, category, question, user_response
 ):
@@ -2117,15 +2131,15 @@ def provide_feedback(
         (s for s in yaml_content["sections"] if s["section_id"] == section_id), None
     )
     if not section:
-        return "Section not found."
+        return "Section not found.", None
 
     step = next((s for s in section["steps"] if s["step_id"] == step_id), None)
     if not step:
-        return "Step not found."
+        return "Step not found.", None
 
     transition = step["transitions"].get(category, None)
     if not transition:
-        return "Category not found."
+        return "Category not found.", None
 
     feedback = "\n".join(transition["content_blocks"])
     if "ai_feedback" in transition:
@@ -2137,7 +2151,8 @@ def provide_feedback(
         )
         feedback += f"\n\nAI Feedback: {ai_feedback}"
 
-    return feedback
+    next_section_and_step = transition.get("next_section_and_step", None)
+    return feedback, next_section_and_step
 
 
 if __name__ == "__main__":
diff --git a/research/activity0.yaml b/research/activity0.yaml
new file mode 100644
index 0000000..0d09cf6
--- /dev/null
+++ b/research/activity0.yaml
@@ -0,0 +1,302 @@
+default_max_attempts_per_step: 3
+sections:
+  - section_id: "section_1"
+    title: "Introduction to The GNU Manifesto"
+    steps:
+      - step_id: "step_1"
+        title: "What is The GNU Manifesto?"
+        content_blocks:
+          - "<img src='https://www.gnu.org/graphics/heckert_gnu.transp.small.png'>"
+          - "Welcome to the GNU Manifesto course! 👋"
+          - "The GNU Manifesto was written by Richard Stallman in 1985 to ask for support in developing the GNU operating system."
+          - "Think about why someone might want to create a free operating system. Consider issues like software freedom, collaboration, and accessibility."
+        tokens_for_ai: "Guide the student to think about the reasons for creating a free operating system. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why do you think Richard Stallman wanted to create a free operating system? 🤔"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You have a good understanding of why Richard Stallman wanted to create a free operating system. 🎉"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning. Use emojis like 👍 and 🌟."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points. 🤔"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner. Use emojis like 🤔 and 📚."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the reasons for creating a free operating system. 🔄"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of the reasons for creating a free operating system in a supportive manner. Use emojis like 🔄 and 🧭."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them. ❓"
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."
+
+      - step_id: "step_2"
+        title: "Importance of The GNU Manifesto"
+        content_blocks:
+          - "The GNU Manifesto is important because it laid the foundation for the Free Software Movement."
+          - "It emphasizes the importance of software freedom, collaboration, and user rights."
+          - "Think about how having free software might benefit users and developers. Consider aspects like cost, accessibility, and innovation."
+        tokens_for_ai: "Guide the student to think about the benefits of free software. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How do you think free software benefits users and developers? 🤔"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the benefits of free software. 🎉"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning. Use emojis like 👍 and 🌟."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points. 🤔"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner. Use emojis like 🤔 and 📚."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the benefits of free software. 🔄"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of the benefits of free software in a supportive manner. Use emojis like 🔄 and 🧭."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them. ❓"
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."
+
+  - section_id: "section_2"
+    title: "Key Concepts of The GNU Manifesto"
+    steps:
+      - step_id: "step_1"
+        title: "What is GNU?"
+        content_blocks:
+          - "GNU stands for 'Gnu's Not Unix' and is a free Unix-compatible software system."
+          - "Richard Stallman and other volunteers are developing GNU to provide a free alternative to proprietary Unix systems."
+          - "Think about why it might be important for GNU to be compatible with Unix. Consider aspects like user familiarity, software compatibility, and ease of adoption."
+        tokens_for_ai: "Guide the student to think about the importance of GNU being compatible with Unix. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why do you think it is important for GNU to be compatible with Unix? 🤔"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand the importance of GNU being compatible with Unix. 🎉"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning. Use emojis like 👍 and 🌟."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points. 🤔"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner. Use emojis like 🤔 and 📚."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the importance of GNU being compatible with Unix. 🔄"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of the importance of GNU being compatible with Unix in a supportive manner. Use emojis like 🔄 and 🧭."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them. ❓"
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."
+
+      - step_id: "step_2"
+        title: "Why GNU Will Be Free"
+        content_blocks:
+          - "GNU is not in the public domain, but it will be free for everyone to use, modify, and redistribute."
+          - "No distributor will be allowed to restrict its further redistribution, ensuring that all versions of GNU remain free."
+          - "Think about why it might be important for GNU to remain free. Consider aspects like user rights, collaboration, and innovation."
+        tokens_for_ai: "Guide the student to think about the importance of GNU remaining free. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why do you think it is important for GNU to remain free? 🤔"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand the importance of GNU remaining free. 🎉"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning. Use emojis like 👍 and 🌟."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points. 🤔"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner. Use emojis like 🤔 and 📚."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the importance of GNU remaining free. 🔄"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of the importance of GNU remaining free in a supportive manner. Use emojis like 🔄 and 🧭."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them. ❓"
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."
+
+  - section_id: "section_3"
+    title: "Contributing to GNU"
+    steps:
+      - step_id: "step_1"
+        title: "How to Contribute"
+        content_blocks:
+          - "There are many ways to contribute to the GNU Project, including donating money, programs, and work."
+          - "Think about why it might be important for people to contribute to the GNU Project. Consider aspects like community, collaboration, and shared goals."
+        tokens_for_ai: "Guide the student to think about the importance of contributing to the GNU Project. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "Why do you think it is important for people to contribute to the GNU Project? 🤔"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand the importance of contributing to the GNU Project. 🎉"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning. Use emojis like 👍 and 🌟."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points. 🤔"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner. Use emojis like 🤔 and 📚."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the importance of contributing to the GNU Project. 🔄"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of the importance of contributing to the GNU Project in a supportive manner. Use emojis like 🔄 and 🧭."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them. ❓"
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."
+
+      - step_id: "step_2"
+        title: "Ways to Contribute"
+        content_blocks:
+          - "You can contribute to the GNU Project by writing code, fixing bugs, improving documentation, and more."
+          - "Think about how your skills and interests might align with the needs of the GNU Project. How can you make a meaningful contribution?"
+        tokens_for_ai: "Guide the student to think about how they can contribute to the GNU Project based on their skills and interests. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How do you think you can contribute to the GNU Project based on your skills and interests? 🤔"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You have a good idea of how you can contribute to the GNU Project. 🎉"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning. Use emojis like 👍 and 🌟."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points. 🤔"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner. Use emojis like 🤔 and 📚."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on how you can contribute to the GNU Project. 🔄"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of how they can contribute to the GNU Project in a supportive manner. Use emojis like 🔄 and 🧭."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them. ❓"
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."
+
+  - section_id: "section_4"
+    title: "Legacy of The GNU Manifesto"
+    steps:
+      - step_id: "step_1"
+        title: "Impact on Software Development"
+        content_blocks:
+          - "The GNU Manifesto has had a profound impact on software development, promoting the principles of free software and user rights."
+          - "Think about how the principles of the GNU Manifesto might have influenced modern software development practices. Consider aspects like open source, collaboration, and innovation."
+        tokens_for_ai: "Guide the student to think about the impact of the GNU Manifesto on modern software development. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How do you think the principles of the GNU Manifesto have influenced modern software development practices? 🤔"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Great! You understand the impact of the GNU Manifesto on modern software development. 🎉"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning. Use emojis like 👍 and 🌟."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points. 🤔"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner. Use emojis like 🤔 and 📚."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the impact of the GNU Manifesto. 🔄"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of the impact of the GNU Manifesto in a supportive manner. Use emojis like 🔄 and 🧭."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them. ❓"
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."
+
+      - step_id: "step_2"
+        title: "Future of Free Software"
+        content_blocks:
+          - "The principles of the GNU Manifesto continue to inspire the Free Software Movement and the development of free software."
+          - "Think about how the principles of free software might shape the future of technology. Consider aspects like user rights, innovation, and collaboration."
+        tokens_for_ai: "Guide the student to think about the future of free software and its impact on technology. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
+        question: "How do you think the principles of free software will shape the future of technology? 🤔"
+        buckets:
+          - correct
+          - partial_understanding
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          correct:
+            content_blocks:
+              - "Excellent! You understand how the principles of free software might shape the future of technology. 🎉"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and encourage the student to continue learning. Use emojis like 👍 and 🌟."
+          partial_understanding:
+            content_blocks:
+              - "You have a partial understanding. Let's clarify a few points. 🤔"
+            ai_feedback:
+              tokens_for_ai: "Provide additional information to clarify the student's understanding in a friendly and supportive manner. Use emojis like 🤔 and 📚."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the future of free software. 🔄"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the student back to the topic of the future of free software in a supportive manner. Use emojis like 🔄 and 🧭."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them. ❓"
+            ai_feedback:
+              tokens_for_ai: "Answer the student's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."
+
+  - section_id: "section_5"
+    title: "Congratulations!"
+    steps:
+      - step_id: "step_1"
+        title: "Well Done!"
+        content_blocks:
+          - "Congratulations on completing the GNU Manifesto course! 🎉"
+          - "You have learned about the key concepts, principles, and impact of the GNU Manifesto."
+          - "This knowledge will help you understand the importance of software freedom and the Free Software Movement."
+          - "We are proud of your dedication and hard work. Well done! 🌟"
+
diff --git a/research/activity13-choose-adventure.yaml b/research/activity13-choose-adventure.yaml
new file mode 100644
index 0000000..ccbcd86
--- /dev/null
+++ b/research/activity13-choose-adventure.yaml
@@ -0,0 +1,367 @@
+default_max_attempts_per_step: 3
+tokens_for_ai_rubric: "You are a master storyteller. Your task is to create a coherent and engaging story based on the following chat history. The story should seamlessly integrate the user's responses and the AI's feedback, ensuring that the narrative flows naturally. Pay special attention to the user's choices and how they shape the story. Use descriptive language to bring the scenes to life and make the story immersive. The story should have a clear beginning, middle, and end, reflecting the user's journey and the outcomes of their decisions. Here is the chat history.
+
+sections:
+  - section_id: "section_1"
+    title: "The Adventure Begins"
+    steps:
+      - step_id: "step_1"
+        title: "Setting the Scene"
+        content_blocks:
+          - "Welcome to the Story Builder game! 🌟"
+          - "You are about to embark on an exciting adventure. Your choices will shape the story."
+          - "Let's begin by setting the scene. Imagine you are in a dense forest, and you come across a fork in the path."
+          - "To the left, the path leads deeper into the forest, where you hear the sound of a flowing river. To the right, the path leads to a clearing with a mysterious glowing light."
+        tokens_for_ai: "Guide the user to make a choice between the two paths. Provide feedback based on their choice."
+        question: "Which path do you choose? Left (forest) or Right (clearing)? 🤔"
+        buckets:
+          - left_forest
+          - right_clearing
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          left_forest:
+            content_blocks:
+              - "You chose to go left, deeper into the forest. 🌲"
+              - "As you walk, the sound of the river grows louder. You soon find yourself at the edge of a beautiful, sparkling river."
+              - "You notice a small boat tied to a tree. Do you take the boat and explore the river, or do you follow the riverbank on foot?"
+            next_section_and_step: "section_2:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
+          right_clearing:
+            content_blocks:
+              - "You chose to go right, towards the clearing. 🌟"
+              - "As you approach the clearing, the glowing light becomes brighter. You find a magical portal shimmering in the air."
+              - "Do you step through the portal to see where it leads, or do you stay and explore the clearing?"
+            next_section_and_step: "section_3:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the story. 🔄"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the story in a supportive manner. Use emojis like 🔄 and 🧭."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them. ❓"
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."
+
+  - section_id: "section_2"
+    title: "The Forest Path"
+    steps:
+      - step_id: "step_1"
+        title: "Encounter at the River"
+        content_blocks:
+          - "You chose to go left, deeper into the forest. 🌲"
+          - "As you walk, the sound of the river grows louder. You soon find yourself at the edge of a beautiful, sparkling river."
+          - "You notice a small boat tied to a tree. Do you take the boat and explore the river, or do you follow the riverbank on foot?"
+        tokens_for_ai: "Guide the user to make a choice between taking the boat or following the riverbank. Provide feedback based on their choice."
+        question: "What do you choose? Take the boat or Follow the riverbank? 🤔"
+        buckets:
+          - take_boat
+          - follow_riverbank
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          take_boat:
+            content_blocks:
+              - "You chose to take the boat and explore the river. 🚣"
+              - "As you paddle down the river, you encounter a group of friendly forest creatures who offer to guide you to a hidden treasure."
+              - "Congratulations! You have discovered a hidden treasure with the help of your new friends. 🎉"
+            next_section_and_step: "section_4:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
+          follow_riverbank:
+            content_blocks:
+              - "You chose to follow the riverbank on foot. 🌲"
+              - "As you walk along the river, you find a hidden cave entrance. Inside, you discover ancient artifacts and a map to a secret location."
+              - "Congratulations! You have discovered ancient artifacts and a secret map. 🎉"
+            next_section_and_step: "section_5:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the story. 🔄"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the story in a supportive manner. Use emojis like 🔄 and 🧭."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them. ❓"
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."
+
+  - section_id: "section_3"
+    title: "The Clearing Path"
+    steps:
+      - step_id: "step_1"
+        title: "The Magical Portal"
+        content_blocks:
+          - "You chose to go right, towards the clearing. 🌟"
+          - "As you approach the clearing, the glowing light becomes brighter. You find a magical portal shimmering in the air."
+          - "Do you step through the portal to see where it leads, or do you stay and explore the clearing?"
+        tokens_for_ai: "Guide the user to make a choice between stepping through the portal or exploring the clearing. Provide feedback based on their choice."
+        question: "What do you choose? Step through the portal or Explore the clearing? 🤔"
+        buckets:
+          - step_through_portal
+          - explore_clearing
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          step_through_portal:
+            content_blocks:
+              - "You chose to step through the portal. 🌟"
+              - "You find yourself in a magical realm filled with wonders and mysteries. A wise old wizard offers to teach you powerful spells."
+              - "Congratulations! You have entered a magical realm and begun your training as a wizard. 🎉"
+            next_section_and_step: "section_6:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
+          explore_clearing:
+            content_blocks:
+              - "You chose to explore the clearing. 🌲"
+              - "You find a hidden garden filled with rare and beautiful plants. A friendly gardener offers to share their knowledge with you."
+              - "Congratulations! You have discovered a hidden garden and gained valuable knowledge. 🎉"
+            next_section_and_step: "section_7:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the story. 🔄"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the story in a supportive manner. Use emojis like 🔄 and 🧭."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them. ❓"
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."
+
+  - section_id: "section_4"
+    title: "The Boat Adventure"
+    steps:
+      - step_id: "step_1"
+        title: "The Hidden Treasure"
+        content_blocks:
+          - "You chose to take the boat and explore the river. 🚣"
+          - "As you paddle down the river, you encounter a group of friendly forest creatures who offer to guide you to a hidden treasure."
+          - "You find the hidden treasure chest. Do you open the treasure or leave it?"
+        tokens_for_ai: "Guide the user to make a choice between opening the treasure or leaving it. Provide feedback based on their choice."
+        question: "What do you choose? Open the treasure or Leave it? 🤔"
+        buckets:
+          - open_treasure
+          - leave_treasure
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          open_treasure:
+            content_blocks:
+              - "You chose to open the treasure. 🎉"
+              - "Inside, you find gold coins, precious gems, and a magical artifact that grants you a special power."
+              - "Congratulations! You have discovered a hidden treasure and gained a special power. 🎉"
+            next_section_and_step: "section_8:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to the final encounter. Use emojis like 👍 and 🌟."
+          leave_treasure:
+            content_blocks:
+              - "You chose to leave the treasure. 🌲"
+              - "You decide that the adventure itself is the real treasure and continue your journey with a sense of fulfillment."
+              - "Congratulations! You have completed the adventure with a sense of fulfillment. 🎉"
+            next_section_and_step: "section_8:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to the final encounter. Use emojis like 👍 and 🌟."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the story. 🔄"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the story in a supportive manner. Use emojis like 🔄 and 🧭."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them. ❓"
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."
+
+  - section_id: "section_5"
+    title: "The Riverbank Adventure"
+    steps:
+      - step_id: "step_1"
+        title: "The Hidden Cave"
+        content_blocks:
+          - "You chose to follow the riverbank on foot. 🌲"
+          - "As you walk along the river, you find a hidden cave entrance. Inside, you discover ancient artifacts and a map to a secret location."
+          - "Do you enter the cave or continue walking along the riverbank?"
+        tokens_for_ai: "Guide the user to make a choice between entering the cave or continuing to walk. Provide feedback based on their choice."
+        question: "What do you choose? Enter the cave or Continue walking? 🤔"
+        buckets:
+          - enter_cave
+          - continue_walking
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          enter_cave:
+            content_blocks:
+              - "You chose to enter the cave. 🌲"
+              - "Inside, you find ancient artifacts and a map to a secret location. You feel a sense of discovery and excitement."
+              - "Congratulations! You have discovered ancient artifacts and a secret map. 🎉"
+            next_section_and_step: "section_8:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to the final encounter. Use emojis like 👍 and 🌟."
+          continue_walking:
+            content_blocks:
+              - "You chose to continue walking along the riverbank. 🌲"
+              - "As you walk, you find a beautiful waterfall and a hidden path leading to a secret garden."
+              - "Congratulations! You have discovered a hidden garden and gained valuable knowledge. 🎉"
+            next_section_and_step: "section_8:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to the final encounter. Use emojis like 👍 and 🌟."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the story. 🔄"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the story in a supportive manner. Use emojis like 🔄 and 🧭."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them. ❓"
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."
+
+  - section_id: "section_6"
+    title: "The Portal Adventure"
+    steps:
+      - step_id: "step_1"
+        title: "The Magical Realm"
+        content_blocks:
+          - "You chose to step through the portal. 🌟"
+          - "You find yourself in a magical realm filled with wonders and mysteries. A wise old wizard offers to teach you powerful spells."
+          - "Do you learn spells from the wizard or explore the magical realm on your own?"
+        tokens_for_ai: "Guide the user to make a choice between learning spells or exploring the realm. Provide feedback based on their choice."
+        question: "What do you choose? Learn spells or Explore the realm? 🤔"
+        buckets:
+          - learn_spells
+          - explore_realm
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          learn_spells:
+            content_blocks:
+              - "You chose to learn spells from the wizard. 🌟"
+              - "The wizard teaches you powerful spells that grant you special abilities. You feel a sense of empowerment and wonder."
+              - "Congratulations! You have learned powerful spells and gained special abilities. 🎉"
+            next_section_and_step: "section_8:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to the final encounter. Use emojis like 👍 and 🌟."
+          explore_realm:
+            content_blocks:
+              - "You chose to explore the magical realm on your own. 🌟"
+              - "As you explore, you discover hidden treasures and magical creatures. You feel a sense of adventure and excitement."
+              - "Congratulations! You have discovered hidden treasures and magical creatures. 🎉"
+            next_section_and_step: "section_8:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to the final encounter. Use emojis like 👍 and 🌟."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the story. 🔄"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the story in a supportive manner. Use emojis like 🔄 and 🧭."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them. ❓"
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."
+
+  - section_id: "section_7"
+    title: "The Clearing Adventure"
+    steps:
+      - step_id: "step_1"
+        title: "The Hidden Garden"
+        content_blocks:
+          - "You chose to explore the clearing. 🌲"
+          - "You find a hidden garden filled with rare and beautiful plants. A friendly gardener offers to share their knowledge with you."
+          - "Do you talk to the gardener or explore the garden on your own?"
+        tokens_for_ai: "Guide the user to make a choice between talking to the gardener or exploring the garden. Provide feedback based on their choice."
+        question: "What do you choose? Talk to the gardener or Explore the garden? 🤔"
+        buckets:
+          - talk_gardener
+          - explore_garden
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          talk_gardener:
+            content_blocks:
+              - "You chose to talk to the gardener. 🌲"
+              - "The gardener shares their knowledge of rare plants and their magical properties. You feel a sense of wonder and curiosity."
+              - "Congratulations! You have gained valuable knowledge about rare plants and their magical properties. 🎉"
+            next_section_and_step: "section_8:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to the final encounter. Use emojis like 👍 and 🌟."
+          explore_garden:
+            content_blocks:
+              - "You chose to explore the garden on your own. 🌲"
+              - "As you explore, you discover hidden paths and secret areas filled with rare plants and magical creatures. You feel a sense of adventure and excitement."
+              - "Congratulations! You have discovered hidden paths and secret areas in the garden. 🎉"
+            next_section_and_step: "section_8:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to the final encounter. Use emojis like 👍 and 🌟."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the story. 🔄"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the story in a supportive manner. Use emojis like 🔄 and 🧭."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them. ❓"
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."
+
+  - section_id: "section_8"
+    title: "The Final Choices"
+    steps:
+      - step_id: "step_1"
+        title: "The Final Encounter"
+        content_blocks:
+          - "You have reached the final part of your adventure. Your choices have led you to this moment."
+          - "You are presented with a final choice: accept a reward for your journey or decline it and continue your adventure."
+          - "Think about what you have learned and experienced. What will you choose?"
+        tokens_for_ai: "Guide the user to make a final choice between accepting the reward or declining it. Provide feedback based on their choice."
+        question: "What do you choose? Accept the reward or Decline the reward? 🤔"
+        buckets:
+          - accept_reward
+          - decline_reward
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          accept_reward:
+            content_blocks:
+              - "You chose to accept the reward. 🎉"
+              - "You are given a magical artifact that grants you special powers and a sense of accomplishment."
+              - "Congratulations! You have completed your adventure and received a magical reward. 🎉"
+            next_section_and_step: "section_9:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and conclude the story. Use emojis like 👍 and 🌟."
+          decline_reward:
+            content_blocks:
+              - "You chose to decline the reward. 🌲"
+              - "You decide that the journey itself was the true reward and continue your adventure with a sense of fulfillment."
+              - "Congratulations! You have completed your adventure with a sense of fulfillment. 🎉"
+            next_section_and_step: "section_9:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and conclude the story. Use emojis like 👍 and 🌟."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the story. 🔄"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the story in a supportive manner. Use emojis like 🔄 and 🧭."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them. ❓"
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."
+
+  - section_id: "section_9"
+    title: "Congratulations!"
+    steps:
+      - step_id: "step_1"
+        title: "Well Done!"
+        content_blocks:
+          - "Congratulations on completing the Story Builder game! 🎉"
+          - "You have made choices that shaped an exciting adventure."
+          - "We hope you enjoyed the journey and the story you helped create."
+          - "We are proud of your creativity and imagination. Well done! 🌟"
diff --git a/research/guarded_ai.py b/research/guarded_ai.py
index 668f450..c794c37 100644
--- a/research/guarded_ai.py
+++ b/research/guarded_ai.py
@@ -90,7 +90,8 @@ def provide_feedback(
         )
         feedback += f"\n\nAI Feedback: {ai_feedback}"
 
-    return feedback
+    next_section_and_step = transition.get("next_section_and_step", None)
+    return feedback, next_section_and_step
 
 
 # Simulate the activity
@@ -98,49 +99,85 @@ def simulate_activity(yaml_file_path):
     yaml_content = load_yaml_activity(yaml_file_path)
     max_attempts = yaml_content.get("default_max_attempts_per_step", 3)
 
-    for section in yaml_content["sections"]:
-        print(f"\nSection: {section['title']}\n")
-        for step in section["steps"]:
-            # Print all content blocks once per step
-            if "content_blocks" in step:
-                for block in step["content_blocks"]:
-                    print(block)
+    current_section_index = 0
+    current_step_index = 0
+
+    while current_section_index < len(yaml_content["sections"]):
+        section = yaml_content["sections"][current_section_index]
+        if current_step_index >= len(section["steps"]):
+            current_section_index += 1
+            current_step_index = 0
+            continue
+
+        step = section["steps"][current_step_index]
+
+        # Print all content blocks once per step
+        if "content_blocks" in step:
+            for block in step["content_blocks"]:
+                print(block)
+        if "question" in step:
+            question = step["question"]
+        else:
+            # Skip classification and feedback if there's no question
+            current_step_index += 1
+            continue
+
+        attempts = 0
+        while attempts < max_attempts:
             if "question" in step:
-                question = step["question"]
-            else:
-                # Skip classification and feedback if there's no question
-                continue
-
-            attempts = 0
-            while attempts < max_attempts:
-                if "question" in step:
-                    print(f"\nQuestion: {question}")
-
-                user_response = input("\nYour Response: ")
-
-                category = categorize_response(
-                    question, user_response, step["buckets"], step["tokens_for_ai"]
-                )
-                print(f"\nCategory: {category}")
-
-                feedback = provide_feedback(
-                    yaml_content,
-                    section["section_id"],
-                    step["step_id"],
-                    category,
-                    question,
-                    user_response,
-                )
-                print(f"\nFeedback: {feedback}")
-
-                if category == "correct":
-                    break
-
-                attempts += 1
-
-            if attempts == max_attempts:
-                print("\nMaximum attempts reached. Moving to the next step.")
+                print(f"\nQuestion: {question}")
+
+            user_response = input("\nYour Response: ")
+
+            category = categorize_response(
+                question, user_response, step["buckets"], step["tokens_for_ai"]
+            )
+            print(f"\nCategory: {category}")
+
+            feedback, next_section_and_step = provide_feedback(
+                yaml_content,
+                section["section_id"],
+                step["step_id"],
+                category,
+                question,
+                user_response,
+            )
+            print(f"\nFeedback: {feedback}")
+
+            if category not in [
+                "off_topic",
+                "asking_clarifying_questions",
+                "partial_understanding",
+            ]:
+                break
+
+            attempts += 1
+
+        if attempts == max_attempts:
+            print("\nMaximum attempts reached. Moving to the next step.")
+
+        if next_section_and_step:
+            current_section_id, current_step_id = next_section_and_step.split(":")
+            current_section_index = next(
+                (
+                    index
+                    for index, s in enumerate(yaml_content["sections"])
+                    if s["section_id"] == current_section_id
+                ),
+                current_section_index,
+            )
+            current_step_index = next(
+                (
+                    index
+                    for index, s in enumerate(section["steps"])
+                    if s["step_id"] == current_step_id
+                ),
+                current_step_index,
+            )
+        else:
+            current_step_index += 1
 
 
 if __name__ == "__main__":
-    simulate_activity("activity12.yaml")
+    #simulate_activity("activity13-choose-adventure.yaml")
+    simulate_activity("activity0.yaml")
-- 
GitLab


From 02c97beebe6316c47c36dcd95a354208ef00a6f4 Mon Sep 17 00:00:00 2001
From: Russell Ballestrini <russell.ballestrini@gmail.com>
Date: Sun, 28 Jul 2024 11:04:30 -0400
Subject: [PATCH 09/20] fix defect when step has no question.

	modified:   app.py
	modified:   research/activity13-choose-adventure.yaml
---
 app.py                                    | 113 +++++++++++++++++-----
 research/activity13-choose-adventure.yaml |   3 +-
 2 files changed, 93 insertions(+), 23 deletions(-)

diff --git a/app.py b/app.py
index dca9ed1..ba7a76b 100644
--- a/app.py
+++ b/app.py
@@ -1769,6 +1769,75 @@ def handle_activity_response(room_name, user_response, username):
                 s for s in section["steps"] if s["step_id"] == activity_state.step_id
             )
 
+            # Check if the step has a question
+            if "question" not in step:
+                # Move to the next step or section
+                next_section, next_step = get_next_step(
+                    activity_content, section["section_id"], step["step_id"]
+                )
+
+                if next_step:
+                    activity_state.section_id = next_section["section_id"]
+                    activity_state.step_id = next_step["step_id"]
+                    activity_state.attempts = 0
+
+                    db.session.add(activity_state)
+                    db.session.commit()
+
+                    # Emit the new step content blocks
+                    content = "\n\n".join(next_step["content_blocks"])
+                    new_message = Message(
+                        username="System", content=content, room_id=room.id
+                    )
+                    db.session.add(new_message)
+                    db.session.commit()
+
+                    socketio.emit(
+                        "message",
+                        {
+                            "id": new_message.id,
+                            "username": "System",
+                            "content": content,
+                        },
+                        room=room_name,
+                    )
+
+                    # Emit the new question if it exists
+                    if "question" in next_step:
+                        question_content = f"Question: {next_step['question']}"
+                        new_message = Message(
+                            username="System", content=question_content, room_id=room.id
+                        )
+                        db.session.add(new_message)
+                        db.session.commit()
+
+                        socketio.emit(
+                            "message",
+                            {
+                                "id": new_message.id,
+                                "username": "System",
+                                "content": question_content,
+                            },
+                            room=room_name,
+                        )
+                else:
+                    # Display activity info before completing
+                    display_activity_info(room_name, username)
+
+                    # Activity completed
+                    db.session.delete(activity_state)
+                    db.session.commit()
+                    socketio.emit(
+                        "message",
+                        {
+                            "id": None,
+                            "username": "System",
+                            "content": "Activity completed!",
+                        },
+                        room=room_name,
+                    )
+                return
+
             # Categorize the user's response
             category = categorize_response(
                 step["question"], user_response, step["buckets"], step["tokens_for_ai"]
@@ -1860,28 +1929,31 @@ def handle_activity_response(room_name, user_response, username):
                         room=room_name,
                     )
 
-                    # Emit the new question
-                    question_content = f"Question: {next_step['question']}"
-                    new_message = Message(
-                        username="System", content=question_content, room_id=room.id
-                    )
-                    db.session.add(new_message)
-                    db.session.commit()
-
-                    socketio.emit(
-                        "message",
-                        {
-                            "id": new_message.id,
-                            "username": "System",
-                            "content": question_content,
-                        },
-                        room=room_name,
-                    )
+                    # Emit the new question if it exists
+                    if "question" in next_step:
+                        question_content = f"Question: {next_step['question']}"
+                        new_message = Message(
+                            username="System", content=question_content, room_id=room.id
+                        )
+                        db.session.add(new_message)
+                        db.session.commit()
+
+                        socketio.emit(
+                            "message",
+                            {
+                                "id": new_message.id,
+                                "username": "System",
+                                "content": question_content,
+                            },
+                            room=room_name,
+                        )
                 else:
-                    # Activity completed!
-                    # Display activity info before deleting.
+                    # Display activity info before completing
                     display_activity_info(room_name, username)
 
+                    # Activity completed
+                    db.session.delete(activity_state)
+                    db.session.commit()
                     socketio.emit(
                         "message",
                         {
@@ -1891,9 +1963,6 @@ def handle_activity_response(room_name, user_response, username):
                         },
                         room=room_name,
                     )
-
-                    db.session.delete(activity_state)
-                    db.session.commit()
             else:
                 # the user response is any bucket other than correct.
                 activity_state.attempts += 1
diff --git a/research/activity13-choose-adventure.yaml b/research/activity13-choose-adventure.yaml
index ccbcd86..fecb4d0 100644
--- a/research/activity13-choose-adventure.yaml
+++ b/research/activity13-choose-adventure.yaml
@@ -1,5 +1,6 @@
 default_max_attempts_per_step: 3
-tokens_for_ai_rubric: "You are a master storyteller. Your task is to create a coherent and engaging story based on the following chat history. The story should seamlessly integrate the user's responses and the AI's feedback, ensuring that the narrative flows naturally. Pay special attention to the user's choices and how they shape the story. Use descriptive language to bring the scenes to life and make the story immersive. The story should have a clear beginning, middle, and end, reflecting the user's journey and the outcomes of their decisions. Here is the chat history.
+tokens_for_ai_rubric: |
+    You are a master storyteller. Your task is to create a coherent and engaging story based on the following chat history. The story should seamlessly integrate the user's responses and the AI's feedback, ensuring that the narrative flows naturally. Pay special attention to the user's choices and how they shape the story. Use descriptive language to bring the scenes to life and make the story immersive. The story should have a clear beginning, middle, and end, reflecting the user's journey and the outcomes of their decisions. Here is the chat history.
 
 sections:
   - section_id: "section_1"
-- 
GitLab


From 7e7b226fb19e09e7ef24913fb491d0c8cb51fa38 Mon Sep 17 00:00:00 2001
From: Russell Ballestrini <russell.ballestrini@gmail.com>
Date: Sun, 28 Jul 2024 11:28:44 -0400
Subject: [PATCH 10/20] print content blocks and skip the llm logic if no
 question in step.

	modified:   research/guarded_ai.py
---
 research/guarded_ai.py | 90 ++++++++++++++++++++++++++----------------
 1 file changed, 55 insertions(+), 35 deletions(-)

diff --git a/research/guarded_ai.py b/research/guarded_ai.py
index c794c37..a2bb5d9 100644
--- a/research/guarded_ai.py
+++ b/research/guarded_ai.py
@@ -94,38 +94,72 @@ def provide_feedback(
     return feedback, next_section_and_step
 
 
+# Get the next step in the activity
+def get_next_step(activity_content, current_section_id, current_step_id):
+    for section in activity_content["sections"]:
+        if section["section_id"] == current_section_id:
+            for i, step in enumerate(section["steps"]):
+                if step["step_id"] == current_step_id:
+                    if i + 1 < len(section["steps"]):
+                        return section, section["steps"][i + 1]
+                    else:
+                        # Move to the next section
+                        next_section_index = (
+                            activity_content["sections"].index(section) + 1
+                        )
+                        if next_section_index < len(activity_content["sections"]):
+                            next_section = activity_content["sections"][
+                                next_section_index
+                            ]
+                            return next_section, next_section["steps"][0]
+    return None, None
+
+
 # Simulate the activity
 def simulate_activity(yaml_file_path):
     yaml_content = load_yaml_activity(yaml_file_path)
     max_attempts = yaml_content.get("default_max_attempts_per_step", 3)
 
-    current_section_index = 0
-    current_step_index = 0
-
-    while current_section_index < len(yaml_content["sections"]):
-        section = yaml_content["sections"][current_section_index]
-        if current_step_index >= len(section["steps"]):
-            current_section_index += 1
-            current_step_index = 0
-            continue
+    current_section_id = yaml_content["sections"][0]["section_id"]
+    current_step_id = yaml_content["sections"][0]["steps"][0]["step_id"]
+
+    while current_section_id and current_step_id:
+        section = next(
+            (
+                s
+                for s in yaml_content["sections"]
+                if s["section_id"] == current_section_id
+            ),
+            None,
+        )
+        if not section:
+            print("Section not found.")
+            break
 
-        step = section["steps"][current_step_index]
+        step = next(
+            (s for s in section["steps"] if s["step_id"] == current_step_id), None
+        )
+        if not step:
+            print("Step not found.")
+            break
 
         # Print all content blocks once per step
         if "content_blocks" in step:
             for block in step["content_blocks"]:
                 print(block)
-        if "question" in step:
-            question = step["question"]
-        else:
-            # Skip classification and feedback if there's no question
-            current_step_index += 1
+
+        # Skip classification and feedback if there's no question
+        if "question" not in step:
+            current_section_id, current_step_id = get_next_step(
+                yaml_content, current_section_id, current_step_id
+            )
             continue
 
+        question = step["question"]
+
         attempts = 0
         while attempts < max_attempts:
-            if "question" in step:
-                print(f"\nQuestion: {question}")
+            print(f"\nQuestion: {question}")
 
             user_response = input("\nYour Response: ")
 
@@ -158,26 +192,12 @@ def simulate_activity(yaml_file_path):
 
         if next_section_and_step:
             current_section_id, current_step_id = next_section_and_step.split(":")
-            current_section_index = next(
-                (
-                    index
-                    for index, s in enumerate(yaml_content["sections"])
-                    if s["section_id"] == current_section_id
-                ),
-                current_section_index,
-            )
-            current_step_index = next(
-                (
-                    index
-                    for index, s in enumerate(section["steps"])
-                    if s["step_id"] == current_step_id
-                ),
-                current_step_index,
-            )
         else:
-            current_step_index += 1
+            current_section_id, current_step_id = get_next_step(
+                yaml_content, current_section_id, current_step_id
+            )
 
 
 if __name__ == "__main__":
-    #simulate_activity("activity13-choose-adventure.yaml")
+    # simulate_activity("activity13-choose-adventure.yaml")
     simulate_activity("activity0.yaml")
-- 
GitLab


From 684f3df38e8f2efdeeb4953ff2cd2e96b77b49b5 Mon Sep 17 00:00:00 2001
From: Russell Ballestrini <russell.ballestrini@gmail.com>
Date: Sun, 28 Jul 2024 11:59:40 -0400
Subject: [PATCH 11/20] fix defect/regression with linear activities

	modified:   guarded_ai.py
---
 research/guarded_ai.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/research/guarded_ai.py b/research/guarded_ai.py
index a2bb5d9..ec6f7db 100644
--- a/research/guarded_ai.py
+++ b/research/guarded_ai.py
@@ -94,14 +94,13 @@ def provide_feedback(
     return feedback, next_section_and_step
 
 
-# Get the next step in the activity
-def get_next_step(activity_content, current_section_id, current_step_id):
+def get_next_section_and_step(activity_content, current_section_id, current_step_id):
     for section in activity_content["sections"]:
         if section["section_id"] == current_section_id:
             for i, step in enumerate(section["steps"]):
                 if step["step_id"] == current_step_id:
                     if i + 1 < len(section["steps"]):
-                        return section, section["steps"][i + 1]
+                        return section["section_id"], section["steps"][i + 1]["step_id"]
                     else:
                         # Move to the next section
                         next_section_index = (
@@ -111,7 +110,10 @@ def get_next_step(activity_content, current_section_id, current_step_id):
                             next_section = activity_content["sections"][
                                 next_section_index
                             ]
-                            return next_section, next_section["steps"][0]
+                            return (
+                                next_section["section_id"],
+                                next_section["steps"][0]["step_id"],
+                            )
     return None, None
 
 
@@ -124,6 +126,7 @@ def simulate_activity(yaml_file_path):
     current_step_id = yaml_content["sections"][0]["steps"][0]["step_id"]
 
     while current_section_id and current_step_id:
+        print(f"Current section: {current_section_id}, Current step: {current_step_id}")
         section = next(
             (
                 s
@@ -193,7 +196,7 @@ def simulate_activity(yaml_file_path):
         if next_section_and_step:
             current_section_id, current_step_id = next_section_and_step.split(":")
         else:
-            current_section_id, current_step_id = get_next_step(
+            current_section_id, current_step_id = get_next_section_and_step(
                 yaml_content, current_section_id, current_step_id
             )
 
-- 
GitLab


From 8d771e8b069d1129ce82b0211cf1ad337701281d Mon Sep 17 00:00:00 2001
From: Russell Ballestrini <russell.ballestrini@gmail.com>
Date: Sun, 28 Jul 2024 12:54:32 -0400
Subject: [PATCH 12/20] allow user to ask question and explore longer

instead of 3 turns per step allow for 30
---
 research/activity13-choose-adventure.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/research/activity13-choose-adventure.yaml b/research/activity13-choose-adventure.yaml
index fecb4d0..b15b8e2 100644
--- a/research/activity13-choose-adventure.yaml
+++ b/research/activity13-choose-adventure.yaml
@@ -1,4 +1,5 @@
-default_max_attempts_per_step: 3
+default_max_attempts_per_step: 30
+
 tokens_for_ai_rubric: |
     You are a master storyteller. Your task is to create a coherent and engaging story based on the following chat history. The story should seamlessly integrate the user's responses and the AI's feedback, ensuring that the narrative flows naturally. Pay special attention to the user's choices and how they shape the story. Use descriptive language to bring the scenes to life and make the story immersive. The story should have a clear beginning, middle, and end, reflecting the user's journey and the outcomes of their decisions. Here is the chat history.
 
-- 
GitLab


From 0462de73686d887faf8c1d21bfd78d0935bc21e1 Mon Sep 17 00:00:00 2001
From: Russell Ballestrini <russell.ballestrini@gmail.com>
Date: Sun, 28 Jul 2024 13:13:57 -0400
Subject: [PATCH 13/20] Activity Mode documented

---
 README.rst | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/README.rst b/README.rst
index 841be94..47e2fcd 100644
--- a/README.rst
+++ b/README.rst
@@ -143,6 +143,28 @@ Structure
 - ``chat.html``: The HTML template for the chatroom interface.
 - ``static/``: Directory for static files like CSS, JavaScript, and images.
 - ``templates/``: Directory for HTML templates.
+- ``research/``: Guarded AI activities or processes. Example YAMLs.
+
+
+Activity Mode
+--------------
+
+Activity mode is an interactive experience where users can engage with a guided AI to learn and answer questions.
+
+The AI provides feedback based on the user's responses and guides them through different sections and steps of an activity.
+
+This mode is designed to be on the "rails", educational, & engaging.
+
+The server expects to load the YAML file out of the S3 bucket you specify in your environment variables.
+
+1. **Start an Activity**: Use the ``/activity`` command followed by the object path to the activity YAML file to start a new activity.
+
+    ``/activity path-to-activity.yaml``
+
+2. **Display Activity Info**: Use the ``/activity info`` command to display information about the current activity, including grading and user performance.
+
+    ``/activity info``
+
 
 Contributing
 ------------
-- 
GitLab


From 2fc774d85cb36c8859a0824d2824f824ead8377a Mon Sep 17 00:00:00 2001
From: Russell Ballestrini <russell.ballestrini@gmail.com>
Date: Sun, 28 Jul 2024 13:59:25 -0400
Subject: [PATCH 14/20] /activity cancel 	modified:   README.rst 
 modified:   app.py

---
 README.rst |  5 +++++
 app.py     | 50 +++++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 52 insertions(+), 3 deletions(-)

diff --git a/README.rst b/README.rst
index 47e2fcd..2baa833 100644
--- a/README.rst
+++ b/README.rst
@@ -165,6 +165,11 @@ The server expects to load the YAML file out of the S3 bucket you specify in you
 
     ``/activity info``
 
+3. **Cancel an Activity**: Use the ``/activity cancel`` command to display cancel the current activity running in the room.
+
+    ``/activity cancel``
+
+
 
 Contributing
 ------------
diff --git a/app.py b/app.py
index ba7a76b..3e976e2 100644
--- a/app.py
+++ b/app.py
@@ -312,6 +312,10 @@ def handle_message(data):
             gevent.spawn(display_activity_info, room_name, data["username"])
             # Exit early since we're displaying activity info
             return
+        if command.startswith("/activity cancel"):
+            gevent.spawn(cancel_activity, room_name, data["username"])
+            # Exit early since we're canceling the activity
+            return
         if command.startswith("/activity"):
             s3_file_path = command.split(" ", 1)[1].strip()
             gevent.spawn(start_activity, room_name, s3_file_path, data["username"])
@@ -1741,6 +1745,40 @@ def start_activity(room_name, s3_file_path, username):
             room=room_name,
         )
 
+
+def cancel_activity(room_name, username):
+    with app.app_context():
+        room = get_room(room_name)
+        activity_state = ActivityState.query.filter_by(room_id=room.id).first()
+
+        if not activity_state:
+            socketio.emit(
+                "message",
+                {
+                    "id": None,
+                    "username": "System",
+                    "content": "No active activity found to cancel.",
+                },
+                room=room_name,
+            )
+            return
+
+        # Delete the activity state
+        db.session.delete(activity_state)
+        db.session.commit()
+
+        # Emit a message indicating the activity has been canceled
+        socketio.emit(
+            "message",
+            {
+                "id": None,
+                "username": "System",
+                "content": "Activity has been canceled.",
+            },
+            room=room_name,
+        )
+
+
 def handle_activity_response(room_name, user_response, username):
     with app.app_context():
         room = get_room(room_name)
@@ -1890,12 +1928,18 @@ def handle_activity_response(room_name, user_response, username):
                 or activity_state.attempts >= activity_state.max_attempts
             ):
                 if next_section_and_step:
-                    current_section_id, current_step_id = next_section_and_step.split(":")
+                    current_section_id, current_step_id = next_section_and_step.split(
+                        ":"
+                    )
                     next_section = next(
-                        s for s in activity_content["sections"] if s["section_id"] == current_section_id
+                        s
+                        for s in activity_content["sections"]
+                        if s["section_id"] == current_section_id
                     )
                     next_step = next(
-                        s for s in next_section["steps"] if s["step_id"] == current_step_id
+                        s
+                        for s in next_section["steps"]
+                        if s["step_id"] == current_step_id
                     )
                 else:
                     # Move to the next step or section
-- 
GitLab


From e3b3ddb007c7796ee9483c2fcbca30ad41180da3 Mon Sep 17 00:00:00 2001
From: Russell Ballestrini <russell.ballestrini@gmail.com>
Date: Sun, 28 Jul 2024 15:07:34 -0400
Subject: [PATCH 15/20] allow player to go back if they change their minds,
 less "rails".

	modified:   research/activity13-choose-adventure.yaml
---
 research/activity13-choose-adventure.yaml | 56 +++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/research/activity13-choose-adventure.yaml b/research/activity13-choose-adventure.yaml
index b15b8e2..e67a1c7 100644
--- a/research/activity13-choose-adventure.yaml
+++ b/research/activity13-choose-adventure.yaml
@@ -63,6 +63,7 @@ sections:
         buckets:
           - take_boat
           - follow_riverbank
+          - go_back
           - off_topic
           - asking_clarifying_questions
         transitions:
@@ -82,6 +83,13 @@ sections:
             next_section_and_step: "section_5:step_1"
             ai_feedback:
               tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
+          go_back:
+            content_blocks:
+              - "You chose to go back to the fork in the path. 🔄"
+              - "You are now back at the fork. To the left, the path leads deeper into the forest, where you hear the sound of a flowing river. To the right, the path leads to a clearing with a mysterious glowing light."
+            next_section_and_step: "section_1:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
           off_topic:
             content_blocks:
               - "It seems like your response is off-topic. Let's try to stay focused on the story. 🔄"
@@ -107,6 +115,7 @@ sections:
         buckets:
           - step_through_portal
           - explore_clearing
+          - go_back
           - off_topic
           - asking_clarifying_questions
         transitions:
@@ -126,6 +135,13 @@ sections:
             next_section_and_step: "section_7:step_1"
             ai_feedback:
               tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
+          go_back:
+            content_blocks:
+              - "You chose to go back to the fork in the path. 🔄"
+              - "You are now back at the fork. To the left, the path leads deeper into the forest, where you hear the sound of a flowing river. To the right, the path leads to a clearing with a mysterious glowing light."
+            next_section_and_step: "section_1:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
           off_topic:
             content_blocks:
               - "It seems like your response is off-topic. Let's try to stay focused on the story. 🔄"
@@ -151,6 +167,7 @@ sections:
         buckets:
           - open_treasure
           - leave_treasure
+          - go_back
           - off_topic
           - asking_clarifying_questions
         transitions:
@@ -170,6 +187,13 @@ sections:
             next_section_and_step: "section_8:step_1"
             ai_feedback:
               tokens_for_ai: "Provide positive reinforcement and guide the user to the final encounter. Use emojis like 👍 and 🌟."
+          go_back:
+            content_blocks:
+              - "You chose to go back to the river. 🔄"
+              - "You are now back at the river. Do you take the boat and explore the river, or do you follow the riverbank on foot?"
+            next_section_and_step: "section_2:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
           off_topic:
             content_blocks:
               - "It seems like your response is off-topic. Let's try to stay focused on the story. 🔄"
@@ -195,6 +219,7 @@ sections:
         buckets:
           - enter_cave
           - continue_walking
+          - go_back
           - off_topic
           - asking_clarifying_questions
         transitions:
@@ -214,6 +239,13 @@ sections:
             next_section_and_step: "section_8:step_1"
             ai_feedback:
               tokens_for_ai: "Provide positive reinforcement and guide the user to the final encounter. Use emojis like 👍 and 🌟."
+          go_back:
+            content_blocks:
+              - "You chose to go back to the river. 🔄"
+              - "You are now back at the river. Do you take the boat and explore the river, or do you follow the riverbank on foot?"
+            next_section_and_step: "section_2:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
           off_topic:
             content_blocks:
               - "It seems like your response is off-topic. Let's try to stay focused on the story. 🔄"
@@ -239,6 +271,7 @@ sections:
         buckets:
           - learn_spells
           - explore_realm
+          - go_back
           - off_topic
           - asking_clarifying_questions
         transitions:
@@ -258,6 +291,13 @@ sections:
             next_section_and_step: "section_8:step_1"
             ai_feedback:
               tokens_for_ai: "Provide positive reinforcement and guide the user to the final encounter. Use emojis like 👍 and 🌟."
+          go_back:
+            content_blocks:
+              - "You chose to go back to the clearing. 🔄"
+              - "You are now back at the clearing. Do you step through the portal to see where it leads, or do you stay and explore the clearing?"
+            next_section_and_step: "section_3:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
           off_topic:
             content_blocks:
               - "It seems like your response is off-topic. Let's try to stay focused on the story. 🔄"
@@ -283,6 +323,7 @@ sections:
         buckets:
           - talk_gardener
           - explore_garden
+          - go_back
           - off_topic
           - asking_clarifying_questions
         transitions:
@@ -302,6 +343,13 @@ sections:
             next_section_and_step: "section_8:step_1"
             ai_feedback:
               tokens_for_ai: "Provide positive reinforcement and guide the user to the final encounter. Use emojis like 👍 and 🌟."
+          go_back:
+            content_blocks:
+              - "You chose to go back to the clearing. 🔄"
+              - "You are now back at the clearing. Do you step through the portal to see where it leads, or do you stay and explore the clearing?"
+            next_section_and_step: "section_3:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
           off_topic:
             content_blocks:
               - "It seems like your response is off-topic. Let's try to stay focused on the story. 🔄"
@@ -327,6 +375,7 @@ sections:
         buckets:
           - accept_reward
           - decline_reward
+          - go_back
           - off_topic
           - asking_clarifying_questions
         transitions:
@@ -346,6 +395,13 @@ sections:
             next_section_and_step: "section_9:step_1"
             ai_feedback:
               tokens_for_ai: "Provide positive reinforcement and conclude the story. Use emojis like 👍 and 🌟."
+          go_back:
+            content_blocks:
+              - "You chose to go back to the previous step. 🔄"
+              - "You are now back at the previous step. Think about what you have learned and experienced. What will you choose?"
+            next_section_and_step: "section_8:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
           off_topic:
             content_blocks:
               - "It seems like your response is off-topic. Let's try to stay focused on the story. 🔄"
-- 
GitLab


From 5d10296f1fa85414173c81dcadfb629443c2d67c Mon Sep 17 00:00:00 2001
From: Russell Ballestrini <russell.ballestrini@gmail.com>
Date: Sun, 28 Jul 2024 19:14:54 -0400
Subject: [PATCH 16/20] escape room mechanics with json_metadata for
 temporarily collecting data

based on where the user has went we can for example set a key: true if
they collected a key needed to access a section's steps.

	modified:   app.py
	new file:   migrations/versions/d737de68d6fa_add_metadata_field_to_activitystate.py
	new file:   research/activity14-choose-adventure.yaml
---
 app.py                                        | 419 +++++++++++-------
 ...6fa_add_metadata_field_to_activitystate.py |  32 ++
 research/activity14-choose-adventure.yaml     | 234 ++++++++++
 3 files changed, 537 insertions(+), 148 deletions(-)
 create mode 100644 migrations/versions/d737de68d6fa_add_metadata_field_to_activitystate.py
 create mode 100644 research/activity14-choose-adventure.yaml

diff --git a/app.py b/app.py
index 3e976e2..0f3859a 100644
--- a/app.py
+++ b/app.py
@@ -107,6 +107,22 @@ class ActivityState(db.Model):
     attempts = db.Column(db.Integer, default=0)
     max_attempts = db.Column(db.Integer, default=3)
     s3_file_path = db.Column(db.String(256), nullable=False)
+    json_metadata = db.Column(db.UnicodeText, default="{}")
+
+    @property
+    def _json_metadata(self):
+        if self.json_metadata:
+            return json.loads(self.json_metadata)
+        return {}
+
+    @_json_metadata.setter
+    def _json_metadata(self, value):
+        self.json_metadata = json.dumps(value)
+
+    def update_metadata(self, key, value):
+        metadata = self._json_metadata
+        metadata[key] = value
+        self._json_metadata = metadata
 
 
 def get_room(room_name):
@@ -1808,43 +1824,54 @@ def handle_activity_response(room_name, user_response, username):
             )
 
             # Check if the step has a question
-            if "question" not in step:
-                # Move to the next step or section
-                next_section, next_step = get_next_step(
-                    activity_content, section["section_id"], step["step_id"]
+            if "question" in step:
+                # Categorize the user's response
+                category = categorize_response(
+                    step["question"],
+                    user_response,
+                    step["buckets"],
+                    step["tokens_for_ai"],
                 )
 
-                if next_step:
-                    activity_state.section_id = next_section["section_id"]
-                    activity_state.step_id = next_step["step_id"]
-                    activity_state.attempts = 0
-
-                    db.session.add(activity_state)
-                    db.session.commit()
+                # Emit the category to the frontend
+                socketio.emit(
+                    "message",
+                    {
+                        "id": None,
+                        "username": "System",
+                        "content": f"Category: {category}",
+                    },
+                    room=room_name,
+                )
 
-                    # Emit the new step content blocks
-                    content = "\n\n".join(next_step["content_blocks"])
-                    new_message = Message(
-                        username="System", content=content, room_id=room.id
-                    )
-                    db.session.add(new_message)
-                    db.session.commit()
-
-                    socketio.emit(
-                        "message",
-                        {
-                            "id": new_message.id,
-                            "username": "System",
-                            "content": content,
-                        },
-                        room=room_name,
+                # Check metadata conditions for the current step
+                if "metadata_conditions" in step["transitions"][category]:
+                    conditions_met = all(
+                        activity_state._json_metadata.get(key) == value
+                        for key, value in step["transitions"][category][
+                            "metadata_conditions"
+                        ].items()
                     )
+                    if not conditions_met:
+                        # Emit a message indicating the conditions are not met
+                        socketio.emit(
+                            "message",
+                            {
+                                "id": None,
+                                "username": "System",
+                                "content": "You do not have the required items to proceed.",
+                            },
+                            room=room_name,
+                        )
+                        # Remind the user of what they can do in the room
+                        content_blocks = step.get("content_blocks", [])
+                        question = step.get("question", "")
+                        options_message = (
+                            "\n\n".join(content_blocks) + "\n\n" + question
+                        )
 
-                    # Emit the new question if it exists
-                    if "question" in next_step:
-                        question_content = f"Question: {next_step['question']}"
                         new_message = Message(
-                            username="System", content=question_content, room_id=room.id
+                            username="System", content=options_message, room_id=room.id
                         )
                         db.session.add(new_message)
                         db.session.commit()
@@ -1854,79 +1881,185 @@ def handle_activity_response(room_name, user_response, username):
                             {
                                 "id": new_message.id,
                                 "username": "System",
-                                "content": question_content,
+                                "content": options_message,
+                            },
+                            room=room_name,
+                        )
+                        return
+
+                # Provide feedback based on the category
+                feedback, next_section_and_step = provide_feedback(
+                    activity_content,
+                    section["section_id"],
+                    step["step_id"],
+                    category,
+                    step["question"],
+                    user_response,
+                )
+
+                # Store and emit the feedback
+                new_message = Message(
+                    username="System", content=feedback, room_id=room.id
+                )
+                db.session.add(new_message)
+                db.session.commit()
+
+                socketio.emit(
+                    "message",
+                    {
+                        "id": new_message.id,
+                        "username": "System",
+                        "content": feedback,
+                    },
+                    room=room_name,
+                )
+
+                # Update metadata based on user actions
+                if "metadata_updates" in step["transitions"][category]:
+                    print(f"metadata_updates in step/category")
+                    for key, value in step["transitions"][category][
+                        "metadata_updates"
+                    ].items():
+                        print(f"{key}: {value}")
+                        activity_state.update_metadata(key, value)
+
+                    # Commit the changes after the loop
+                    db.session.add(activity_state)
+                    db.session.commit()
+
+                # Log the updated metadata
+                print(f"Updated metadata: {activity_state._json_metadata}")
+
+                # if "correct" or max_attempts reached.
+                if (
+                    category
+                    not in [
+                        "off_topic",
+                        "asking_clarifying_questions",
+                        "partial_understanding",
+                    ]
+                    or activity_state.attempts >= activity_state.max_attempts
+                ):
+                    if next_section_and_step:
+                        (
+                            current_section_id,
+                            current_step_id,
+                        ) = next_section_and_step.split(":")
+                        next_section = next(
+                            s
+                            for s in activity_content["sections"]
+                            if s["section_id"] == current_section_id
+                        )
+                        next_step = next(
+                            s
+                            for s in next_section["steps"]
+                            if s["step_id"] == current_step_id
+                        )
+
+                        if next_step:
+                            activity_state.section_id = next_section["section_id"]
+                            activity_state.step_id = next_step["step_id"]
+                            activity_state.attempts = 0
+
+                            db.session.add(activity_state)
+                            db.session.commit()
+
+                            # Emit the new step content blocks
+                            content = "\n\n".join(next_step["content_blocks"])
+                            new_message = Message(
+                                username="System", content=content, room_id=room.id
+                            )
+                            db.session.add(new_message)
+                            db.session.commit()
+
+                            socketio.emit(
+                                "message",
+                                {
+                                    "id": new_message.id,
+                                    "username": "System",
+                                    "content": content,
+                                },
+                                room=room_name,
+                            )
+
+                            # Emit the new question if it exists
+                            if "question" in next_step:
+                                question_content = f"Question: {next_step['question']}"
+                                new_message = Message(
+                                    username="System",
+                                    content=question_content,
+                                    room_id=room.id,
+                                )
+                                db.session.add(new_message)
+                                db.session.commit()
+
+                                socketio.emit(
+                                    "message",
+                                    {
+                                        "id": new_message.id,
+                                        "username": "System",
+                                        "content": question_content,
+                                    },
+                                    room=room_name,
+                                )
+                        else:
+                            # Display activity info before completing
+                            display_activity_info(room_name, username)
+
+                            # Activity completed
+                            db.session.delete(activity_state)
+                            db.session.commit()
+                            socketio.emit(
+                                "message",
+                                {
+                                    "id": None,
+                                    "username": "System",
+                                    "content": "Activity completed!",
+                                },
+                                room=room_name,
+                            )
+                    else:
+                        # Display activity info before completing
+                        display_activity_info(room_name, username)
+
+                        # Activity completed
+                        db.session.delete(activity_state)
+                        db.session.commit()
+                        socketio.emit(
+                            "message",
+                            {
+                                "id": None,
+                                "username": "System",
+                                "content": "Activity completed!",
                             },
                             room=room_name,
                         )
                 else:
-                    # Display activity info before completing
-                    display_activity_info(room_name, username)
+                    # the user response is any bucket other than correct.
+                    activity_state.attempts += 1
+                    db.session.add(activity_state)
+                    db.session.commit()
 
-                    # Activity completed
-                    db.session.delete(activity_state)
+                    # Emit the question again
+                    question_content = f"Question: {step['question']}"
+                    new_message = Message(
+                        username="System", content=question_content, room_id=room.id
+                    )
+                    db.session.add(new_message)
                     db.session.commit()
+
                     socketio.emit(
                         "message",
                         {
-                            "id": None,
+                            "id": new_message.id,
                             "username": "System",
-                            "content": "Activity completed!",
+                            "content": question_content,
                         },
                         room=room_name,
                     )
-                return
-
-            # Categorize the user's response
-            category = categorize_response(
-                step["question"], user_response, step["buckets"], step["tokens_for_ai"]
-            )
-
-            # Emit the category to the frontend
-            socketio.emit(
-                "message",
-                {
-                    "id": None,
-                    "username": "System",
-                    "content": f"Category: {category}",
-                },
-                room=room_name,
-            )
-
-            # Provide feedback based on the category
-            feedback, next_section_and_step = provide_feedback(
-                activity_content,
-                section["section_id"],
-                step["step_id"],
-                category,
-                step["question"],
-                user_response,
-            )
-
-            # Store and emit the feedback
-            new_message = Message(username="System", content=feedback, room_id=room.id)
-            db.session.add(new_message)
-            db.session.commit()
-
-            socketio.emit(
-                "message",
-                {
-                    "id": new_message.id,
-                    "username": "System",
-                    "content": feedback,
-                },
-                room=room_name,
-            )
-
-            # if "correct" or max_attempts reached.
-            if (
-                category
-                not in [
-                    "off_topic",
-                    "asking_clarifying_questions",
-                    "partial_understanding",
-                ]
-                or activity_state.attempts >= activity_state.max_attempts
-            ):
+            else:
+                # Handle steps without a question
+                next_section_and_step = step.get("next_section_and_step")
                 if next_section_and_step:
                     current_section_id, current_step_id = next_section_and_step.split(
                         ":"
@@ -1941,43 +2074,19 @@ def handle_activity_response(room_name, user_response, username):
                         for s in next_section["steps"]
                         if s["step_id"] == current_step_id
                     )
-                else:
-                    # Move to the next step or section
-                    next_section, next_step = get_next_step(
-                        activity_content, section["section_id"], step["step_id"]
-                    )
 
-                if next_step:
-                    activity_state.section_id = next_section["section_id"]
-                    activity_state.step_id = next_step["step_id"]
-                    activity_state.attempts = 0
-
-                    db.session.add(activity_state)
-                    db.session.commit()
-
-                    # Emit the new step content blocks
-                    content = "\n\n".join(next_step["content_blocks"])
-                    new_message = Message(
-                        username="System", content=content, room_id=room.id
-                    )
-                    db.session.add(new_message)
-                    db.session.commit()
+                    if next_step:
+                        activity_state.section_id = next_section["section_id"]
+                        activity_state.step_id = next_step["step_id"]
+                        activity_state.attempts = 0
 
-                    socketio.emit(
-                        "message",
-                        {
-                            "id": new_message.id,
-                            "username": "System",
-                            "content": content,
-                        },
-                        room=room_name,
-                    )
+                        db.session.add(activity_state)
+                        db.session.commit()
 
-                    # Emit the new question if it exists
-                    if "question" in next_step:
-                        question_content = f"Question: {next_step['question']}"
+                        # Emit the new step content blocks
+                        content = "\n\n".join(next_step["content_blocks"])
                         new_message = Message(
-                            username="System", content=question_content, room_id=room.id
+                            username="System", content=content, room_id=room.id
                         )
                         db.session.add(new_message)
                         db.session.commit()
@@ -1987,7 +2096,44 @@ def handle_activity_response(room_name, user_response, username):
                             {
                                 "id": new_message.id,
                                 "username": "System",
-                                "content": question_content,
+                                "content": content,
+                            },
+                            room=room_name,
+                        )
+
+                        # Emit the new question if it exists
+                        if "question" in next_step:
+                            question_content = f"Question: {next_step['question']}"
+                            new_message = Message(
+                                username="System",
+                                content=question_content,
+                                room_id=room.id,
+                            )
+                            db.session.add(new_message)
+                            db.session.commit()
+
+                            socketio.emit(
+                                "message",
+                                {
+                                    "id": new_message.id,
+                                    "username": "System",
+                                    "content": question_content,
+                                },
+                                room=room_name,
+                            )
+                    else:
+                        # Display activity info before completing
+                        display_activity_info(room_name, username)
+
+                        # Activity completed
+                        db.session.delete(activity_state)
+                        db.session.commit()
+                        socketio.emit(
+                            "message",
+                            {
+                                "id": None,
+                                "username": "System",
+                                "content": "Activity completed!",
                             },
                             room=room_name,
                         )
@@ -2007,29 +2153,6 @@ def handle_activity_response(room_name, user_response, username):
                         },
                         room=room_name,
                     )
-            else:
-                # the user response is any bucket other than correct.
-                activity_state.attempts += 1
-                db.session.add(activity_state)
-                db.session.commit()
-
-                # Emit the question again
-                question_content = f"Question: {step['question']}"
-                new_message = Message(
-                    username="System", content=question_content, room_id=room.id
-                )
-                db.session.add(new_message)
-                db.session.commit()
-
-                socketio.emit(
-                    "message",
-                    {
-                        "id": new_message.id,
-                        "username": "System",
-                        "content": question_content,
-                    },
-                    room=room_name,
-                )
 
         except Exception as e:
             socketio.emit(
diff --git a/migrations/versions/d737de68d6fa_add_metadata_field_to_activitystate.py b/migrations/versions/d737de68d6fa_add_metadata_field_to_activitystate.py
new file mode 100644
index 0000000..0ac2450
--- /dev/null
+++ b/migrations/versions/d737de68d6fa_add_metadata_field_to_activitystate.py
@@ -0,0 +1,32 @@
+"""Add metadata field to ActivityState
+
+Revision ID: d737de68d6fa
+Revises: d04950c5a624
+Create Date: 2024-07-28 17:02:11.872502
+
+"""
+from alembic import op
+import sqlalchemy as sa
+
+
+# revision identifiers, used by Alembic.
+revision = "d737de68d6fa"
+down_revision = "d04950c5a624"
+branch_labels = None
+depends_on = None
+
+
+def upgrade():
+    # ### commands auto generated by Alembic - please adjust! ###
+    with op.batch_alter_table("activity_state", schema=None) as batch_op:
+        batch_op.add_column(sa.Column("json_metadata", sa.UnicodeText(), server_default="{}"))
+
+    # ### end Alembic commands ###
+
+
+def downgrade():
+    # ### commands auto generated by Alembic - please adjust! ###
+    with op.batch_alter_table("activity_state", schema=None) as batch_op:
+        batch_op.drop_column("json_metadata")
+
+    # ### end Alembic commands ###
diff --git a/research/activity14-choose-adventure.yaml b/research/activity14-choose-adventure.yaml
new file mode 100644
index 0000000..9d77ad4
--- /dev/null
+++ b/research/activity14-choose-adventure.yaml
@@ -0,0 +1,234 @@
+default_max_attempts_per_step: 30
+
+tokens_for_ai_rubric: |
+    You are a master storyteller. Your task is to create a coherent and engaging story based on the following chat history. The story should seamlessly integrate the user's responses and the AI's feedback, ensuring that the narrative flows naturally. Pay special attention to the user's choices and how they shape the story. Use descriptive language to bring the scenes to life and make the story immersive. The story should have a clear beginning, middle, and end, reflecting the user's journey and the outcomes of their decisions. Here is the chat history.
+
+sections:
+  - section_id: "section_1"
+    title: "The Escape Room Begins"
+    steps:
+      - step_id: "step_1"
+        title: "Waking Up"
+        content_blocks:
+          - "You wake up in a dimly lit room with no memory of how you got there. The room is small and has a single door that is locked."
+          - "You see a rug on the floor, a bookshelf with a book, and a safe on the wall."
+          - "What do you do first? Look under the rug, examine the book, or try to open the safe?"
+        tokens_for_ai: "Guide the user to make a choice between looking under the rug, examining the book, or trying to open the safe. Provide feedback based on their choice."
+        question: "What do you choose? Look under the rug, Examine the book, or Try to open the safe? 🤔"
+        buckets:
+          - look_under_rug
+          - examine_book
+          - try_open_safe
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          look_under_rug:
+            content_blocks:
+              - "You chose to look under the rug. 🧺"
+              - "You find a key hidden under the rug."
+              - "Do you take the key or continue exploring the room?"
+            next_section_and_step: "section_2:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
+            metadata_updates:
+              key: true
+          examine_book:
+            content_blocks:
+              - "You chose to examine the book. 📖"
+              - "The book contains a note with a password: 'ESCAPE123'."
+              - "Do you take note of the password or continue exploring the room?"
+            next_section_and_step: "section_3:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
+            metadata_updates:
+              password: true
+          try_open_safe:
+            content_blocks:
+              - "You chose to try to open the safe. 🔒"
+              - "The safe is locked and requires both a key and a password to open."
+              - "Do you look under the rug, examine the book, or continue exploring the room?"
+            next_section_and_step: "section_4:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the story. 🔄"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the story in a supportive manner. Use emojis like 🔄 and 🧭."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them. ❓"
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."
+
+  - section_id: "section_2"
+    title: "The Key"
+    steps:
+      - step_id: "step_1"
+        title: "Found the Key"
+        content_blocks:
+          - "You chose to look under the rug. 🧺"
+          - "You find a key hidden under the rug."
+          - "Do you take the key or continue exploring the room?"
+        tokens_for_ai: "Guide the user to make a choice between taking the key or continuing to explore the room. Provide feedback based on their choice."
+        question: "What do you choose? Take the key or Continue exploring? 🤔"
+        buckets:
+          - take_key
+          - continue_exploring
+          - go_back
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          take_key:
+            content_blocks:
+              - "You chose to take the key. 🔑"
+              - "You now have the key. Do you examine the book or try to open the safe?"
+            next_section_and_step: "section_1:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
+            metadata_updates:
+              key: true
+          continue_exploring:
+            content_blocks:
+              - "You chose to continue exploring the room. 🕵️"
+              - "You see a rug on the floor, a bookshelf with a book, and a safe on the wall."
+              - "What do you do next? Examine the book or try to open the safe?"
+            next_section_and_step: "section_1:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
+          go_back:
+            content_blocks:
+              - "You chose to go back to the previous step. 🔄"
+              - "You are now back at the previous step. What do you choose? Look under the rug, Examine the book, or Try to open the safe?"
+            next_section_and_step: "section_1:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the story. 🔄"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the story in a supportive manner. Use emojis like 🔄 and 🧭."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them. ❓"
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."
+
+  - section_id: "section_3"
+    title: "The Book"
+    steps:
+      - step_id: "step_1"
+        title: "Found the Password"
+        content_blocks:
+          - "You chose to examine the book. 📖"
+          - "The book contains a note with a password: 'ESCAPE123'."
+          - "Do you take note of the password or continue exploring the room?"
+        tokens_for_ai: "Guide the user to make a choice between taking note of the password or continuing to explore the room. Provide feedback based on their choice."
+        question: "What do you choose? Take note of the password or Continue exploring? 🤔"
+        buckets:
+          - take_password
+          - continue_exploring
+          - go_back
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          take_password:
+            content_blocks:
+              - "You chose to take note of the password. 🔑"
+              - "You now have the password. Do you look under the rug or try to open the safe?"
+            next_section_and_step: "section_1:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
+            metadata_updates:
+              password: true
+          continue_exploring:
+            content_blocks:
+              - "You chose to continue exploring the room. 🕵️"
+              - "You see a rug on the floor, a bookshelf with a book, and a safe on the wall."
+              - "What do you do next? Look under the rug or try to open the safe?"
+            next_section_and_step: "section_1:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
+          go_back:
+            content_blocks:
+              - "You chose to go back to the previous step. 🔄"
+              - "You are now back at the previous step. What do you choose? Look under the rug, Examine the book, or Try to open the safe?"
+            next_section_and_step: "section_1:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the story. 🔄"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the story in a supportive manner. Use emojis like 🔄 and 🧭."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them. ❓"
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."
+
+  - section_id: "section_4"
+    title: "The Safe"
+    steps:
+      - step_id: "step_1"
+        title: "Opening the Safe"
+        content_blocks:
+          - "You chose to try to open the safe. 🔒"
+          - "The safe is locked and requires both a key and a password to open."
+          - "Do you use the key and enter the password to open the safe or continue exploring the room?"
+        tokens_for_ai: "Guide the user to make a choice between using the key and entering the password to open the safe or continuing to explore the room. Provide feedback based on their choice."
+        question: "What do you choose? Use the key and enter the password or Continue exploring? 🤔"
+        buckets:
+          - use_key_and_password
+          - continue_exploring
+          - go_back
+          - off_topic
+          - asking_clarifying_questions
+        transitions:
+          use_key_and_password:
+            metadata_conditions:
+              key: true
+              password: true
+            content_blocks:
+              - "You chose to use the key and enter the password to open the safe. 🔑"
+              - "The safe opens, revealing a hidden treasure."
+              - "Congratulations! You have found the hidden treasure. 🎉"
+            next_section_and_step: "section_5:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to the final encounter. Use emojis like 👍 and 🌟."
+          continue_exploring:
+            content_blocks:
+              - "You chose to continue exploring the room. 🕵️"
+              - "You see a rug on the floor, a bookshelf with a book, and a safe on the wall."
+              - "What do you do next? Look under the rug or examine the book?"
+            next_section_and_step: "section_1:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
+          go_back:
+            content_blocks:
+              - "You chose to go back to the previous step. 🔄"
+              - "You are now back at the previous step. Do you take note of the password or continue exploring the room?"
+            next_section_and_step: "section_3:step_1"
+            ai_feedback:
+              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
+          off_topic:
+            content_blocks:
+              - "It seems like your response is off-topic. Let's try to stay focused on the story. 🔄"
+            ai_feedback:
+              tokens_for_ai: "Gently guide the user back to the story in a supportive manner. Use emojis like 🔄 and 🧭."
+          asking_clarifying_questions:
+            content_blocks:
+              - "I see you have some questions. Let's address them. ❓"
+            ai_feedback:
+              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."
+
+  - section_id: "section_5"
+    title: "Congratulations!"
+    steps:
+      - step_id: "step_1"
+        title: "Well Done!"
+        content_blocks:
+          - "Congratulations on finding the hidden treasure! 🎉"
+          - "You have successfully completed the escape room."
+          - "We hope you enjoyed the adventure. 🌟"
+
-- 
GitLab


From 602039ca71b6600de8e017795ac63029d597dc3f Mon Sep 17 00:00:00 2001
From: Russell Ballestrini <russell.ballestrini@gmail.com>
Date: Sun, 28 Jul 2024 20:37:31 -0400
Subject: [PATCH 17/20] play tested and working

	modified:   app.py
---
 app.py | 85 +++++++++++++++++++++++++---------------------------------
 1 file changed, 37 insertions(+), 48 deletions(-)

diff --git a/app.py b/app.py
index 0f3859a..f74afc7 100644
--- a/app.py
+++ b/app.py
@@ -1955,19 +1955,45 @@ def handle_activity_response(room_name, user_response, username):
                             for s in next_section["steps"]
                             if s["step_id"] == current_step_id
                         )
+                    else:
+                        # Move to the next step or section
+                        next_section, next_step = get_next_step(
+                            activity_content, section["section_id"], step["step_id"]
+                        )
 
-                        if next_step:
-                            activity_state.section_id = next_section["section_id"]
-                            activity_state.step_id = next_step["step_id"]
-                            activity_state.attempts = 0
+                    if next_step:
+                        activity_state.section_id = next_section["section_id"]
+                        activity_state.step_id = next_step["step_id"]
+                        activity_state.attempts = 0
 
-                            db.session.add(activity_state)
-                            db.session.commit()
+                        db.session.add(activity_state)
+                        db.session.commit()
+
+                        # Emit the new step content blocks
+                        content = "\n\n".join(next_step["content_blocks"])
+                        new_message = Message(
+                            username="System", content=content, room_id=room.id
+                        )
+                        db.session.add(new_message)
+                        db.session.commit()
 
-                            # Emit the new step content blocks
-                            content = "\n\n".join(next_step["content_blocks"])
+                        socketio.emit(
+                            "message",
+                            {
+                                "id": new_message.id,
+                                "username": "System",
+                                "content": content,
+                            },
+                            room=room_name,
+                        )
+
+                        # Emit the new question if it exists
+                        if "question" in next_step:
+                            question_content = f"Question: {next_step['question']}"
                             new_message = Message(
-                                username="System", content=content, room_id=room.id
+                                username="System",
+                                content=question_content,
+                                room_id=room.id,
                             )
                             db.session.add(new_message)
                             db.session.commit()
@@ -1977,44 +2003,7 @@ def handle_activity_response(room_name, user_response, username):
                                 {
                                     "id": new_message.id,
                                     "username": "System",
-                                    "content": content,
-                                },
-                                room=room_name,
-                            )
-
-                            # Emit the new question if it exists
-                            if "question" in next_step:
-                                question_content = f"Question: {next_step['question']}"
-                                new_message = Message(
-                                    username="System",
-                                    content=question_content,
-                                    room_id=room.id,
-                                )
-                                db.session.add(new_message)
-                                db.session.commit()
-
-                                socketio.emit(
-                                    "message",
-                                    {
-                                        "id": new_message.id,
-                                        "username": "System",
-                                        "content": question_content,
-                                    },
-                                    room=room_name,
-                                )
-                        else:
-                            # Display activity info before completing
-                            display_activity_info(room_name, username)
-
-                            # Activity completed
-                            db.session.delete(activity_state)
-                            db.session.commit()
-                            socketio.emit(
-                                "message",
-                                {
-                                    "id": None,
-                                    "username": "System",
-                                    "content": "Activity completed!",
+                                    "content": question_content,
                                 },
                                 room=room_name,
                             )
@@ -2377,7 +2366,7 @@ def provide_feedback(
     if not transition:
         return "Category not found.", None
 
-    feedback = "\n".join(transition["content_blocks"])
+    feedback = ""
     if "ai_feedback" in transition:
         tokens_for_ai = (
             step["tokens_for_ai"] + " " + transition["ai_feedback"]["tokens_for_ai"]
-- 
GitLab


From aa783ded700a954f63c4a8c9a94e1d2e9bfe65c0 Mon Sep 17 00:00:00 2001
From: Russell Ballestrini <russell.ballestrini@gmail.com>
Date: Sun, 28 Jul 2024 20:53:00 -0400
Subject: [PATCH 18/20] 	modified:   guarded_ai.py

---
 research/guarded_ai.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/research/guarded_ai.py b/research/guarded_ai.py
index ec6f7db..f0d5765 100644
--- a/research/guarded_ai.py
+++ b/research/guarded_ai.py
@@ -80,7 +80,7 @@ def provide_feedback(
     if not transition:
         return "Category not found."
 
-    feedback = "\n".join(transition["content_blocks"])
+    feedback = ""
     if "ai_feedback" in transition:
         tokens_for_ai = (
             step["tokens_for_ai"] + " " + transition["ai_feedback"]["tokens_for_ai"]
@@ -126,7 +126,7 @@ def simulate_activity(yaml_file_path):
     current_step_id = yaml_content["sections"][0]["steps"][0]["step_id"]
 
     while current_section_id and current_step_id:
-        print(f"Current section: {current_section_id}, Current step: {current_step_id}")
+        print(f"\n\nCurrent section: {current_section_id}, Current step: {current_step_id}\n\n")
         section = next(
             (
                 s
@@ -148,8 +148,7 @@ def simulate_activity(yaml_file_path):
 
         # Print all content blocks once per step
         if "content_blocks" in step:
-            for block in step["content_blocks"]:
-                print(block)
+            print("\n\n".join(step["content_blocks"]))
 
         # Skip classification and feedback if there's no question
         if "question" not in step:
-- 
GitLab


From dd13bce82bf959e896d79994a2c67fa8c06b874a Mon Sep 17 00:00:00 2001
From: Russell <russell.ballestrini@gmail.com>
Date: Mon, 29 Jul 2024 06:17:48 -0400
Subject: [PATCH 19/20] Update research/guarded_ai.py

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
---
 research/guarded_ai.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/research/guarded_ai.py b/research/guarded_ai.py
index f0d5765..802de93 100644
--- a/research/guarded_ai.py
+++ b/research/guarded_ai.py
@@ -152,7 +152,7 @@ def simulate_activity(yaml_file_path):
 
         # Skip classification and feedback if there's no question
         if "question" not in step:
-            current_section_id, current_step_id = get_next_step(
+            current_section_id, current_step_id = get_next_section_and_step(
                 yaml_content, current_section_id, current_step_id
             )
             continue
@@ -199,7 +199,6 @@ def simulate_activity(yaml_file_path):
                 yaml_content, current_section_id, current_step_id
             )
 
-
 if __name__ == "__main__":
     # simulate_activity("activity13-choose-adventure.yaml")
     simulate_activity("activity0.yaml")
-- 
GitLab


From 9f3c5fb3a724b4b8e0860c64ca1793961e93bd26 Mon Sep 17 00:00:00 2001
From: Russell Ballestrini <russell.ballestrini@gmail.com>
Date: Mon, 29 Jul 2024 06:33:42 -0400
Subject: [PATCH 20/20] hcanges per rabbit feedback

	modified:   app.py
	modified:   research/guarded_ai.py
---
 app.py                 | 19 +++++++------------
 research/guarded_ai.py |  6 +++++-
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/app.py b/app.py
index f74afc7..4863bd1 100644
--- a/app.py
+++ b/app.py
@@ -110,19 +110,17 @@ class ActivityState(db.Model):
     json_metadata = db.Column(db.UnicodeText, default="{}")
 
     @property
-    def _json_metadata(self):
-        if self.json_metadata:
-            return json.loads(self.json_metadata)
-        return {}
+    def dict_metadata(self):
+        return json.loads(self.json_metadata) if self.json_metadata else {}
 
-    @_json_metadata.setter
-    def _json_metadata(self, value):
+    @dict_metadata.setter
+    def dict_metadata(self, value):
         self.json_metadata = json.dumps(value)
 
     def update_metadata(self, key, value):
-        metadata = self._json_metadata
+        metadata = self.dict_metadata
         metadata[key] = value
-        self._json_metadata = metadata
+        self.dict_metadata = metadata
 
 
 def get_room(room_name):
@@ -1847,7 +1845,7 @@ def handle_activity_response(room_name, user_response, username):
                 # Check metadata conditions for the current step
                 if "metadata_conditions" in step["transitions"][category]:
                     conditions_met = all(
-                        activity_state._json_metadata.get(key) == value
+                        activity_state.dict_metadata.get(key) == value
                         for key, value in step["transitions"][category][
                             "metadata_conditions"
                         ].items()
@@ -1916,11 +1914,9 @@ def handle_activity_response(room_name, user_response, username):
 
                 # Update metadata based on user actions
                 if "metadata_updates" in step["transitions"][category]:
-                    print(f"metadata_updates in step/category")
                     for key, value in step["transitions"][category][
                         "metadata_updates"
                     ].items():
-                        print(f"{key}: {value}")
                         activity_state.update_metadata(key, value)
 
                     # Commit the changes after the loop
@@ -1928,7 +1924,6 @@ def handle_activity_response(room_name, user_response, username):
                     db.session.commit()
 
                 # Log the updated metadata
-                print(f"Updated metadata: {activity_state._json_metadata}")
 
                 # if "correct" or max_attempts reached.
                 if (
diff --git a/research/guarded_ai.py b/research/guarded_ai.py
index 802de93..b7552e3 100644
--- a/research/guarded_ai.py
+++ b/research/guarded_ai.py
@@ -1,3 +1,4 @@
+import argparse
 import yaml
 from openai import OpenAI
 
@@ -200,5 +201,8 @@ def simulate_activity(yaml_file_path):
             )
 
 if __name__ == "__main__":
+    parser = argparse.ArgumentParser(description="Simulate an activity.")
+    parser.add_argument("yaml_file_path", type=str, help="Path to the activity YAML file", default="activity0.yaml")
+    args = parser.parse_args()
+    simulate_activity(args.yaml_file_path)
     # simulate_activity("activity13-choose-adventure.yaml")
-    simulate_activity("activity0.yaml")
-- 
GitLab