/*
 * Copyright (c) 2005 Absolutely Training Limited
 * 
 * Created on 07-Dec-2005
 */
 
/**
 * Translation of the Java TestPage class into JavaScript
 * 
 * @author paulb
 */
function TestPage(first, last, total) {
	this.first = first;
	this.last = last;
	this.total = total;
	this.questions = [];
}

TestPage.prototype.addQuestion = function( question) {
    this.questions.push(question);
};

TestPage.prototype.getQuestions = function() {
    return this.questions;
};

/**
 * Generates test page header in the following format: "Questions: 10 - 20 of 60"
  */
TestPage.prototype.getPageHeader = function() {
    return "Questions: " + this.first + " - " + this.last + " of " + this.total;
};

TestPage.prototype.isLastPage = function() {
    return this.last == this.total;
};

/**
 * Number of first question on page
 */
TestPage.prototype.getFirst = function() {
    return this.first;
};

/**
 * Number of last question on page
 */
TestPage.prototype.getLast = function() {
    return this.last;
};

/**
 * Total amount of question in test, which page belongs to
 */
TestPage.prototype.getTotal = function() {
    return this.total;
};

