Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by TheShadowGamer

  1. Okay so now I'm having issues making it so the buttons actually go somewhere. Where do I apply the link to the buttons so it doesn't A. Create a button above my word as in this version. B. put the href somewhere that it doesn't screw up my divs and form? Also if I do this localStorage.setItem("gatorScore",gator); how do I actually store the value of var gator? Just add another comma? <!doctype html> <html> <head> <meta charset="UTF-8" /> <title>Find Out Your Spirit Animal</title> <meta name="viewport" content="width=device
  2. To be honest I can tell that he enjoys making us suffer, and my friends in the class agree with me. Before spring break he put 4 assignments due in one week, we only had 2 weeks to do them, one of which was a project that I basically spent most of those 2 weeks working on, while also having to work on a 3D model due the same week, and after we got back and he saw that half the class had dropped out he essentially said he purposely did that just to weed out the people without the willpower to do the work.
  3. Okay I'm currently working on setting up my "check" function in this to save the values but the issue I can't seem to fix at the moment is that I'm getting the error "Unexpected token else" on line 88* and I can't seem to find the problem. Maybe someone else can spot what I'm missing. <!doctype html> <html> <head> <meta charset="UTF-8" /> <title>Find Out Your Spirit Animal</title> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" type="text/css" href="quiz.css"> </head> <body&g
  4. He wants JavaScript, HTML, CSS and he recommended using JSON that does the following " Take in and store user input from at least 5 different questions answered by the user via HTML form elements (2 points) Use an array of options to correlate user data to a matrix of potential results you've designed (2 points) Dynamically display appropriate result images and text to the user after completing the questions (2 points) Format appropriately for use on a mobile, tablet, or desktop screen using media queries (2 points) Include original content that communicates
  5. I wish it were that simple but our teacher wants it one question per page and we have to transfer the data page by page and then give the user a personality, or in my case spirit animal based on the answers they provided. Another issue is he recommended using JSON, but we've never even used it before.
  6. Okay, here is what I have so far. First my HTML <!DOCTYPE HTML> <html> <head> <meta content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Find Out Your Spirit Animal</title> <link rel="stylesheet" type="text/css" href="quiz.css"> </head> <body> <div id= "myQuiz"> <h1>Spirit Animal Quiz</h1> <div class = "progress"> <div class="on"></div> <div></div>
  7. What I currently have is the questions setup in JSON and then I'm calling them into the HTML. Would that work for recording the values or would I need to put them elsewhere in order to record the values in JSON? Main reason I don't know if this would work is because the JSON tutorial I found showed doing this with answers already determined, don't know if me putting the questions in JSON would make it impossible to actually take the users answer as the value or not.
  8. Okay, my professor told me to use JSON. But now I can't figure out how to make JSON take the users choice from a radio button. I've found how to do it for entered information, but can't figure out how to make it take a buttons input. Basically how do I make it record the button press in JSON and add the value to the appropriate selection? I do love how he wants me to use something we haven't used before on a project of all things. "question" : "How would you describe your skin?", "answer" : [ {"id" : 0, "text" : "Rough"}, {"id" : 1, "text"
  9. I'll give it a shot, thanks!
  10. So, I'm really stuck. I know how to make a quiz just fine, with radio buttons, go to the next page, etc., but for our project we have to make the quiz go from one page to the next and hold the answers provided, and then at the end we need to output the result by combining the answers. Essentially it's a personality quiz type thing, rather than a scoring one. My idea is to add 1 each time an answer corresponding to that personality is given, but how to I transfer those values from one page to the next?
  11. I also tried creating a separate else if statement if the variable is null at the main menu and I still get an error from it.
  12. I got it to work, I feel like an idiot because it was as simple as changing document.write(res[i]+"-blip "); to res[i] = (res[i]+"-blip "); It took me so long to figure out something so simple. For f**ks sake brain, work with me here! Okay so I have one last problem. How do I get cancel to work at the main menu without causing an error? I already tried doing || null at the beginning or end. But I need the "Thanks using the..." message and I can't get it to pop of if I don't include "null" in that statement. <!DOCTYPE html> <html> <head> <title>Project 1 – M
  13. working on fixing the indentation, but what I'm trying to do is have it converted in PROGRAM 2: adding -blip to words 5 characters or more and adding clang to less than character words, but then I need to actually call upon the converted versions in PROGRAM 3, so what do I use to permanently change the strings within the array* for when I call on them? Better looking now? Maybe? <!DOCTYPE html> <html> <head> <title>Project 1 – Michael Fiorello</title> <p id="demo"></p> <script> do { //MAIN MENU var input = p
  14. <!DOCTYPE html> <html> <head> <title>Project 1 – Michael Fiorello</title> <p id="demo"></p> <script> do { //MAIN MENU var input = prompt("Please enter 1, 2, 3, or exit."); { //PROGRAM 1-Enter the string to be converted to robot speak if (input === "1") do { var one = prompt ("Please enter a string.");{ if (one === "") { console.warn("You need to enter something");} } }while (one === "")//keep repeating program
  15. Just found the getElementById page a moment ago, was about to update I was going to attempt to implement. For for(i = 0; i<res.one; i++) i = 0 is stating to start with the first array. i++ is adding to the counter. Trying to remember what i<res.one is I think it makes it so it can go on forever as long as var one exists. Only learned it for the first time yesterday. I know that if I did i<10 it would stop after the tenth interval //Never mind that edit was stupid.
  16. So I got program 2 to function, but it's not adding blip and clang to the words as well as keeping them as an array. I also can't figure out where to implement "<p id="trythis"></p>" to actually use "document.getElementBtId('trythis').innerHTML ="whatever"" and definitely need it because document.write seems to do f**k all. //Removed code for updated version below.
  17. Or how do I declare that input as an array once it's split if that's the issue. That's the last thing I can think of.
  18. So what does the string default to if not arr? I tried one, Array, array, res, and i and still not working. So what do I use instead of document write? Thats what we were taught in our tutorial videos
  19. I think I've got it but I can't figure out how to fix line 24 so that it will actually do it. <!DOCTYPE html> <html> <head> <title>Project 1 – Michael Fiorello</title> <script> do{ //MAIN MENU var input = prompt ("Please enter 1, 2, 3, or exit.");{ //PROGRAM 1-Enter the string to be converted to robot speak if(input == "1") do{ var one = prompt ("Please enter a string.");{ if (one == "") { console.warn("You need to enter something");} }
  20. I think I understand what you mean, but what do I replace this "alert" message with alert("'"+res[0]+"'" + " length is: "+res[0].length); to just record them as an array?
  21. Currently what I can't figure out is how to record them rather than just saying the lengths. I need to be able to do this If a word is five or more letters long, add “-blip” to the end of the word If a word is less than five letters long, add “-clang” to the end of the word. It's the only part of the program that I'm completely dumbfounded on.
  22. Thank you, that seems like it will work perfectly.
  23. So what I want to do is make it so the user enters a string. For example a prompt comes up and the user enters "I want to do something" into the text box. Is there a way to make each word into its own variable so that they would become var I var want var to var do var something so that I can then check length and change each individually? Trying to find a way, but all I can find is checking length of an entered string, but not the ability to check each word individually.
  24. I got it to work by removing null and replacing it with ""
  25. I still have no clue what you mean or how to fix it. I tried changing it to == also.
  • Create New...