Explorar el Código

chore: Change over to integer values for enums

Sean Blackburn hace 1 año
padre
commit
0857d826a2

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

@@ -1,24 +1,25 @@
 description: Types of grading
 description: Types of grading
-type: string
+type: integer
+format: u8
 oneOf:
 oneOf:
   - title: Overall grade
   - title: Overall grade
-    const: overall_grade
+    const: 0
     description: An overall grade of the course
     description: An overall grade of the course
   - title: Final exam
   - title: Final exam
-    const: final_exam
+    const: 1
     description: Final Exam
     description: Final Exam
   - title: Midterm exams
   - title: Midterm exams
-    const: midterm_exams
+    const: 2
     description: An exam, that is held in the middle of the term.
     description: An exam, that is held in the middle of the term.
   - title: Weekly exams
   - title: Weekly exams
-    const: weekly_exams
+    const: 3
     description: An exam is held each week
     description: An exam is held each week
   - title: Report grading
   - title: Report grading
-    const: report_grading
+    const: 4
     description: Reports are graded
     description: Reports are graded
   - title: Homework grading
   - title: Homework grading
-    const: homework_grading
+    const: 5
     description: Homework is graded
     description: Homework is graded
   - title: Presentation grading
   - title: Presentation grading
-    const: presentation_grading
+    const: 6
     description: Presentations are graded
     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
 description: Method, how the module is executed
+type: integer
+format: u8
 oneOf:
 oneOf:
   - title: term weekly
   - title: term weekly
-    const: term_weekly
+    const: 0
     description: A term-based module, that is taught on a weekly basis over a single term.
     description: A term-based module, that is taught on a weekly basis over a single term.
   - title: block
   - title: block
-    const: block
+    const: 1
     description: |
     description: |
       A block, which is taught over a short timespan (less than a term).
       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
 description: Various types of teaching types/locations
+type: integer
+format: u8
 oneOf:
 oneOf:
   - title: On Site
   - title: On Site
-    const: on_site
+    const: 0
     description: Only taught on site
     description: Only taught on site
   - title: Online
   - title: Online
-    const: online
+    const: 1
     description: Exclusively taught online
     description: Exclusively taught online
   - title: Hybrid
   - title: Hybrid
-    const: hybrid
+    const: 2
     description: Both on site and online
     description: Both on site and online
   - title: External
   - title: External
-    const: external
+    const: 3
     description: Taught at an external location.
     description: Taught at an external location.
   - title: Flipped Classroom
   - title: Flipped Classroom
-    const: flipped_classroom
+    const: 4
     description: |
     description: |
       Both on site and online, where the students learn at home and come back with
       Both on site and online, where the students learn at home and come back with
       questions
       questions

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

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

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

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

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

@@ -8,14 +8,14 @@ data:
     ends: 54600
     ends: 54600
     lecturers:
     lecturers:
       - 12
       - 12
-    lecture_type: on_site
+    lecture_type: 0
     rooms:
     rooms:
       - "4.417"
       - "4.417"
     pages:
     pages:
       - 3
       - 3
     dates: []
     dates: []
     course_pk: 1
     course_pk: 1
-    module_execution_method: term_weekly
+    module_execution_method: 0
   - pk: 651
   - pk: 651
     name: oop1
     name: oop1
     revision_pk: 16
     revision_pk: 16
@@ -25,11 +25,11 @@ data:
     ends: 42300
     ends: 42300
     lecturers:
     lecturers:
       - 12
       - 12
-    lecture_type: on_site
+    lecture_type: 0
     rooms:
     rooms:
       - "4.427"
       - "4.427"
     pages:
     pages:
       - 4
       - 4
     dates: []
     dates: []
     course_pk: 1
     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
   - 6007774
 ects: 3
 ects: 3
 marks:
 marks:
-  - overall_grade
-  - final_exam
-  - midterm_exams
+  - 1
+  - 2
+  - 6
 cat: Fachausbildung
 cat: Fachausbildung
 sub_cat: Fachgrundlagen
 sub_cat: Fachgrundlagen
 dependencies:
 dependencies:

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

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

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

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