<?

/* XMLFile
 * 
 * This is the interface for any class that interacts with the xml file that
 * contains the election and ballot data
 */

/* isGeneralElection($filename)
 *
 * This method returns true if the election is open to all undergraduates
 * (the questions that are asked are not restrictive in terms of who can
 * vote)
 *
 * In: String $filename - The name of the XML file to use
 * Return: boolean - true if everyone can vote in all questions, false if
 * otherwise
 */

 function isGeneralElection($filename){
	return true;
 }
 
/* getElectionStartTime($filename)
 *
 * This method gets the start time of the election from the XML file and
 * returns an instance of the Date class which has the information about
 * the start time.
 *
 * In: String $filename - The name of the XML file use
 * Return: Date Array - the date information for the starting time of the
 *   election (6 keys: "YEAR", "MONTH", "DAY", "HOUR", "MINUTE", "SECOND")
 */
 
function getElectionStartTime($filename){
	return NULL;
}

/* getElectionEndTime($filename)
 *
 * This method gets the ending time of the election from the XML file and
 * returns an instance of the Date class which has the information about
 * the start time.
 *
 * In: String $filename - The name of the XML file use
 * Return: Date Array - the date information for the ending time of the
 *   election (6 keys: "YEAR", "MONTH", "DAY", "HOUR", "MINUTE", "SECOND")
 */
 
function getElectionEndTime($filename){
	return NULL;
}

/* getImageDirectory($filename)
 *
 * This method returns the location of the image directory to use for
 * candidate pictures
 *
 * In: String $filename - the name of the XML file to use
 * Return: String - the directory location of the images on the server
 */

function getImageDirectory($filename){
	return "./";
}

/* getInfoDirectory($filename)
 *
 * This method returns the location of the personal information directory 
 * to use for candidate personal html pages (transformed from word docs)
 *
 * In: String $filename - the name of the XML file to use
 * Return: String - the directory location of the personal html pages on the server
 */

function getInfoDirectory($filename){
	return "./";
}

/* getElectionID($filename)
 *
 * This method gets the ID number of the election from the XML file.
 *
 * In: String $filename - The name of the XML file use
 * Return: int - the ID number for the election
 */
 
function getElectionID($filename){
	return 0;
}

/* getElectionTitle($filename)
 *
 * This method gets the title of the election from the XML file.
 *
 * In: String $filename - The name of the XML file use
 * Return: String - The title of the election
 */
 
function getElectionTitle($filename){
	return "";
}

/* getWelcomeText($filename)
 *
 * This method gets the welcoming text of the election from the XML file.
 * This text will be displayed on the welcoming page of the election.
 *
 * In: String $filename - The name of the XML file use
 * Return: String - the welcome text to be displayed on the first page the
 *   users see after logging in.
 */
 
function getWelcomeText($filename){
	return "";
}

/* getNumberOfQuestions($filename)
 *
 * This method gets the number of questions in the election from the XML file.
 *
 * In: String $filename - The name of the XML file use
 * Return: int - the number of questions in the current election
 */
 
function getNumberOfQuestions($filename){
	return 0;
}

/* getQuestions($filename)
 *
 * This method returns an array of all of the questions in the election.
 * Whenever all questions are needed (initial verification, to generate the
 * ballot etc...) this method is used to avoid parsing the xml file
 * multiple times
 *
 * In: String $filename - the name of the XML file to use
 * Return: Array - an array of questions
 */
 
function getQuestions($filename){
	return NULL;
}

/* generateQuestionArray($question_xml)
 *
 * This method generates an array for the question provided as an argument
 *
 * In: XML $question_xml - the XML element which is the
 *     question to generate the array for
 * Return: Array - an array representing the question
 * 			"text" => String - question text
 * 			"type" => String - type of question
 *			"voters" => Array of each year indicating if they can vote
 *				"freshman" => boolean - can freshmen vote?
 *				"sophmore" => boolean - can sophmores vote?
 *				"junior" => boolean - can juniors vote?
 *				"senior" => boolean - can seniors vote?
 *			"choices" => Array of candidate information
 *				"text" => String - candidate text
 *				"moreinfo" => Array
 *					"type" => link or file
 *					"location" => String - more information link
 *				"picture" => String - location of a picture to display
 *			["numchoose"] => int - number of things to choose from
 *			["moreinfo"] => String - Link for more information on the
 *			    question
 */

function generateQuestionArray($question_xml){
	return NULL;	
}

/* getQuestion($filename, $question_number)
 *
 * This method gets information about a specific question (specified by
 * number) and returns an instance of the Question class which contains all
 * of the information about the question.
 *
 * In: String $filename - The name of the XML file use
 * In: int $question_number - The number of the question that information
 *     is desired about.
 * Return: Question Array - an array which contains
 *     information about the desired question number.
 */
 
function getQuestion($filename, $question_number){
	return NULL;
}

?>
