// XAAL toolkit // Copyright (C) 2009 Ville Karavirta // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . package xaal.objects.interaction; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import xaal.objects.Xaal; import xaal.objects.animation.AnimationOperation; public abstract class Question extends AnimationOperation { private QuestionContents label; private QuestionContents hint; private Map items; private String solution; private int random; public Question(Xaal xaalDoc) { super(xaalDoc); items = new HashMap(); } public QuestionContents getLabel() { return label; } public void setLabel(QuestionContents label) { this.label = label; } public void setLabel(String label) { this.label = new QuestionContents("label", label); } public QuestionContents getHint() { return hint; } public void setHint(QuestionContents hint) { this.hint = hint; } public void setHint(String hint) { this.hint = new QuestionContents("hint", hint); } public String getSolution() { return solution; } public void setSolution(String solution) { this.solution = solution; } public void addQuestionItem(QuestionItem q) { items.put(q.getId(), q); } public Iterator getQuestionItems() { return items.values().iterator(); } public int getRandom() { return random; } public void setRandom(int random) { this.random = random; } }