package cz.muni.fi.bronchus.questions; import java.util.Vector; /** * Ordering Objects question, with some amount of answers and their order * @author Tomáš Udržal */ public class OrderingObjectsQuestion extends Question { /** * Vector of answers */ private Vector answers; /** * Vector of answers's orders */ private Vector orders; /** * Horizontally adjustment of answers */ private boolean horizontally; /** * Shuffle order of answers */ private boolean shuffle; /** Creates a new instance of OrderingObjectsQuestion */ public OrderingObjectsQuestion() { super("Ordering Objects"); answers=new Vector(); orders=new Vector(); shuffle=false; horizontally=true; } /** * Setter method for the adjustment of answers * @param x true if horizontally false if vertically */ public void setHorizontally(boolean x) { horizontally=x; } /** * Getter method for the adjustment of answers * @return true if horizontally false if vertically */ public boolean isHorizontally() { return horizontally; } /** * Adds an answer to the end of the Vector * @param x answer to be added */ public void addAnswer(String x) { answers.add(x); } /** * Adds an answer's order to the end of the Vector * @param x answer's order to be added */ public void addAnswerOrder(String x) { orders.add(x); } /** * Getter method for the Vector of answers * @return Vector of answers */ public Vector getAnswers() { return answers; } /** * Getter method for the Vector of answers's orders * @return Vector of answers's orders */ public Vector getOrders() { return orders; } /** * Setter method for the shuffle of answers * @param x true if shuffle of answers is enabled otherwise false */ public void setShuffle(boolean x) { shuffle=x; } /** * Getter method for the shuffle of answers * @return true if shuffle of answers 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