I'm writing a program for some quiz software. I have a question class containing the ArrayLists for the question, answer, options, marks and negative marks. Something like this:
class question
{
private ArrayList<Integer> index_list;
private ArrayList<String> question_list;
private ArrayList<String> answer_list;
private ArrayList<String> opt1_list;
private ArrayList<String> opt2_list;
}
I want to shuffle all questions, but for questions to be shuffled, all the objects need to be shuffled. I would have approached this problem in this way:
First of all, I would not have used this design and used String not ArrayList<String>
type as instance variables, and would then have used the Collections.shuffle
method to shuffle objects. But my team insists on this design.
Now, the question class is containing increasing ArrayLists as the entry to the questions are made. How to shuffle the questions now?