<?php
namespace Main\StrategyPattern;

require_once 'IMarker.php';

class SingleChoice implements IMarker
{
	// Attributes
	private $_correctAnswer;
	
	// Constructor
	
	public function __construct($correctAnswer)
	{
		$this->_correctAnswer = $correctAnswer;
	}
	
	// Methods for properties
	// Getters and Setters
	
	// Methods
	public function Mark($answers)
	{
		// If we are passed an array, it should contain just
		// one answer
		if(is_array(($answers)))
		{
			if(count($answers) == 1)
			{
				$answers = $answers[0];
			}
		}
		
		if($answers == $this->_correctAnswer)
		{
			return true;				
		}
		return false;
	}
}
?>