CSCI 185: Spring 2024

Introduction to Programming for the Web

CSCI 185: Spring 2024

UNCA Logo

Fish by @akeatk

Quiz 2

Download Starter Files

1. Required: DOM Manipulation (38 Points)

Open the exercise01 folder and complete the three tasks described in the picture below:

2. Optional: Functions & Loops (Replaces Question 7 & 8 if you do well)

If you’re worried about the paper portion of the exam and would like to show your JavaScript knowledge via code, try implementing the following task described below. Completing this task won’t count against you, but will help your score if you accidentally messed up a a question in the paper-based exam.

Open the exercise02-optional folder and examine all of the files. Inside of main.js, there is a fetchCourses function (already built for you) that fetches all of the UNCA course offerings for Fall, 2024: (here). Note that by modifying the year or term in the URL string, you can also view course offerings from previous semesters.

Your job

  1. Modify the function body of the displayResults(courses) function so that it outputs to the #results element only courses that offered within the CSCI department. You may use any kind of loop that you like.
  2. Ensure that your HTML snippet displays the following information for each course (using a template literal like we’re doing in HW6):
    • Title
    • Location
    • Days (i.e., which days does the course meet?)
  3. Location and Days may be null. That’s OK for this exercise (though in real life, you’d probably want to output a friendlier message).

Hints

 <section class="course">
    <h3>NM 101.001: Digital Design Principles</h3>
    <ul>
        <li>Location: OWE 305</li>
        <li>Days: MW</li>
    </ul>
</section>

What to Submit

Please read carefully: Doublecheck your work to make sure you’ve completed the first task (the second task is optional). Then, update your homepage by adding a link to quiz02/exercise01 (required) and a link to quiz02/exercise02-optional (optional).

After committing and syncing your changes to GitHub, paste a link to your homepage on GitHub pages under the Quiz 2 submission section. If your GitHub is not working for whatever reason, just zip your COMPLETED quiz02 folder and upload it to the Moodle.