diff --git a/questionGenerator/src/main/java/questionGenerator/generator/AbstractGenerator.java b/questionGenerator/src/main/java/questionGenerator/generator/AbstractGenerator.java index 936b736d..7cfa8d09 100644 --- a/questionGenerator/src/main/java/questionGenerator/generator/AbstractGenerator.java +++ b/questionGenerator/src/main/java/questionGenerator/generator/AbstractGenerator.java @@ -14,6 +14,7 @@ import org.wikidata.wdtk.wikibaseapi.apierrors.MediaWikiApiErrorException; import main.java.questionGenerator.question.Question; +import main.java.questionGenerator.question.QuestionType; public abstract class AbstractGenerator { @@ -29,7 +30,7 @@ public abstract class AbstractGenerator { private QuestionType type; private static final String MESSAGES_PATH = "messages"; - public AbstractGenerator(String propertyId) { + public AbstractGenerator(String propertyId, QuestionType type) { this.propertyId = propertyId; this.type = type; } diff --git a/questionGenerator/src/main/java/questionGenerator/generator/RightAnswerIsEntity.java b/questionGenerator/src/main/java/questionGenerator/generator/RightAnswerIsEntity.java index ffdba910..e631cee5 100644 --- a/questionGenerator/src/main/java/questionGenerator/generator/RightAnswerIsEntity.java +++ b/questionGenerator/src/main/java/questionGenerator/generator/RightAnswerIsEntity.java @@ -11,10 +11,12 @@ import org.wikidata.wdtk.datamodel.interfaces.Value; import org.wikidata.wdtk.wikibaseapi.apierrors.MediaWikiApiErrorException; +import main.java.questionGenerator.question.QuestionType; + public abstract class RightAnswerIsEntity extends AbstractGenerator { - public RightAnswerIsEntity(String propertyId) { - super(propertyId); + public RightAnswerIsEntity(String propertyId, QuestionType type) { + super(propertyId, type); } @Override diff --git a/questionGenerator/src/main/java/questionGenerator/generator/specificGenerators/CapitalGenerator.java b/questionGenerator/src/main/java/questionGenerator/generator/specificGenerators/CapitalGenerator.java index f4cce0eb..e7bc6d3a 100644 --- a/questionGenerator/src/main/java/questionGenerator/generator/specificGenerators/CapitalGenerator.java +++ b/questionGenerator/src/main/java/questionGenerator/generator/specificGenerators/CapitalGenerator.java @@ -1,6 +1,7 @@ package main.java.questionGenerator.generator.specificGenerators; import main.java.questionGenerator.generator.RightAnswerIsEntity; +import main.java.questionGenerator.question.QuestionType; public class CapitalGenerator extends RightAnswerIsEntity { diff --git a/questionGenerator/src/main/java/questionGenerator/generator/specificGenerators/LanguageGenerator.java b/questionGenerator/src/main/java/questionGenerator/generator/specificGenerators/LanguageGenerator.java index a80b4718..07bb70b0 100644 --- a/questionGenerator/src/main/java/questionGenerator/generator/specificGenerators/LanguageGenerator.java +++ b/questionGenerator/src/main/java/questionGenerator/generator/specificGenerators/LanguageGenerator.java @@ -1,6 +1,7 @@ package main.java.questionGenerator.generator.specificGenerators; import main.java.questionGenerator.generator.RightAnswerIsEntity; +import main.java.questionGenerator.question.QuestionType; public class LanguageGenerator extends RightAnswerIsEntity { diff --git a/questionGenerator/src/main/java/questionGenerator/generator/specificGenerators/PopulationGenerator.java b/questionGenerator/src/main/java/questionGenerator/generator/specificGenerators/PopulationGenerator.java index 077e7c04..9ba5273b 100644 --- a/questionGenerator/src/main/java/questionGenerator/generator/specificGenerators/PopulationGenerator.java +++ b/questionGenerator/src/main/java/questionGenerator/generator/specificGenerators/PopulationGenerator.java @@ -9,6 +9,7 @@ import org.wikidata.wdtk.datamodel.interfaces.Value; import main.java.questionGenerator.generator.AbstractGenerator; +import main.java.questionGenerator.question.QuestionType; public class PopulationGenerator extends AbstractGenerator { diff --git a/questionGenerator/src/main/java/questionGenerator/generator/specificGenerators/SizeGenerator.java b/questionGenerator/src/main/java/questionGenerator/generator/specificGenerators/SizeGenerator.java index c6bd5533..a6066984 100644 --- a/questionGenerator/src/main/java/questionGenerator/generator/specificGenerators/SizeGenerator.java +++ b/questionGenerator/src/main/java/questionGenerator/generator/specificGenerators/SizeGenerator.java @@ -9,6 +9,7 @@ import org.wikidata.wdtk.datamodel.interfaces.Value; import main.java.questionGenerator.generator.AbstractGenerator; +import main.java.questionGenerator.question.QuestionType; public class SizeGenerator extends AbstractGenerator { diff --git a/questionGenerator/src/test/java/questionGenerator/question/QuestionTests.java b/questionGenerator/src/test/java/questionGenerator/question/QuestionTests.java index 91e68857..171895b6 100644 --- a/questionGenerator/src/test/java/questionGenerator/question/QuestionTests.java +++ b/questionGenerator/src/test/java/questionGenerator/question/QuestionTests.java @@ -13,6 +13,7 @@ import org.junit.jupiter.api.Test; import main.java.questionGenerator.question.Question; +import main.java.questionGenerator.question.QuestionType; public class QuestionTests { @@ -21,7 +22,7 @@ public class QuestionTests { @BeforeEach void setUp() { List answers = Arrays.asList("A", "B", "C"); - question = new Question("What is the capital of France?", answers); + question = new Question("What is the capital of France?", answers, "en", QuestionType.CAPITAL); } @Test