Teachers and substitutes are often asked to cover classes without warning. This app serves as a spot for teachers to collect activities and make lesson plans to use when they are unable to prep.
- Ideal user for this application is a teacher or a substitute.
- The user needs quick activties for their students because they forgot to make lesson plans.
- The user has too many responsibilities and not enough time to make plans, so using the app with give them quick ideas.
- The user may not be a certified teacher and needs activities for students to do.
- The user needs activities to fill unstructured time.
- When an activity is added, an object is created and pushed to the array of activities.
- Users can view, edit, and delete their created items, but can only view items created by other users.
- Users can add activities to lesson plans to create groups of activities.
- Users can search through all activities and all lessons.
to come
export default function AddActivitytoLesson({ obj }) {
const [show, setShow] = useState(false);
const handleClose = () => setShow(false);
const handleShow = () => setShow(true);
const [formInput, setFormInput] = useState(initialState);
const [activities, setActivities] = useState([]);
const { user } = useAuth();
useEffect(() => {
getAllActivities().then(setActivities);
}, [obj]);
const handleChange = (e) => {
const { name, value } = e.target;
setFormInput((prevState) => ({
...prevState,
[name]: value,
}));
};
const handleSubmit = (e) => {
e.preventDefault();
if (formInput.activity_id) {
const payload = { ...formInput, lessonPlan_id: obj.firebaseKey };
createMergedObj(payload).then(({ name }) => {
const patchPayload = { firebaseKey: name };
updateMergedObject(patchPayload).then(handleClose);
});
} else {
window.alert('Select an Activity');
}
};