Midterm Exam Details

Midterm Exam

Details

  • Exam Format: The exam consists of 20 multiple choice questions. You will be required to review code within a GitHub repository and answer questions related to it. You may find it helpful to clone and run the project.

  • Topics Covered: The exam will cover all material from the course from Weeks 1 to 7. This includes:

  • Time Limit: The questions will be available for 12 hours from friday (March 15th) noon to midnight.

  • Submission: The exam will be found on Brightspace. Navigate to our course shell, and then click on Assessments → Tests where you will find the Midterm Exam.

  • Open Resources: This is an open-book exam. You're allowed to use this content site, your repositories, the internet, and AI.

  • Code of Conduct: While the exam is open resources, you're strictly prohibited from collaborating with any other humans, either in this class or outside of it. This includes:

    • Requesting help from others.
    • Soliciting help by posting questions on any forum, chat (public or private), or any other platform.
    • Attempting to form an "exam bank" of answers with other students.

Note on Academic Integrity: The purpose of this exam is to assess your individual understanding of the course material. Upholding academic integrity is crucial to maintain a fair and effective learning environment. Each student's work should represent their own understanding, and adherence to these guidelines ensures the integrity of your educational progress.

Good luck!

Practice Questions

The following questions are provided to give you an idea of the types of questions you can expect on the exam. The actual exam will have different questions for a different project, but they will be similar in nature.

For these questions, please refer to the /week-7 folder of the GitHub repository webdev-2-demos found here: https://github.com/warsylewicz/webdev2-demos/tree/master/app/week-7 (opens in a new tab)

It is recommended to clone the repository (opens in a new tab) and run the application locally to help answer the questions.

1. Which of the following is true about the component architecture of the application?

The Page component composes Weather, NewEvent, and EventList components. The NewEvent component receives handlers from the Page component as props.

The Page component is composed by the NewEvent component and passes data as props to it.

The EventList component is composed by the Page component and receives no props.

The Weather component is composed by the EventCard component.

2. In `new-event.js`, why can the four statements used to clear the form input fields, e.g. setName(''), be removed from the `handleSubmit` function?

The `useState` hooks automatically clear the form input fields.

The `handleSubmit` function is not actually being used.

`onCloseEvent()` causes the form to unmount, clearing all state.

These statements cannot be removed, otherwise the form will not clear.

3. Considering `new-event.js`, what would happen if the `event.preventDefault()` line was removed from the `handleSubmit` function?

The page will refresh on form submission.

The form will not be submitted.

The application will crash.

No impact on the application.

4. In `page.js`, if the `setNewEventOpen` function is accidentally removed from the destructuring array in the useState hook, what will be the impact on the application?

The application will crash when attempting to view the page.

Nothing, the function is not being used.

Next.js infers the function name based on the state name `newEventOpen`.

The application will crash when attempting to open the 'new event' modal.

5. Which of the following is true about the `data` object returned by the `fetchWeatherData` function?

The `data` object is a JSON string.

The `data` object is a promise.

The `data` object is undefined because it is obtained from an external API.

The `data` object contains the elevation for the city of Calgary.