Submit Button Not Changing Questions
A PHP Error was encountered
Severity: Notice
Message: Undefined index: userid
Filename: views/question.php
Line Number: 191
Backtrace:
File: /var/www/html/cnasolution/application/views/question.php
Line: 191
Function: _error_handler
File: /var/www/html/cnasolution/application/controllers/Questions.php
Line: 419
Function: view
File: /var/www/html/cnasolution/index.php
Line: 315
Function: require_once
Submit Button Not Changing Questions
I am building a cute webpage for my teacher (who's very fun) as a Christmas present, but whenever I enter text into the input box and submit any question past the first, the code marks it as incorrect. I thought I had fixed this problem when I changed the question submit, every time the question changes, but apparently not. Can someone tell me what I'm doing wrong?
Funn Chunn | Quiz Funn Chunn | Quiz
JavaScript
var mainHeaderJs = document.getElementById("mainHeader"); var questionBoxJs = document.getElementById("questionBox"); var inputBoxJs = document.getElementById("inputBox"); var inputBoxOuterJs = document.getElementById("inputBoxOuter"); var subTextJs = document.getElementById("subText"); var logoImgOuterJs = document.getElementById("logoImgOuter"); var playAgainOuter = document.getElementById("playAgainOuter"); var playerScore = 0; function finalScore() { mainHeaderJs.innerHTML = "You Got a Score of " + playerScore + " Out of 10"; playAgainOuter.innerHTML = "" questionBoxJs.innerHTML = ""; inputBoxOuterJs.innerHTML = ""; } function playAgain() { mainHeaderJs.innerHTML = "Funn Chunn | Quiz"; firstQ(); playerScore = 0; playAgainOuter.innerHTML = ""; inputBoxOuterJs.innerHTML = ""; } function moveOnGood() { subTextJs.innerHTML = "Correct! Moving on to the next question"; setTimeout(function () { subTextJs.innerHTML = ""; }, 2000); } function moveOnBad() { subTextJs.innerHTML = "Moving on to the next question..."; setTimeout(function () { subTextJs.innerHTML = ""; }, 2000); } function firstQ() { setTimeout(function () { questionBoxJs.innerHTML = "Question 1: What is Mrs. Chunn's Favorite Team?"; }, 2000); } function firstQAnswer() { var Q1Answer = inputBoxJs.value; Q1Answer = Q1Answer.toUpperCase(); if (Q1Answer == "ALABAMA") { inputBoxOuterJs.innerHTML = ""; playerScore += 1; moveOnGood(); secondQ(); } else if (Q1Answer == "CRIMSON") { inputBoxOuterJs.innerHTML = ""; playerScore += 1; moveOnGood(); secondQ(); } else if (Q1Answer == "CRIMSON TIDE") { inputBoxOuterJs.innerHTML = ""; playerScore += 1; moveOnGood(); secondQ(); } else { inputBoxOuterJs.innerHTML = ""; moveOnBad(); secondQ(); } } function secondQ() { setTimeout(function () { questionBoxJs.innerHTML = "Question 2: Is Mrs. Chunn a Millenial?"; }, 2000); } function secondQAnswer() { var Q2Answer = inputBoxJs.value; Q2Answer = Q2Answer.toUpperCase(); if (Q2Answer == "YES") { inputBoxOuterJs.innerHTML = ""; playerScore += 1; moveOnGood(); thirdQ(); } else if (Q2Answer == "YEAH") { inputBoxOuterJs.innerHTML = ""; playerScore += 1; moveOnGood(); thirdQ(); } else if (Q2Answer == "Y") { inputBoxOuterJs.innerHTML = ""; playerScore += 1; moveOnGood(); thirdQ(); } else { inputBoxOuterJs.innerHTML = ""; moveOnBad(); thirdQ(); } }