// 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/YesNoQuestion.java
// public class YesNoQuestion extends Question {
// 
//     private Boolean m_correctAnswer = null;
// 	private Boolean m_givenAnswer = null;
// 
// 	public YesNoQuestion() {
// 		this("", "");
// 	}
// 
// 	/**
// 	 * @param aQuestionId
// 	 * @param aQuestionText
// 	 */
// 	public YesNoQuestion(String aQuestionId, String aQuestionText) {
// 		super(aQuestionId, aQuestionText);
// 	}
// 
//     public YesNoQuestion(String aQuestionId, String aQuestionText,
//             Boolean correctAnswer) {
//         super(aQuestionId, aQuestionText);
//         this.m_correctAnswer = correctAnswer;
//     }
// 
//     @Override
//     @XmlElement
//     public Boolean getCorrectAnswer() {
//         return m_correctAnswer;
//     }
// 
//     public void setCorrectAnswer(Boolean correctAnswer) {
//         this.m_correctAnswer = correctAnswer;
//     }
// 
//     @Override
//     @XmlElement
//     public Boolean getGivenAnswer() {
//         return m_givenAnswer;
//     }
// 
//     /**
//      * @param givenAnswer
//      *            - The answer selected by the user
//      */
//     public void setGivenAnswer(Boolean givenAnswer) {
//         this.m_givenAnswer = givenAnswer;
//     }
// }


import java.awt.FlowLayout;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import evaluation.evalBench.EvaluationResources;
import evaluation.evalBench.task.YesNoQuestion;

package evaluation.evalBench.panel;



/**
 * @author David
 * 
 */
public class YesNoQuestionPanelStrategy extends QuestionPanelStrategy {

	private ButtonGroup radioButtonGroup;
	private JRadioButton yesButton, noButton;

	/**
	 * @param aTask
	 */
	public YesNoQuestionPanelStrategy(YesNoQuestion aTask) {
		super(aTask);
	}

	@Override
	public boolean checkForCorrectInput() {

		if (yesButton.isSelected()) {
			((YesNoQuestion) super.getQuestion()).setGivenAnswer(true);
			setErrorMessage("");
			return true;
		} else if (noButton.isSelected()) {
			((YesNoQuestion) super.getQuestion()).setGivenAnswer(false);
			setErrorMessage("");
			return true;
		} else {
			setErrorMessage(EvaluationResources.getString("yesnoquestion.errorSelect"));
			return false;
		}
	}

	@Override
	public JPanel getNewAnsweringPanel() {
		JPanel innerPanel = new JPanel();
		innerPanel.setLayout(new FlowLayout());


// 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/YesNoQuestion.java
// public class YesNoQuestion extends Question {
// 
//     private Boolean m_correctAnswer = null;
// 	private Boolean m_givenAnswer = null;
// 
// 	public YesNoQuestion() {
// 		this("", "");
// 	}
// 
// 	/**
// 	 * @param aQuestionId
// 	 * @param aQuestionText
// 	 */
// 	public YesNoQuestion(String aQuestionId, String aQuestionText) {
// 		super(aQuestionId, aQuestionText);
// 	}
// 
//     public YesNoQuestion(String aQuestionId, String aQuestionText,
//             Boolean correctAnswer) {
//         super(aQuestionId, aQuestionText);
//         this.m_correctAnswer = correctAnswer;
//     }
// 
//     @Override
//     @XmlElement
//     public Boolean getCorrectAnswer() {
//         return m_correctAnswer;
//     }
// 
//     public void setCorrectAnswer(Boolean correctAnswer) {
//         this.m_correctAnswer = correctAnswer;
//     }
// 
//     @Override
//     @XmlElement
//     public Boolean getGivenAnswer() {
//         return m_givenAnswer;
//     }
// 
//     /**
//      * @param givenAnswer
//      *            - The answer selected by the user
//      */
//     public void setGivenAnswer(Boolean givenAnswer) {
//         this.m_givenAnswer = givenAnswer;
//     }
// }


// Path: src/evaluation/evalBench/panel/YesNoQuestionPanelStrategy.java
import java.awt.FlowLayout;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import evaluation.evalBench.EvaluationResources;
import evaluation.evalBench.task.YesNoQuestion;

package evaluation.evalBench.panel;



/**
 * @author David
 * 
 */
public class YesNoQuestionPanelStrategy extends QuestionPanelStrategy {

	private ButtonGroup radioButtonGroup;
	private JRadioButton yesButton, noButton;

	/**
	 * @param aTask
	 */
	public YesNoQuestionPanelStrategy(YesNoQuestion aTask) {
		super(aTask);
	}

	@Override
	public boolean checkForCorrectInput() {

		if (yesButton.isSelected()) {
			((YesNoQuestion) super.getQuestion()).setGivenAnswer(true);
			setErrorMessage("");
			return true;
		} else if (noButton.isSelected()) {
			((YesNoQuestion) super.getQuestion()).setGivenAnswer(false);
			setErrorMessage("");
			return true;
		} else {
			setErrorMessage(EvaluationResources.getString("yesnoquestion.errorSelect"));
			return false;
		}
	}

	@Override
	public JPanel getNewAnsweringPanel() {
		JPanel innerPanel = new JPanel();
		innerPanel.setLayout(new FlowLayout());


		yesButton = new JRadioButton(EvaluationResources.getString("yesnoquestion.yes"));
