public Quiz getQuizFromContents() { List<Question> questions = new ArrayList<Question>(); for (QuestionEditor editor : questionEditorList) { questions.add(editor.getQuestionFromContents()); } return new Quiz(titleTxt.getText(), authorTxt.getText(), questions); }
public QuestionEditor addNewQuestionEditor() { QuestionEditor questionEditor = new QuestionEditor(); questionEditorList.add(questionEditor); questionEditor.setNumber(questionEditorList.size()); this.questionsPanel.add(questionEditor); this.revalidate(); this.repaint(); this.pack(); return questionEditor; }
public void addQuestion(Question question) { QuestionEditor editor = addNewQuestionEditor(); editor.setContent(question); }