-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgpt.pu
More file actions
201 lines (175 loc) · 4.77 KB
/
gpt.pu
File metadata and controls
201 lines (175 loc) · 4.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
@startuml SE
enum UserType {
t_admin,
t_teacher,
t_student
}
enum SubjectType {
t_physics,
t_computerScience,
}
enum QuesType {
t_choice,
t_multichoice,
}
class User {
-UserType _usertype
-std::string _userName
-std::string _password
-bool _is_logined
-User()
-bool check_pw(std::string)
+virtual ~User()=0
}
class Student {
-vector<shared_ptr<Class>> _class
}
class Teacher {
-vector<shared_ptr<Class>> _class
}
class Admin {
+PersonnelManagement()
}
class UserManage {
-User *_cur_user
-map<string, shared_ptr<Admin>> _all_admins
-map<string, shared_ptr<Teacher>> _all_teachers
-map<string, shared_ptr<Student>> _all_students
+bool loginAdmin(string, string)
+bool loginTeacher(string, string)
+bool loginStudent(string, string)
+void logout()
}
class Class {
-vector<shared_ptr<Student>> _all_students
-shared_ptr<Teacher> _responsible_teacher
-SubjectType _subject
-string uuid
-shared_ptr<Exam> _exam
}
class ClassManage {
-map<string, shared_ptr<Class>> _all_class
}
class Question {
-string _ques_uuid
-QuesType _ques_type
-string _quesStem
-uint32_t _difficulty
-uint32_t _score
+void updateStem(string)
+void updateScore(uint32_t)
+void updateDifficulty(uint32_t)
{abstract} +virtual float grade(string)=0
}
class MultipleChoiceQuestion {
}
class SingleChoiceQuestion {
}
class TrueOrFalseeQuestion {
}
class ShortAnswerQuestion {
}
class QuesManage {
-map<string,shared_ptr<Question>> _allQuestion
+shared_ptr<Question>& searchQuestion(string uuid)
}
class Paper {
-vector<shared_ptr<Question>> _Ques
-int _sum_score
-int _num_of_ques
-int _average_score
-string _paper_id
-vector<shared_ptr<AnswerSheet>> _anssheets
-vector<shared_ptr<Student>> _student_id
}
class QuestionDataSet {
-vector<shared_ptr<Question>> _QuesDataSet
-int _num_of_ques
-bool _ready_to_authorize
-bool _is_authorized
-bool _is_baned
-string _uuid
-vector<shared_ptr<Paper>> _produce_papers
+void addQuestion(shared_ptr<Question>)
}
class Exam {
-double _need_hours
-vector<shared_ptr<Class>> _for_class
-chrono::system_clock::time_point _startTime
-string _classRoom
+bool updateClass(shared_ptr<Class>)
}
class ExamManage {
-vector<shared_ptr<Exam>> _all_Exam
+vector<shared_ptr<Exam>> listAllExam(User* p)
+void addExam(shared_ptr<Exam>)
}
class Solution {
-shared_ptr<Question> _soure_ques
-string answer
-float score
-shared_ptr<Student> _student
-float _real_score
+void write_answer(string ans)
}
class AnswerSheet {
-shared_ptr<Paper> _soure_paper
-vector<shared_ptr<Solution>> _all_solutions
-float _total_real_score
-shared_ptr<Student> _solver
}
class Storage {
- string _users_file_path
- string _questions_file_path
- string _exam_file_path
- string _answersheet_file_path
- string _paper_file_path
- string _question_file_path
--
+ static Storage &getInstance()
+ bool save_users(vector<User *>)
+ void loadFileAdmin(UserManage&)
+ void loadFileClass(UserManage&)
+ void loadFileQuestion(QuesManage&)
+ void loadFilePaper(QuestionDataSetManage&)
+ void loadFileQuesDataSet(QuestionDataSetManage&)
+ void const saveAdmin(UserManage&)
+ void const saveQuestions(QuesManage&)
+ void const savePaper(QuestionDataSetManage&)
+ void const saveQuesDataSet(QuestionDataSetManage&)
+ void const saveExam(ExamManage&)
}
"UserManage" <.. "Storage" : <<use>>
"QuesManage" <.. "Storage" : <<use>>
"ExamManage" <.. "Storage" : <<use>>
"ClassManage" <.. "Storage" : <<use>>
"Storage" <.. "UserManage" : <<use>>
"Storage" <.. "QuesManage" : <<use>>
"Storage" <.. "ExamManage" : <<use>>
"Storage" <.. "ClassManage" : <<use>>
User <|-- Admin : Inheritance
User <|-- Teacher : Inheritance
User <|-- Student : Inheritance
ClassManage "1" o-- "*" Class : Aggregation
Class o-- "*" Student : Aggregation
Teacher o-- "*" Class : Aggregation
UserManage o-- "*" User : Aggregation
UserManage o-- User : Aggregation
ClassManage o-- "*" Exam : Aggregation
Question <|-- MultipleChoiceQuestion : Inheritance
Question <|-- SingleChoiceQuestion : Inheritance
Question <|-- TrueOrFalseeQuestion : Inheritance
Question <|-- ShortAnswerQuestion : Inheritance
QuestionDataSet o-- "*" Paper : Aggregation
QuestionDataSet o-- "*" Question : Aggregation
ExamManage -- "*" Exam : Aggregation
Paper o-- "*" Student : Aggregation
AnswerSheet o-- "*" Solution : Aggregation
Solution o-- Question : Association
Solution o-- Student : Association
AnswerSheet o-- Paper : Association
AnswerSheet o-- Student : Association
QuesManage -- "*" Paper : Aggregation
Exam -- "*" Paper : Aggregation
Exam -- "*" Class : Aggregation
@enduml