forked from Arquisoft/wichat_0
-
Notifications
You must be signed in to change notification settings - Fork 0
update section 8 #228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
update section 8 #228
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,103 +1,38 @@ | ||
| @startuml Domain_Model | ||
|
|
||
| ' Define entities (classes) | ||
| class User { | ||
| +String userId | ||
| +String username | ||
| +String email | ||
| +String password | ||
|
|
||
| +void register() | ||
| +void login() | ||
| +void play() | ||
| +void viewStats() | ||
| +void logout() | ||
| } | ||
|
|
||
| class UserStats { | ||
| +int totalGamesPlayed | ||
| +int totalQuestionsAnswered | ||
| +int totalCorrectAnswers | ||
| +int totalIncorrectAnswers | ||
| +int totalHintsUsed | ||
| +double averageTimePerQuestion | ||
|
|
||
| +void updateStats() | ||
| } | ||
|
|
||
| class Game { | ||
| +String gameId | ||
| +User player | ||
| +GameMode gameMode | ||
| +GameConfiguration gameConfig | ||
| +List<Question> questions | ||
|
|
||
| +void startGame() | ||
| +void endGame() | ||
| +void obtainQuestions() | ||
| +void answerQuestion() | ||
| +void askForHint() | ||
| } | ||
|
|
||
| enum GameMode { | ||
| "Each wise man with his subject" | ||
| "Travel with us" | ||
| "The hot question" | ||
| "Discovering cities" | ||
| etc. | ||
| } | ||
|
|
||
| class GameConfiguration { | ||
| +int numberOfQuestions | ||
| +int timeLimit | ||
| +bool hintsEnabled | ||
|
|
||
| +void configureGame() | ||
| } | ||
|
|
||
| class Question { | ||
| +String questionId | ||
| +String imageUrl | ||
| +String questionText | ||
| +String wikiDataReference | ||
| +QuestionCategory category | ||
| +List<AnswerOption> answerOptions | ||
|
|
||
| +void validateAnswer() | ||
| +void provideHint() | ||
| } | ||
|
|
||
| enum QuestionCategory { | ||
| "Entertainment" | ||
| "Science" | ||
| "Sports" | ||
| "Geography" | ||
| "History" | ||
| "Literature" | ||
| etc. | ||
| } | ||
|
|
||
| class AnswerOption { | ||
| +String optionId | ||
| +String optionText | ||
| +bool isCorrect | ||
| } | ||
|
|
||
| class AIChat { | ||
| +String sessionId | ||
| +String chatHistory | ||
| +String wikiDataReference | ||
| } | ||
|
|
||
|
|
||
| ' Define relationships | ||
| User "1" --> "0..*" Game : plays | ||
| User "1" --> UserStats : has | ||
| Game "1" --> "1..*" Question : contains | ||
| Game "1" --> GameConfiguration : has | ||
| Game "1" --> GameMode : has | ||
| Game "1" --> AIChat : includes | ||
| Question "1" --> "1..*" AnswerOption : has | ||
| Question "1" --> QuestionCategory : belongs to | ||
|
|
||
| @enduml | ||
| entity "User" { | ||
| * username: String | ||
| - required, unique, regex: /^[a-zA-Z0-9_]+$/, 3–30 chars | ||
| * password: String | ||
| - required | ||
| * createdAt: Date = now | ||
| } | ||
|
|
||
| entity "Score" { | ||
| * userId: String | ||
| - references User._id | ||
| * score: Number = 0 | ||
| * gameMode: String ['basicQuiz', 'expertDomain', 'timeAttack', 'endlessMarathon', 'custom'] | ||
| - required | ||
| * questionsPassed: Number = 0 | ||
| * questionsFailed: Number = 0 | ||
| * accuracy: Number = 0 | ||
| * meanTimeToAnswer: Number = 0 | ||
| * createdAt: Date = now | ||
| } | ||
|
|
||
| entity "Question" { | ||
| * question: String | ||
| - required | ||
| * answers: [Object] | ||
| - required | ||
| * correctAnswerId: Number | ||
| - required | ||
| * type: String | ||
| - required | ||
| * image: String | ||
| - optional | ||
| * createdAt: Date = now (expires in 30 min) | ||
| } | ||
|
|
||
| @enduml |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.