From aa14f3c660b903538464991e05c7a2ed6c8454bc Mon Sep 17 00:00:00 2001 From: Dario Date: Sat, 27 Apr 2024 17:21:15 +0200 Subject: [PATCH] docs: doc 8 --- docs/diagrams/uml/ConceptsDomainModel.puml | 95 ++++++++++++++++++++++ docs/src/08_concepts.adoc | 85 +++---------------- 2 files changed, 105 insertions(+), 75 deletions(-) create mode 100644 docs/diagrams/uml/ConceptsDomainModel.puml diff --git a/docs/diagrams/uml/ConceptsDomainModel.puml b/docs/diagrams/uml/ConceptsDomainModel.puml new file mode 100644 index 00000000..63449912 --- /dev/null +++ b/docs/diagrams/uml/ConceptsDomainModel.puml @@ -0,0 +1,95 @@ +@startuml +enum QuestionCategory { + GEOGRAPHY + SPORTS + MUSIC + ART + VIDEOGAMES +} + +enum AnswerCategory { + CAPITAL_CITY + COUNTRY + SONG + STADIUM + BALLON_DOR + GAMES_PUBLISHER + PAINTING + WTPOKEMON + GAMES_COUNTRY + GAMES_GENRE + BASKETBALL_VENUE + COUNTRY_FLAG +} + +enum QuestionType { + TEXT + IMAGE +} + +enum GameMode { + KIWI_QUEST + FOOTBALL_SHOWDOWN + GEO_GENIUS + VIDEOGAME_ADVENTURE + ANCIENT_ODYSSEY + RANDOM + CUSTOM +} + +class Question { + content: String + answers: List + correctAnswer: Answer + questionCategory: QuestionCategory + type: QuestionType + games: List +} + +class User { + username: String + email: String + password: String + role: String + games: List + statistics: Statistics +} + +class Statistics { + correct: Long + wrong: Long + total: Long + user: User +} + +class Answer { + text: String + category: AnswerCategory + language: String +} + +class Game { + rounds: long + actualRound: long + user: User + questions: List + correctlyAnsweredQuestions: int + language: String + roundStartTime: LocalDateTime + roundDuration: Integer + currentQuestionAnswered: boolean + isGameOver: boolean + gamemode: GameMode + questionCategoriesForCustom: List +} + + +User "1"--"1" Statistics +Game "n"--"n" Question +Game "n" -- "1" User +Question "n" -- "n" Answer +GameMode -- Game +Question -- QuestionCategory +Answer -- AnswerCategory +Question -- QuestionType +@enduml \ No newline at end of file diff --git a/docs/src/08_concepts.adoc b/docs/src/08_concepts.adoc index 4d2e9248..7ccdd2e3 100644 --- a/docs/src/08_concepts.adoc +++ b/docs/src/08_concepts.adoc @@ -4,90 +4,25 @@ ifndef::imagesdir[:imagesdir: ../images] == Cross-cutting Concepts .Domain Model -This is the first version of the diagram, it will be updated if needed. +This is the diagram that includes the domain model of the backend. -[plantuml,"ConceptsDomainModel1",png] +[plantuml,"Concept Domain Model",png] ---- -@startuml -enum QuestionCategory { - GEOGRAPHY - SPORTS - MUSIC -} - -enum AnswerCategory { - CAPITAL_CITY - COUNTRY - SONG - STADIUM - BALLON_DOR -} - -enum QuestionType{ - TEXT - IMAGE - AUDIO -} - -class Question{ - content: String - answers: List - correctAnswer: Answer - questionCategory: QuestionCategory - type: QuestionType - games: List -} - -class User{ - username: String - email: String - password: String - role: String - games: List -} - -class Statistics{ - correct: Long - wrong: Long - total: Long - user: User -} - -class Answer { - text: String - category: AnswerCategory - language: String -} - -class Game { - user: User - questions: List - rounds: int - actualRound: int - correctlyAnsweredQuestions: int - language: String - roundStartTime: LocalDateTime - roundDuration: Integer - currentQuestionAnswered: boolean - isGameOver: boolean -} - - -User "1"--"1" Statistics -Game "n"--"n" Question -Game "n" -- "1" User -Question "n" -- "n" Answer - -@enduml +include::../diagrams/uml/ConceptsDomainModel.puml[] ---- |=== -| Class | Explanation -| Question | The model of the questions, has a type to specify if it is text, image or audio. Stores both right and wrong answers +| *Class* | *Explanation* +| Question | The model of the questions, has a type to specify if it is text or image. Stores both right and wrong answers | User | The people using the application, they have statistics and take part in a ranking to compete | Answer | Models each possible answer, created to reuse answers that are common to different questions, as well as distractors | Game | It is created when the user starts a game and includes the rounds that the user has to answer | Statistics | Stores information about the amount of correct and wrong answers that each user has answered +| *Enum* | *Explanation* +| QuestionCategory | Category for the question +| QuestionType | Type of the question (if it shows a text or an image etc) +| AnswerCategory | Category of the answer (used also for getting distractors) +| GameMode | Game mode for the game |=== .Question Generator