protected NativeTaskSelectionSingle(TaskDescriptor descriptor) { super(descriptor); this.correctAnswer = this.getTaskOptions().get(0); for (TaskOption taskOption : this.getTaskOptions()) { if (taskOption.getReward() > this.correctAnswer.getReward()) { this.correctAnswer = taskOption; } } }
@Override public void answer(String givenAnswer) { Identificator<TaskOption> taskOptoinId = new Identificator<TaskOption>(givenAnswer); for (TaskOption taskOption : this.getTaskOptions()) { if (taskOption.getId().equals(taskOptoinId)) { this.storedAnswer = taskOption; return; } } }