-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmodel.py
More file actions
1668 lines (1570 loc) · 49.8 KB
/
model.py
File metadata and controls
1668 lines (1570 loc) · 49.8 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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: utf-8 -*-
### Codebench Dataset Extractor by Marcos Lima (marcos.lima@icomp.ufam.edu.br)
### Universidade Federal do Amazonas - UFAM
### Instituto de Computação - IComp
class CodebenchObject:
"""General class that specifies model object base structure."""
def as_list(self):
"""Return a list with model object attributes values."""
pass
@staticmethod
def get_attr_names():
"""Return a list with model object attributes names ."""
pass
class Semester(CodebenchObject):
"""
Model object that represents a semester.
Attributes:
desc (str): A string describing the semester.
n_courses (int): The number of courses in the semester.
n_assignments (int): The number of assignments in the semester.
n_users (int): The number of users associated with the semester.
n_codes (int): The number of users codes associated with the semester.
n_executions (int): The number of users code executions in the semester.
n_mirrors (int): The number of code mirrors events in the semester.
n_grades (int): The number of users grades associated with the semester.
n_mousemoves (int): The number of mouse moves events recorded in the semester.
Methods:
as_list(): Returns the attributes of the academic term as a list.
get_attr_names(): Returns a list of attribute names for the academic term.
"""
def __init__(self, description):
"""Initialize a Periodo object with a semester description."""
self.desc = description
self.n_courses = 0
self.n_assignments = 0
self.n_users = 0
self.n_codes = 0
self.n_executions = 0
self.n_mirrors = 0
self.n_grades = 0
def as_list(self):
"""Return a list of attribute names of the Periodo class."""
return [
self.desc,
self.n_courses,
self.n_assignments,
self.n_users,
self.n_codes,
self.n_executions,
self.n_mirrors,
self.n_grades
]
@staticmethod
def get_attr_names():
return [
'desc',
'n_courses',
'n_assignments',
'n_users',
'n_codes',
'n_executions',
'n_mirrors',
'n_grades'
]
class Course(CodebenchObject):
"""
Model object that represents a course of the academic term.
Attributes:
semester (str): The academic term or semester the course belongs to.
code (str): The code or identifier of the course.
desc (str): Description of the course.
n_assignments (int): Number of assignments associated with the course.
n_users (int): Number of users enrolled in the course.
Methods:
as_list(): Returns the attributes of the course as a list.
get_attr_names(): Returns a list of attribute names for the course.
"""
def __init__(self, semester, code, desc):
"""
Initializes a new instance of Turma.
Args:
semester (str): The academic term or semester.
code (str): The code or identifier of the course.
desc (str): Description of the course.
"""
self.semester = semester
self.code = code
self.desc = desc
self.n_assignments = 0
self.n_users = 0
def as_list(self):
"""
Returns the attributes of the Turma instance as a list.
Returns:
list: A list containing semester, code, desc, number of assignments,
and number of users.
"""
return [
self.semester,
self.code,
self.desc,
self.n_assignments,
self.n_users
]
@staticmethod
def get_attr_names():
"""
Returns the names of attributes of the Turma class.
Returns:
list: A list containing names of attributes: semester, code, desc,
n_assignments, and n_users.
"""
return [
'semester',
'code',
'desc',
'n_assignments',
'n_users'
]
class Assignment(CodebenchObject):
"""
Model object that represents an assignment.
Attributes:
semester (str): The semester during which the assignment is conducted.
course (str): The course to which the assignment belongs.
code (str): Unique identifier for the assignment.
title (str or None): The title of the assignment.
open_date (str or None): The date when the assignment opens.
close_date (str or None): The date when the assignment closes.
programming_lang (str or None): The programming language used for the assignment.
assignment_type (str or None): The type of the assignment (e.g., homework, project).
weight (float or None): The weight/importance of the assignment.
n_blocks (int or None): The number of code blocks in the assignment.
blocks (list): A list containing the code blocks for the assignment.
Methods:
as_list(): Returns the attributes of the assignment as a list.
get_attr_names(): Returns a list of attribute names for the assignment.
"""
def __init__(self, semester, course, code):
"""
Initialize an instance of Atividade.
Args:
semester (str): The semester during which the assignment is conducted.
course (str): The course to which the assignment belongs.
code (str): Unique identifier for the assignment.
"""
self.semester = semester
self.course = course
self.code = code
self.title = None
self.open_date = None
self.close_date = None
self.programming_lang = None
self.assignment_type = None
self.weight = None
self.n_blocks = None
self.blocks = []
def as_list(self):
"""
Return the attributes of the assignment as a list.
Returns:
list: A list containing the attributes of the assignment.
"""
return [
self.semester,
self.course,
self.code,
self.title,
self.open_date,
self.close_date,
self.programming_lang,
self.assignment_type,
self.weight,
self.n_blocks,
self.blocks
]
@staticmethod
def get_attr_names():
"""
Return a list of attribute names for the assignment.
Returns:
list: A list containing the names of attributes for the assignment.
"""
return [
'semester',
'course',
'code',
'title',
'open_date',
'close_date',
'programming_lang',
'assignment_type',
'weight',
'n_blocks',
'blocks'
]
class User(CodebenchObject):
"""
A User class for representing and storing various attributes of a user,
including personal, educational, and work-related information.
Attributes:
semester (str): The current semester of the user.
course (str): The name of the course the user is enrolled in.
code (str): A unique identifier code for the user.
course_id (str): The unique identifier for the course.
course_name (str): The name of the course.
institution_id (str): The unique identifier for the institution.
institution_name (str): The name of the institution.
high_school_name (str): The name of the high school attended by the user.
school_type (str): The type of the high school (e.g., public, private).
shift (str): The shift in which the user attended high school.
graduation_year (int): The year the user graduated from high school.
has_a_pc (bool): Whether the user has a personal computer.
share_this_pc (bool): Whether the user shares their personal computer.
this_pc_has (str): Specifications or features of the user's personal computer.
previous_experience_of (str): Previous experience of the user in the field.
worked_or_interned (bool): Whether the user has worked or interned.
company_name (str): The name of the company where the user worked or interned.
year_started_working (int): The year when the user started working.
year_stopped_working (int): The year when the user stopped working.
started_other_degree (bool): Whether the user started another degree.
degree_course (str): The name of the other degree course.
institution_name_2 (str): The name of the institution of the other degree.
year_started_this (int): The year the user started the other degree.
year_stopped_this (int): The year the user stopped the other degree.
sex (str): The sex of the user.
year_of_birth (int): The year of birth of the user.
civil_status (str): The civil status of the user (e.g., single, married).
have_kids (bool): Whether the user has kids.
"""
def __init__(self, semester, course, code):
"""
Initializes a new User object with the given semester, course, and code.
Other attributes are initialized to None and can be set later.
"""
self.semester = semester
self.course = course
self.code = code
# Initialize other attributes to None
self.course_id = None
self.course_name = None
self.institution_id = None
self.institution_name = None
self.high_school_name = None
self.school_type = None
self.shift = None
self.graduation_year = None
self.has_a_pc = None
self.share_this_pc = None
self.this_pc_has = None
self.previous_experience_of = None
self.worked_or_interned = None
self.company_name = None
self.year_started_working = None
self.year_stopped_working = None
self.started_other_degree = None
self.degree_course = None
self.institution_name_2 = None
self.year_started_this = None
self.year_stopped_this = None
self.sex = None
self.year_of_birth = None
self.civil_status = None
self.have_kids = None
def as_list(self):
"""
Returns a list of all user attributes in the order defined.
Returns:
list: A list of user attributes.
"""
return [
self.semester,
self.course,
self.code,
self.course_id,
self.course_name,
self.institution_id,
self.institution_name,
self.high_school_name,
self.school_type,
self.shift,
self.graduation_year,
self.has_a_pc,
self.share_this_pc,
self.this_pc_has,
self.previous_experience_of,
self.worked_or_interned,
self.company_name,
self.year_started_working,
self.year_stopped_working,
self.started_other_degree,
self.degree_course,
self.institution_name_2,
self.year_started_this,
self.year_stopped_this,
self.sex,
self.year_of_birth,
self.civil_status,
self.have_kids
]
@staticmethod
def get_attr_names():
"""
Returns a list of all user attribute names in the order defined.
Returns:
list: A list of attribute names as strings.
"""
return [
'semester',
'course',
'code',
'course_id',
'course_name',
'institution_id',
'institution_name',
'high_school_name',
'school_type',
'shift',
'graduation_year',
'has_a_pc',
'share_this_pc',
'this_pc_has',
'previous_experience_of',
'worked_or_interned',
'company_name',
'year_started_working',
'year_stopped_working',
'started_other_degree',
'degree_course',
'institution_name_2',
'year_started_this',
'year_stopped_this',
'sex',
'year_of_birth',
'civil_status',
'have_kids'
]
class Execution(CodebenchObject):
"""
Model object that represents a Codebench User Code Execution (Submition or Test).
Attributes:
semester (str): The semester during which the login event occurred.
course (str): The course associated with the login event.
user (str): The user unique identifier .
assigment (str): The crouse assignment.
problem (str): The problema id.
seq (int): The execution sequential order.
ex_type (str): The execution type (Submition | Test).
datetime (str): The execution date and time.
Methods:
as_list(): Returns the attributes of the User Code Execution as a list.
get_attr_names(): Returns the names of the attributes as a list.
"""
def __init__(self, semester, course, user, assignment, problem, seq, ex_type, datetime):
"""
Initialize an Execution object with the provided parameters.
Parameters:
- semester (str): The semester of the execution.
- course (str): The course associated with the execution.
- user (str): The user who performed the execution.
- assignment (str): The assignment associated with the execution.
- problem (str): The problem or task being executed.
- seq (int): The sequence number of the attempt.
- ex_type (str): The type of execution (e.g., 'submission', 'test').
- datetime: The timestamp of the execution.
"""
self.datetime = datetime
self.semester = semester
self.course = course
self.user = user
self.assignment = assignment
self.problem = problem
self.seq_attempt = seq
self.ex_type = ex_type
#self.code = code
self.has_err = False
self.err_msg = None
self.err_type = None
self.exec_time = None
self.tcases_results = None
self.n_tcases = None
self.grade = None
self.complexity = None
self.n_classes = None
self.n_functions = None
self.funcs_complexity = None
self.classes_complexity = None
self.total_complexity = None
self.n_blocks = None
self.loc = None
self.lloc = None
self.sloc = None
self.comments = None
self.single_comments = None
self.multi_comments = None
self.blank_lines = None
self.h1 = None
self.h2 = None
self.N1 = None
self.N2 = None
self.h = None
self.N = None
self.calculated_N = None
self.volume = None
self.difficulty = None
self.effort = None
self.bugs = None
self.time = None
self.endmarker = None
self.name = None
self.number = None
self.string = None
self.newline = None
self.indent = None
self.dedent = None
self.lpar = None
self.rpar = None
self.lsqb = None
self.rsqb = None
self.colon = None
self.comma = None
self.semi = None
self.plus = None
self.minus = None
self.star = None
self.slash = None
self.vbar = None
self.amper = None
self.less = None
self.greater = None
self.equal = None
self.dot = None
self.percent = None
self.lbrace = None
self.rbrace = None
self.eq_equal = None
self.not_eq = None
self.less_eq = None
self.greater_eq = None
self.tilde = None
self.circumflex = None
self.lshift = None
self.rshift = None
self.dbl_star = None
self.plus_eq = None
self.minus_eq = None
self.star_eq = None
self.slash_eq = None
self.percent_eq = None
self.amper_eq = None
self.vbar_eq = None
self.circumflex_eq = None
self.lshift_eq = None
self.rshift_eq = None
self.dbl_star_eq = None
self.dbl_slash = None
self.dbl_slash_eq = None
self.at = None
self.at_eq = None
self.rarrow = None
self.ellipsis = None
self.colon_eq = None
self.op = None
self.error_token = None
self.comment = None
self.nl = None
self.encoding = None
self.number_int = None
self.number_float = None
self.kwd_and = None
self.kwd_or = None
self.kwd_not = None
self.kwd_none = None
self.kwd_false = None
self.kwd_true = None
self.kwd_as = None
self.kwd_assert = None
self.kwd_async = None
self.kwd_await = None
self.kwd_break = None
self.kwd_class = None
self.kwd_continue = None
self.kwd_def = None
self.kwd_del = None
self.kwd_if = None
self.kwd_elif = None
self.kwd_else = None
self.kwd_except = None
self.kwd_finally = None
self.kwd_for = None
self.kwd_while = None
self.kwd_import = None
self.kwd_from = None
self.kwd_global = None
self.kwd_in = None
self.kwd_is = None
self.kwd_lambda = None
self.kwd_nonlocal = None
self.kwd_pass = None
self.kwd_raise = None
self.kwd_return = None
self.kwd_try = None
self.kwd_with = None
self.kwd_yield = None
self.keyword = None
self.identifier = None
self.builtin_type = None
self.builtin_func = None
self.kwd_print = None
self.kwd_input = None
self.builtin_type_unique = None
self.builtin_func_unique = None
self.identifiers_unique = None
self.identifiers_max_len = None
self.identifiers_min_len = None
self.identifiers_mean_len = None
def as_list(self):
"""
Returns the attributes of the Execution object as a list.
Returns:
- list: List containing the attributes of the Execution object in a specific order.
"""
return [
self.datetime,
self.semester,
self.course,
self.user,
self.assignment,
self.problem,
self.seq_attempt,
self.ex_type,
self.has_err,
self.err_msg,
self.err_type,
self.exec_time,
self.tcases_results,
self.n_tcases,
self.grade,
self.complexity,
self.n_classes,
self.n_functions,
self.funcs_complexity,
self.classes_complexity,
self.total_complexity,
self.n_blocks,
self.loc,
self.lloc,
self.sloc,
self.comments,
self.single_comments,
self.multi_comments,
self.blank_lines,
self.h1,
self.h2,
self.N1,
self.N2,
self.h,
self.N,
self.calculated_N,
self.volume,
self.difficulty,
self.effort,
self.bugs,
self.time,
self.endmarker,
self.name,
self.number,
self.string,
self.newline,
self.indent,
self.dedent,
self.lpar,
self.rpar,
self.lsqb,
self.rsqb,
self.colon,
self.comma,
self.semi,
self.plus,
self.minus,
self.star,
self.slash,
self.vbar,
self.amper,
self.less,
self.greater,
self.equal,
self.dot,
self.percent,
self.lbrace,
self.rbrace,
self.eq_equal,
self.not_eq,
self.less_eq,
self.greater_eq,
self.tilde,
self.circumflex,
self.lshift,
self.rshift,
self.dbl_star,
self.plus_eq,
self.minus_eq,
self.star_eq,
self.slash_eq,
self.percent_eq,
self.amper_eq,
self.vbar_eq,
self.circumflex_eq,
self.lshift_eq,
self.rshift_eq,
self.dbl_star_eq,
self.dbl_slash,
self.dbl_slash_eq,
self.at,
self.at_eq,
self.rarrow,
self.ellipsis,
self.colon_eq,
self.op,
self.error_token,
self.comment,
self.nl,
self.encoding,
self.number_int,
self.number_float,
self.kwd_and,
self.kwd_or,
self.kwd_not,
self.kwd_none,
self.kwd_false,
self.kwd_true,
self.kwd_as,
self.kwd_assert,
self.kwd_async,
self.kwd_await,
self.kwd_break,
self.kwd_class,
self.kwd_continue,
self.kwd_def,
self.kwd_del,
self.kwd_if,
self.kwd_elif,
self.kwd_else,
self.kwd_except,
self.kwd_finally,
self.kwd_for,
self.kwd_while,
self.kwd_import,
self.kwd_from,
self.kwd_global,
self.kwd_in,
self.kwd_is,
self.kwd_lambda,
self.kwd_nonlocal,
self.kwd_pass,
self.kwd_raise,
self.kwd_return,
self.kwd_try,
self.kwd_with,
self.kwd_yield,
self.keyword,
self.identifier,
self.builtin_type,
self.builtin_func,
self.kwd_print,
self.kwd_input,
self.builtin_type_unique,
self.builtin_func_unique,
self.identifiers_unique,
self.identifiers_max_len,
self.identifiers_min_len,
self.identifiers_mean_len
]
@staticmethod
def get_attr_names():
"""
Returns a list of attribute names of the Execution object.
Returns:
- list: List containing the names of the attributes of the Execution object.
"""
return [
'datetime',
'semester',
'course',
'user',
'assignment',
'problem',
'seq_attempt',
'ex_type',
'has_err',
'err_msg',
'err_type',
'exec_time',
'tcases_results',
'n_tcases',
'grade',
'complexity',
'n_classes',
'n_functions',
'funcs_complexity',
'classes_complexity',
'total_complexity',
'n_blocks',
'loc',
'lloc',
'sloc',
'comments',
'single_comments',
'multi_comments',
'blank_lines',
'h1',
'h2',
'N1',
'N2',
'h',
'N',
'calculated_N',
'volume',
'difficulty',
'effort',
'bugs',
'time',
'endmarker',
'name',
'number',
'string',
'newline',
'indent',
'dedent',
'lpar',
'rpar',
'lsqb',
'rsqb',
'colon',
'comma',
'semi',
'plus',
'minus',
'star',
'slash',
'vbar',
'amper',
'less',
'greater',
'equal',
'dot',
'percent',
'lbrace',
'rbrace',
'eq_equal',
'not_eq',
'less_eq',
'greater_eq',
'tilde',
'circumflex',
'lshift',
'rshift',
'dbl_star',
'plus_eq',
'minus_eq',
'star_eq',
'slash_eq',
'percent_eq',
'amper_eq',
'vbar_eq',
'circumflex_eq',
'lshift_eq',
'rshift_eq',
'dbl_star_eq',
'dbl_slash',
'dbl_slash_eq',
'at',
'at_eq',
'rarrow',
'ellipsis',
'colon_eq',
'op',
'error_token',
'comment',
'nl',
'encoding',
'number_int',
'number_float',
'kwd_and',
'kwd_or',
'kwd_not',
'kwd_none',
'kwd_false',
'kwd_true',
'kwd_as',
'kwd_assert',
'kwd_async',
'kwd_await',
'kwd_break',
'kwd_class',
'kwd_continue',
'kwd_def',
'kwd_del',
'kwd_if',
'kwd_elif',
'kwd_else',
'kwd_except',
'kwd_finally',
'kwd_for',
'kwd_while',
'kwd_import',
'kwd_from',
'kwd_global',
'kwd_in',
'kwd_is',
'kwd_lambda',
'kwd_nonlocal',
'kwd_pass',
'kwd_raise',
'kwd_return',
'kwd_try',
'kwd_with',
'kwd_yield',
'keyword',
'identifier',
'builtin_type',
'builtin_func',
'kwd_print',
'kwd_input',
'builtin_type_unique',
'builtin_func_unique',
'identifiers_unique',
'identifiers_max_len',
'identifiers_min_len',
'identifiers_mean_len'
]
class Login(CodebenchObject):
"""Model object that represents a Codebench User Login Event.
This class represents a user login event in the Codebench system. It contains
information such as the semester, course, date, time, user, and event type.
Attributes:
semester (str): The semester during which the login event occurred.
course (str): The course associated with the login event.
date (str): The date of the login event.
time (str): The time of the login event.
user (str): The user who performed the login.
event (str): The type of event (e.g., "login", "logout").
Methods:
as_list(): Returns the attributes of the login event as a list.
get_attr_names(): Returns the names of the attributes as a list.
"""
def __init__(self, semester, course, user, date, time, event):
"""
Initialize a Login object with provided attributes.
Args:
semester (str): The semester during which the login event occurred.
course (str): The course associated with the login event.
user (str): The user who performed the login.
date (str): The date of the login event.
time (str): The time of the login event.
event (str): The type of event (e.g., "login", "logout").
"""
self.semester = semester
self.course = course
self.date = date
self.time = time
self.user = user
self.event = event
def as_list(self):
"""
Return the attributes of the login event as a list.
Returns:
list: A list containing the semester, course, date, time, user, and event.
"""
return [
self.semester,
self.course,
self.date,
self.time,
self.user,
self.event,
]
@staticmethod
def get_attr_names():
"""
Return the names of the attributes as a list.
Returns:
list: A list containing the names of the attributes.
"""
return [
'semester',
'course',
'date',
'time',
'user',
'event',
]
class CodeMirror(CodebenchObject):
"""
Model object that represents a CodeMirror User Events.
Attributes:
semester (str): The semester associated with the event.
course (str): The course associated with the event.
assignment (str): The assignment associated with the event.
user (str): The user associated with the event.
problem (str): The problem associated with the event.
timestamp (str): The timestamp of the event.
date (str): The date of the event.
time (str): The time of the event.
event (str): The type of event.
msg (str): Additional message related to the event.
"""
def __init__(self, semester, course, assignment, user, problem, timestamp, date, time, event, msg):
"""
Initializes a CodeMirror object.
Args:
semester (str): The semester associated with the event.
course (str): The course associated with the event.
assignment (str): The assignment associated with the event.
user (str): The user associated with the event.
problem (str): The problem associated with the event.
timestamp (str): The timestamp of the event.
date (str): The date of the event.
time (str): The time of the event.
event (str): The type of event.
msg (str): Additional message related to the event.
"""
self.semester = semester
self.course = course
self.assignment = assignment
self.user = user
self.problem = problem
self.timestamp = timestamp
self.date = date
self.time = time
self.event = event