コード例 #1
0
 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;
     }
   }
 }
コード例 #2
0
 @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;
     }
   }
 }