Skip to content

Class Diagram

Semih Yılmaz edited this page Oct 19, 2024 · 7 revisions
classDiagram
    class User {
        -int id
        -String username
        -String name
        -String email
        -String password
        -String proficiencyLevel
        -int points
        -String profile_picture
        -List~Quiz~ createdQuizzes
        -List~QuizAttempt~ solvedQuizzes
        -List~Question~ favoritedQuestions
        -List~Quiz~ favoritedQuizzes
        -List~ForumPost~ forumPosts
        +createAccount()
        +login()
        +changeProfileDetails()
        +viewProfile()
        +createQuiz()
        +favoriteQuiz()
        +favoriteQuestion()
        +createForumPost()
        +replyForumPost()

        +getId() int
        +getUsername() String
        +setUsername(username : String)
        +getName() String
        +setName(name : String)
        +getEmail() String
        +setEmail(email : String)
        +getPassword() String
        +setPassword(password : String)
        +getProficiencyLevel() String
        +setProficiencyLevel(proficiencyLevel : String)
        +getPoints() int
        +setPoints(points : int)
        +getProfilePicture() String
        +setProfilePicture(profile_picture : String)
        +getCreatedQuizzes() List~Quiz~
        +getSolvedQuizzes() List~QuizAttempt~
        +getFavoritedQuestions() List~Question~
        +getFavoritedQuizzes() List~Quiz~
        +getForumPosts() List~ForumPost~
    }

    class Quiz {
        -int id
        -String title
        -String description
        -String image
        -User creator
        -String difficultyLevel
        -List~Question~ questions

        +Quiz(title : String, description : String, image: String, creator: User)
        +addQuestion()
        +calculateDifficulty()

        +getId() int
        +getTitle() String
        +setTitle(title : String)
        +getDescription() String
        +setDescription(description : String)
        +getImage() String
        +setImage(image : String)
        +getCreator() User
        +setCreator(creator : User)
        +getDifficultyLevel() String
        +setDifficultyLevel(difficultyLevel : String)
        +getQuestions() List~Question~
        +setQuestions(questions : List~Question~)
    }

    class QuizAttempt{
        -int id
        -Quiz quiz
        -User user
        -List~QuestionAnswer~ questionAnswers
        -int score
        -Timestamp completed_at

        +QuizAttempt(quiz : Quiz, user : User)

        +getId() int
        +getQuiz() Quiz
        +setQuiz(quiz : Quiz)
        +getUser() User
        +setUser(user : User)
        +getQuestionAnswers() List~QuestionAnswer~
        +setQuestionAnswers(questionAnswers : List~QuestionAnswer~)
        +getScore() int
        +setScore(score : int)
        +getCompletedAt() Timestamp
        +setCompletedAt(completed_at : Timestamp)
    }

    class Question {
        -int id
        -String questionType
        -String questionText
        -String correctAnswer
        -List~String~ wrongAnswers

        +Question(questionType : String, questionText: String, correctAnswer: String, wrongAnswers: List~String~)
        +getDifficulty()

        +getId() int
        +getQuestionType() String
        +setQuestionType(questionType : String)
        +getQuestionText() String
        +setQuestionText(questionText : String)
        +getCorrectAnswer() String
        +setCorrectAnswer(correctAnswer : String)
        +getWrongAnswers() List~String~
        +setWrongAnswers(wrongAnswers : List~String~)
    }

    class QuestionAnswer {
        -int id
        -Question question
        -String answer
        -bool correct

        +QuestionAnswer(question : Question, answer: String)

        +getId() int
        +getQuestion() Question
        +setQuestion(question : Question)
        +getAnswer() String
        +setAnswer(answer : String)
        +isCorrect() bool
        +setCorrect(correct : bool)
    }

    class ForumPost {
        -String postID
        -String author
        -String content
        -List~Reply~ replies

        +linkToLexvoEntry()
        +addReply(reply : Reply)

        +getPostID() String
        +getAuthor() String
        +setAuthor(author : String)
        +getContent() String
        +setContent(content : String)
        +getReplies() List~Reply~
        +setReplies(replies : List~Reply~)
    }

    class Reply {
        -String replyID
        -String content
        -String author

        +getReplyID() String
        +getContent() String
        +setContent(content : String)
        +getAuthor() String
        +setAuthor(author : String)
    }

    User "1" o-- "*" Quiz : creates
    User --> Question : favorites
    User --> Quiz : favorites
    Quiz "1" *-- "*" Question : contains
    User --> ForumPost : creates
    ForumPost --> Reply : has replies
    Quiz "1" <-- "*" QuizAttempt
    User "1" *-- "*" QuizAttempt : attempts
    QuizAttempt *-- QuestionAnswer

Loading

🏠 Home

🗃️ All Project Files

💻 Lab Reports

📝 Meeting Notes

Lab Meeting Notes
Team Meeting Notes
🧑🏻‍💻 About Us
🗂️ Templates
CmpE 352

🚀 Important Project Files

🗃️ All Project Files
📝 352 Meeting Notes
📜 Research & Resources
Clone this wiki locally