JavaScript Quiz 1

First Name
Last Name
Password
Password

 

  1. if minutes = 9 & timeSt = ((minutes < 10) ? ":0" : ":") + minutes; Then timeSt equals
    A. :0
    B. :09
    C. :9
    D. 9
  1. The prompt() method requires two pieces of information. The first is text to be displayed, and the second is the default data in the entry field.
    A. true
    B. false
  1. You have to specify the language attribute when using the SCRIPT tag.
    A. true
    B. false
  1. The attributes for the SCRIPT tag are:
    A. LANGUAGE
    B. INCLUDE
    C. EXT
    D. ARCHIVE
    E. SRC
  1. The extension for external files within the SCRIPT tag is
    A. .ext
    B. .pl
    C. .js
    D. .inc
  1. JavaScript comment tags (not HTML tags)
    A. //
    B. <!-- xxxx -->
    C. /* xxx */
    D. ‘
    E. rem
  1. document.write('<IMG SRC="welcome.gif">'); is a valid JavaScript statement
    A. true
    B. false
  1. a == b returns (if a = new Array(1,2) and b = new Array(1,2))
    A. true
    B. false
  1. 4 == "4" returns
    A. true
    B. false
  1. Which of the following are legal variable names?
    A. _dummy
    B. v13
    C. 13v
    D. A9

 

JavaScript Quiz 1 Results

 

"; $txtStr .= ""; $txtStr .= ""; $txtStr .= "\n"; $txtFile = fopen($file, "a+"); $txtFile.fwrite($txtFile, $txtStr); $txtFile.fclose($txtFile); /********** EOF Writes the Results to a Text File **********/ /********** Writes the Results to the DB **********/ $where = "WHERE Last = '". $Last ."' AND Password = '". $Password ."'"; $strSQL = "SELECT * FROM $table ". $where; $update = "UPDATE $table SET ". $test ." = '". $correct ."' ". $where; $conn = @mysql_connect($dbhost, $dbuser, $dbpwd) or die(mysql_error()); $db = @mysql_select_db($db, $conn) or die(mysql_error()); $rsStudent = @mysql_query($strSQL, $conn); if (mysql_num_rows($rsStudent)) { $field = mysql_fetch_assoc($rsStudent); if ($field[$test] == NULL) { mysql_query($update); echo("

Quiz Score has been entered.

"); } else { echo("

You already have a score for this test.

"); $OK = FALSE; } } else { echo("

Name/Password was not in the Database.

"); $OK = FALSE; } mysql_close($conn); /********** EOF Writes the Results to the DB **********/ if ($OK) { // Write Out the Results only if valid Name/Password /********** Writes the Results to the Webpage **********/ echo($correct ." Out of ". $Questions ." (". round(($correct / $Questions) * 100) ."%)
"); if ($correct == $Questions) echo("Congratulations on getting a 100%"); else if ($correct == $Questions - 1) { echo("

"); echo("Correct Answer:
"); echo("Q". $wrong[1] ." = ". $Question[$wrong[1]]); } else { echo("

"); echo("Correct Answers:
"); for ($i = 1; $i <= count($wrong); $i++) { echo("Q". $wrong[$i] ." = ". $Question[$wrong[$i]] ."
"); } } /********** End of Writes the Results to the Webpage **********/ /********** References for incorrect answers **********/ if (strpos($incorrec, "1 ")) { echo('

Question 1: Cl ock Example'); echo('
Question 1: Annotated Clock Example'); } if (strpos($incorrec, "2")) { echo('

Question 2: Prompt Reference'); } if (strpos($incorrec, "8")) { echo('

Question 8: Comparison Operators'); } if (strpos($incorrec, "9")) { echo('

Question 9: Comparison Operators'); } /********** End of References for incorrect answers **********/ } // End of OK - Writing Out the Results ?>

"; $txtStr .= $First ." ". $Last; $txtStr .= ""; $txtStr .= $correct; $txtStr .= ""; if (strlen($incorrec) > 0) $txtStr .= $incorrec; else $txtStr .= " "; $txtStr .= ""; $txtStr .= $DT; $txtStr .= "