Arquisoft / wiq_en1b

wiq_en1b
https://youtu.be/r2XqDUHj3zU
0 stars 2 forks source link

Transaction for the new questions #95

Closed UO289845 closed 5 months ago

UO289845 commented 5 months ago

The new Main of the Question Generator is designed to remove the current questions and introduces new ones. The problem is that it should be a transaction, that is, is something goes wrong the old questions won't be removed.

The PersistentMain.class will change, so that the main method would have these lines:

List<Question> questions = generate();
QuestionRepository.getInstance().populate(questions);

instead of the current

QuestionRepository.getInstance().removeAll();
generate();

The new populate method in the QuestionRepository will be a transaction, will remove all the present questions and insert all the new ones, which receive as a parameter.

UO289845 commented 5 months ago

The changes to PersistentMain.java are now live in branch Question_Generator_General