Przeglądaj źródła

chore: Change over to integer values for enums

Sean Blackburn 1 rok temu
rodzic
commit
0857d826a2

+ 9 - 8
src/components/enums/grading-type.yaml

@@ -1,24 +1,25 @@
 description: Types of grading
-type: string
+type: integer
+format: u8
 oneOf:
   - title: Overall grade
-    const: overall_grade
+    const: 0
     description: An overall grade of the course
   - title: Final exam
-    const: final_exam
+    const: 1
     description: Final Exam
   - title: Midterm exams
-    const: midterm_exams
+    const: 2
     description: An exam, that is held in the middle of the term.
   - title: Weekly exams
-    const: weekly_exams
+    const: 3
     description: An exam is held each week
   - title: Report grading
-    const: report_grading
+    const: 4
     description: Reports are graded
   - title: Homework grading
-    const: homework_grading
+    const: 5
     description: Homework is graded
   - title: Presentation grading
-    const: presentation_grading
+    const: 6
     description: Presentations are graded

+ 4 - 3
src/components/enums/lecture-execution-type.yaml

@@ -1,10 +1,11 @@
-type: string
 description: Method, how the module is executed
+type: integer
+format: u8
 oneOf:
   - title: term weekly
-    const: term_weekly
+    const: 0
     description: A term-based module, that is taught on a weekly basis over a single term.
   - title: block
-    const: block
+    const: 1
     description: |
       A block, which is taught over a short timespan (less than a term).

+ 7 - 6
src/components/enums/teaching-type.yaml

@@ -1,20 +1,21 @@
-type: string
 description: Various types of teaching types/locations
+type: integer
+format: u8
 oneOf:
   - title: On Site
-    const: on_site
+    const: 0
     description: Only taught on site
   - title: Online
-    const: online
+    const: 1
     description: Exclusively taught online
   - title: Hybrid
-    const: hybrid
+    const: 2
     description: Both on site and online
   - title: External
-    const: external
+    const: 3
     description: Taught at an external location.
   - title: Flipped Classroom
-    const: flipped_classroom
+    const: 4
     description: |
       Both on site and online, where the students learn at home and come back with
       questions

+ 1 - 1
src/components/enums/weekday.yaml

@@ -1,6 +1,6 @@
+description: The various weekdays
 type: integer
 format: u8
-description: The various weekdays
 oneOf:
   - title: Monday
     const: 0

+ 3 - 3
src/components/examples/api/modules/index.yaml

@@ -10,9 +10,9 @@ data:
       - 6
     ects: 3
     marks:
-      - overall_grade
-      - final_exam
-      - midterm_exams
+      - 1
+      - 2
+      - 6
     cat: Fachausbildung
     sub_cat: Fachgrundlagen
     dependencies:

+ 4 - 4
src/components/examples/api/modules/{module}/history.yaml

@@ -8,14 +8,14 @@ data:
     ends: 54600
     lecturers:
       - 12
-    lecture_type: on_site
+    lecture_type: 0
     rooms:
       - "4.417"
     pages:
       - 3
     dates: []
     course_pk: 1
-    module_execution_method: term_weekly
+    module_execution_method: 0
   - pk: 651
     name: oop1
     revision_pk: 16
@@ -25,11 +25,11 @@ data:
     ends: 42300
     lecturers:
       - 12
-    lecture_type: on_site
+    lecture_type: 0
     rooms:
       - "4.427"
     pages:
       - 4
     dates: []
     course_pk: 1
-    module_execution_method: term_weekly
+    module_execution_method: 0

+ 3 - 3
src/components/examples/api/modules/{module}/index.yaml

@@ -9,9 +9,9 @@ module_related_pk:
   - 6007774
 ects: 3
 marks:
-  - overall_grade
-  - final_exam
-  - midterm_exams
+  - 1
+  - 2
+  - 6
 cat: Fachausbildung
 sub_cat: Fachgrundlagen
 dependencies:

+ 4 - 4
src/components/examples/api/terms/{term}/revisions/{revision}/lectures/index.yaml

@@ -10,8 +10,8 @@ data:
       - 5.3B51
     lecturers:
       - 14
-    lecture_type: on_site
-    module_execution_method: term_weekly
+    lecture_type: 0
+    module_execution_method: 0
     pages:
       - 1
     course_pk: 2
@@ -28,8 +28,8 @@ data:
       - 5.3B51
     lecturers:
       - 10
-    lecture_type: on_site
-    module_execution_method: term_weekly
+    lecture_type: 0
+    module_execution_method: 0
     pages:
       - 1
     course_pk: 2

+ 2 - 2
src/components/examples/api/terms/{term}/revisions/{revision}/lectures/{lecture}/index.yaml

@@ -9,8 +9,8 @@ rooms:
   - 5.3B51
 lecturers:
   - 14
-lecture_type: on_site
-module_execution_method: term_weekly
+lecture_type: 0
+module_execution_method: 0
 pages:
   - 1
 course_pk: 2