donb-hf commited on
Commit
d35ce58
Β·
verified Β·
1 Parent(s): 4d87af1

update clear_btn

Browse files
Files changed (1) hide show
  1. app.py +22 -1
app.py CHANGED
@@ -65,9 +65,30 @@ with demo:
65
  reset_state = lesson_graph.reset_state()
66
  return list(reset_state)
67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  clear_btn.click(
69
  handle_reset,
70
- outputs=[teacher_name, subject, grade_level, learning_objective, activity, assessment, resource, school_board, message_output]
 
 
 
 
71
  )
72
 
73
  # Add Markdown section explaining the purpose and use of the app
 
65
  reset_state = lesson_graph.reset_state()
66
  return list(reset_state)
67
 
68
+ def handle_reset():
69
+ reset_state = lesson_graph.reset_state()
70
+ # Return values for all components, including search_output and graph_output
71
+ return (
72
+ reset_state.teacher_name,
73
+ reset_state.subject,
74
+ reset_state.grade_level,
75
+ reset_state.learning_objective,
76
+ reset_state.activity,
77
+ reset_state.assessment,
78
+ reset_state.resource,
79
+ reset_state.school_board,
80
+ "", # Reset search_output
81
+ None, # Reset graph_output
82
+ reset_state.message
83
+ )
84
+
85
  clear_btn.click(
86
  handle_reset,
87
+ outputs=[
88
+ teacher_name, subject, grade_level, learning_objective,
89
+ activity, assessment, resource, school_board,
90
+ search_output, graph_output, message_output
91
+ ]
92
  )
93
 
94
  # Add Markdown section explaining the purpose and use of the app