<!--
function makeArray(len) {
    for (var i = 0; i < len; i++) this[i] = null;
this.length = len;
}

function makeQuestion(question, correctAnswer) {
var args = makeQuestion.arguments;
this.question = question;
this.correctAnswer = correctAnswer;
this.userAnswer = null;
this.isCorrect = isCorrect;
this.showForm = showForm;
this.userChoices = new makeArray(args.length - 2);
   for (var i = 0; i < args.length - 2; i++) { 
   this.userChoices[i] = args[i + 2];
   }
}
function isCorrect() {
if (this.correctAnswer == this.userAnswer) return true;
else return false;
}
// Method to display contents of question object.
function showForm(n) {
document.write('<p>' + (n + 1) + '. ' + this.question + '<BLOCKQUOTE><FORM>');
    for (var i = 0; i < this.userChoices.length; i++) {
        document.write('<INPUT TYPE = "RADIO" NAME = "q' + n + 
                       '" onClick = "quiz[' + n + '].userAnswer = ' + i + '">');
        document.write(this.userChoices[i] + '<BR>');
    }
document.write('</FORM></BLOCKQUOTE>');
}
// Function to correct the quiz and display score, correct answers.
function correctQuiz() {
var correct = 0;
correctPage = '<HTML><HEAD><TITLE>Corrections</TITLE><LINK REL="StyleSheet" HREF="media.css" TYPE="text/css"></HEAD><BODY>';
    for (var i = 0; i < quiz.length; i++) {
    if (quiz[i].isCorrect()) correct++;
    }
var score = Math.round((correct / quiz.length) * 100);
correctPage += '<SPAN CLASS="hi">Score: ' + score + ' %</SPAN>';
    if (correct < quiz.length) { 
    correctPage += ifWrong;
        for (var i = 0; i < quiz.length; i++) {
            if (!quiz[i].isCorrect()) {
            correctPage += (i + 1) + '. ' +
            quiz[i].userChoices[quiz[i].correctAnswer] + '<BR>';
            }
        }
    }
    else correctPage += ifAced;
correctPage += '<P><A HREF="JAVASCRIPT:void(0);" onClick="window.close()">Close this window.</A></BODY></HTML>';
correctwin = window.open ('', '', 'height=375,width=300,scrollbars=yes,left=50,top=50');
    if (correctwin.opener == null) correctwin.opener = window;
correctwin.location = 'javascript:opener.correctPage';
}
// Message to display if quiz is aced.
var ifAced = "<P>What a star! All right.<P>"; 
// Message to display if any are wrong.
var ifWrong = "<P>Here are the correct answers to the questions you got wrong:<P>";

quiz = new makeArray(10);
quiz[0] = new makeQuestion("In March 2007, which UK public service broadcaster struck a deal with YouTube to provide video clips?", 2,                                                         "ITV",                
                           "Channel 4",               
                           "BBC");              
quiz[1] = new makeQuestion("What is the name of the TV channel, launched by former American Vice-President Al Gore, which hopes to 'democratise' television by showing user-generated content?", 0,
                           "Current TV",
                           "See Me TV", 
                	   "We TV");
quiz[2] = new makeQuestion("In which online world can you spend Linden Dollars and visit a Swedish embassy, the world's first virtual embassy?", 2, 
                           "World of Warcraft", 
                           "Ultima",
                           "Second Life");
quiz[3] = new makeQuestion("What is an avatar?", 0, 
                           "A graphical representation of a user, perhaps in a chat room or virtual world.",
                           "An online discussion forum.", 
                           "A type of videogame focused on role-playing.");
quiz[4] = new makeQuestion("What does DRM stand for?", 1, 
                           "Digital Restriction Mechanism",
                           "Digital Rights Management", 
                           "Digital Rights Maintenance");
quiz[5] = new makeQuestion("What is broadcast on BBC7?", 0, 
                           "Spoken word comedy, drama and children's programmes.",
                           "User-generated content like videos and music.", 
                           "Classic children's TV programmes.");
quiz[6] = new makeQuestion("Which organisation allows creators of digital content to licence their work so others can re-use it without giving up all rights of ownership.", 2, 
                           "Copyright Control",
                           "Controlling Creativity", 
                           "Creative Commons");
quiz[7] = new makeQuestion("What is a wiki?", 2, 
                           "A website indexing music and video files for download.",
                           "A message board.", 
                           "A website which users can edit.");
quiz[8] = new makeQuestion("Which organisation is behind the XO?", 0, 
                           "One Laptop Per Child",
                           "Apple", 
                           "Wikimedia");
quiz[9] = new makeQuestion("TiVO and Sky+ are examples of...", 1, 
                           "...Electronic Programme Guides (EPGs)",
                           "...Personal Video Recorders (PVRs)", 
                           "...Personal Digital Assistants (PDAs)");

// -->
