Array
University of Oregon

Quiz Ninja, Ch. 2

The following steps cover an example of client-side JavaScript from Ch. 2 of our textbook:

  1. Download the Ch. 2 Quiz Ninja files to the 111 folder on your computer as follows:

    a) Download index.htm to 111/p2/quiz-ninja.html. Do not name the file index.html.
    b) Download scripts.js to 111/p2/js/scripts.js.
    c) Download styles.css to 111/p2/css/styles.css.

  2. Open your 111 folder in a text editor (Sublime, Atom or Brackets).
  3. Preview the web app in Chrome.
  4. Use CyberDuck to upload all three files to folders with the same name on the uoregon.edu server. Do not upload a file named index.html; the correct file name is quiz-ninja.html.
  5. In Chrome, open the 111/p2/quiz-ninja.html web page that is on the uoregon.edu server, to make sure that it works the same as when you preview the web page on your computer.
  6. Open the JavaScript Primer in Chrome. Study the syntax of  the if  and if-else statements. See also pp. 69-72 in Ch. 3 of our textbook.
  7. Add an if statement to scripts.js to alert the user when a correct answer is given. Test it by previewing quiz-ninja.html in Chrome.
  8. Change the if to an if-else that alerts the user when a correct answer is given, and also alerts the user when an incorrect answer is given.
    Test it by previewing quiz-ninja.html in Chrome.
  9. After the previous step is correct and complete, use CyberDuck to upload the final version of quiz-ninja.html and scripts.js to the server. This will be a Project 2 deliverable.
Skip to toolbar