LeetCamp written quiz

Day 19 · about 20 minutes · 20 marks · Name (first name only): ____________

Part A: choose one answer (1 to 7 are about our LeetCamp site, 8 to 10 are general) 10 marks

  1. Our site. What does <link rel="stylesheet" href="styles.css" /> do?
    1. Connects the CSS file to the page
    2. Makes a link to another page
    3. Adds a picture
  2. Our site. The navbar is <header class="nav">. What is class="nav" for?
    1. It shows the word nav on the page
    2. It gives the box a name so CSS can style it
    3. It links to the navbar page
  3. Our site. Which three steps repeat in "How we do it"?
    1. Read, Write, Print
    2. Start, Stop, Pause
    3. Plan and Build, Test and Debug, Deploy and Showcase
  4. Our site. .steps { display: grid; grid-template-columns: repeat(3, 1fr); } does what to our step cards?
    1. Hides them
    2. Puts them side by side in three equal columns
    3. Stacks them in one column
  5. Our site. .nav-inner uses display: flex; justify-content: space-between;. What do we see?
    1. The LeetCamp name on the left and the links on the right
    2. Everything in the middle, on top of each other
    3. Nothing, the navbar disappears
  6. Our site. At the top of styles.css we wrote --accent: #b88cff;. What is it?
    1. A broken line of code
    2. The name of a font
    3. A variable: a colour we name once and reuse with var(--accent)
  7. Our site. Our quiz checks if (answer === "Tsavo"). A learner clicks Amboseli. What happens?
    1. The page crashes
    2. The else part runs and says Not quite, try again
    3. The quiz says Correct
  8. General. From the inside out, the box model is:
    1. margin, border, padding, content
    2. content, padding, border, margin
    3. padding, content, margin, border
  9. General. What is the alt text on an image for?
    1. To make the image bigger
    2. To describe the image if it cannot be seen
    3. To link to another page
  10. General. What does console.log("Hi") do?
    1. Deletes the page
    2. Makes a button
    3. Shows Hi in the Console (a tool for finding bugs)

Part B: spot the bug (from our site) 6 marks

  1. Spot the bug in our quiz button and write the fix.
    <button class="quiz-btn" onclick="check('Tsavo')>Tsavo</button>
    2 marks
  2. Spot the bug in our card hover and write the fix.
    .card:hover {
      transform translateY(-4px);
    }
    2 marks
  3. Our quiz result never appears on the page. Spot the bug and write the fix.
    document.getElementById("result").textcontent = "Correct!";
    2 marks

Part C: short answers 4 marks

  1. Our site has three kinds of files. Name them and say what each one does (3 marks).
    3 marks
  2. Describe one bug you fixed in YOUR project and how you fixed it.
    1 mark