package cz.muni.fi.bronchus.questions; import java.util.Vector; /** * Standard Multiple Response question, with some amount of answers, * each can be correct or incorrect * @author Tomáš Udržal */ public class MultipleResponseQuestion extends Question { /** * Vector of answers */ private Vector answersWording; /** * Vector of answers's trueness */ private Vector answersTruth; /** * Shuffle order of answers */ private boolean shuffle; /** Creates a new instance of MultipleResponseQuestion */ public MultipleResponseQuestion() { super("Multiple Response"); answersWording=new Vector(); answersTruth=new Vector(); shuffle=false; } /** * Adds an answer and its trueness to the end of the Vector * @param x answer to be added * @param y trueness of the answer to be added */ public void addAnswer(String x, Boolean y) { answersWording.add(x); answersTruth.add(y); } /** * Getter method for the Vector of answers * @return Vector of answers */ public Vector getAnswersWording() { return answersWording; } /** * Getter method for the Vector of answers's trueness * @return Vector of answers's trueness */ public Vector getAnswersTruth() { return answersTruth; } /** * Setter method for the shuffle order of answers * @param x true if shuffle is enabled otherwise false */ public void setShuffle(boolean x) { shuffle=x; } /** * Getter method for the shuffle order of answers * @return true if shuffle is enabled otherwise false */ public boolean isShuffle() { return shuffle; } /** * Method for generating a response processing condition from a selected answers * @return response processing condition */ public String generateCondition() { String s=""; for (int i=0; i