// Path: src/evaluation/evalBench/EvaluationResources.java
// public class EvaluationResources {
// 
// 	private static final ResourceBundle resourceBundle = ResourceBundle
// 			.getBundle(EvaluationResources.class.getPackage().getName()
// 					+ ".evaluationGui");
// 
// 	/**
// 	 * Prevent instantiation
// 	 */
// 	private EvaluationResources() {
// 	}
// 
// 	/**
// 	 * Retrieves a string from the resource bundle
// 	 */
// 	public static String getString(String key) {
// 		return resourceBundle.getString(key);
// 	}
// }
// 
// Path: src/evaluation/evalBench/task/DateQuestion.java
// public class DateQuestion extends Question {
// 
//     private Date m_correctAnswer = null;
// 	private Date m_givenAnswer = null;
// 
// 	public DateQuestion() {
// 		this("", "");
// 	}
// 
// 	public DateQuestion(String aQuestionId, String aQuestionText) {
// 		super(aQuestionId, aQuestionText);
// 	}
// 
//     @Override
//     @XmlElement
//     public Date getCorrectAnswer() {
//         return m_correctAnswer;
//     }
// 
//     public void setCorrectAnswer(Date m_correctAnswer) {
//         this.m_correctAnswer = m_correctAnswer;
//     }
// 
//     @Override
//     @XmlElement
//     public Date getGivenAnswer() {
//         return m_givenAnswer;
//     }
// 
//     public void setGivenAnswer(Date m_givenAnswer) {
//         this.m_givenAnswer = m_givenAnswer;
//     }
// 	
// 	@Override
// 	public Question clone() {
// 		DateQuestion clone = (DateQuestion) super.clone();
// 		
// 		if (m_correctAnswer != null) {
// 			clone.m_correctAnswer = new Date(m_correctAnswer.getTime());
// 		}
// 		
// 		if (m_givenAnswer != null) {
// 			clone.m_givenAnswer = new Date(m_givenAnswer.getTime());
// 		}
// 		
// 		return clone;
// 	}
// }


import java.util.Date;
import javax.swing.JComponent;
import com.toedter.calendar.JCalendar;
import evaluation.evalBench.EvaluationResources;
import evaluation.evalBench.task.DateQuestion;
package evaluation.evalBench.panel;





public class DateQuestionPanelStrategy extends QuestionPanelStrategy {

	//private JPanel answeringPanel;
	private JCalendar calendar;

	public DateQuestionPanelStrategy(DateQuestion aQuestion) {
		super(aQuestion);
	}

	@Override
	public boolean checkForCorrectInput() {

		if (calendar.getDate() != null) {
			Date selectedDate = calendar.getDate();
//			DateFormat formatDate = new SimpleDateFormat("yyyy-MM-dd");
//			String formatedDate = formatDate.format(selectedDate);

			((DateQuestion) super.getQuestion()).setGivenAnswer(selectedDate);
			setErrorMessage("");
			return true;
		}
		
// Path: src/evaluation/evalBench/EvaluationResources.java
// public class EvaluationResources {
// 
// 	private static final ResourceBundle resourceBundle = ResourceBundle
// 			.getBundle(EvaluationResources.class.getPackage().getName()
// 					+ ".evaluationGui");
// 
// 	/**
// 	 * Prevent instantiation
// 	 */
// 	private EvaluationResources() {
// 	}
// 
// 	/**
// 	 * Retrieves a string from the resource bundle
// 	 */
// 	public static String getString(String key) {
// 		return resourceBundle.getString(key);
// 	}
// }
// 
// Path: src/evaluation/evalBench/task/DateQuestion.java
// public class DateQuestion extends Question {
// 
//     private Date m_correctAnswer = null;
// 	private Date m_givenAnswer = null;
// 
// 	public DateQuestion() {
// 		this("", "");
// 	}
// 
// 	public DateQuestion(String aQuestionId, String aQuestionText) {
// 		super(aQuestionId, aQuestionText);
// 	}
// 
//     @Override
//     @XmlElement
//     public Date getCorrectAnswer() {
//         return m_correctAnswer;
//     }
// 
//     public void setCorrectAnswer(Date m_correctAnswer) {
//         this.m_correctAnswer = m_correctAnswer;
//     }
// 
//     @Override
//     @XmlElement
//     public Date getGivenAnswer() {
//         return m_givenAnswer;
//     }
// 
//     public void setGivenAnswer(Date m_givenAnswer) {
//         this.m_givenAnswer = m_givenAnswer;
//     }
// 	
// 	@Override
// 	public Question clone() {
// 		DateQuestion clone = (DateQuestion) super.clone();
// 		
// 		if (m_correctAnswer != null) {
// 			clone.m_correctAnswer = new Date(m_correctAnswer.getTime());
// 		}
// 		
// 		if (m_givenAnswer != null) {
// 			clone.m_givenAnswer = new Date(m_givenAnswer.getTime());
// 		}
// 		
// 		return clone;
// 	}
// }


// Path: src/evaluation/evalBench/panel/DateQuestionPanelStrategy.java
import java.util.Date;
import javax.swing.JComponent;
import com.toedter.calendar.JCalendar;
import evaluation.evalBench.EvaluationResources;
import evaluation.evalBench.task.DateQuestion;

package evaluation.evalBench.panel;





public class DateQuestionPanelStrategy extends QuestionPanelStrategy {

	//private JPanel answeringPanel;
	private JCalendar calendar;

	public DateQuestionPanelStrategy(DateQuestion aQuestion) {
		super(aQuestion);
	}

	@Override
	public boolean checkForCorrectInput() {

		if (calendar.getDate() != null) {
			Date selectedDate = calendar.getDate();
//			DateFormat formatDate = new SimpleDateFormat("yyyy-MM-dd");
//			String formatedDate = formatDate.format(selectedDate);

			((DateQuestion) super.getQuestion()).setGivenAnswer(selectedDate);
			setErrorMessage("");
			return true;
		}
		
		setErrorMessage(EvaluationResources.getString("datequestion.errorNull"));