[2023] CS50 - (Week 8) Trivia Solution | Walkthrough & Guide for Beginners | By Anvea

Поділитися
Вставка
  • Опубліковано 26 січ 2025

КОМЕНТАРІ • 38

  • @CaptainLuminary
    @CaptainLuminary Рік тому +25

    The week:8 was so fast paced that I couldn't learn any HTML, CSS and JavaScript whatsoever. The knowledge of syntax was a big hindrance in the pset:8. Thankyou so much Anvea

    • @lavitra.
      @lavitra. 11 місяців тому +2

      absolutely disappointed with the way they did week 8. I didn't understand anything at all either.

    • @azipage
      @azipage 5 місяців тому +1

      totally agree; I thought the problem was me, and I could not understand what they were doing this week. But actually I see some people who are having the same thoughts

  • @O-VideoProduction
    @O-VideoProduction Рік тому

    Thanks!

  • @WhoLaughed
    @WhoLaughed Рік тому +4

    Very good, just that on the last function the reason your code is getting reloaded is because of and what you can do is that in JS u can
    document.querySelector("#checker").addEventListener("click", function(event) {
    event.preventDefault();
    // … do other stuff when the form is submitted
    });
    This way u dont submit and the page doesnt autoupdate (reload)... understand?

    • @ed3137
      @ed3137 10 місяців тому

      thank you!

  • @ankitpandey8678
    @ankitpandey8678 Рік тому +6

    I have written the code as it is but my buttons are not turning red why
    ????

  • @cashewnuts2126
    @cashewnuts2126 Рік тому +1

    thank you so much for your help Anvea. Your videos truly make a difference and have a major impact on me. Without your videos I would be so lost in this cs50 course, I watch every video you post and I find them all helpful. Thank you so much for your time and effort. From South Africa ❤

  • @jakubnossowski793
    @jakubnossowski793 5 місяців тому

    Thank you, very helpful.

  • @psych_shock4370
    @psych_shock4370 Рік тому

    Nice guide to this problem set. I had a hard time with html css and JavaScript, and this helped me a lot.

  • @thebaconking4174
    @thebaconking4174 Рік тому

    Thank you so much for this video Anvea! I was stuck on this for a few days and this really helped. Can you please make a guide for the pset in Week 8?

  • @William_Burns
    @William_Burns Рік тому

    Awesome video, Anvea!! I really appreciate you and your guides! 🙏

  • @clips1363
    @clips1363 Рік тому +2

    Can you jump to week 9 finance

  • @majahreljak2774
    @majahreljak2774 Рік тому

    Than you Anvea 😃

  • @ethanmccue-yr3pr
    @ethanmccue-yr3pr 8 місяців тому

    Thank you so much for the tutorial! This is another Solution, what do you think?

    Document
    Trivia!
    Part 1: Multiple Choice
    What is the approximate ratio of people to sheep in New zealand?
    6 people per 1 sheep
    3 people per 1 sheep
    1 person per 1 sheep
    1 person per 3 sheep
    1 person per 6 sheep

    Part 2: Free Response
    In which country is it illegal to own one guinea pig, as a lone guinea pig might be lonely?
    Check Answer

    // TODO: Add code to check answers to questions
    //run the script once the DOM is loaded
    window.addEventListener("load", function () {
    //when correct answer is clicked change button colour to green
    let correct = document.querySelector('.correct');
    correct.addEventListener('click', function () {
    correct.style.backgroundColor = 'green';
    document.querySelector('#feedback1').innerHTML = 'Correct!';
    });
    //When any incorrect answer is clicked, change color to red.
    let incorrects = document.querySelectorAll('.incorrect');
    for (let i = 0; i < incorrects.length; i++) {
    incorrects[i].addEventListener('click', function () {
    incorrects[i].style.backgroundColor = 'red';
    document.querySelector('#feedback1').innerHTML = 'Incorrect';
    });
    }
    //check free response submission
    document.querySelector('#check').addEventListener('click', function () {
    let input = document.querySelector('input');
    if (input.value === 'Switzerland') {
    input.style.backgroundColor = 'green';
    document.querySelector('#feedback2').innerHTML = 'Correct!';
    } else {
    input.style.backgroundColor = 'red';
    document.querySelector('#feedback2').innerHTML = 'Incorrect';
    }
    });
    });

  • @gomork6821
    @gomork6821 Рік тому

    you're the best

  • @omnia-amo
    @omnia-amo Рік тому +2

    Hello, this was very helpful! I have a question tho. When I try to press the buttons to test my code, I cannot get it to work. Like when I click the buttons, nothing happens. It doesn’t turn red/green and it’s the same for the free response question. When I press the button, it reloads the page. Idk what to do.

    • @mananmudliar1353
      @mananmudliar1353 Рік тому

      Did you find any solution to this problem ? i'm having the same issue.

    • @omnia-amo
      @omnia-amo Рік тому

      @@mananmudliar1353 yeah, I don’t have my code with me rn, but I will get back to you once I have access to it.

    • @thedyladylagurl
      @thedyladylagurl Рік тому

      im having the same prob =( send help

    • @thepnesh
      @thepnesh Рік тому

      the issue is on the curly braces if you put one at the wrong place.Go through your code step by step. I had the same issue and fixed it

    • @omnia-amo
      @omnia-amo Рік тому

      @@thepnesh I got it figured out, thanks for your suggestion

  • @andreasim6765
    @andreasim6765 Рік тому

    Could you help with week 9 finance please? I am real stucked and frustrated by it as I can't resolve an error that keep recurring.

  • @avarmauk
    @avarmauk Рік тому

    Hi Anvea, you don't have a week 9 walkthrough?

  • @faza613
    @faza613 Рік тому +1

    week 9 finance please

  • @lucasbraga1230
    @lucasbraga1230 3 місяці тому

    where are you from? u got a lovely accent
    ps: i could not hear the frog being loud xD

  • @kalmar6789
    @kalmar6789 Рік тому

    please also upload week's 8 pset and also of week's 9, thanks!!

    • @Anvea
      @Anvea  Рік тому +4

      Hey!! Yes I fully intend to but life has taken over. Thank you so much for the reminder :’) I’ll try my best to publish the rest by November!! 🤞🏻

    • @kalmar6789
      @kalmar6789 Рік тому

      @@Anvea Best wishes!!

    • @Leney8
      @Leney8 4 місяці тому

      @@Anvea please upload as soon as possible because you are the best teacher 👩‍🏫🌻🌻🪻for learning the cs50 weeks solutions and i pray your life will be the best of happiness and sunshine and no toxicity and help us with understand this coding because i couldn't get what kind of error i'm having whatever i do it doesn't quite get right it's really annoying 🤯🤯. but then again TAKE CARE 🫡🤍🤍 PLEASE HELP ME WITH THISSS🥺🥺🥲🥲 you're the ONLY ONEE 🌻🌻

  • @emmanuelonuchi4260
    @emmanuelonuchi4260 Рік тому

    Does this script still work if more trivia questions are added, if not what should I do?

  • @نوافالدوسري-ن7ن

    Week8 Homepage🙇🏻‍♂️

  • @TerriJerde
    @TerriJerde Рік тому

    Promo sm 🎉

  • @moyomi8713
    @moyomi8713 Рік тому

    i send you a kiss 😘