generated from Arquisoft/wiq_0
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from Arquisoft/Question_Generation_General
Question generation general
- Loading branch information
Showing
50 changed files
with
2,058 additions
and
328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package main.java; | ||
|
||
import java.util.List; | ||
|
||
import main.java.questionGenerator.QuestionGenerator; | ||
import main.java.questionGenerator.question.Question; | ||
import main.java.questionGenerator.question.QuestionType; | ||
import main.java.questionGenerator.repository.QuestionRepository; | ||
|
||
public class StaticMain { | ||
|
||
public static void main(String[] args) { | ||
QuestionGenerator qg = QuestionGenerator.getInstance(); | ||
|
||
run(qg, QuestionType.CAPITAL, 3); | ||
run(qg, QuestionType.LANGUAGE, 3); | ||
run(qg, QuestionType.POPULATION, 3); | ||
run(qg, QuestionType.SIZE, 3); | ||
run(qg, QuestionType.HEAD_OF_GOVERMENT, 3); | ||
run(qg, QuestionType.DIRECTOR, 3); | ||
run(qg, QuestionType.VIDEOGAME_DEVELOPER, 3); | ||
run(qg, QuestionType.VIDEOGAME_PUBLISHER, 3); | ||
run(qg, QuestionType.VIDEOGAME_GENRE, 3); | ||
run(qg, QuestionType.VIDEOGAME_COUNTRY, 3); | ||
|
||
} | ||
|
||
private static void run(QuestionGenerator qg, QuestionType type, int numberOfQuestions){ | ||
List<Question> questions = qg.generateQuestions(type, numberOfQuestions); | ||
for(int i=0; i<questions.size(); i++) { | ||
Question question = questions.get(i); | ||
question.setNumber(i); | ||
System.out.println(question.getJSON().toString()); | ||
} | ||
System.out.println(); | ||
QuestionRepository.getInstance().insert(questions.stream().map(q -> q.getJSON().toString()).toList()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.