2082 2

BIT302 ยท 2082 ยท 10 marks

Develop use case diagram, class diagram, and sequence diagram of online entrance examination system. Make necessary assumptions.

Develop use case diagram, class diagram, and sequence diagram of online entrance examination system. Make necessary assumptions.[10]

Software EngineeringChapter 3: System Modeling and DesignUML diagrams and aggregation

Quick answer

The three diagrams describe the same online entrance examination system from three angles. The use case diagram is the behavioural outside view and fixes what the Student and the Admin can ask the system to do, the class diagram is the structural view and fixes the classes User, Student, Admin, Exam, Question, ExamAttempt and Result with their attributes, operations and relationships, and the sequence diagram is the interaction view and fixes the order in which those objects exchange messages while one exam is taken. Together they cover requirements, structure and behaviour, which is why UML models are normally drawn as a set rather than singly.

Online Entrance Examination System - UML Diagrams

Note: No specific reference notes were found for this topic. The following answer is based on standard UML modeling principles as taught in Software Engineering courses for BSc CSIT, Tribhuvan University.


Assumptions Made

  1. The system allows students to register, log in, and attempt an online entrance exam.
  2. An admin manages questions, sets exam schedules, and views results.
  3. The system auto-evaluates answers and generates results.
  4. An examiner/teacher can add and manage questions.
  5. The exam has a timer; the system auto-submits when time expires.

1. Use Case Diagram

Actors

ActorRole
StudentRegisters, logs in, takes exam, views result
AdminManages users, schedules exam, views reports
ExaminerAdds/manages questions
System (Timer)Auto-submits exam on timeout

Use Cases

+---------------------------------------------------------------+
|           Online Entrance Examination System                  |
|                                                               |
|   [Register]          [Login]         [Logout]               |
|                                                               |
|   [View Exam Schedule]   [Start Exam]   [Answer Questions]   |
|                                                               |
|   [Submit Exam]       [View Result]   [View Scorecard]       |
|                                                               |
|   [Add Questions]     [Edit Questions] [Delete Questions]    |
|                                                               |
|   [Schedule Exam]     [Manage Users]  [Generate Report]      |
|                                                               |
|   [Auto Submit] (System/Timer)                               |
+---------------------------------------------------------------+

Student -----> Register
Student -----> Login
Student -----> View Exam Schedule
Student -----> Start Exam
Student -----> Answer Questions
Student -----> Submit Exam
Student -----> View Result
Student -----> View Scorecard

Examiner ----> Login
Examiner ----> Add Questions
Examiner ----> Edit Questions
Examiner ----> Delete Questions

Admin -------> Login
Admin -------> Schedule Exam
Admin -------> Manage Users
Admin -------> Generate Report
Admin -------> View Result

System ------> Auto Submit  <<extends>> Submit Exam

Submit Exam <<includes>> Evaluate Answers
Start Exam  <<includes>> Load Questions

Relationships Summary

  • Start Exam includes Load Questions
  • Submit Exam includes Evaluate Answers
  • Auto Submit extends Submit Exam (triggered when timer expires)
  • View Scorecard extends View Result

2. Class Diagram

+------------------+        +---------------------+
|      User        |        |       Exam          |
+------------------+        +---------------------+
| - userID: int    |        | - examID: int       |
| - name: String   |        | - title: String     |
| - email: String  |        | - duration: int     |
| - password: String|       | - totalMarks: int   |
| - role: String   |        | - scheduleDate: Date|
+------------------+        | - status: String    |
| + login()        |        +---------------------+
| + logout()       |        | + startExam()       |
| + register()     |        | + endExam()         |
+------------------+        | + getQuestions()    |
        |                   +---------------------+
        |                           |
   _____|_____               _______|_______
  |           |             |               |
+-------+ +--------+  +----------+   +-----------+
|Student| | Admin  |  | Question |   |  Result   |
+-------+ +--------+  +----------+   +-----------+
|-stuID | |-adminID|  |-quesID   |   |-resultID  |
|-grade | |-dept   |  |-quesText |   |-stuID     |
+-------+ +--------+  |-options[]|   |-examID    |
|+takeExam()|+scheduleExam()|correctAns||-score  |
|+viewResult()|+manageUser()|+getAnswer()|+grade |
+-------+ +--------+  +----------+   +-----------+
                                            |
                       +--------------------+
                       |   ExamAttempt      |
                       +--------------------+
                       | - attemptID: int   |
                       | - stuID: int       |
                       | - examID: int      |
                       | - startTime: Time  |
                       | - endTime: Time    |
                       | - answers[]: String|
                       +--------------------+
                       | + submitAnswers()  |
                       | + calculateScore() |
                       | + autoSubmit()     |
                       +--------------------+

Relationships

RelationshipDescription
User is parent of Student and AdminGeneralization
Student takes ExamAssociation (many-to-many)
Exam contains QuestionComposition (1 to many)
ExamAttempt links Student and ExamAssociation class
ExamAttempt generates ResultDependency

3. Sequence Diagram

Scenario: Student Takes and Submits an Exam

Student      LoginPage     ExamController    QuestionDB     Timer      ResultModule
   |              |               |               |            |             |
   |--login()---->|               |               |            |             |
   |              |--authenticate()|              |            |             |
   |              |<--success-----|               |            |             |
   |<--dashboard--|               |               |            |             |
   |              |               |               |            |             |
   |--startExam()->              |               |            |             |
   |              |--loadExam()-->|               |            |             |
   |              |               |--getQuestions()->          |             |
   |              |               |<--questionSet-|            |             |
   |              |               |--startTimer()------------->|             |
   |<---------questions displayed--|               |            |             |
   |              |               |               |            |             |
   |--answerQuestion()------------>|               |            |             |
   |              |               |--saveAnswer()->|            |             |
   |              |               |               |            |             |
   |              |               |<---timeExpired-------------|             |
   |              |               |--autoSubmit() |            |             |
   |--submitExam()---------------->|               |            |             |
   |              |               |--calculateScore()--------------------->|
   |              |               |<--score--------------------------------|
   |<---------result displayed-----|               |            |             |
   |              |               |               |            |             |

Reading the diagram: time runs downward, each vertical line is the lifetime of one object, and each horizontal arrow is a message. The student logs in through the login page, the exam controller loads the exam and pulls the question set from the question database, the timer is started, and answers are saved as they are given. Whichever happens first, the student submitting or the timer expiring, ends the attempt: autoSubmit() covers the timeout case, which is why the timer has its own lifeline. The result module then scores the attempt and the score is returned to the student.


Conclusion

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.