File size: 14,461 Bytes
763047f 1701e56 31f7bae 6f03cc8 12c332b 3ffb57b 12c332b 1701e56 92cbbd6 12c332b 1701e56 12c332b 1701e56 12c332b 1701e56 12c332b 3ffb57b 31f7bae 3ffb57b 2e33552 bd1f057 94ab8f3 c59f424 2532cf6 e74edce bd1f057 94ab8f3 2e33552 4d87af1 2e33552 4d87af1 12c332b 94ab8f3 1701e56 94ab8f3 1701e56 12c332b 1701e56 94ab8f3 1701e56 12c332b 6f03cc8 78ed8a7 31f7bae c393524 6f03cc8 5f124eb d35ce58 94ab8f3 d35ce58 5f124eb 1701e56 d35ce58 94ab8f3 d35ce58 5f124eb b578ae8 661fcad 31f7bae 12c332b 31f7bae 1701e56 94ab8f3 31f7bae 1701e56 94ab8f3 31f7bae 1701e56 31f7bae 1701e56 31f7bae 69d4aa5 720f77a bfb47b4 720f77a 69d4aa5 92cbbd6 720f77a 1701e56 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
import gradio as gr
from lesson_graph import LessonGraph
# Instantiate the LessonGraph class
lesson_graph = LessonGraph()
# Gradio interface
demo = gr.Blocks()
with demo:
gr.Markdown("# EduScape: Design Your Educational Landscape")
gr.Markdown("Welcome to EduScape, where lesson planning becomes an adventure in crafting educational journeys. Design, visualize, and perfect your learning landscapes with ease.")
with gr.Row():
teacher_name = gr.Textbox(label="Teacher Name (Required)", placeholder="Enter the teacher's full name", info="e.g., Sarah Johnson")
school_board = gr.Textbox(label="School Board/Region (Optional)", placeholder="Enter the school board or region", info="e.g., Oakville District School Board")
country_authority = gr.Textbox(label="Country Authority (Optional)", placeholder="Enter the country-level education authority", info="e.g., Ministry of Education")
with gr.Row():
subject = gr.Textbox(label="Subject (Required)", placeholder="Enter the subject name", info="e.g., Earth Science")
grade_level = gr.Textbox(label="Grade Level (Required)", placeholder="Enter the grade level", info="e.g., Grade 7")
with gr.Row():
learning_objective = gr.Textbox(label="Learning Objective (Optional)", placeholder="Enter the main learning goal", info="e.g., Understand the water cycle and its impact on Earth's climate")
activity = gr.Textbox(label="Activity (Optional)", placeholder="Enter the main class activity", info="e.g., Create a terrarium to model the water cycle")
with gr.Row():
assessment = gr.Textbox(label="Assessment (Optional)", placeholder="Enter the assessment method", info="e.g., Group presentation on terrarium observations")
resource = gr.Textbox(label="Resource/Material (Optional)", placeholder="Enter required resources", info="e.g., Terrarium kit, climate diagrams")
with gr.Row():
generate_btn = gr.Button("Map Your Lesson Plan")
graph_btn = gr.Button("Display Graph (JSON)")
clear_btn = gr.Button("Clear Landscape")
examples = [
["Sarah Johnson", "Oakville District School Board", "Ministry of Education", "Earth Science", "Grade 7", "Understand the water cycle and its impact on Earth's climate", "Create a terrarium to model the water cycle", "Group presentation on terrarium observations", "Terrarium kit, climate diagrams"],
["Marek Nowak", "Warsaw School District", "Ministry of National Education of Poland", "Matematyka", "Klasa 2", "Zrozumienie podstawowych operacji matematycznych", "Rozwi膮zywanie prostych zada艅 tekstowych", "Praca grupowa nad rozwi膮zywaniem zada艅", "Podr臋cznik, karty pracy, tablica interaktywna"],
# Example 1: Grade IV - Natural Numbers (matches 1.1, 1.2)
["Anna Kowalska",
"Krak贸w School District",
"Ministry of National Education of Poland",
"Matematyka",
"Klasa IV",
"Zapisywanie i odczytywanie liczb naturalnych wielocyfrowych oraz ich interpretacja na osi liczbowej",
"Zaznaczanie i odczytywanie liczb na osi liczbowej oraz por贸wnywanie liczb naturalnych",
"Sprawdzian umiej臋tno艣ci odczytywania i por贸wnywania liczb",
"O艣 liczbowa, karty z liczbami naturalnymi"],
# Example 2: Grade V - Fractions (matches 5.1, 5.2)
["Piotr Wi艣niewski",
"Warsaw School District",
"Ministry of National Education of Poland",
"Matematyka",
"Klasa V",
"Dodawanie i odejmowanie u艂amk贸w dziesi臋tnych w pami臋ci i pisemnie",
"Rozwi膮zywanie zada艅 z dodawaniem i odejmowaniem u艂amk贸w dziesi臋tnych w kontek艣cie pieni臋dzy (z艂, gr)",
"Kartk贸wka z dzia艂a艅 na u艂amkach dziesi臋tnych",
"Karty zada艅, kalkulator (dla trudniejszych przyk艂ad贸w)"],
# Example 3: Grade VII - Algebra (matches 3.1, 3.3)
["Maria D膮browska",
"Gda艅sk School District",
"Ministry of National Education of Poland",
"Matematyka",
"Klasa VII",
"Zapisywanie zale偶no艣ci przedstawionych w zadaniach w postaci wyra偶e艅 algebraicznych",
"Zapisywanie wyra偶e艅 algebraicznych na podstawie informacji osadzonych w kontek艣cie praktycznym",
"Samodzielne uk艂adanie i rozwi膮zywanie zada艅 tekstowych z wyra偶eniami algebraicznymi",
"Karty zada艅 z wyra偶eniami algebraicznymi"],
# Example 4: Grade VIII - Geometry (matches 8.7)
["Tomasz Lewandowski",
"Pozna艅 School District",
"Ministry of National Education of Poland",
"Matematyka",
"Klasa VIII",
"Zastosowanie twierdzenia Pitagorasa w sytuacjach praktycznych",
"Rozwi膮zywanie zada艅 wykorzystuj膮cych twierdzenie Pitagorasa w kontek艣cie rzeczywistym",
"Projekt praktyczny: wykorzystanie twierdzenia Pitagorasa w terenie",
"Przyrz膮dy pomiarowe, karty zada艅 z geometrii"],
# Example 5: Grade VI - Statistics (matches 13.1, 13.2)
["Ewa Kami艅ska",
"Wroc艂aw School District",
"Ministry of National Education of Poland",
"Matematyka",
"Klasa VI",
"Odczytywanie i interpretowanie danych przedstawionych w tekstach, tabelach, na diagramach i wykresach",
"Tworzenie diagram贸w s艂upkowych i ko艂owych oraz wykres贸w na podstawie zebranych danych",
"Projekt: zbieranie danych klasowych i przedstawianie ich na r贸偶nych typach wykres贸w",
"Papier milimetrowy, linijki, szablony do wykres贸w"],
["Maria Chen",
"Calgary Public Schools",
"Alberta Education",
"Mathematics",
"Grade 1",
"Students interpret and explain quantity to 100",
"Using base-10 blocks to represent two-digit numbers and practice skip counting by 5s and 10s",
"Group counting assessment using manipulatives",
"Base-10 blocks, number charts, counting frames"],
["David Thompson",
"Edmonton Catholic Schools",
"Alberta Education",
"Mathematics",
"Grade 3",
"Analyze and apply strategies for multiplication and division within 100",
"Create arrays using counters to model multiplication facts and explore the relationship between multiplication and division",
"Small group problem-solving tasks involving real-world multiplication scenarios",
"Counters, grid paper, multiplication tables"],
["Sarah Blackwater",
"Siksika Nation School Board",
"Alberta Education",
"Mathematics",
"Grade 4",
"Apply place value to decimal numbers and relate fractions to decimals",
"Using First Nations beading patterns to explore decimal numbers and fractions",
"Create and explain patterns using decimals and fractions in cultural contexts",
"Beading materials, decimal grids, number lines"],
["Ahmed Hassan",
"Lethbridge School District",
"Alberta Education",
"Mathematics",
"Grade 5",
"Estimate and calculate area using standard units, investigate symmetry as a geometric property",
"Creating and measuring geometric designs using square units and exploring symmetry in nature",
"Project-based assessment: Design and measure a garden plot using standard units",
"Grid paper, rulers, geometric shapes, nature specimens"],
["Lisa Running Rabbit",
"Treaty 7 Education Authority",
"Alberta Education",
"Mathematics",
"Grade 6",
"Investigate magnitude with positive and negative numbers, explain location and movement in the Cartesian plane",
"Using traditional games to explore positive and negative numbers, mapping traditional territories on coordinate plane",
"Create and solve problems involving integers in real-world contexts",
"Coordinate grid paper, traditional games materials, temperature charts"]
]
gr.Examples(
examples=examples,
inputs=[teacher_name, school_board, country_authority, subject, grade_level, learning_objective, activity, assessment, resource]
)
search_output = gr.Textbox(label="Content Discovery Search String", show_copy_button=True)
graph_output = gr.Image(label="Your Educational Landscape")
message_output = gr.Textbox(label="Landscape Status", show_copy_button=True)
def handle_generate(teacher_name, subject, grade_level, learning_objective, activity, assessment, resource, school_board, country_authority):
try:
search_string, image = lesson_graph.process_inputs(
teacher_name, subject, grade_level, learning_objective, activity, assessment, resource, school_board, country_authority
)
return search_string, image, "Lesson plan mapped successfully!"
except ValueError as e:
return "", None, f"Error: {str(e)}. Please fill in all required fields."
generate_btn.click(
handle_generate,
inputs=[teacher_name, subject, grade_level, learning_objective, activity, assessment, resource, school_board, country_authority],
outputs=[search_output, graph_output, message_output]
)
graph_btn.click(
lesson_graph.graph_to_json,
outputs=[message_output]
)
def handle_reset():
reset_state = lesson_graph.reset_state()
return (
reset_state.teacher_name,
reset_state.subject,
reset_state.grade_level,
reset_state.learning_objective,
reset_state.activity,
reset_state.assessment,
reset_state.resource,
reset_state.school_board,
reset_state.country_authority, # Include the new field
"", # Reset search_output
None, # Reset graph_output
reset_state.message
)
clear_btn.click(
handle_reset,
outputs=[
teacher_name, subject, grade_level, learning_objective,
activity, assessment, resource, school_board, country_authority, # Include the new field
search_output, graph_output, message_output
]
)
# Add Markdown section explaining the purpose and use of the app
gr.Markdown("""
## Purpose of EduScape: Understanding Lesson Plans as a Graph
EduScape helps educators visualize lesson plans as a graph, where key lesson elements (teacher, subject, grade level, learning objectives, activities, assessments, and resources) are represented as nodes with logical relationships. This structure allows teachers to better understand the connections between different parts of their lessons, facilitating clearer planning and discovery of resources.
### Key Features:
- **User Input-Driven Graph Construction**: Educators can input details like teacher name, subject, grade level, learning objective, activity, assessment, and resources to automatically construct a lesson plan graph.
- **Graph Visualization**: Each element of the lesson plan is represented as a node, and the connections between these elements (like how an activity achieves the learning objective) are visualized through edges.
- **Content Discovery**: The system generates a search string based on input, which can help the teacher discover content or resources to support their lesson plan.
### Required and Optional Fields:
- **Required Fields**: Teacher Name, Subject, and Grade Level
- **Optional Fields**: Learning Objective, Activity, Assessment, Resource/Material, and School Board/Region
### Logical Flow of the Knowledge Graph:
1. The **Teacher** node connects to the **Subject** node (representing what the teacher teaches).
2. The **Subject** node connects to the **Grade Level** (defining what is taught and to whom).
3. If provided, the **Learning Objective** node links to the **Subject** (showing what specific goal is covered).
4. If provided, the **Country Authority** node connects to the **Learning Objective** (indicating that the national authority defines the learning objectives).
5. If both are provided, the **Activity** node links to the **Learning Objective** (showing how the objective is achieved through student engagement).
6. If provided, the **Assessment** node connects to the **Learning Objective** (indicating how learning is evaluated).
7. If both are provided, the **Resource** node connects to the **Activity** (detailing what materials are needed for the activity).
8. If provided, the **Teacher** also connects to the **School Board** (showing which governing body the teacher belongs to).
9. If both are provided, the **Country Authority** node connects to the **School Board** (showing oversight from the national level).
### Example Use Case:
A teacher, Sarah Johnson, inputs her lesson plan for Grade 7 Earth Science. She must provide her name, the subject, and the grade level. Optionally, she can add a learning objective about understanding the water cycle, an activity to create a terrarium, a group presentation for assessment, and specify resources like a terrarium kit. The system visualizes the relationships between these elements in the graph and generates a content discovery string to help her find additional resources.
EduScape ensures that teachers can organize their lessons effectively while aligning with the curriculum and discovering resources to enhance their lesson delivery, with flexibility to include as much or as little detail as they prefer.
""")
gr.Markdown("""
---
""")
gr.Markdown("""
### License: CC BY-NC-SA 4.0
This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. [Learn more](https://creativecommons.org/licenses/by-nc-sa/4.0/).
""")
# Launch the EduScape app
demo.launch() |