// 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/ItemSelectionQuestion.java
// public class ItemSelectionQuestion extends Question{
// 	private static final String SEPARATOR = ", ";
// 	
//     protected SortedSet<String> m_answeredSelected_Item_ID = null;
// 	protected SortedSet<String> m_correctSelected_Item_ID = null;
// 	
// 	public ItemSelectionQuestion(){
// 	    super();
// 	}
// 	
//     public ItemSelectionQuestion(String aQuestionId, String aQuestionText){
//         super(aQuestionId, aQuestionText);
//     }
//     
// 	public ItemSelectionQuestion(String aQuestionId, String aQuestionText, SortedSet<String> correctItemIDs){
// 		super(aQuestionId, aQuestionText);
// //		m_answeredSelected_Item_ID = new TreeSet<String>();
// 		m_correctSelected_Item_ID = correctItemIDs;
// 	}
// 	
// 	@Override
//     @XmlElementWrapper(name = "givenAnswers") 
//     @XmlElement(name = "givenAnswer")
// 	public SortedSet<String> getGivenAnswer() {
// 		return m_answeredSelected_Item_ID;
// 	}
// 	
// 	public void setGivenAnswer(SortedSet<String> answeredSelectedItemID) {
// 		m_answeredSelected_Item_ID = answeredSelectedItemID;
// 	}
// 	
// 	@XmlElementWrapper(name = "correctAnswers") 
// 	@XmlElement(name = "correctAnswer")
// 	public SortedSet<String> getCorrectAnswer() {
// 		return m_correctSelected_Item_ID;
// 	}
// 	
// 	public void setCorrectAnswer(SortedSet<String> mCorrectSelectedItemID) {
// 		m_correctSelected_Item_ID = mCorrectSelectedItemID;
// 	}
// 	
// 	@Override
// 	public String exportCorrectAnswer() {
// 	    return StringUtils.join(m_correctSelected_Item_ID, SEPARATOR);
// 	}
// 
// 	@Override
// 	public String exportGivenAnswer() {
//         return StringUtils.join(m_answeredSelected_Item_ID, SEPARATOR);
// 	}
// 	
// 	@Override
// 	public Question clone() {
// 		// TODO convert shallow copy to a deep copy
// 		return super.clone();
// 	}
// }


import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.util.SortedSet;
import java.util.TreeSet;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextPane;
import org.apache.commons.lang3.StringUtils;
import evaluation.evalBench.EvaluationResources;
import evaluation.evalBench.task.ItemSelectionQuestion;

package evaluation.evalBench.panel;





public class ItemSelectionQuestionPanelStrategy extends QuestionPanelStrategy{
	JTextPane itemPane;
	//JToggleButton jStartSelectionButton;
	SortedSet<String> selectedItems;
	
	public ItemSelectionQuestionPanelStrategy(ItemSelectionQuestion aTask) {
        super(aTask);
        selectedItems = new TreeSet<String>();
    }
	
	@Override
	public boolean checkForCorrectInput() {
		this.setErrorMessage((""));
		if (selectedItems != null && selectedItems.size()>0){
            //jStartSelectionButton.setSelected(false);

            ((ItemSelectionQuestion)super.getQuestion()).setGivenAnswer(selectedItems);
            return true;
        }

        // otherwise show error msg

// 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/ItemSelectionQuestion.java
// public class ItemSelectionQuestion extends Question{
// 	private static final String SEPARATOR = ", ";
// 	
//     protected SortedSet<String> m_answeredSelected_Item_ID = null;
// 	protected SortedSet<String> m_correctSelected_Item_ID = null;
// 	
// 	public ItemSelectionQuestion(){
// 	    super();
// 	}
// 	
//     public ItemSelectionQuestion(String aQuestionId, String aQuestionText){
//         super(aQuestionId, aQuestionText);
//     }
//     
// 	public ItemSelectionQuestion(String aQuestionId, String aQuestionText, SortedSet<String> correctItemIDs){
// 		super(aQuestionId, aQuestionText);
// //		m_answeredSelected_Item_ID = new TreeSet<String>();
// 		m_correctSelected_Item_ID = correctItemIDs;
// 	}
// 	
// 	@Override
//     @XmlElementWrapper(name = "givenAnswers") 
//     @XmlElement(name = "givenAnswer")
// 	public SortedSet<String> getGivenAnswer() {
// 		return m_answeredSelected_Item_ID;
// 	}
// 	
// 	public void setGivenAnswer(SortedSet<String> answeredSelectedItemID) {
// 		m_answeredSelected_Item_ID = answeredSelectedItemID;
// 	}
// 	
// 	@XmlElementWrapper(name = "correctAnswers") 
// 	@XmlElement(name = "correctAnswer")
// 	public SortedSet<String> getCorrectAnswer() {
// 		return m_correctSelected_Item_ID;
// 	}
// 	
// 	public void setCorrectAnswer(SortedSet<String> mCorrectSelectedItemID) {
// 		m_correctSelected_Item_ID = mCorrectSelectedItemID;
// 	}
// 	
// 	@Override
// 	public String exportCorrectAnswer() {
// 	    return StringUtils.join(m_correctSelected_Item_ID, SEPARATOR);
// 	}
// 
// 	@Override
// 	public String exportGivenAnswer() {
//         return StringUtils.join(m_answeredSelected_Item_ID, SEPARATOR);
// 	}
// 	
// 	@Override
// 	public Question clone() {
// 		// TODO convert shallow copy to a deep copy
// 		return super.clone();
// 	}
// }


// Path: src/evaluation/evalBench/panel/ItemSelectionQuestionPanelStrategy.java
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.util.SortedSet;
import java.util.TreeSet;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextPane;
import org.apache.commons.lang3.StringUtils;
import evaluation.evalBench.EvaluationResources;
import evaluation.evalBench.task.ItemSelectionQuestion;

package evaluation.evalBench.panel;





public class ItemSelectionQuestionPanelStrategy extends QuestionPanelStrategy{
	JTextPane itemPane;
	//JToggleButton jStartSelectionButton;
	SortedSet<String> selectedItems;
	
	public ItemSelectionQuestionPanelStrategy(ItemSelectionQuestion aTask) {
        super(aTask);
        selectedItems = new TreeSet<String>();
    }
	
	@Override
	public boolean checkForCorrectInput() {
		this.setErrorMessage((""));
		if (selectedItems != null && selectedItems.size()>0){
            //jStartSelectionButton.setSelected(false);

            ((ItemSelectionQuestion)super.getQuestion()).setGivenAnswer(selectedItems);
            return true;
        }

        // otherwise show error msg

        this.setErrorMessage(EvaluationResources.getString("itemsel.taskpanel.error"));
