1
0
Fork 0
mirror of https://gitlab.com/kauron/jstudy synced 2025-09-30 12:51:10 +02:00
jstudy/src/main/java/es/kauron/jstudy/model/AnsweredItem.java
2019-09-13 18:16:53 +02:00

24 lines
874 B
Java

package es.kauron.jstudy.model;
import javafx.beans.property.ReadOnlyIntegerProperty;
import javafx.beans.property.ReadOnlyIntegerWrapper;
import javafx.beans.property.ReadOnlyLongWrapper;
import javafx.beans.property.ReadOnlyStringWrapper;
public class AnsweredItem {
public final ReadOnlyStringWrapper answerProperty;
public final ReadOnlyLongWrapper timeProperty;
public final ReadOnlyIntegerProperty indexProperty;
public final TestItem item;
public AnsweredItem(TestItem item, int index, String answer, long timeNano) {
this.item = item;
this.indexProperty = new ReadOnlyIntegerWrapper(index);
this.answerProperty = new ReadOnlyStringWrapper(answer);
this.timeProperty = new ReadOnlyLongWrapper(timeNano);
}
public boolean isRight() {
return item.getAnswer().equals(answerProperty.get());
}
}