Mike you are really an amazing teacher, I watched a video thats 1 hour length and didnt get a single thing and in the end it was just full of mistakes but you just speak so clearly and explain everything in detail that I can understand and not just copy the code, you are so underrated btw, thank you for creating such high quality classes you are saving my life litereally.
Mike,you should update code on your site.I fixed it: var questions = [ { prompt: "What color are apples? (a) Red/Green (b) Purple (c) Orange", answer: "a"// idk why did you use \Purple instead of Purple }, { prompt: "What color are Bananas? (a) Teal (b) Magenta (c) Yellow", answer: "c"// you used \Magenta instead of Magenta }, { prompt: "What color are strawberries? (a) Yellow (b) Red (c) Blue", answer: "b"//ans. is not a,you used \Red instead of Red } ]; var score = 0; for(var i = 0; i < questions.length; i++){ var response = window.prompt(questions[i].prompt); if(response == questions[i].answer){ score++; alert("Correct!"); } else { alert("WRONG!"); } } alert("you got " + score + "/" + questions.length);
Hey Mike, I appreciate your videos. I watch you and Bob Tabor. I took your PHP course too. I have a request and a suggestion for you. For the request, I would really like to see you make a video that explains implementing a shopping cart and payment system in a website. Most of the videos I have seen regarding this are very specific to something like Wordpress (which I don't use). I would like to know more about the whole process of first choosing a payment processor and then actually tying it into a website with code. You have the skills to explain this in an understandable way. As a suggestion, if you would change to a lavalier microphone, the sound quality of your videos would be much better. Since you don't need to physically move a lot in your videos, you could even get by with a $20 corded version like the Boya by-m1 and it would make a big improvement over your shotgun mic. Anyway, thanks for the easy to understand and free knowledge. You've been a great help to me.
Thanks Mike, after the questions are answered, and you get, you got 3/3 or whatever, I click ok, and the questions repeat. Been trying to include a Break code, but it's not working. You, or anyone have an answer or suggestion to stop the questions from repeating?
For some reason I can’t seem to actually read the question out to the user, it just shows up undefined or whatever and I can’t figure out what’s wrong.
ya I guess you can. You could set a variable equal to timer and decrease it every second, with a for/while loop. Then you could reset it or not, as you wish
Gives me this error> /Users/pao/Documents/Code/Charlie/test.js:36 var response = window.prompt(questions[i].prompt); ^ ReferenceError: window is not defined
I would check for syntax or spelling errors. Especially, keep track of what goes on which side of the brackets. This is usually why I can't get JS to work on my browser. Also, check to make sure you've spelled the JS file name when you reference it in your html file.
i create html page with moving imge ok after how could i add ai.js file to the html same image's up ? its coming js file up moving imge down how to get same border with all file ?
your work was well explained and perfect but you didnt show in most of your teachings you skipped the html and css. i do need to see how you added the table to i can follow along and get same result please.
I threw another monkey wrench into the code. On your line 22 I entered a #1 instead of the letter ' i ' for (questions[ i ].prompt); and it kept asking me the Bananas question 3 times lol
@@Just_a_girl_in_a_new_city Just a couple small errors. I put comments in your code, but I'll summarize first: 1. In your second question, you had put options (b) and (c) on the next line, so they were not seen as part of the string anymore. The 17 and 18 were showing up as integers instead. 2. Your alert("right!!") was on the same line as score++; ...So I moved that down to the next line. Here is the code fixed. You can try it out: var questions= [ { prompt:"what is your name? (a)deepa (b)rita (c)Gita", answer:"a" }, { prompt:"what is your age? (a)10 (b)17 (c)18", /*
@@scottisitt much tnks for ur help, but it doesn't seems to work for me ,maybe because I m doing this all in my Android phone. But as u are saying the code worked for u so I think code is correct..so tnks.
@@Just_a_girl_in_a_new_city Hmm... What text editor or IDE are you using? I didn't know you could code on mobile devices, but I checked online and it looks like you can. One IDE I saw recommended was Dcoder (yes, spelled without the first "e"). Looks like it supports HTML and JavaScript....among many others. Maybe you can try using that...? I also checked to see if there were any formatting issues from copying and pasting the corrected code from the UA-cam comment section back to my editor...but there were no problems. The code still worked. So, yeah, maybe try Dcoder or something similar.
Dear Mike, Thank you very much for taking the time to teach others. You do a wonderful job. Can you do me a favor, please? Can you show me the html code for this multiple choice code? I will appreciate it! Regards, Cesar
I know it's been awhile. In html, since the JS is using alerts, you only need to add a link. I'd put it in the the head. Ask Away My Friend, Blah Blah BlaH
I have discovered a "cleaner" and more basic way for this code. score = 0; function question(question, answer) { var reply = prompt(question) if(reply === answer) { alert('Correct!') score += 1 } else { alert('WRONG!') } } question("question here", "answer here"); alert("Your score: " + score);
"What color is a strawberry?"
Mike: red
HTML: WRONG
hahaha bots
Mike you are really an amazing teacher, I watched a video thats 1 hour length and didnt get a single thing and in the end it was just full of mistakes but you just speak so clearly and explain everything in detail that I can understand and not just copy the code, you are so underrated btw, thank you for creating such high quality classes you are saving my life litereally.
Finished your python lessons and am almost done with these ones. Your explanation of concepts is very well organized. Thank you so much.
Thanks Mike. Could you show us how to do that using radio buttons rather than a text entry area?
I actually managed to do this by myself before watching the tutorial. Seems like things are finally starting to click
hey mike i have one question about this
can you set up a timer with it for user to answer their question within that time
Well explained, straight to the point, and simple. Kudos!!!
Finished Tutorial 24.Thanks to Mike
How can I transform from a div in html with question to an array in js but showing it to the user?
Thank you for your awesome tutorials.
Nice Work Nathaniel B!!!
All I gotta say is wow I mean damn never seen a tutorial so concise and straight to the point shit bro
Mike,you should update code on your site.I fixed it:
var questions = [
{
prompt: "What color are apples?
(a) Red/Green
(b) Purple
(c) Orange",
answer: "a"// idk why did you use
\Purple instead of
Purple
},
{
prompt: "What color are Bananas?
(a) Teal
(b) Magenta
(c) Yellow",
answer: "c"// you used
\Magenta instead of
Magenta
},
{
prompt: "What color are strawberries?
(a) Yellow
(b) Red
(c) Blue",
answer: "b"//ans. is not a,you used
\Red instead of
Red
}
];
var score = 0;
for(var i = 0; i < questions.length; i++){
var response = window.prompt(questions[i].prompt);
if(response == questions[i].answer){
score++;
alert("Correct!");
} else {
alert("WRONG!");
}
}
alert("you got " + score + "/" + questions.length);
Would you please help me? Why we should use
.
@@chowdhuryazizul8699 i think /n is use for new line
@@Challengetogetsubscriber-zv1un yes. Thanks
Hey Mike, I appreciate your videos. I watch you and Bob Tabor. I took your PHP course too. I have a request and a suggestion for you. For the request, I would really like to see you make a video that explains implementing a shopping cart and payment system in a website. Most of the videos I have seen regarding this are very specific to something like Wordpress (which I don't use). I would like to know more about the whole process of first choosing a payment processor and then actually tying it into a website with code. You have the skills to explain this in an understandable way. As a suggestion, if you would change to a lavalier microphone, the sound quality of your videos would be much better. Since you don't need to physically move a lot in your videos, you could even get by with a $20 corded version like the Boya by-m1 and it would make a big improvement over your shotgun mic. Anyway, thanks for the easy to understand and free knowledge. You've been a great help to me.
Great video thanks! Do you have another video of applying a timer to the quiz??
How would I do this but instead of print boxes use radio buttons?
Thanks Mike, after the questions are answered, and you get, you got 3/3 or whatever, I click ok, and the questions repeat. Been trying to include a Break code, but it's not working. You, or anyone have an answer or suggestion to stop the questions from repeating?
For some reason I can’t seem to actually read the question out to the user, it just shows up undefined or whatever and I can’t figure out what’s wrong.
im a javascript beginner. That helps! Thank you!
Hi, thanks for the video. I have a question. If I have 1000 questions with 4 MCQs, how should i manage these data?
Can I make a timer for this quiz working during answering ?\
ya I guess you can. You could set a variable equal to timer and decrease it every second, with a for/while loop. Then you could reset it or not, as you wish
Thanks, searched so much for a simple way to do this, and found you. Good job on the video
Gives me this error>
/Users/pao/Documents/Code/Charlie/test.js:36
var response = window.prompt(questions[i].prompt);
^
ReferenceError: window is not defined
What software do you use for your screencast?
Great job, this is right project explanation for a beginner in JavaScript. Exactly what I am looking for
Do you have to put things inside the variable questions?
you solve my all problems like a Boss😂
Why can't i execute it on my browser?
I would check for syntax or spelling errors. Especially, keep track of what goes on which side of the brackets. This is usually why I can't get JS to work on my browser. Also, check to make sure you've spelled the JS file name when you reference it in your html file.
Could anyone please tell me why he didn't put a semicolon at the end of the questions array, and the program still worked!?
That's awesome! Thanks for this, Mike!
if(response == questions[i].answer){//
alert("you got " + score + "/" + questions.length);
What is the interpretation of these codes?
how can randomize the questions and questions are not repeated...
Hi,
What if the question has multiple correct answers? Does that work?
Nice one. Can we add image to a question? How?
i create html page with moving imge ok after how could i add ai.js file to the html same image's up ?
its coming js file up moving imge down how to get same border with all file ?
Awsome teaching 👏
can you show the html code as well
This is what I wrote as my html:
JS Multiple Choice Quiz
JavaScript Multiple Choice Quiz
Important thing is to have your JS file referenced in the script tags.
i could not really understand what window.promp(question[i].prompt) meant?
can someone care to explain?
It means that the 'prompt' should open when the window loads.
it loops all your questions from 0 to 3
Hey everyone! Does someone know how can i make something similar, with only Html, Css and JavaScript, but you get different options every time
how to set time for every random number addition
your work was well explained and perfect but you didnt show in most of your teachings you skipped the html and css. i do need to see how you added the table to i can follow along and get same result please.
Man you're awesome, but I laughed so hard at the strawberries part.
My bro I cant thank you enough for this..
hey its nice
i have 3000 questions how to convert to array data
great tutorial and great job, well done. many thanks
awsome 😍😍
awesome man!! nice going
I threw another monkey wrench into the code. On your line 22 I entered a #1 instead of the letter ' i ' for (questions[ i ].prompt); and it kept asking me the Bananas question 3 times lol
You are just great....
man great job .....very helpful.GOD BLESS yuh
Very helpful!! Thank you so much!
How we can comparison right and wrong answer at the end of quiZ??
did you ever figure this out???
Thanks it was really nice and helpful
is this code is executed.did anyone check????
I'm answering a year late, but, yes, it did work for me.
@@scottisitt my code is not working, can u find the mistake.
var questions= [
{
prompt:"what is your name?
(a)deepa
(b)rita
(c)Gita",
answer:" a"
},
{
prompt:"what is your age?
(a)10
(b)17
(c)18",
answer: "c"
},
{
prompt:"what is your scool?
(a)univrsal
(b)venky
(c)kmc",
answer: "a"
},
];
var score = 0;
for(var i=0;i
@@Just_a_girl_in_a_new_city Just a couple small errors. I put comments in your code, but I'll summarize first:
1. In your second question, you had put options (b) and (c) on the next line, so they were not seen as part of the string anymore. The 17 and 18 were showing up as integers instead.
2. Your alert("right!!") was on the same line as score++; ...So I moved that down to the next line.
Here is the code fixed. You can try it out:
var questions= [
{
prompt:"what is your name?
(a)deepa
(b)rita
(c)Gita",
answer:"a"
},
{
prompt:"what is your age?
(a)10
(b)17
(c)18", /*
@@scottisitt much tnks for ur help, but it doesn't seems to work for me ,maybe because I m doing this all in my Android phone. But as u are saying the code worked for u so I think code is correct..so tnks.
@@Just_a_girl_in_a_new_city Hmm... What text editor or IDE are you using? I didn't know you could code on mobile devices, but I checked online and it looks like you can. One IDE I saw recommended was Dcoder (yes, spelled without the first "e"). Looks like it supports HTML and JavaScript....among many others. Maybe you can try using that...?
I also checked to see if there were any formatting issues from copying and pasting the corrected code from the UA-cam comment section back to my editor...but there were no problems. The code still worked. So, yeah, maybe try Dcoder or something similar.
Hi ! Great video....
WHAT APPLICATION DO YOU USE TO MAKE AMAZING TUTORIAL??
VS code
@@rollerskdude It's atom. look on the top left next to the apple logo (the menubar).
Very good tutorial thank you useful for a project I’m working on
Great video..
Can someone explain what the
means?!?
its a regular expression. it starts a new line its like i think
I need a personal help with this
this is another useful tutorial , thank you
you're a lifesaver. thank you!
Hey mike can you do a tutorial on applescript?
Dear Mike,
Thank you very much for taking the time to teach others. You do a wonderful job. Can you do me a favor, please? Can you show me the html code for this multiple choice code? I will appreciate it!
Regards,
Cesar
I know it's been awhile. In html, since the JS is using alerts, you only need to add a link. I'd put it in the the head. Ask Away My Friend, Blah Blah BlaH
I have discovered a "cleaner" and more basic way for this code.
score = 0;
function question(question, answer) {
var reply = prompt(question)
if(reply === answer) {
alert('Correct!')
score += 1
} else {
alert('WRONG!')
}
}
question("question here", "answer here");
alert("Your score: " + score);
That's good, but it is not cleaner, because you dont't use arrays and you can't make count of right questions like 2/3.
how to convert html to exe
what is the
?
it means/gives you new line in the prompt window..
hii, you know how to make quiz game with jquery.
show me the html code of this part
Yes, strawberries are indeed yellow...
it was really good tutorial
good work. thank you for that.
window is not defined.
osm video mike
this isnt working for me
hey brother make a quiz which gives a rank to someone who attempt it among who have already attempted it
Do it yourself
روان و كريم youpi oof
THANKS MAN
tnx
Goood word i med the complett code plz and thank
you have .tort my how to code js
var problems= [
{
prompt:"what is your name?
(a)deepa
(b)rita
(c)Gita",
answer:" a"
},
{
prompt:"what is your age?
(a)10
(b)17
(c)18",
answer: "c"
},
{
prompt:"what is your scool?
(a)univrsal
(b)venky
(c)kmc",
answer: "a"
},
];
var score = 0;
for(var i=0;i
you have "else{ "wrong!!!"}" should be "else{alert(wrong!!!)}"
you variable score is not same as you initialize it what is 'marks' ?
great
It's a bit confusing though
helo Mike
mike insta id please :)