• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 2. The Online Test > questions.js—The JavaScript Source File

2.4. questions.js—The JavaScript Source File

Let's continue with questions.js , the JavaScript source file called by administer.html, shown in Example 2.2.

Example 2.2. The Beginning of the questions.js Source Code

     1  function question(answer, support, question, a, b, c, d) {
     2    this.answer = answer;
     3    this.support = support;
     4    this.question = question;
     5    this.a = a;
     6    this.b = b; 
     7    this.c = c;
     8    this.d = d;
     9    return this;
    10    }
    11  var units = new Array(
    12    new question("a", "The others are external objects.", 
    13    "Choose the built-in JavaScript object:",   "Image", "mimeType", 
    14    "Password", "Area"),
    15  // and so on ...
    16    }


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint